Answers>Learn about MEV & transaction ordering>How transaction ordering works
How transaction ordering works
// Tags
transaction orderingmempool
TL;DR: Transaction ordering is the process by which a blockchain decides which pending transactions get included in the next block and in what sequence. This ordering directly affects which transactions succeed, which fail, and how much value each participant receives. On most blockchains, the entity producing the block has full discretion over transaction order. Historically, transactions were ordered by gas price, with the highest bidder going first. Today, the process is far more complex, involving base fees, priority fees, private order flow, specialized block builders, and auction mechanisms that have transformed block construction into a sophisticated marketplace.
The Simple Explanation
When you submit a transaction to a blockchain, it enters the mempool, a public holding area where every pending transaction waits to be included in a block. The mempool is not a queue. There is no guaranteed first-come-first-served ordering. Instead, the block producer (a validator on Proof of Stake chains, a miner on Proof of Work chains) selects which transactions to include and arranges them in whatever order they choose.
This is fundamentally different from how traditional systems work. When you place an order on a stock exchange, the exchange has strict rules about time priority: orders that arrive first are executed first. On a blockchain, the block producer is the exchange, and they can reorder the trades however they want. The only constraint is that each transaction must be valid given the state produced by the transactions before it in the same block.
Why does ordering matter so much? Because in DeFi, the order of transactions within a block can determine prices, liquidations, and arbitrage outcomes. If two people are trying to buy the same token from the same liquidity pool, the person whose transaction executes first gets a better price. The second person's transaction executes against a pool with less liquidity and a higher price. The difference between going first and going second can be worth thousands or millions of dollars.
The Traditional Model: Gas Price Ordering
Before Ethereum's EIP-1559 upgrade (August 2021), transaction ordering was straightforward: users attached a gas price to their transaction, and block producers sorted the mempool by gas price, highest first. If you wanted your transaction to land before someone else's, you paid a higher gas price. This created a simple but brutal auction system called a Priority Gas Auction (PGA).
PGAs were chaotic during high-demand periods. MEV searchers competing for arbitrage or liquidation opportunities would rapidly outbid each other, incrementing their gas prices in real time. A single profitable MEV opportunity could trigger dozens of competing transactions, each with progressively higher gas prices, consuming block space and driving up costs for everyone else on the network. Users trying to make a simple token transfer would see their gas costs spike because bots were bidding up the price of block space in pursuit of MEV profits.
The PGA model also meant that transaction ordering was entirely determined by willingness to pay. There was no concept of fairness, no consideration of when a transaction was submitted, and no mechanism to protect regular users from being outbid by sophisticated bots with faster mempool monitoring and higher capital reserves.
EIP-1559 and the Two-Part Fee Model
Ethereum's EIP-1559 upgrade replaced the single gas price with a two-component fee structure: a base fee and a priority fee (tip). The base fee is set algorithmically by the protocol based on how full the previous block was. When blocks are more than 50% full, the base fee increases. When blocks are less than 50% full, it decreases. The base fee is burned (removed from circulation), meaning it does not go to validators.
The priority fee is the amount a user pays directly to the validator as an incentive to include their transaction. In a world where every transaction pays the same base fee, the priority fee becomes the differentiator for ordering. Transactions with higher priority fees get included first.
This model improved fee predictability for users (the base fee adjusts smoothly rather than spiking unpredictably) and reduced the effectiveness of PGAs (since competing bots can no longer spike the overall gas price for everyone, only their own priority fee). However, it did not eliminate ordering-based value extraction. Validators (or the builders they delegate to) still control the sequence of transactions within a block, and the priority fee still creates an auction for positioning.
Modern Block Building: Proposer-Builder Separation
Today, transaction ordering on Ethereum is dominated by a system called Proposer-Builder Separation (PBS), implemented through MEV-Boost and the Flashbots ecosystem. PBS splits the block production process into two roles: builders who assemble the block's contents and proposers (validators) who sign off on the final block.
The process works as follows. Users submit transactions to the public mempool or directly to builders through private channels. MEV searchers monitor the mempool and construct bundles, which are ordered groups of transactions designed to capture specific MEV opportunities (arbitrage, liquidation, sandwich). Builders collect these bundles along with regular user transactions, assemble them into a complete block ordered to maximize total value, and submit their block as a bid to a relay. The relay validates the block and forwards the highest-value bid to the proposer. The proposer selects the winning bid (typically the one that pays them the most), signs the block header, and the relay publishes the full block to the network.
Over 90% of Ethereum blocks are now produced through this PBS pipeline. The system has professionalized transaction ordering to a degree that would have been unimaginable in the early days of the network. Block building has become a competitive, capital-intensive business where a handful of builders produce the majority of blocks based on their ability to extract and distribute MEV efficiently.
Private Order Flow
One of the most significant developments in transaction ordering is the rise of private order flow. Instead of broadcasting transactions to the public mempool (where they are visible to front-running bots), users can submit transactions directly to builders through private channels. Services like Flashbots Protect, MEV Blocker, and private transaction relays accept user transactions and forward them to builders without exposing them to the public mempool.
Private order flow protects users from sandwich attacks (since bots cannot see the transaction to front-run it) but creates new dynamics in the block building market. Builders with access to exclusive private order flow have a competitive advantage because they can construct more valuable blocks than builders limited to public mempool transactions. This has led to a concentration of block building among a small number of builders with the best order flow relationships, raising concerns about centralization in a system designed to be decentralized.
Transaction Ordering on Other Chains
Solana handles transaction ordering differently because of its architecture. There is no traditional mempool. Transactions are sent directly to the current leader (the validator responsible for producing the current slot's block). The leader determines ordering, and Solana's Gulf Stream protocol forwards transactions to the upcoming leader in advance. This reduces some MEV attack vectors (like traditional mempool sniping) but gives the leader significant ordering power during their slot.
Layer 2 rollups like Arbitrum, Base, and Optimism currently use centralized sequencers that order transactions on a first-come-first-served basis. The sequencer receives transactions, orders them by arrival time, and batches them for submission to Ethereum L1. This model reduces ordering-based MEV compared to Ethereum L1 but concentrates ordering power in a single entity. Efforts to decentralize sequencers, including shared sequencing networks and sequencer rotation mechanisms, are active areas of development.
How does transaction ordering create MEV?
Because the block producer chooses the sequence of transactions, that sequence itself becomes a source of profit. Reordering, inserting, or censoring transactions can capture value that would otherwise go to ordinary users, and this captured value is called MEV. A searcher who sees a large swap in the mempool can place a buy just before it and a sell just after to pocket the price impact. The deeper reason this is possible is structural: as long as someone controls ordering and transactions are visible before they execute, the opportunity exists, which is exactly why MEV exists.
How does transaction ordering differ across blockchains?
Each chain hands ordering power to a different actor, which changes how much MEV users are exposed to. Ethereum uses builders and proposers, Solana hands the current leader control, and most rollups rely on a single sequencer. The table below compares the three models.
Chain
Ordering mechanism
MEV exposure
Ethereum L1
Builders order by total value via PBS
High; arbitrage and sandwich attacks common
Solana
Current leader orders, no public mempool
Less mempool sniping, but the leader still controls order
L2 rollups (Arbitrum, Base)
Centralized sequencer, first-come-first-served
Reduced reordering MEV, but the sequencer is trusted
What are the main types of order-based value extraction?
Not all ordering-based value extraction is harmful. Some forms keep markets efficient, while others come directly at the expense of the user being ordered around. The table below summarizes the most common categories searchers pursue.
MEV type
What it does
Who is affected
Arbitrage
Profits from price gaps across pools or venues
Mostly benign; aligns prices
Liquidation
Repays undercollateralized loans for a bonus
Borrowers near their threshold
Sandwich
Front-runs and back-runs a victim swap
Traders on the public mempool
Back-running
Places a transaction right after a target
Varies; often benign
Can you protect transactions from harmful ordering?
Yes, to a meaningful degree. The simplest defense is to keep a transaction out of the public mempool by routing it through a private order flow service, so front-running bots never see it before it executes. Setting tight slippage limits also caps how much a sandwich can extract. These approaches, along with fair-ordering research and encrypted mempools, are part of a broader set of MEV mitigation strategies that aim to protect users without sacrificing the openness of the network.
Frequently Asked Questions
Is transaction ordering the same as first-come-first-served?
Usually not. On most blockchains the block producer can arrange included transactions in any valid order, so arrival time does not guarantee execution order. Some Layer 2 sequencers do order by arrival time today, but that is a property of those specific systems, not of blockchains in general.
Does a higher fee guarantee my transaction goes first?
It improves your odds but does not guarantee position. A higher priority fee makes inclusion and earlier placement more likely, yet builders optimize for the total value of the whole block, so a bundle that pays more overall can still outrank your standalone transaction.
Does transaction ordering relate to finality?
They are connected but distinct. Ordering decides the sequence within a block, while finality decides when that block can no longer be reversed. A transaction can be ordered and included yet still be undone if the block is reorganized before it is final.
Can transaction order change after a block is produced?
Within a single block, no; the order is fixed once the block is signed. But the block itself can be replaced during a chain reorganization, which can drop or reorder transactions relative to the canonical chain until finality is reached.
Do Layer 2s eliminate MEV?
Not entirely. A centralized sequencer that orders by arrival time reduces the reordering MEV common on Ethereum L1, but it concentrates ordering power in one operator and does not remove every form of extraction. Decentralizing sequencers is an active area of research aimed at addressing this.
How Quicknode Fits In
Transaction ordering affects every application that submits or monitors transactions on a blockchain. Quicknode's Core API provides the low-latency RPC access developers need to submit transactions with accurate fee estimation and precise timing. Fast response times ensure your application's transactions reach the network with minimal delay, which is especially important in competitive environments where milliseconds determine transaction positioning.
For applications that need to monitor how transactions are being ordered and included, Quicknode Streams delivers real-time block data with guaranteed delivery and finality-order processing. By streaming transaction data filtered to your contracts and addresses, you can analyze ordering patterns, detect MEV activity affecting your users, and build systems that respond to block-level dynamics in real time. Quicknode's infrastructure ensures your application has the speed, reliability, and data access needed to navigate the complex realities of modern transaction ordering.