Exploring the Mempool Space
Last day to participate in Gitcoin Grants—contributing 1 DAI means 336 DAI in matching. Let's help the world go bankless!
Dear Bankless Nation,
It’s the place where all of your pending Ethereum transactions go.
But there’s so much more going on in the mempool than most expect. Arbitrage bots, front-runners, and more. The mempool is filled with money-hungry apex predators.
They hide in the mempool waiting to attack. They monitor any and all transactions with the intention to exploit them. If any profitable opportunities arise? They pounce.
It can be a pretty scary place. But the Ethereum community is starting to learn more and more about the mempool. We’re leveling up.
Today, Matt shares his knowledge with you.
Here’s everything you need to know about the mempool.
P.S. Special request for the Bankless Nation—We released the Bankless 2020 Survey earlier this week. If you have 5 mins, please fill it out so you can help us level up!
Make time to complete this assignment before next week
DeFi Dad shows you how you can buy yTrump (Trump wins) or nTrump (Trump loses) for the 2020 Presidential election with Augur tokens. It makes it that much easier to use prediction markets on Ethereum!
Here’s what you’ll learn with this week’s assignment:
- How to tokenize prediction market outcomes on Augur Foundry
- How to wrap those tokenized outcomes
- How to provide liquidity so others can buy into this market on Uniswap or Balancer
Why the Mempool Matters: The Hidden Competition for Confirmation
Every pending Ethereum transaction invisibly competes in the mempool to be confirmed.
While the mempool is a critical piece of blockchain infrastructure, many (most?) people have little understanding of how the mempool game works – or how the rules can be used against your best interests.
- Are you waiting for your transaction to confirm? That’s the mempool.
- Are you priced out by high gas fees? That’s the mempool too.
- Are you frustrated by a stuck transaction that has blocked your wallet? Yep…the mempool.
- Are you confused by automated bots instantly exploiting arbitrage opportunities? Yeah. You get the idea.
Fortunately, over the past few months, the mempool has started to come out of the shadows.
The industry is beginning to share compelling tales that describe the hidden world of mempool competition. A sampling of worthwhile reads include:
- Ethereum is a Dark Forest
- Evidence of Mempool Manipulation on Black Thursday
- Escaping the Dark Forest
- Staring into the Monsters Eye
- How to Munch on Pickles from a Whale Dinner
These narratives illustrate how the mempool can be mysterious, confounding, and even downright dangerous. Until recently, going hands-on with mempool data has been out-of-reach for all but the most sophisticated and well-financed teams.
Hence the Blocknative team is excited to help show the Bankless Nation why the mempool matters. We will introduce the core concepts, then explore the implications for traders and builders, and wrap up with some new, easy-to-use tooling for you to go hands-on with real-time mempool data.
What is the Mempool: A Competitive Marketplace for Confirmation
The mempool is a competitive game where winning gets your transaction confirmed as quickly as possible at the lowest fee. When you approve and sign a transaction, it enters the mempool — and joins tens of thousands of other pending transactions that are jockeying for precious block space.
In other words, the game is on for your transaction to get confirmed and go on-chain.
But the gas price is set before your transaction enters the mempool. The higher the gas price, the higher the miner incentive to include your transaction in the next block, making the mempool a first-price auction. As a result, the mempool is neither a static nor a benign environment but instead a highly dynamic – perhaps even chaotic – system.
This effectively makes the mempool a real-time marketplace for on-chain confirmation and settlement. In this marketplace, your transaction competes shoulder-to-shoulder with thousands of other transactions for miner attention.
Know the Rules of Competition
To help you compete, here are some of the 5 core concepts that combine to form the rules of the mempool marketplace:
1. Each node has its own version
By definition, the mempool is pre-consensus. That means that each node in the network has its own unique version of the mempool. Getting your arms around the entire mempool on your own can be next to impossible.
2. It’s open & public
Mempool data is open and publicly available to the entire network. So ‘everyone’ can see each of your transactions as they are happening. But you can also see everyone else’s transactions before they go on-chain.
3. It’s mutable
Because the mempool is pre-consensus, it is mutable. This means that pending transactions can be overwritten with replacement transactions, including Speed Ups and Cancels. Replacement transactions are critical tools for winning mempool competitions – or bowing out if conditions become unfavorable.
4. Transactions can get dropped
Network congestion can cause rapid increases in gas prices, making some pending transactions no longer competitive. Given that many nodes on the network have limited memory resources, uncompetitive transactions may be dropped by miner nodes in particular. If your transaction gets dropped, it disappears from large sections of the mempool. Further, detecting that your transaction has been dropped is difficult without complex infrastructure.
5. Transactions can get stuck
Dropped transactions can create nonce gaps, which then create stuck transactions. Stuck transactions will ‘freeze’ any further transactions from your wallet being confirmed until the nonce gap is resolved.
As you can see, the rules of the mempool are surprisingly complicated – and often interact with each other in unexpected ways. Against this backdrop, it is no surprise that the mempool is now frequently characterized as a Dark Forest.
New Tools that Make You More Competitive
Blocknative is committed to democratizing access to mempool data and providing next-generation tools to make this data easy to act on. We recently introduced a net-new interface for working with streaming transaction data called Mempool Explorer.
Mempool Explorer is designed to help level the playing field for builders and traders just like you — everyone should have access to the data.
Once you have mastered the basics, you can:
- Detect whenever liquidity begins to move in or out of a specific protocol.
- Track top DEXs to monitor pending buy/sell trends.
- Monitor the latest yield farming project to gauge momentum – and insider activity.
- Watch all 4 UNI Farming Pools on Uniswap.
- Keep track of stablecoin transactions over $5,000 USD.
- And more.
While the mempool can be a confusing and even scary place, it doesn’t have to be. Blocknative’s goal is to make mempool data accessible and easy to work with.
Read our favorites pieces on the Mempool
P.S. Fill out the Bankless 2020 Survey & help us level up!
Matt Cutler is the co-founder and CEO of Blocknative. Blocknative specializes in monitoring decentralized mempools via its unique global data platform. His first startup, Web analytics pioneer NetGenesis, went public in 2000 at the height of the Web 1.0 boom. His most recent startup, mobile collaboration platform Collaborate.com, was acquired by Cisco in 2013.
🙏Thanks to our sponsor
Zerion is the easiest way to manage your DeFi portfolio. Explore market trends, invest in 170+ tokens, view returns across wallets and see your full transaction history on one sleek interface. They’re also fully bankless, which means they don’t own your private keys and can’t ever access your funds. I use this app daily! Start exploring DeFi with Zerion on web, iOS or Android. 🔥
P.S. Don’t forget to get check out Zerion’s new Uniswap integration. 🦄
Not financial or tax advice. This newsletter is strictly educational and is not investment advice or a solicitation to buy or sell any assets or to make any financial decisions. This newsletter is not tax advice. Talk to your accountant. Do your own research.
Disclosure. From time-to-time I may add links in this newsletter to products I use. I may receive commission if you make a purchase through one of these links. I’ll always disclose when this is the case.