curve-contract icon indicating copy to clipboard operation
curve-contract copied to clipboard

Is Ann correct?

Open zgfzgf opened this issue 4 years ago • 4 comments

https://github.com/curvefi/curve-contract/blob/8c338d100b2c389a78cbd9b77c238ee305bca2bd/vyper/stableswap.vy#L102 should be: Ann: uint256 = convert(self.A, uint256) * N_COINS * N_COINS

zgfzgf avatar Mar 04 '22 06:03 zgfzgf

same confusion

klouskingsley avatar May 12 '22 03:05 klouskingsley

same confusion

beatriz-web3 avatar Jun 08 '22 09:06 beatriz-web3

I think it should be changed convert(self.A, uint256) * (N_COINS ** N_COINS)
not convert(self.A, uint256) * N_COINS * N_COINS

harry1k avatar Jun 08 '22 10:06 harry1k

I think this question can be solved by this annotation. https://github.com/curvefi/curve-contract/blob/master/contracts/pool-templates/base/SwapTemplateBase.vy#L136 The A passed into the contract is "A * (n ** (n - 1))" (there is a typo on it.), not the A shown in the equation. Thus, Ann is correct. Maybe the "self.A" might not be named as "self.A", it will make people confused.

SuDo-Chance avatar Aug 17 '22 03:08 SuDo-Chance