Join today to get full access to our basics to advance crypto courses, exclusive insights, research & analysis.

Tutorial: Acala (swap, liquidity & aUSD)

What is Acala? 

Acala is a layer 1 Ethereum-compatible smart contract platform built on Polkdot, designed for DeFi and scaling decentralised apps (DApps) to Polkadot.

The host of features that Acala offers include Acala Swap (built in exchange) and providing liquidity to the pools that power the swaps. Users can also mint Acala Dollar (aUSD), Acala’s decentralised, multi-collateral-backed native stablecoin that is soft-pegged to the US Dollar. 

Our previous tutorial covers liquid staking (DOT/LDOT) on Acala. This tutorial will go through how to use Acala Swap, provide liquidity and mint aUSD.

 

Tutorial

 Getting set up 

 Head to https://acala.network/ and click ‘apps’.

On the following screen, you’ll be prompted to connect a compatible wallet; we’re going to go with Polkadot{js}. If you don’t already have this wallet, setting one up is very straightforward. You can check out our previous tutorial for a quick run-down, which also goes through funding your wallet and bridging tokens to the Acala network.

 

Swapping tokens

Start by clicking on the swap page. 

Next, choose the asset you want to swap and the one you want to swap into (make sure these assets are on the Acala network). Once you enter an amount, the corresponding amount of the other token you can expect to receive will be displayed.

Below this, you’ll have more details of the transaction, such as the minimum amount of the swap asset you can expect to receive, the price of the swap and the trading fee.

Acala’s fee is ‘flexible,’ meaning that you can choose the token you would like to pay in. This will be set to ACA (Acala’s native token) by default, which offers the best discount, but this will obviously require you to fund your wallet with some ACA. If you want to default to a different token, click on the settings gear icon in the top right corner of your screen, followed by ‘flexible fee’. You can choose the token you would like to pay fees in the following pop-up.

Just above the ‘swap’ button, there is another settings gear icon. If you click on this, you’ll be able to adjust the slippage tolerance. The price of the swap is subject to change from the time you are quoted to the time that the transaction is actually processed. The slippage tolerance represents the percentage price difference you are ok with. Acala will specify a slippage tolerance by default, which is generally what most people stick with.

Once you click ‘swap’, you’ll be prompted to confirm the transaction in your wallet.

 

Providing Liquidity 

An important risk to consider when supplying liquidity is impermanent loss. This is a phenomenon where you, as a liquidity provider (LP), can end up with less value than what could have been realised by simply holding onto your assets (e.g. in a crypto wallet).

It’s essential to have a good understanding of impermanent loss before you provide liquidity to a pool.

Therefore, before continuing with this tutorial, we highly recommend reading our pro article (link), which provides a more detailed explanation and practical example of impermanent loss.

Start by navigating to the ‘LP Staking’ tab on the Earn page.

Here you’ll see the list of asset pairs you can provide liquidity for. These are the liquidity pools that power Acala swap. You’ll also see some stats for each pool, such as the total value of the tokens in the pool in USD and the current APR rate. 

Note: 100% of LP rewards are claimable once Acala’s loyalty programme ends. 40-60% of rewards (the loyalty bonus) are forfeited when an LP claims before the programme ends. You can hover over the clock icon to view the estimated date that the programme will end.


Click ‘become a liquidity provider’ for your chosen pool.

On the following page, once you enter the amount of one token you want to provide, the corresponding amount of the other token you will need to provide will be shown. This is because token pairs need to be added to the pool in a set ratio to keep the pool balanced. Your wallet’s balance for each of these tokens will be displayed.

Towards the bottom of the screen, you’ll see more details of the transaction, such as the minimum amount of liquidity provider tokens you can expect to receive (these represent your share of the pool), the exchange rate, and the flexible fee. 



You’ll see that you have the option to stake your LP tokens. If you do this, you’ll earn additional yield in the form of ACA (Acala’s native token). The current LP staking APR will be displayed (as shown above).

Same as when swapping, you can choose the token you would like to pay  Acala’s fee in by clicking on the settings gear icon in the top right-hand corner of the screen. To adjust the slippage tolerance, click on the settings gear icon towards the bottom of the screen. 

Once you’re happy, click ‘add liquidity’ to finalise the transaction. You’ll need to confirm this transaction in your wallet.

Your LP position should now be visible when you navigate back to the earn page.

Withdrawing 

LP tokens

Head to the ‘LP staking’ tab on the earn page and click on the ‘stake/unstake’ button for the LP tokens you have staked.

In the following pop-up, enter the amount you would like to unstake (click ‘max’ to unstake your entire balance) and click ‘unstake’.

Liquidity 

Navigate to the ‘withdraw liquidity’ tab on the swap page. 

Next, select the token pair and enter the amount you want to withdraw (click ‘max’ to withdraw your entire balance).

Note that if you choose to stake your LP tokens, you will first need to unstake some of these before you can withdraw liquidity. You can follow the steps above to do this manually, or you can toggle the ‘automatically unstake LP tokens’ switch button. 

Once you click ‘withdraw liquidity’, you’ll be prompted to confirm the transaction in your wallet.

 

Minting aUSD

As mentioned, aUSD is Acala’s native stablecoin. To mint aUSD, users need to provide collateral. Start by navigating to the mint page, here you’ll see an overview of your wallet balance. 

The first thing you’ll need to do (if you haven’t done so already) is fund your wallet with a token that’s accepted as collateral (again these token(s) need to be on the Acala network).

Next, you’ll need to deposit some collateral into a vault. To do this, click ‘create vault’.

On the following page, select the type of collateral you want to go with. Here you’ll see a couple of key parameters listed for each token; these include:

Stability fee – this is essentially the interest rate you pay for your loan (payable in aUSD)

This rate is not fixed; it is calculated at the end of each block and varies according to each asset.

Req collateral % – the required collateral ratio to borrow aUSD (i.e. how much you have to put up to get the loan). In the example above, users would have to deposit $100 of DOT to receive a max of $50 worth of aUSD.

Liquidation % – if your collateral value falls below this ratio, the loan will be liquidated.

Liquidation fee –  this is charged to users who are liquidated.

Click ‘next’ once you’ve selected an asset.

On this page, you’ll need to enter the amount of DOT you want to deposit and how much aUSD you would like to mint. 

When you do this, you’ll be able to see your collateral ratio, which represents the ratio between the USD value of your collateral asset and minted aUSD. As already mentioned, the liquidation % is the minimum ratio before a loan is liquidated.

Above this, you’ll also be able to see your liquidation price in relation to the current price of your collateral asset (in USD). 

Because you are borrowing a stablecoin against an asset that fluctuates in price, it is your responsibility to maintain the safety of your loan by ensuring that the collateral ratio remains above the liquidation ratio. We’ll cover this in more detail below. However, before proceeding, make sure you are comfortable with this ratio and never invest more than you are willing to lose.

On the following screen, you’ll be presented with an overview of the transaction. Same as before, you can choose the token you would like to pay Acala’s fee in by clicking on the settings gear icon in the top right-hand corner of the screen. 

Click ‘confirm’ to finalise the transaction. Now when you go to the ‘my vault section’ of the mint page, you should see your loan position.

As already mentioned, it’s your responsibility to ensure that the collateral ratio remains above the liquidation ratio. You can click the ‘payback’ button to repay some of your loan. If you maintain the same amount of collateral, your collateral ratio will increase. You also have the option to ‘mint more’ aUSD, but keep in mind that this will affect your liquidation price and hence your collateral ratio.

As you can see from the image above, this page is also where you can deposit or withdraw more collateral. Again depositing more collateral while maintaining the same amount of aUSD will increase your collateral ratio.

 

 

Comment and share if you found this tutorial helpful! Also, let us know what tutorials you’d like to see next!

 

Disclaimer: THIS IS NOT FINANCIAL OR INVESTMENT ADVICE. Only you are responsible for any capital-related decisions you make and only you are accountable for the results.

Post a Comment

About Author

Ali O'Meara

More articles by this author

Copy & Crypto School writer from Ireland. Recent neuroscience graduate who is fairly new to the crypto world!