Question About Profit Calculation for Sandwich Attacks in Flashbots Data Browser

Hi everyone,

I’m currently working on my Bachelor’s thesis about frontrunning attacks, and I came across the Flashbots Data Browser, which provides data about sandwich attacks, including profit figures. I’m particularly curious about how these profits are calculated.

From my understanding, the costs for the attacker include the bribe they pay to block builders to prioritize their bundle. Since this bribe is not explicitly visible, I assume that the profit figures provided by Flashbots represent the gross gains of the attacker (i.e., the extracted value before deducting costs). Does that interpretation seem correct?

Additionally, am I correct in assuming that there’s no reliable way to calculate the actual net profit (gains minus costs) for the attacker, as it’s not possible to track the exact bribe paid for a specific bundle?

Thank you in advance for your insights!

The profit in mev-inspect is calculated as the USD difference between token_in and token_out amount, you can find the code here mev-inspect-py/mev_inspect/sandwiches.py at main · flashbots/mev-inspect-py · GitHub
The bribe paid by the attacker can be obtained from the coinbase difference of the bot if it’s paid directly to the builder

1 Like