The Auto Market Maker (AMM) is the core of pool models and liquidity pools, instead of using the Oracle price, AMMs determine the prices by the algorithm.
Users can provide liquidity to RunesDeX by depositing an equivalent value of BTC and Runes tokens into a pool.
The addLiquidity function
allows users to add liquidity to a RunesDeX pool, contributing both BTC and Runes tokens.
As a user, you deposit an equivalent value of BTC and Runes tokens into the liquidity pool. This helps maintain the balance in the pool, ensuring that trades can occur smoothly.
When you add liquidity, you will receive pool tokens representing your position. These tokens automatically earn fees proportional to your share of the pool, and can be redeemed at any time. By adding liquidity you'll earn 0.25% of all trades on this pair proportional to your share of the pool. Fees are added to the pool, accrue in real time and can be claimed by withdrawing your liquidity.
The removeLiquidity function
allows users to withdraw their liquidity from the pool by redeeming their LP tokens for the underlying BTC and Runes tokens.
Calculate Withdrawal Amounts:
The amount of BTC and Runes tokens you receive is based on your share of the pool. The pool calculates your proportionate share and returns the corresponding amounts of BTC and Runes tokens to you.
Receive BTC and Runes Tokens:
The calculated amounts of BTC and Runes tokens are transferred from the pool back to your wallet, completing the withdrawal process.
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.
Runes Dex - implements the functionality of an automated market maker (AMM).
The Runes Dex Exchange have a several features for decentralized Runes trading:
Following this, we would suggest utilising the quick guide on Runes Dex.
Users can swap between BTC and Runes tokens available in the RunesDeX liquidity pools. The swap price is determined by the ratio of the tokens in the pool, adjusted according to the constant product formula.
1. User's Runes with Dust BTC or BTC Transfer to Swap
The user initiates the SWAP by transferring their Runes tokens along with a small amount of BTC (dust BTC) or BTC directly to the swap contract. This step includes the user's intention to exchange Runes tokens for BTC or vice versa.
2. Fee Transfer to the Pool (Not Less Than Dust BTC)
A portion of the transaction fee is transferred to the liquidity pool. This fee, which is not less than the dust BTC amount, compensates the liquidity providers for their participation and risk in the pool. This fee helps maintain the pool's operation and incentivizes liquidity provision.
3. Fee Transfer to the Treasury (Not Less Than Dust BTC)
Another portion of the transaction fee is directed to the RunesDeX treasury. This fee, also not less than the dust BTC amount, supports the maintenance and development of the RunesDeX platform, ensuring its sustainability and growth.
4. Pool's Runes with Dust BTC or BTC Transfer to Swap
The liquidity pool responds by transferring the corresponding amount of Runes tokens with dust BTC or BTC to the user’s wallet. This step completes the exchange process, ensuring the user receives the desired tokens as per the swap rate.
5. Transfer Back the User's Unused BTC from Input UTXOs
If the user initially transfers more BTC than is required for the swap, the unused BTC is returned to the user's wallet. This step ensures that only the necessary amount of BTC is used for the transaction, and any excess BTC is safely returned.
6. Transfer Back the Pool's or User's (Based on Sender) Unused Runes
Similarly, if the liquidity pool or user transferred more Runes tokens than required for the swap, the unused Runes tokens are returned to the respective sender. This step ensures efficient use of the tokens and avoids any excess transfer.
Liquidity providers earn a 0.25% fee on each trade proportional to their share in the pool.
A portion of the transaction fee is transferred to the liquidity pool. This fee, which is not less than the dust BTC amount, compensates the liquidity providers for their participation and risk in the pool. This fee helps maintain the pool's operation and incentivizes liquidity provision.
Runes DeX earns 0.25% fee on each transaction to the treasury.
Another portion of the transaction fee is directed to the RunesDeX treasury. This fee, also not less than the dust BTC amount, supports the maintenance and development of the RunesDeX platform, ensuring its sustainability and growth.
The total swap fees for Runes Dex are 0.5%.
Runes Dex Have a user friendly interface so swaps can be easy compared for any users.
Before started you should install wallet compatible with BTC and Runes protocols. You can learn how to get it here.
Let's start trading:
Go to the Runes Dex Website.
Connect your wallet.
Choose the token you want to trade from the dropdown menu in the upper section. Whichever token you choose, you will need to make sure you have a sufficient amount of them in your wallet to trade with.
Next, either type an amount in the upper section to input the number of tokens you want to swap (spending amount). Or, type an amount in the lower section to input the number of tokens you want to swap to (receiving amount).
Check all the details, and click the Confirm button.
Then Confirm transaction in your wallet.
Done! You can check your transaction on blockchain explorer.
AMMs use liquidity pools, where users can deposit cryptocurrencies to provide liquidity. These pools then use algorithms to set token prices based on the ratio of assets in the pool. When a user wants to trade, they swap one token for another directly through the AMM, with prices determined by the pool's algorithm.
RunesDeX utilizes a simple mathematical formula:
Where x represents the quantity of BTC, and y represents the quantity of Runes tokens in a liquidity pool, with k
being a constant. This formula ensures that the product of the token quantities remains constant during trades.
Unlike traditional exchanges that rely on order books to match buyers and sellers, RunesDeX facilitates trades directly against the liquidity pool, providing a decentralized and permissionless trading experience.
Slippage occurs when the actual price you get for a trade is different from the expected or quoted price. It often happens in situations of high market volatility or low liquidity. If you want to buy or sell an asset at a specific price, but the market conditions change before your trade is executed, you might end up with a slightly different price than you anticipated. Slippage can result in a higher or lower cost for your trade than you initially planned.
Impermanent loss is a term used in liquidity provision. When you provide liquidity to a pool by depositing two different assets, the value of your assets can change over time due to price fluctuations. Impermanent loss occurs when the value of your assets in the pool is less than if you had simply held those assets without providing liquidity. It's "impermanent" because the loss can decrease or disappear as the prices of the assets change.
Detailed about impermanent loss
Liquidity providers face the risk of impermanent loss, which occurs when the price of the deposited tokens changes compared to the price at the time of deposit, potentially leading to less favorable returns compared to simply holding the tokens.
Price impact refers to the effect a large trade has on the price of an asset in a market. When someone buys or sells a significant amount of an asset, it can cause the price to move in the direction of the trade due to the imbalance in supply and demand. The larger the trade relative to the overall liquidity in the market, the greater the price impact. Price impact can lead to higher or lower prices depending on whether it's a buy or sell order.