Building a fair distributed economy: Igra's approach to MEV

Hello world! Today let's talk about MEV, miner (or maximum) extracted value. It's a tricky topic as it intersects technology, economics, and even philosophy.

First, let's dive into automatic market maker fundamentals.

What is AMM

Ethereum, our great ancestor, unlocked a new class of applications called "DeFi", decentralized finance. Essentially, these apps allow users to create and exchange assets called "tokens." Today, the DeFi ecosystem is vast, counting thousands of apps and billions in daily traded value of tokens and derivatives.

Unlike in the centralized world, the vast majority of on-chain exchanges do not allow users to simply create "buy" and "sell" orders. The cornerstone of a decentralized exchange (or "DEX") is an automatic market maker algorithm, which allows token exchange (or "swapping") within its contract ("pool") if the price is within a certain range (called "slippage").

The AMM price formula looks like this: Δy = (y × Δx) / (x + Δx),

Δy = tokens received
y = output reserve balance
Δx = tokens sent
x = input reserve balance

So if Alice wants to swap 1 ETH for USDC, it will work if there are 50 ETH and 100,000 USDC in the pool. To swap, she sends a transaction specifying the desired amounts (2000 USDC for 1 ETH) and price change tolerance (slippage, normally 0.5% or 1%). This tolerance is needed because the exact price cannot be guaranteed with 100% precision, as other transactions may execute before Alice's, changing token balances in the pool and affecting the price.

If the current pool price fits within her specified range, the swap will happen. Slippage ensures Alice doesn't pay too much if someone executes a large swap before hers that significantly impacts the price.

AMM is a great technology that compensates for the lack of order book architecture used in classical trading systems. However, they cause some undesirable side effects, like front-running.

What is front-running

Now, AMM design is simple and it works, but sophisticated actors can easily exploit it. One prominent attack is front-running, also called a “sandwich attack”: Bob places his buying transaction before Alice's, raising the price, causing Alice to pay more (even within her slippage tolerance), and then places a selling transaction right after to profit from the price difference. (This is a brief, simplified overview. To understand the intricacies of AMMs and front-running in depth, you can read https://www.rareskills.io/category/uniswap-v2).

What is MEV

Front-running attacks aren't so easy to coordinate, as transaction order in blocks is supposed to be random. However, about 5 years ago, Ethereum miners discovered a bonus income stream by arranging transactions according to the highest bidder's request. This is called MEV, "miner extracted value," and is well documented in an excellent paper: https://arxiv.org/abs/1904.05234.
TL;DR: MEV is not good for Alice.

Since then, it has become an accepted practice. What's more disturbing is that most blockchain architectures have accepted this as both a status quo and a core economic mechanism.

One example of how MEV affects regular users is a recent coordinated sandwich attack on a Uniswap user who mistakenly set slippage to 100% and lost more than $200,000 USD (https://cointelegraph.com/news/crypto-trader-loses-least-215000-stablecoins-from-sandwich-attack).

Igra's stance on MEV

We at Igra believe in a fair and distributed economy. We believe systems where few concentrate validating power or coordinate attacks with sophisticated actors and profit from small players are not fair and not truly distributed. While one might reluctantly accept a reality where users must be taxed to compensate miners and increase system security, this isn't the case with MEV since it doesn't actually enhance security. It doesn't increase the number of nodes, their stability, or diversity, as there's no trustless enforcing mechanism. MEV simply makes validators and bot masters richer.

How Igra Inherits MEV Resilience from Kaspa

At Igra, we’re strong proponents of MEV-resilience and we're making it one of the cornerstones of our architecture. By using Kaspa blockDAG as a sequencer, we inherit its fast, leaderless, parallelized consensus.

Kaspa uses a blockDAG structure (directed acyclic graph of blocks) rather than a single chain, allowing many blocks to be created in parallel. Multiple parallel blocks are accepted each round, and no single miner can predict or control exactly which block will confirm a given transaction. If a user broadcasts a transaction, multiple miners will likely include it in their nearly simultaneous blocks. The final ordering is determined by Kaspa’s algorithm, not by a single miner’s whims. Bob can’t predict the order of transactions and therefore cannot extract value from Alice.

On top of this, Kaspa blockDAG enables another possible mechanism where DeFi protocols can deploy dedicated miners with sufficient hash power to guarantee processing Alice's transaction with zero MEV within a reasonable timeframe.

Why MEV resilience is good for Kaspa miners

Igra aims to benefit Kaspa L1 by increasing its transaction volume and security budget. More fees for miners means better hardware, more nodes, higher hashrate, and greater security for Igra with faster consensus—a win-win.

This equally benefits users by reducing MEV threats, not just removing them but potentially replacing them with fair auction mechanics. If a transaction has extractable value, multiple miners will compete for inclusion, outbidding each other by offering higher rebates to users.

We recommend following ongoing research by @hashdag and @MichaelSuttonIL, such as this talk https://youtu.be/MugsziO0OYY?si=iy_e0YKVQ_QcHnoJ and these threads: https://x.com/MichaelSuttonIL/status/1797704992440356923, https://x.com/hashdag/status/1861525921527640475?t=FaRz_Ujxxg2s-arOb0mZeg&s=19.

Outro

We believe in a scalable digital economy that minimizes MEV and other unfair practices benefiting few at the expense of the many. Igra is playing fair.

We invite you to join this discussion and share your thoughts on MEV resilience topic.