curvefi / curve-contract

Vyper contracts used in Curve.fi exchange pools.
https://www.curve.fi/
Other
1.03k stars 385 forks source link

The variable "Ann" should be changed #153

Closed harry1k closed 2 years ago

harry1k commented 2 years ago

https://github.com/curvefi/curve-contract/blob/b0bbf77f8f93c9c5f4e415bce9cd71f0cdee960e/contracts/pools/3pool/StableSwap3Pool.vy#L371

I think it should be changed to Ann: uint256 = amp * (N_COINS ** N_COINS)

The "A*n**n" variable is essential to solve the stableswap algorithm.

harry1k commented 2 years ago

I thought the variable 'amp' in the code should be the same as 'amp' in Stableswap. However, I found that 'amp' in code means amp * n^(n-1).