Skip to content

Arbitrage Optimal amountIn calculation problem #7

Answered by t4sk
FurkanSezal asked this question in Q&A
Discussion options

You must be logged in to vote

3.0797718755 * 1e21 is optimal amount in but it's being used as amount out

uint256 borrowAmount = amount;
        // borrow quote token on lower price pool,
        uint256 debtAmount = getAmountIn(borrowAmount, orderedReserves.a1, orderedReserves.b1);

https://github.com/Uniswap/v2-periphery/blob/0335e8f7e1bd1e8d8329fd300aea2ef2f36dd19f/contracts/libraries/UniswapV2Library.sol#L52-L53

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
4 replies
@FurkanSezal
Comment options

@t4sk
Comment options

@FurkanSezal
Comment options

@FurkanSezal
Comment options

Comment options

You must be logged in to vote
1 reply
@t4sk
Comment options

Answer selected by FurkanSezal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants