Content pfp
Content
@
0 reply
0 recast
2 reactions

Cristian Strat pfp
Cristian Strat
@c
Does anyone have an implementation of “getAmountIn” for Velo v2 / Solidly “stable” pools? i.e., the inverse of this function https://github.com/velodrome-finance/contracts/blob/main/contracts/Pool.sol#L449 The curve is the curve is yx^3 + xy^3 = k.
1 reply
5 recasts
9 reactions

Stas pfp
Stas
@stas
Don't recall, but this might be helpful to draft one https://github.com/velodrome-finance/contracts/blob/main/contracts/Router.sol#L600 Anything specific you're trying to achieve?
1 reply
0 recast
0 reaction

Cristian Strat pfp
Cristian Strat
@c
Thanks! I looked around a bit, and it doesn't seem like the router/zap logic has exact-output quoting. The use case is to calculate the input amount required to swap into an exact output amount. e.g., how much USDC do I need to get exactly 1 ETH
1 reply
0 recast
1 reaction