-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Liquidity pool questions #155
Comments
|
|
|
If I simply :
|
Whenever a swap occurs, the tokenPool and cashPool values change, depending upon the direction of swap, trading fee is calculated and added to the respective variable. Let's take an example: Automated Market Liquidity ( 1000 Tez and 1000 ctez) and you are the sole liquidity provider with 2000 Lp Tokens of the Pool. If someone swapped 1 tez to ctez at that time. Trading Fee = 0.05/100 * 1 tez = 500 mutez ( 0.000050 tez ) Since, the user is swapping around 0.1 % of liquidity, there are facing slippage in the trade. In the smart contract, tokenPool value is the ctez balance of the Automated Market Maker and cashPool is the xtz balance. Upon Remove Liquidity, following calculation would be executed: xtz_amount = (user_lp_balance * cashPool ) / total_lp_supply = 1001 tez Note - This is an extremely basic example to explain the working of the AMM. There are other things to consider while providing liquidity to the pairs. |
Are the fees always taken in XTZ ? Does it mean that the cashPool will always grow ? |
The fees are taken in ctez and xtz, depending upon the input of the swap. If the swap is from ctez to tez, then fee is taken in the form of ctez and vice-versa. |
Thanks
Interesting 🤔
Le mar. 21 juin 2022 à 17:12, Ryoma Echizen ***@***.***> a
écrit :
… The fees are taken in ctez and xtz, depending upon the input of the swap.
If the swap is from ctez to tez, then fee is taken in the form of ctez and
vice-versa.
—
Reply to this email directly, view it on GitHub
<#155 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AATLHMBSYYLK3OKN4HZQKI3VQHLUBANCNFSM5YGS2D6Q>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Q1 : It is said : "By adding liquidity you'll earn 0.05% of all trades on this pair proportional to your share of the pool."
How can I get this reward ?
Is it a global reward of the pool ? But when i convert back the LQ tokens to XTZ and CTez, is it including the reward too or not ? How can I see the formula of it to verify it ?
Q2 : When I get some LQ tokens from the Liquidity pool, what happens to my XTZ on it and its delegation ? Who get my delegation rewards out of it ? As XTZ are deflationists, it means that user is losing some inflation value here
The text was updated successfully, but these errors were encountered: