What Is JIT Liquidity? Just-in-Time MEV on Uniswap Explained
By Merunas Grincalaitis, founder of MEV DAO and a developer who builds MEV, sniping and trading bots on Ethereum. Last updated: October 2026.
TL;DR: JIT (just-in-time) liquidity is an MEV strategy where a searcher sees a large pending swap, adds concentrated liquidity to that exact Uniswap price range right before it, and removes it right after, all in the same block. The searcher collects most of the swap fee and hedges the inventory on another venue. Unlike a sandwich, the trader actually gets a slightly better price, but passive LPs lose fees they would have earned. Uniswap Labs found it was a small, highly concentrated activity in 2021 and 2022, and Uniswap V4 hooks now let pools penalize it.
People usually hear "JIT liquidity attack" and assume it's another way to rob traders. It isn't quite that. When I explain it to developers, I put it this way: a sandwich attacks the trader, a JIT position competes with the other liquidity providers. That difference changes who should care and what you can do about it.
What is JIT liquidity?
JIT liquidity is liquidity that exists for exactly one swap. It's minted in the transaction right before a big trade and burned in the transaction right after.
The term comes from Uniswap V3, which introduced concentrated liquidity. In V3 an LP chooses a price range, and inside that range their capital works much harder than a full-range V2 position. If you put a lot of liquidity into one tiny range right where a swap will execute, you become most of the active liquidity for that swap, so you earn most of its fee.
Uniswap Labs researchers Xin Wan and Austin Adams wrote the main study on it, "JIT Liquidity on Uniswap" (September 2022, also on SSRN). Their definition is the one I use: the LP watches the public mempool, spots a large swap, and wraps it with a mint and a burn.
How does a JIT liquidity trade work step by step?
It's a three-transaction bundle around someone else's swap.
- Spot the swap. The bot sees a large pending swap in the public mempool, say a big USDC to WETH trade.
- Mint. It calculates the price the swap will start at and adds a large concentrated position, often just one tick wide, covering that price.
- The user's swap executes. Because the JIT position is most of the in-range liquidity, it takes most of the fee. It also ends up holding the other side of the trade.
- Burn. In the next transaction the bot removes the position and collects the fees plus its new token balance.
- Hedge. Since it now holds more of one token than it started with, it rebalances on another venue, for example a centralized exchange.
Steps 2 to 4 have to land in that exact order in one block, so JIT searchers send them as a Flashbots bundle. The Uniswap Labs post walks through a real one in block 13733864 if you want to inspect it on Etherscan.
How is JIT liquidity different from a sandwich attack?
The structure looks similar, but the effect on the trader is the opposite. Here's how I compare the three "wrap around a trade" strategies:
| JIT liquidity | Sandwich attack | Backrun | |
|---|---|---|---|
| Position around the victim tx | Before and after | Before and after | After only |
| What the bot adds first | Liquidity (mint) | A buy that moves price | Nothing |
| Effect on the trader's price | Slightly better (more depth) | Worse | None |
| Who loses | Passive LPs in that range | The trader | Nobody directly |
| Main risk for the bot | Inventory and hedging cost | The trade reverts or the slippage limit blocks it | Competition |
| Works with MEV-Share hints? | No, it needs to go before the tx | No | Yes |
A sandwich attack pushes the price against you before your swap. A JIT position adds depth before your swap, so you get less price impact. Wan and Adams note that JIT and backrunning compete for the same opportunity, which caps how much price improvement the trader gets at around twice the pool's fee rate.
Is JIT liquidity profitable?
Only on big swaps, only in the right pools, and only if hedging is cheap. The bot's profit is roughly:
fee earned on the swap − gas for the mint and burn − the bundle bid to the builder − the cost of hedging the inventory it picked up
The Uniswap Labs study found a few things that still shape how I think about it:
- It was dominated by very few players. Over 95% of JIT attempts in their dataset came from one account, and fewer than 20 addresses ever tried it.
- It was small relative to volume, about 0.3% of the V3 volume they measured from May 2021 to July 2022.
- It clustered in a few deep pools, with the USDC-WETH 5 bp pool accounting for over half.
- Very low fee pools (1 bp) mostly don't work, because the fee doesn't cover a typical hedging cost.
Those numbers are from 2021 and 2022. I haven't seen a newer study of the same quality, so treat them as the shape of the market, not current figures. The logic hasn't changed, though: you need a swap large enough that a share of a 5 or 30 bp fee beats two transactions of gas, a competitive bid and a CEX hedge.
That's also why JIT is a professional's game. You need a fast mempool feed, an accurate V3 tick simulator, builder relationships and a hedging account. It's a different business from the strategies I describe in how MEV bots make money.
Is JIT liquidity bad for liquidity providers?
For the passive LPs in that range, yes, because the JIT position takes fees they'd have earned without taking on their long-term risk. A passive LP carries price risk and impermanent loss for weeks. A JIT LP carries risk for a few seconds and leaves.
The academic worry is what happens next. Agostino Capponi, Ruizhe Jia and Brian Zhu modeled it in "The Paradox of Just-in-Time Liquidity in Decentralized Exchanges". Their finding is that JIT can crowd out passive LPs: if they expect JIT bots to take the best fees, some stop providing liquidity, and total liquidity in the pool can end up lower. So JIT can help one trade while hurting the pool over time. The paper also discusses fee designs that reduce the problem.
My practical view: if you're a passive LP in a deep ETH/stablecoin pool, JIT is a small leak, not a disaster. If you run a thin pool for your own token, it's not something you'll see much, because JIT needs big swaps.
How does Uniswap V4 deal with JIT liquidity?
V4 doesn't ban it in the core, but hooks let a pool penalize liquidity that leaves too quickly. The clearest example I know is OpenZeppelin's LiquidityPenaltyHook. It holds back fees from a position and, if the liquidity is removed within a set number of blocks after it was added, takes a penalty and donates it to the LPs who are still in range.
Two caveats from the code itself. The contract is marked experimental, and its own comments warn that in thin pools part of the penalty can be recaptured by a second account. So it raises the cost of JIT rather than making it impossible.
If you're building on V4, I cover what hooks change for launch bots in Uniswap V4 sniper hooks. For a searcher, the lesson is simple: before you simulate a JIT, read the pool's hook. A hook can make the same trade unprofitable.
Can traders avoid JIT liquidity, and should they?
Most traders don't need to avoid it, since it usually improves their price. What they should avoid is the public mempool, because the same visibility that enables JIT also enables sandwiches.
If you send through a private RPC like Flashbots Protect, your swap isn't broadcast publicly. Flashbots' MEV-Share docs say its nodes currently accept only backruns, so a searcher can't put a mint in front of your trade through that channel. You lose a possible tiny price improvement from JIT, but you also remove the sandwich risk, which is the bigger problem for almost everyone. I compare the options in what is MEV protection.
Frequently asked questions
What does JIT mean in crypto?
JIT means just-in-time. In DeFi it usually refers to JIT liquidity: concentrated liquidity added right before a large swap and removed right after, in the same block, to capture the swap fee.
Is JIT liquidity an attack?
Not on the trader. A JIT position adds depth, so the trader usually gets a slightly better price. It takes fees away from passive liquidity providers, which is why some people call it an attack on LPs.
Can JIT liquidity happen on Uniswap V2?
It's mostly a V3 and V4 thing. V2 liquidity is spread over the full price range, so a JIT LP would need far more capital to capture a meaningful share of one swap's fee.
Is JIT liquidity the same as a sandwich attack?
No. Both wrap a trade, but a sandwich moves the price against the trader, while JIT adds liquidity that reduces the trader's price impact.
How do I protect my LP position from JIT?
You can't fully stop it in a standard V3 pool. On V4, pools can use hooks such as OpenZeppelin's LiquidityPenaltyHook, which penalizes liquidity removed within a few blocks of being added.
Does a private RPC stop JIT liquidity?
Mostly. JIT searchers rely on seeing your swap in the public mempool. Through Flashbots Protect and MEV-Share, searchers can only backrun, so they can't place a mint before your trade.
Related guides
- How MEV Bots Make Money on Ethereum (and Who Keeps the Profit)
- What Is a Sandwich Attack? How to Avoid Getting Sandwiched
- Backrunning Bot on Ethereum: First MEV-Share Strategy
- MEV Bot Meaning: 60 Terms Every Searcher Should Know
JIT is a good example of how much infrastructure a "simple" MEV idea needs: tick-level simulation, bundle bidding and a hedge. If you want a strategy like this built and tested on a mainnet fork before it touches real funds, see custom MEV bot development at MEV DAO or message me on Telegram.