210 похожих чатов

Please give me a little help. The formula for the

LP tokens in a pool is SQR(Token A * Token B), correct?

If I recalculate one of my pools in this way, I should have about 3000 more LP tokens than are shown. So a difference of about 3%.

What am I missing here? Or is this the current state of the IL in the pool?

6 ответов

19 просмотров

there are differences in the datatypes, i think you have calculated with a very high amount of decimals, the code has not so many decimals, that could cause this issue

the sqrt only applies for the initial tokens. after that, the tokens are calculated in relation to the existing liquidity. due to slipage (you provide a different relation than the current one in the pool) the real liquidity will diverge from the sqrt formula. thats why the chain saves the current reserve for A and B and the total amount of liquidity tokens. this way you can calculate your share of the reserve.

SilverBack-Feistritzer Автор вопроса
kuegi
the sqrt only applies for the initial tokens. afte...

Thank you very much! Is there a separate formula to calculate this reserve? Or is it simply the difference? Sorry for the maybe stupid question. I'm trying to understand the whole thing in a language that is not my mother tongue 😉 (maybe I'll be allowed to join the German DeFiChain group again sometime).

SilverBack Feistritzer
Thank you very much! Is there a separate formula t...

the current reserve you get from the chain reserveA, reserveB and the totalLPTokens is in totalLiquidity. your share of assetA is <yourTokens>/totalLiquidity * reserveA

SilverBack-Feistritzer Автор вопроса
Bernd Mack
there are differences in the datatypes, i think yo...

Thank you! But it wasn't the decimal places, I left them out. But I think Kuegi has given me a clue to the explanation.

SilverBack-Feistritzer Автор вопроса
kuegi
the current reserve you get from the chain reserve...

Oh, thank you, I was on the wrong track! That's right, that's the calculation approach. Embarrassing for me, sorry.

Похожие вопросы

Обсуждают сегодня

@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Hello, Is iExec also part of the "inception program" or another one ? Would it be a name to qualified the nature of the relationship between iExec and Nvidia? And does Secret ...
Ñïķøłäś
8
Ready for some fun AND a chance to win TKO Tokens? Join us for exciting minigames in our Telegram group! 🕒 Don’t miss out—games start on today 25 October 2024, at 8 PM! Ge...
Milkyway | Tokocrypto
255
any reference of this implementation?
BitBuddha
29
Also, why can’t the community have a vote/ say when it comes to initiatives like buybacks. Isn’t the point of crypto decentralisation? Don’t we deserve input as long term supp...
👨🏽‍🦰
13
Hi guys, any problem with Pulsebrige? Trying to transfer from wETH to ETH. First it tells me to connect my metamask "through mobile app" not desktop. Then I did and confirmed ...
Snowflakecrypto
13
Карта сайта