For mr. @iamdefinitelyahuman. Please, I need your help.
eugeneford opened this issue · 0 comments
Hello, @iamdefinitelyahuman.
First of all, I want to apologize for posting this here. I know that Github issues are not intended for technical support and honestly tried to get some guidance in Telegram and Discord. I've also read all the documentation, whitepapers at Curve.fi, all history of the messages in Discord's #dev channel as well as tons of other documentation.
I'm trying to understand the specifics of the 3pool contract, and struggling to do so. I'm doing so with one very specific goal — to deeply understand how APRs are calculated for Curve pools. I need your help to understand the following:
What the RATES constant stands for?
I originally thought that it is about the precision of the specific token, but found that USDT and USDC have 6 decimals while this array contains much higher values 10^30.
curve-contract/contracts/pools/3pool/StableSwap3Pool.vy
Lines 177 to 181 in b0bbf77
What the _xp() function does?
My guess was that it returns the DAI, USDC, USDT balances normalized with a Lending precision. If my guess is right, why do we use the Lending precision if it is not a lending pool?
curve-contract/contracts/pools/3pool/StableSwap3Pool.vy
Lines 195 to 218 in b0bbf77
What the _get_D() function does?
My guess was that it is connected to the pool invariant calculation, but it is not clear to me why do we go through a loop to calculate the D? I have found some relevant information in dev documentation, but really struggling to understand the specifics of "converging solution"