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
sold_id:0
tokens_sold:
6521609294209082182
bought_id:1
tokens_bought:
1476425104436295904386
But the result of my calculation is
out.Fee : &{B 44901041 0}
out.SwapInfo :
out TokenAmountOut : 1476425104436295901193
But the result of my calculation is
out.Fee : &{B 37401350 0}
out.SwapInfo :
out TokenAmountOut : 179495139100822346101543
There are other examples. Some addresses have factory contract type two-pool pools, and there are also non-factory contract type two-pool pools. They all have this problem. I carefully compared the vyper code on the chain, but still cannot find the problem.
The text was updated successfully, but these errors were encountered:
@mafangtao : I cannot reproduce the issue with the latest state of above 2 pools, our simulation code yield the same results with forge/foundry (onchain simulation).
Is this still happen at your side? Next time it happen please capture the entity.Pool used for creating the simulator (something similar to this) and paste it here.
There seems to be a bug in the CalcAmountOut function of curve's two pools. The calculation results are correct for some pools and wrong for others.
for example:
1-https://etherscan.io/tx/0x8d5ec325fb01a5fa9cf6c8795dbbfa0979e924eef04ba31810eab80ee16c2655#eventlog
The data on the chain is
sold_id:0
tokens_sold:
6521609294209082182
bought_id:1
tokens_bought:
1476425104436295904386
But the result of my calculation is
out.Fee : &{B 44901041 0}
out.SwapInfo :
out TokenAmountOut : 1476425104436295901193
2-https://etherscan.io/tx/0x6cc9b9e290cc78e0f7424935c071f11e001ca654ae21ac4702c79489d672f579
The data on the chain is:
sold_id:0
tokens_sold:
2000000000000000000
bought_id:1
tokens_bought:
179495139100822344170953
But the result of my calculation is
out.Fee : &{B 37401350 0}
out.SwapInfo :
out TokenAmountOut : 179495139100822346101543
There are other examples. Some addresses have factory contract type two-pool pools, and there are also non-factory contract type two-pool pools. They all have this problem. I carefully compared the vyper code on the chain, but still cannot find the problem.
The text was updated successfully, but these errors were encountered: