-
Notifications
You must be signed in to change notification settings - Fork 266
Sandwich profit amount inflated in some cases #283
Comments
This is good. I propose a more conservative version which works for imbalances in both directions (overweight front or back runs). profitFrontrun = (frontOut * (backOut / backIn) - frontIn) |
Hey @Dire-0x @pmcgoohan, what's your progress on this? I've had another issue with profit calculation from sandwiches. In this case I get a negative profit (loss), where the transaction looks like it should be positive. Curious to here your thoughts. Frontrun: https://etherscan.io/tx/0x54998a9e51516e5d5979f2a3ea76adb2d609cdeb7c745a01270bf5a03d2cc56a You can find the sandwich with this query:
|
@tutacrypto You can check if our calculation was correct here, which the profit is 0. 215237 WETH plus over 5k BLIB.
|
Oh nice tool, thanks for sharing @bryanzk Any news on making the PR with your model @pmcgoohan? |
I have found that the
sandwich.profit_amount
in some cases is very inflated... I'll give an example (the amounts below are made up but I have seen many cases of this happening).frontrun: 1,000,000 USDC -> 100 ETH
backrun: 300 ETH -> 3,200,000 USDC
mev-inspect calculates the profit as 3,200,000 - 1,000,000 USDC
we should calculate the profit pro rata, like this
profit = 100 * (3,200,000 / 300) - 1,000,000
profit should be $66k but is currently calculated as $2.2m
Here is an example case detected by mev-inspect
frontrun: https://etherscan.io/tx/0x59211262bbc5b8260d4d7ea6311ac81d358a09a99a7422f9a27e3b3fbe92b549
backrun: https://etherscan.io/tx/0x87fda6ee1f2c74e106aab959beca197a8749f988c692aedf10c8499ad5805a81
The text was updated successfully, but these errors were encountered: