Just-In-Time Liquidity (JIT)
Adding liquidity right before a large swap and removing it after, to capture its fees.
Basically
A bot adds funds to a trading pool just before a large swap. It removes them straight after and collects the fees.
Key Takeaways
- Just-In-Time (JIT) liquidity is an MEV strategy where a bot mints a concentrated liquidity position immediately before a large swap and burns it immediately after. It captures the majority of swap fees within a single block.
- Concentrated liquidity AMMs like Uniswap v3 made JIT possible by letting providers focus capital in narrow price ranges. A JIT bot can dominate the active tick with massive short-lived deposits.
- JIT benefits swappers through deeper liquidity and lower slippage. It dilutes fees for passive liquidity providers by an average of 85% on targeted swaps, raising questions about long-term LP sustainability.
What Is Just-In-Time Liquidity?
Just-In-Time (JIT) liquidity is a strategy in decentralised finance. A liquidity provider adds a large, tightly concentrated position to an automated market maker pool moments before a pending swap executes, then removes it immediately after. The position exists in the pool for roughly 12 seconds, or one Ethereum block, earning swap fees while bearing almost no impermanent loss risk.
The term "just-in-time" borrows from manufacturing, where inventory arrives precisely when needed rather than sitting idle. Capital shows up for a single transaction, does its job, and leaves. This capital efficiency is extreme, but it comes at the expense of passive LPs who provide the baseline liquidity that keeps pools functional around the clock.
JIT emerged shortly after Uniswap v3 launched in May 2021. Research from Imperial College London identified over 36,000 JIT events across the first 20 months of v3's existence, generating approximately 7,500 ETH in profit for JIT bots. Despite targeting less than 1% of all blocks, JIT reshaped the debate about who benefits from concentrated liquidity design.
How It Works
JIT liquidity combines public mempool visibility with permissionless liquidity provision. The process unfolds in five steps, all orchestrated to land within a single block.
Why Concentrated Liquidity Enabled JIT
In traditional constant-product AMMs like Uniswap v2, liquidity is spread uniformly across the entire price curve from zero to infinity. An LP adding funds contributes to every possible price. Dominating liquidity at the current trading price is impossible without deploying astronomical capital.
Concentrated liquidity AMMs let LPs allocate capital within custom price ranges defined by discrete tick boundaries. A single-tick position keeps all capital active only at one narrow price increment, so a JIT bot can deploy millions of dollars into one tick and instantly become the dominant provider at that price point with far less capital than blanket coverage would demand. Permissionless, instant mint-and-burn design with no lockup period completed the conditions for JIT to emerge.
Transaction Bundle Anatomy
A JIT operation is typically submitted as an atomic bundle through a private relay. The bundle has the following structure.
The entire bundle executes atomically within one block. If any transaction fails, the block builder may exclude the bundle entirely, protecting the JIT bot from partial execution risk.
JIT vs. Sandwich Attacks
JIT is often compared with sandwich attacks, another MEV strategy. Both wrap a target transaction between two attacker transactions, but they extract value from different parties.
A sandwich attack directly harms the person making the swap by moving the price against them. JIT improves the swapper's execution by providing deeper liquidity at the current price, while existing LPs bear the cost through a diluted fee share. This distinction is why some researchers classify JIT as "benign MEV," though passive LPs would disagree.
Impact on Passive Liquidity Providers
The core tension of JIT is the redirection of fees from long-term liquidity providers to short-lived bots. Research quantifies the scale of this dilution.
In aggregate, JIT targets a small fraction of total pool volume: most months show less than $200 million in JIT volume against hundreds of billions in total trading. But the per-event impact is severe, and the threat creates a persistent disincentive for passive LP participation. Academic research has shown that when uninformed trading demand is inelastic relative to pool depth, JIT entry can cause passive LPs to exit entirely, creating "liquidity freezes" where the pool depends on JIT bots that only show up for profitable swaps.
The Net-Positive Debate
JIT affects each stakeholder differently. Whether it is good or bad for DeFi depends on which stakeholder you ask.
Protocol Mitigations
The DeFi ecosystem has developed several responses to JIT. Uniswap v4's hooks system is a particular focus.
Intent-based trading architectures offer a response beyond protocol-level changes. They route swaps through competitive solver auctions rather than directly through on-chain AMM pools, removing transactions from the public mempool and reducing the surface area for JIT.
Why It Matters
JIT liquidity illustrates a fundamental tension in open, permissionless financial systems. The same transparency and composability that make DeFi powerful also create opportunities for sophisticated actors to extract value from less sophisticated participants. The mempool visibility that enables JIT also enables front-running and sandwich attacks.
Builders designing liquidity pools or AMM protocols should treat JIT as a cautionary case study in mechanism design. The concentrated liquidity model improved capital efficiency for legitimate LPs but simultaneously created a new attack surface. Protocols like Spark operate on different infrastructure, including Bitcoin Layer 2s and payment channels, and avoid these specific AMM dynamics, but the broader lesson applies everywhere: any system with visible pending transactions and permissionless participation must account for strategic ordering by informed actors.
Our research explores MEV dynamics and their impact on DeFi markets in more depth. See our work on limit orders in DeFi and the convergence of traditional and decentralised finance.
Risks and Considerations
The glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.