You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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?
D_P = D_P * D / (_x * N_COINS) # If division by 0, this will be borked: only withdrawal will work. And that is good
Dprev = D
D = (Ann * S + D_P * N_COINS) * D / ((Ann -1) * D + (N_COINS +1) * D_P)
# Equality with the precision of 1
if D > Dprev:
if D - Dprev <=1:
break
else:
if Dprev - D <=1:
break
return D
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"
The text was updated successfully, but these errors were encountered:
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:
curve-contract/contracts/pools/3pool/StableSwap3Pool.vy
Line 82 in b0bbf77
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"
The text was updated successfully, but these errors were encountered: