Open nzhl opened 1 year ago
See section 2.1 of this paper. Then it's a matter of calculus!
When listening to the Flashbots MEV-Share Matchmaker on the Goerli network this transaction was returned, 0xe678b8a63274d0a14c5b9438997157d5212cfaddb79151effd36afa291e8e9e6. This arbitrage appears to be losing WETH. Is the arbitrage formula reversed or am I just reading this wrong (more likely scenario)?
See section 2.1 of this paper. Then it's a matter of calculus!
Hey handsome, I understand calculus, but I've looked through the link you gave me three times and still can't find the derivation process of the calculation formula in the BlindBackrun contract. This article is about the arbitrage process from the Uniswap market to a related market with infinite liquidity, while the calculation formula in your BlindBackrun contract refers to two identical Uniswap markets, such as the arbitrage between the currency pairs of Uniswap and Sushiswap. Would you be able to update an article showing how to derive the calculation formula inside the GatAmountIn method? This would be very helpful for us to research new arbitrage methods. Thank you very much!
I am struggling to figure out how can we deduce the formula used in
getAmountIn
. Basically here if we want to maximize our profit those two pools must have almost the same price at final stage. Hence we have:Also we know how the pair pool is updating accordingly after swap:
Based on equations mentioned above, i just have no clue how can i simplify it to the formula in the code. Do i miss anything here ?
https://github.com/flashbots/simple-blind-arbitrage/blob/62582059a26f3852949e71a49821ee3c613f2f27/src/blindBackrun.sol#L83