contractV2 icon indicating copy to clipboard operation
contractV2 copied to clipboard

Calc amount in/out

Open Lanskih90 opened this issue 11 months ago • 0 comments

Hi, How can I calculate in a contract the amount of Token 1, how much do I need to give to get 1000 Tokens 2 ? For example, I want to buy in the pool WETH/USDC - 3 WETH, how can I calculate the exact amount USDC that I need to pay? I looked through DODO v2 contracts and didn't find such a function... UniswapV2 has functions getAmountIn and getAmountOut for this, perhaps DODO v2 has similar functions?

Lanskih90 avatar Mar 18 '24 17:03 Lanskih90