Create a liquidity pool
Overview
You can create your own liquidity pools (LP) on Katana, contribute your liquidity to existing pools, and earn trading fees from the resulting transactions. This guide explains how to create a new pool, add liquidity to an existing pool, and remove liquidity from a pool.
If you're a token creator, you can launch your own ERC20 token on Katana and create a liquidity pool with it. This is a unique opportunity to bootstrap liquidity for your tokens and incentivize trading. By creating a pool, you provide a platform for users to trade your token with other tokens, increasing its utility and value.
During an initial whitelisting period, only you as the owner of the Ronin address that deployed the ERC20 token can create liquidity pools with your token. After the whitelisting period ends, users can contribute liquidity to your pool or create their own pools with your token.
After creating a liquidity pool, you can create a farm to encourage users to contribute liquidity to your pool.
When creating a new pool, you choose two tokens to pair together. These tokens can be any ERC20 tokens, including "main" and "seed" tokens. The system deposits your tokens into a smart contract, effectively increasing the pool's liquidity.
For example, if you decide to contribute to the AXS-RON pool, you need to deposit an equivalent value of both tokens. Say the value of 1 AXS is USD 7.17 and the value of 1 RON is USD 2.72. If you want to provide 1 AXS into the AXS-RON pool, you also need to provide around 2.7 AXS.
In recognition of your contribution, you receive liquidity pool (LP) tokens, which represent your share in the pool.
These tokens not only signify your stake but also entitle you to a portion of the trading fees generated by the pool's transactions, directly proportional to your contribution. These fees are added to pool and accrue in real-time. You can claim them by withdrawing your liquidity.
You can also stake your LP tokens to earn farm rewards. For more information, see Farm.
Be aware that earning a profit through providing liquidity isn't guaranteed. You may face what's known as impermanent loss, a risk that arises from fluctuations in the value of the deposited tokens.
Prerequisites
- Only whitelisted Ronin addresses can create liquidity pools during a token whitelisting period. To apply, submit your Ronin address to Sky Mavis. This address will be linked to your token contract after you deploy it.
- Have your token's details and tag classification finalized with Sky Mavis.
- To provide liquidity on Katana, you need to have tokens in your Ronin Wallet. You can acquire tokens by depositing from Ethereum using Ronin Bridge, buying tokens through the Purchase website, or receiving tokens from other users. For more information, see Acquire RON.
Write your ERC20 token contract
To create a token, we recommend that you use the OpenZeppelin ERC-20 contract. This way, you don't have to write the contract from scratch. Instead, you import the library and use its functions.
Your token contract MUST strictly follow the ERC20 token standard and our smart contract guidelines. For more information, refer to Smart contract guidelines.
Deploy your ERC20 contract to Ronin
Deploy your token contract to the Ronin network. Make sure to test your contract on the Saigon testnet before deploying it to the Ronin mainnet.
For more information, refer to Deploy a smart contract on Ronin.
Submit your token address and publish timestamp
Submit the following information to your Sky Mavis partner engineer:
- Deployer Ronin address for LP creation.
- Publish timestamp for your token.
- ERC20 token contract address.
- Deployer Ronin address for farm creation if different from the LP creation address.
Sky Mavis will review your ERC20 token contract to ensure it meets the requirements. If the contract is approved, Sky Mavis will map your LP creation Ronin address with the contract address. This will make the token visible to you on Katana, where you can launch liquidity pools with it.
Create a liquidity pool
-
Go to Katana and connect your Ronin Wallet.
-
Select the Liquidity pool page, then click Create new pool.
-
Select the tokens you want to pool, then enter the amount. You may need to approve both tokens in your Ronin Wallet if you interact with them for the first time. Token creators: select your token from the list. When selecting the token, you will see its publish date at the bottom. This date signifies when the whitelisting period ends
-
Click Confirm to finalize pool creation.
-
Review the details of your liquidity contribution:
- The amount of tokens you are contributing.
- The amount of LP tokens you will receive in return.
- The exchange rate.
- The share of the pool you will receive, which is 100% for a pool creator.
- The publish date of the token, which signifies when the whitelisting period ends.
Click Create pool & Supply, then confirm the transaction in your Ronin Wallet.
Your pool is now created and scheduled for publishing on the specified date.
As long as the pool is in a scheduled state, only you can see it.
On the publishing date, the pool will become available for all Katana users to contribute liquidity to. As a liquidity provider, you will start earning fees from the pool's transactions.
As a token creator, you can also create a farm for your token. For more information, see Create a farm.
Edit a pool
You can change the amount of tokens in a pool as long as the pool is in a scheduled state.
- On the Liquidity pool page, select the pool you want to edit.
- Add or remove tokens from the pool. For more information, see Add liquidity to a pool and Remove liquidity from a pool.
- Click Confirm, review the details, then confirm the transaction in your Ronin Wallet.
Add liquidity to a pool
You can contribute liquidity to existing pools to earn fees from the pool's transactions.
-
Open Katana and connect your Ronin Wallet.
-
Select the Liquidity pool page, then open the pool you want to contribute to.
-
Enter the amount of tokens you want to contribute, then click Add. Katana automatically calculates the equivalent amount of the other token based on the current exchange rate. You may need to approve both tokens in your Ronin Wallet if you interact with them for the first time.
-
Review the details of your liquidity contribution:
- The amount of LP tokens you will get in return.
- The amount of tokens you are contributing.
- The share of the pool you will receive.
Click Confirm add liquidity, then confirm the transaction in your Ronin Wallet.
Your transaction is now submitted to the blockchain. When it completes, Katana displays a confirmation pop-up. Close it or click View on explorer to see the detailed information about the transaction.
The My position panel is now updated with your latest contribution:
- The amount of ERC20 tokens you contributed.
- The amount of LP tokens received in return.
View your positions
To see all the pools you contributed to and the fees earned, open the Liquidity pool page, then select My positions.
Here you can see the following information:
- The pools to which you contributed.
- The annual percentage rate (APR) for each pool.
- Your position in each pool.
- The fees you earned from each pool.
- Your claimable rewards from farming, if the pool supports it.
To view more details, such as the amount of LP tokens and the pool's performance over time, select each pool.
Remove liquidity from a pool
Removing pool tokens converts your position back into underlying tokens at the current rate, proportional to your share of the pool. Accrued fees are included in the amounts you receive.
-
Open the Liquidity pool page, then select the pool from which you want to withdraw liquidity.
-
Select the Remove liquidity panel.
-
Select the portion of your liquidity you want to remove, or enter the amount manually. Then, click Remove.
-
Review how much you're getting when removing liquidity, then click Confirm remove liquidity and confirm the transaction in your Ronin Wallet.
Your transaction is now submitted to the blockchain. When it completes, Katana displays a confirmation pop-up. Close it or click View on explorer to see the detailed information about the transaction.
The My position panel is now updated with your latest position after removing liquidity:
You have now removed your liquidity by removing your LP tokens, and have gotten your tokens with the accrued fees, proportionate to your shares. Thank you for your service.