UniswapV2Arb2 solution note : no need to calculate flash swap fee? #31
Replies: 2 comments 1 reply
-
|
That is because did the arbitrage in a way that we won't be paying back fees, we basically swapped token but instead of first sending the tokens we wanted to swap we first received the token we wanted from the pool and the do an arbitrage using that token and then send back to the pool the token we wanted to swap. Doing that makes us not pay the flash-loan swap fee. Ask questions if anything is confusing. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the reply. I found it a bit difficult to understand the difference in context between It was initially confusing because the comments in UniswapV2Arb2.test.sol are exactly the same as those in UniswapV2Arb1.test.sol. That made it a bit tricky to immediately grasp the unique goal or setup of the second exercise. Perhaps the comments in UniswapV2Arb2.test.sol could be updated to reflect the slightly different scenario more accurately. In The swap fee is already factored in using the Seeing it from this reverse perspective—starting with repayment and working backwards, helped me understand the logic behind |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In
test/uniswap-v2/solutions/UniswapV2Arb2.test.sol:UniswapV2Arb2Test, there’s a note in the solution that says :// NOTE - no need to calculate flash swap feeWhy is the flash swap fee calculation not needed in this case?
Shouldn't we be repaying the borrowed amount plus the 0.3% fee when arbitraging back to the pair address?
Beta Was this translation helpful? Give feedback.
All reactions