Open Dire-0x opened 2 years ago
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) profitBackrun = (backOut - (backIn (frontIn / frontOut))) sandwichProfit = min by abs {profitFrontrun, profitBackrun}
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.
Screenshot:
Frontrun: https://etherscan.io/tx/0x54998a9e51516e5d5979f2a3ea76adb2d609cdeb7c745a01270bf5a03d2cc56a backrun: https://etherscan.io/tx/0x9d7b0757c6b05751d6141464d4ed7f27499a83445fa17c5e25799675a1cbbeab
You can find the sandwich with this query:
select *
from `flashbots`.`sandwiches`
where block_number = 14659109
@tutacrypto You can check if our calculation was correct here, which the profit is 0. 215237 WETH plus over 5k BLIB. https://eigenphi.io/ethereum/tx/0xef3b1a72096dd03ccdd7acf8baed8c16e8cc039d1d37fd39a8501d0369f577c0
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.
Screenshot:
Frontrun: https://etherscan.io/tx/0x54998a9e51516e5d5979f2a3ea76adb2d609cdeb7c745a01270bf5a03d2cc56a backrun: https://etherscan.io/tx/0x9d7b0757c6b05751d6141464d4ed7f27499a83445fa17c5e25799675a1cbbeab
You can find the sandwich with this query:
select * from `flashbots`.`sandwiches` where block_number = 14659109
Oh nice tool, thanks for sharing @bryanzk From this link, my computation looks correct ( a ~0.21 wETH profit) and the data on Dune incorrect.
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