FRP-24: Quantifying MEV on L2s

Is there any research on quantifying MEV on L2 chains? (Polygon, Arbitrum etc)
We know that on L2s, without the existence of flashbots, most MEV resolves into PGAs. It would be interesting to see some metrics around the quantity of MEV being extracted and the split between validator/searcher.

3 Likes

I think there is one report by @Quintus here.

3 Likes

That’s quite outdated and not very helpful honestly. I’m sure there are better resources

2 Likes

RE Polygon: “The main reason we sourced this data from another party is that,
due to Polygon’s block size and rate, simulating and tracing transactions can
be executed at only slightly faster than the network speed, making this a very
expensive process (note: event-based tracing significantly improves this process,
but it still remains expensive).” This could be resolved by having multiple servers doing different sequences of blocks couldn’t it @Quintus?

RE Arbtrium: “Unfortunately, at this time, Arbitrum does not provide tracing of transactions.” I think they now do, it would be interesting to use the mev-inspect-py fork there to conduct some research.

Have not seen anything up-to-date or comprehensive but v interesting to see what it looks like. Will post here if I find anything more recent

1 Like

I have seen some evidence of tons of spam transactions being a dominant strategy on L2s due to their increased throughput and lower transaction fees. I believe there is certainly a research opportunity regarding MEV on L2s. It differs case-by-case because each L2 usually differs greatly. Lately, I have been reading about the aquitas protocols and the FSS from Ari Juels and chainlink. I am not sure whether or not I align with the approach but I also know that arbitrum has mentioned they want to use this service for the network sequencers as Ed Felton and Ari are both colleagues and have done work together in the past.

1 Like

fyi we (Flashbots) are happy to give a grant for any data efforts to quantify MEV on L2s! and to build on top of @Quintus’s work (basically porting mev-inspect-py to an L2).

will also note a relevant resource – Marlin’s MEV dashboard, using mev-inspect to quantify MEV on Polygon https://explore.marlin.org/

6 Likes

If I recall correctly the issue was that you need to know the state at the start of a block to be able to replay it and the only good way of accessing old state was recreating it by executing the blocks that came before

1 Like

It’s an issue across all the low gas utilization, high throughput chains. Thus far, the crude solution seems to be to set gas price floors (present on most L2s and sidechains).

FWIW – I think studying Solana + Jito Labs might be interesting/relevant here, given some similarities in blockspace fee markets (oversupply of blockspace, low unit prices, likely more gas-price sensitive end users, more informal MEV markets etc) to L2s, which may in turn affect the shape and form MEV takes (dominant strategies, value accrual, etc)

And yeah you’re totally spot-on re:how different L2s are choosing to tackle MEV. May result in a diverse set of localized MEV ecosystems. Or potentially favor cross-chain searchers and builders who are capitalized well-enough to do “netting” across layers (similar to how cross-border remittances or cross-CEX arbs work).

Going to look around on L2 research forums + ask around to see if anyone has attempted to quantify this :saluting_face:

3 Likes

I haven’t looked too much into Jito labs as I am hesitant about the Solana ecosystem. Still, from your recommendation, perhaps there is value in drawing a unique comparison in their approach to benefit the greater ecosystem. I recently saw some PRs on the Flashbots research GitHub that might be interesting to you. Perhaps there is room to collaborate there? Also, Ed made this post in the arbitrum discussion forums about 10 days ago that is relevant. Ed was a co-author of the Flashboys paper and a founder of the arbitrum network.

2 Likes

Some people have mentioned spamming so this report on a spamming strategy on polygon may be interesting:

2 Likes

This is fascinating, thanks for sharing @Quintus. I wonder if there’s a cutoff point after which this type of strategy (more like spam & griefing) isn’t really economic anymore?

For some quick reference stats, here’s the USD-denominated gas fees for a simple WETH<>USDC swap on uni v3 across various chains at the time of writing this post:

  • Ethereum L1 = $1.94
  • Polygon PoS = <$0.01
  • Optimism = $0.09
  • Arbitrum One = $0.59

Solana DEX spot swaps are also effectively priced as “gas” free.

Suppose this does make the case for setting minimum (non-zero) base fees.

2 Likes

FYI we have started working on the topic with @0xpanoramix (FRP 24)
We have a public repo, feel free to check/comment on our work.
We are now actively working on having a clean branch for Polygon while doing some trials on Arbitrum and researching a way to scale the historical chain analysis.

5 Likes

Very cool, thank you for sharing it here!

1 Like

regarding the historical chain analysis, you might be interested in substreams - https://substreams.streamingfast.io/

the tldr is that substreams is a novel technological innovation from The Graph and does a bunch of incredible things. Here is a list of chains they have built support for

here is what you can get from substreams

2 Likes

Update on the FRP 24:

  • We are now saving all mev txs to a newly added db
  • We have managed to add a module that takes care of all the profit analysis (retrieving historical prices, computing the usd profit and running some other analysis)
  • Improving on Marlin Protocol’s version that get the tx data from the logs rather than the traces works great for Polygon (200k+ blocks analysed)
  • We have started running mev-inspect-py for Arbitrum but it is faster to go with the logs so that’s what we are doing
  • We have a PoC for Optimism using the logs
  • We have also been working on scaling, indeed, with 38M blocks for Polygon it is going to take quite some time to do the whole history. One thing is batching the number of requests, the other is to potentially run local nodes to reduce the latency of the requests. Ofc the hardware part helps as well, we should have some interesting benchmark to provide here in the coming weeks.
  • One bottleneck is the RPC provider, we quickly hit limit rates unless we use Pocket Network but it is often down. I think we will implement a rotation of RPC providers.

As always, please feel free to have a look at what we do on the repo, the branches of interest are master-polygon, master-arbitrum and master-optimism. Don’t hesitate to give us feedback and ideas.

Thank you @0xEvan but I think they do not support none of the blockchains we are diving into here. Would be interesting to look at other chains though. Maybe a future FRP :slight_smile:

2 Likes

The current plan is:

  • Finding a reliable source of prices (Coingecko and CryptoCompare only provide hourly data up to 90 days, we need historical hourly data since inception). If you have anything to recommend, that would help
  • Running the analysis on Polygon for a long period (500k blocks) and seeing if we face any issues → fixing and iterating + measuring the time it takes and other benchmarking
  • Once the above is done for Polygon, we want to do it for Arbitrum and Optimism
  • Then running the history since inception to have the final data to write the paper
1 Like

Marlin and Fastlane are two projects that may be helpful + potentially want to collaborate with you on this research. Not sure if you’re involved with either of those, but figured I would mention if helpful!

Seems like you’re already working somewhat with Marlin:

Here is a list of the metrics we are looking at for each chain:

  • usd profit by block: time series + average + median + distribution
  • usd profit by day: time series + average + median + distribution
  • nb of txs by block: time series + average + median + distribution
  • nb of txs by day: time series + average + median + distribution
  • what are the top 10 tokens profit is taken in? How does it distribute?

What else would you guys love to see?

I come with some price information from the team


@alex: i believe we use Uniswap oracle data for the MEV-Explore dashboard! (so, per block)
cc @taarushv

@Tina: I don’t know what our data team’s solution is currently, but in the past (not in Flashbots) Amberdata had provided me with great price feeds for my mining research.

@elainehu: yes amberdata will have this data. I use chainlink Data Feeds API Reference | Chainlink Documentation since it’s aggregated price not just from a single dex.

1 Like