Back to news
TutorialTutorials

Just-in-Time (JIT) Liquidity Explained: How LPs Snipe Big Swaps

Tony Rabbit 1 month ago 33 views 0 shares
Just-in-Time (JIT) Liquidity Explained: How LPs Snipe Big Swaps

Just-in-time liquidity (JIT) is a maximal extractable value (MEV) strategy where a sophisticated liquidity provider adds a large, ultra-tight concentrated liquidity position in the exact same block as an incoming large swap, collects the bulk of that swap's trading fee, and then removes the position immediately afterward. The whole maneuver, deposit, fee capture, and withdrawal, happens within a single block, so the JIT provider takes on almost no price exposure or inventory risk while skimming fees that would otherwise have gone to passive liquidity providers.

If you have ever wondered why a whale's trade sometimes seems to be "absorbed" perfectly by liquidity that appears and vanishes in one block, that is just-in-time liquidity JIT in action. It is one of the cleaner, less adversarial forms of MEV, but it still redistributes value away from ordinary LPs and toward bots watching the chain.

Key Takeaways

  • JIT liquidity adds a concentrated LP range in the same block as a big swap, then withdraws it.
  • The JIT provider captures most of the swap fee with near-zero inventory or price risk.
  • It relies on Uniswap v3-style concentrated liquidity, where a tight range earns an outsized share of fees.
  • Passive LPs are diluted: they earn less fee revenue because the JIT bot crowds them out for one block.
  • Unlike a sandwich attack, JIT does not worsen the trader's price; it only competes for the fee.

What is just-in-time liquidity JIT?

Just-in-time liquidity JIT exists because of concentrated liquidity. On older automated market makers, liquidity was spread evenly across every possible price. On Uniswap v3-style pools, an LP can instead concentrate capital into a narrow price band. The narrower and more capital-heavy that band, the larger the share of trading fees it earns when a swap crosses through it.

A JIT bot weaponizes this. When it spots a large pending swap, it deposits an enormous, razor-thin liquidity position centered exactly on the current price, just wide enough to cover the swap. Because that position is so dense relative to existing liquidity, it captures the overwhelming majority of the fee on that single trade. Then, in the same block, the bot pulls the liquidity back out. There is no waiting around to be exposed to market moves, which is the whole point. For background on how an ordinary range position works, see our guide on how to provide liquidity on Uniswap and the broader tradeoffs in concentrated liquidity, pros and cons.

How a JIT bot reads the mempool and front-positions a swap

The strategy starts in the mempool, the waiting area where pending transactions sit before being included in a block. A JIT bot continuously scans this pool for large, fee-rich swaps. When it finds one, it builds a bundle of transactions designed to execute in a precise order around the victim, the same ordering control that powers most MEV bots.

A typical JIT bundle looks like this:

  1. Mint: add a large concentrated position immediately before the target swap.
  2. Swap: the whale's trade executes and pays its fee, most of which now flows to the JIT position.
  3. Burn: remove the liquidity right after, collecting principal plus the captured fees.

Because block builders order transactions by the value they extract, the bot bids part of its expected profit as priority fees or a direct payment to the builder, ensuring its mint lands just ahead of the swap and its burn lands just behind it. This is order-flow competition, not a price attack.

Who wins and who loses

The economics of just-in-time liquidity JIT are a redistribution, not a theft from the trader. The table below breaks down each party.

PartyOutcome
JIT providerWins. Earns most of the swap fee with almost no inventory or price risk because the position lives for one block.
Passive LPsLose. They are diluted for that block and collect a smaller slice of the fee they would otherwise have earned.
The whale traderRoughly neutral, sometimes slightly better. Extra liquidity can mean marginally lower slippage on the swap.
Block builderWins a share. The bot pays priority fees or a bribe to secure its ordering, so some value flows to the builder.

The clearest loser is the set of passive LPs who provide steady, full-range or wide-range liquidity. They take on the real risk, including impermanent loss and price exposure, yet a JIT bot swoops in for the most profitable trades and leaves them the leftovers. Over time this erodes the yield that makes passive LPing attractive.

How JIT differs from a sandwich attack

JIT is frequently confused with a sandwich attack, because both wrap transactions around a victim's swap. The difference is fundamental: a sandwich attack harms the trader, while JIT does not.

In a sandwich, the attacker buys the same asset right before the victim (pushing the price up), lets the victim buy at the worse price, then sells right after for a profit. The victim gets a measurably worse fill. JIT, by contrast, is a provisioning mechanic. The bot is not trading against the swap, it is supplying liquidity to it. The trader's execution price is unchanged or even marginally improved, and the only party that loses is the competing pool of LPs. One is an adversarial value-extraction attack on the user; the other is a fee-capture race among liquidity providers.

How JIT shows up on-chain

JIT leaves a distinctive fingerprint that you can spot in a block explorer. The signature is a mint and a burn of a large, very tight concentrated position bracketing a single large swap, all inside one block, often from the same address or a known MEV contract.

Look for these markers:

  • An add-liquidity (mint) event and a remove-liquidity (burn) event in the same block, separated only by the whale's swap.
  • A position with an extremely narrow tick range, often just one or a few ticks wide, centered on the current price.
  • A position size far larger than the pool's normal resting liquidity, sized to dominate that one trade.
  • The liquidity provider collecting a fee amount that is large relative to how briefly the capital was deployed.

When you see liquidity that materializes and disappears around one big trade, with the provider walking away with the lion's share of the fee, you are looking at just-in-time liquidity JIT. It is a reminder that on permissionless chains, fee revenue is contestable, and the most attentive bots, not the most patient LPs, often win the best trades.

This article is for educational purposes only and is not financial advice.