Just-In-Time Liquidity (JIT)
A DeFi MEV strategy where liquidity is added to a pool moments before a large swap and removed immediately after to capture fees.
Key Takeaways
- Just-In-Time (JIT) liquidity is a MEV strategy where a bot mints a concentrated liquidity position immediately before a large swap and burns it immediately after, capturing the majority of swap fees within a single block.
- JIT became possible because concentrated liquidity AMMs like Uniswap v3 allow providers to focus capital in narrow price ranges, letting a JIT bot dominate the active tick with massive short-lived deposits.
- The strategy benefits swappers (deeper liquidity, lower slippage) but 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 decentralized finance where a liquidity provider adds a large, tightly concentrated position to an automated market maker pool moments before a pending swap executes, then removes the position immediately after. The provider exists in the pool for roughly 12 seconds (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. JIT liquidity works the same way: 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 exploits the combination of public mempool visibility and permissionless liquidity provision. The process unfolds in five steps, all orchestrated to land within a single block:
- The JIT bot monitors the mempool for large pending swap transactions on concentrated liquidity pools. It filters for swaps above a minimum size threshold, since the fixed costs of minting and burning a position (gas fees plus block builder tips) require substantial swap volume to be profitable.
- The bot calculates the exact price tick where the swap will execute and mints a concentrated CLMM position in the narrowest possible range: a single tick, representing roughly a 0.01% price increment. By concentrating all capital into this one tick, the bot can represent 80% to 90% or more of active liquidity at that price point.
- Using private transaction relay services like Flashbots, the bot submits a bundle to block builders containing three transactions in strict order: the mint, the target swap, and the burn. MEV-Boost infrastructure ensures the block builder includes them in the correct sequence.
- When the swap executes, fees are distributed pro-rata among all active liquidity providers in the tick range. Because the JIT position dominates the tick, the bot captures the corresponding share of fees: often 85% or more.
- In the same block, the bot burns its position and withdraws all deposited capital plus earned fees. It then hedges the small inventory imbalance on a centralized exchange, typically at a cost of 1 to 2 basis points.
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, making it impossible to dominate liquidity at the current trading price without deploying astronomical capital.
Concentrated liquidity AMMs changed this equation. LPs can allocate capital within custom price ranges defined by discrete tick boundaries. A single-tick position means all capital is active only at one narrow price increment. This lets a JIT bot deploy millions of dollars into a single tick, instantly becoming the dominant provider at that price point while requiring far less capital than blanket coverage would demand. The 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 structure looks like this:
// JIT bundle submitted to block builder
Bundle {
tx[0]: JIT bot mints concentrated position
-> pool.mint(tickLower, tickUpper, amount)
-> single-tick range at current price
tx[1]: Target swap (the victim's pending transaction)
-> pool.swap(amountIn, recipient, ...)
-> fees distributed pro-rata to active LPs
tx[2]: JIT bot burns position + collects fees
-> pool.burn(tickLower, tickUpper, amount)
-> pool.collect(recipient, tickLower, tickUpper, ...)
}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 to sandwich attacks, another MEV strategy that wraps a target transaction between two attacker transactions. Despite the structural similarity, they extract value from different parties:
| Aspect | JIT Liquidity | Sandwich Attack |
|---|---|---|
| Value extracted from | Passive LPs (fee dilution) | Swapper (price manipulation) |
| Impact on swapper | Positive: deeper liquidity, lower slippage | Negative: worse execution price |
| Mechanism | Mint before swap, burn after | Buy before swap, sell after |
| Perception | Debated: beneficial to traders, harmful to LPs | Universally considered extractive |
A sandwich attack directly harms the person making the swap by moving the price against them. JIT actually improves the swapper's execution by providing deeper liquidity at the current price. The cost is borne by existing LPs, who see their fee share diluted. 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 that it redirects fees from long-term liquidity providers to short-lived bots. Research quantifies the scale of this dilution:
- On targeted swaps, passive LPs experience an average 85% reduction in their fee share, earning roughly 15% of what they would have received without JIT interference
- In the ETH/USDC 0.3% pool, only two bot contracts ever successfully executed JIT, with one bot capturing 93% of all JIT-derived fees
- The top 25 JIT wallets accounted for over 97% of JIT liquidity event volume across Uniswap v3 wETH-USDC pools
- Over 95% of all JIT liquidity has historically been provided by a single address
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
Whether JIT is good or bad for DeFi depends on which stakeholder you ask:
Arguments for JIT
- Swappers receive execution prices that are on average 0.14% better when JIT liquidity is present, reducing slippage on large trades
- JIT represents extreme capital efficiency: deploying funds precisely when and where they are needed rather than locking them idle
- The maximum price improvement from JIT is bounded at roughly two times the pool's fee rate, providing predictable benefit to traders
- JIT targets less than 1% of blocks, making the aggregate impact on passive LP returns relatively modest
Arguments Against JIT
- JIT providers bear none of the ongoing risks (impermanent loss, adverse selection from informed traders) that passive LPs face for providing baseline liquidity
- JIT bots selectively provide liquidity only for uninformed order flow, leaving passive LPs exposed to all the toxic (informed) flow that causes losses
- The strategy is accessible only to whales with sophisticated infrastructure: capital requirements average 269 times the target swap volume
- Persistent JIT activity disincentivizes passive LP provision, which threatens the baseline liquidity that makes pools functional between large swaps
Protocol Mitigations
The DeFi ecosystem has developed several responses to JIT, particularly through Uniswap v4's hooks system:
- Time-lock hooks: a
beforeRemoveLiquidityhook can prevent liquidity from being burned in the same block it was minted, forcing JIT bots to hold positions for at least one additional block and exposing them to impermanent loss risk - Volatility-based exit fees: hooks can analyze in-block volatility and raise exit fees for short-duration positions that coincide with large swaps
- Fee redistribution: a two-tiered mechanism that redistributes a portion of short-term LP profits to long-term LPs, proposed in academic research on the "Paradox of JIT Liquidity"
- Internal JIT: v4 hooks can internalize JIT by having the pool itself add and remove liquidity around incoming swaps, capturing fees for the pool's benefit rather than external bots
Beyond protocol-level changes, intent-based trading architectures route swaps through competitive solver auctions rather than on-chain AMM pools directly, reducing the surface area for JIT by removing transactions from the public mempool.
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 is the same property that enables front-running and sandwich attacks.
For builders designing liquidity pools or AMM protocols, JIT is a cautionary case study in mechanism design. The concentrated liquidity model that improved capital efficiency for legitimate LPs simultaneously created a new attack surface. Protocols like Spark that operate on different infrastructure (Bitcoin Layer 2s, payment channels) 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.
For a deeper exploration of MEV dynamics and their impact on DeFi markets, see our research on limit orders in DeFi and the convergence of traditional and decentralized finance.
Risks and Considerations
- JIT is dominated by a handful of well-capitalized bots: over 92% of total JIT profit has been captured by a single address, making it effectively inaccessible to retail participants
- The strategy requires sophisticated infrastructure including mempool monitoring, private transaction relay access, smart contract development, and centralized exchange accounts for hedging
- JIT bots bear delta risk between the on-chain position and the off-chain hedge, as the two legs are not atomic: the mint-swap-burn bundle executes on-chain, but the hedge trade occurs separately on a centralized exchange
- Regulatory classification of JIT remains uncertain: the European Securities and Markets Authority (ESMA) included JIT in a 2025 report on MEV implications for crypto markets, and future regulation could restrict or require disclosure of such strategies
- As anti-JIT hooks become more common in Uniswap v4 pools, JIT bots must develop pool-specific detection logic, increasing operational complexity and reducing the strategy's universality
This 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.