The previous getAmountIn() function wasn't working properly on mainnet because it would frequently under/overflow. I've updated the math to, I think, address this.
I'm not sure if this new function is optimal always, but it's directionally correct and a good place to start.
The previous getAmountIn() function wasn't working properly on mainnet because it would frequently under/overflow. I've updated the math to, I think, address this.
I'm not sure if this new function is optimal always, but it's directionally correct and a good place to start.