With the help of this guide, you will learn how to use the Klaytn-DEX to perform all available actions on the blockchain, such as connect your wallet, swap tokens, farm and stake LP tokens, and so on. We will start by introducing the basic concepts used throughout the guide, and then walk you through all available functionality.
Klaytn-DEX works with ERC-20 or KIP7 tokens.
Token swaps in Dex are a simple way to trade one ERC-20 or KIP7 token for another. Each pair of tokens on Dex is underpinned by a liquidity pool.
Liquidity pools are smart contracts that hold balances of two unique tokens and enforce rules on depositing and withdrawing them.
The guide covers the following operations available on Klaytn-DEX:
The first thing you need to do is to connect your wallet to DEX. DEX works with two wallets: Metamask and Kaikas. You have to have a wallet in either of those to be able to work with DEX.
-
Install Chrome extension for Metamask or Kaikas and create a wallet.
-
Open DEX. In the upper right corner, you will find a
Connect Wallet
button.Depending on which extensions you installed and which wallets you have, you will see the available options for connecting a wallet. For example, if you have a Kaikas wallet but not a Metamask one, this is what you will see:
-
Choose a wallet to connect to DEX. If you haven't already, add the Klaytn Baobab Testnet to your wallet:
- Network Name: Klaytn Testnet
- New RPC URL: https://api.baobab.klaytn.net:8651
- Chain ID: 1001
- Currency Symbol: KLAY
- Block Explorer URL: https://baobab.scope.klaytn.com
Once you have connected a wallet, you will see its information displayed in the upper right corner. The wallet address and balance are displayed:
You can swap tokens in the Trade
>Swap
tab.
-
Select the pair of tokens you want to swap:
-
Put in the amount of tokens to swap. When you put a value in either of the boxes, the value for the other token will be calculated automatically:
-
Set the slippage tolerance (the percentage of the total swap value you can tolerate losing due to the difference in actual price and the price at confirmation time). To do this, expand
Slippage tolerance
section and choose the percentage. For example, here we've chosen0.5%
:Note that the lesser the tolerance, the greater the chance that the transaction will fail. Dex will warn you about this.
-
Expand
Transaction Details
to view the transaction details such as the price impact or the minimum amount of tokens you will receive. -
If you agree to the conditions of the transaction, press
Swap
and confirm the swap.
You can face the following issues during the swap:
-
Insufficient amount of tokens.
If the amount of tokens you want ot swap is higher than what you have in your wallet, you won't be able to perform the swap.
-
Not enough KLAY for transaction fee.
If you don't have enough KLAY tokens in your wallet, you will see this error after pressing
Swap
. You won't be able to confirm the transaction unless you have enough KLAY to pay the fee. -
Route between the pair of tokens is not found.
Enable multi-hops in the swap preferences to be able to swap a pair of tokens that doesn't have a liquidity pool.
If you press the settings icon, you will see swap settings (enabling multi-hops and expert mode):
If you enable multi-hops, you will be able to swap tokens that don't have a liquidity pool for their pair.
Note the differences in route for two following swap operations:
-
If multi-hops are disabled, there is no route between
VEN
andDEX
: -
If multi-hops are enables, there is a route between
VEN
andDEX
through multiple other pairs:
In expert mode, you only need to confirm access to the token once. After that it will be available for all future operations.
Liquidity pools are smart contracts that hold balances of two unique tokens and enforce rules on depositing and withdrawing them.
Liquidity pools contain LP tokens. When you add liquidity to a liquidity pool, you receive LP tokens. When you remove liquidity, you remove LP tokens from the pool.
You can add and remove liquidity in the Trade
>Liquidity
tab:
-
If you haven't joined any pool, you will only be able to add liquidity:
-
If you already joined pools, you will see their information as well:
-
In the
Trade
>Liquidity
tab, pressAdd Liquidity
. -
Select the pair of tokens:
-
Choose the pair of tokens for which you want to add liquidity. Note that for some pairs the pool already exists and for some it doesn't.
- The pool already exists for the pair of tokens you've chosen: in this case, when you specify the amount of tokens to add for any of the tokens, the value for the second token will be calculated automatically:
The pool commission shows which percentage you will earn from all trades on this pair (proportional to your share).
-
The pool doesn't exist for the pair of tokens you've chosen: in this case, DEX will notify you that by adding liquidity for this pair of tokens you will be creating a new pool:
When you specify the amount of tokens to add, you are also setting the rates for this pool:
-
Confirm supply.
-
In the
Trade
>Liquidity
tab, choose the pool from which you want to remove LP tokens. -
Move slider to indicate how much tokens you want to remove.
Alternatively, you can also switch to the
Detailed
tab to put in the exact values. -
Press
Remove
. You will see the details of the transaction.
- Confirm remove.
You can farm tokens in the Earn
>Farms
tab.
- View farming pools
- Expand details about a farming pool
- Calculate ROI (farming)
- Sort farming pools
- Stake LP tokens
- Add or remove staked LP tokens
- Withdraw earned DEX tokens
On the Earn
>Farms
page, you will see the full list of farming pools. Switch Staked only
button to view only the pools in which you have staked LP tokens.
The pool icon and name indicate the pair of LP tokens. For each pool, you are shown:
- how much tokens you have earned
- the annual percentage rate (APR) for the pool
- liquidity of the pool
- pool multiplier
If you click on a pool, you will see more information about it. You will see how much LP tokens you've staked and how much DEX tokens you've earned.
You will also be able to:
- Change the amount of staked LP tokens
- Withdraw earned DEX tokens
- See information about the token pair on KlaytnFinder
- View contract on KlaytnFinder
Click on the calculator icon next to the APR value to open ROI calculator:
To calculate how much you will earn, specify the time period for which the tokens will be staked, how often to compound the earnings, and pick the amount of LP tokens to stake. The calculator will show you how much you will earn based on these conditions.
Expand the details section to see APR (annual percentage rate) including LP rewards, base APR, and APY (annual percentage yield):
You can sort pools on the page:
Hot
: show open pools with the most APR firstLiquidity
: sort pools by their liquidityAPR
: sort pools by their annual percentage rateMultiplier
: sort pools by their multiplierEarned
: sort pools by how much you have earned in themLatest
: show the newly created pools first
-
Choose the pool in which to stake tokens and click on it.
Note that if you don't have the LP tokens that are being staked in this pool, you will need to get them first.
-
Stake LP tokens and confirm the operation:
When you already have LP tokens staked in the pool, you will be able to stake additional LP tokens and unstake LP tokens.
-
Click on the pool:
-
Choose whether to add or remove LP tokens:
- To stake additional LP tokens, click
+
. - To unstake LP tokens, click
-
.
Note that you can only add more LP tokens if you have any.
- To stake additional LP tokens, click
You can stake tokens in the Earn
>Pools
tab.
- View staking pools
- Expand details about a staking pool
- Calculate ROI (staking)
- Sort staking pools
- Stake tokens
- Add or remove staked tokens
- Withdraw earned tokens
On the Earn
>Pools
page, you will see the full list of staking pools. Switch Staked only
button to view only the pools in which you have staked tokens.
The pool icon and name indicate which token is staked and which token is earned. For each pool, you are shown:
- how much tokens you have earned
- the USD equivalent of the total amount of tokens staked in this pool
- the annual percentage rate (APR) for the pool
- when the pool ends
If you click on a pool, you will see more information about it. You will see how much you've staked and earned.
You will also be able to:
- Change the amount of staked tokens
- Withdraw earned tokens
- See information about the token on KlaytnFinder
- View contract on KlaytnFinder
- Add the token to your wallet
Click on the calculator icon next to the APR value to open ROI calculator:
To calculate how much you will earn, specify the time period for which the tokens will be staked, how often to compound the earnings, and pick the amount to stake. The calculator will show you how much you will earn based on these conditions.
Expand the details section to see APR (annual percentage rate) and APY (annual percentage yield):
You can sort pools on the page:
Hot
: show open pools with the most APR firstAPR
: sort pools by their annual percentage rateEarned
: sort pools by how much you have earned in themTotal staked
: sort pools by how much is staked in themLatest
: show the newly created pools first
-
Choose the pool in which to stake tokens and click on it.
-
If you don't have the tokens that are being staked in this pool, you will need to get them first.
-
If you have the tokens that are being staked in this pool, you will see the stake button (e.g.,
Stake KLAY
for theKLAY
token):
-
-
After clicking the stake button, you need to specify how much of your tokens you'd want to stake and confirm staking:
You can change the number of staked tokens by pressing either the +
to add tokens or -
to remove tokens from the staking pool:
Note that you can only add more tokens if you have any.
Click Withdraw
to withdraw the tokens you have earned:
Go to the Charts
tab to view DEX dashboard. You will land on the Overview
page, where you can find the graphs showing the changes in total value locked (TVL) and 24-hour volume by days, weeks, or months. This page also features top tokens, top pools, and the latest transactions in DEX.
You can view top pools on the Overview
page. From there, click All pools
to see the full list of pools. Alternatively, you can go to the Pools
tab at the top of the page.
Click on a pool to view the detailed information about it. The page for each pool features the list of transactions for this pool and a graph like this:
Depending on the settings, it can show you the changes in volume, total value locked (TVL), liquidity, or fees. You can also specify the time period, e.g. a month or year.
From this overview page, you can go directly to this pool on DEX, trade, or add liquidity.
You can view top tokens on the Overview
page. From there, click All tokens
to see the full list of pools. Alternatively, you can go to the Tokens
tab at the top of the page.
Click on a token to view the detailed information about it.
Depending on the settings, it can show you you the changes in price, volume, or total value locked (TVL). You can also specify the time period, e.g. a month or year.
You can view proposals and vote for them.
In the Voting
tab you can view all proposals: active, executed, defeated, finished. For each proposal, you see its start and end dates, title, and status.
To show only active proposals, switch Only Active
button in the upper left corner. You can also filter proposal either by their start date or end date.
To view details of a proposal, click on it, and you will be taken to the page that contains the detailed description of the proposal.
- Kaikas Wallet users can't vote on the current version of Dex
Once you navigate to a proposal page, at the top of the page you will find the Vote
button and the available voting options.
Click Vote
. You will be taken to snapshot where you can cast your vote.