Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
How JIT liquidity captures swap fees in one block, who it hurts, and how to protect big trades.
JIT liquidity is when a bot adds a large concentrated position right before a big swap and removes it right after, all in one block, to capture that swap’s fees.
The name is short for just-in-time liquidity. It shows up in MEV threads, Uniswap pool dashboards, and the occasional “why did my LP fees vanish” complaint. Most people meet the term while trying to figure out who took money that felt like theirs.
Here is the reassuring part up front. If you saw “JIT liquidity attack” in a sandwich discussion and assumed it was hitting your trade, that is usually wrong. JIT rarely worsens a swap. It mostly reshuffles who earns the fees. This guide walks the mechanism, then answers the part you came for: who it actually hurts, and what to do about it.
JIT liquidity in crypto is a maximal extractable value (MEV) tactic where a bot supplies liquidity for a single swap and then withdraws it, all inside the same block, purely to earn that swap’s trading fee.
The full name, just-in-time liquidity, is the clearest description of the timing. The liquidity arrives just in time for one trade and leaves the instant that trade settles. Nothing lingers. The bot is not trying to be a long-term liquidity provider. It is renting the pool a share of fees for a few milliseconds.
This is where the biggest misconception lives. Many people first see “JIT liquidity attack” next to sandwich attacks and assume a bot is squeezing their trade. That framing is mostly wrong, and we untangle it in a later section. JIT does not push your price around. It competes for the fees that would otherwise go to the pool’s existing liquidity providers.
It is easy to confuse this with other “liquidity” terms too, especially exit liquidity, which is a completely different idea about who gets left holding a bag. JIT liquidity is a fee-capture mechanic, not a dump-on-retail one. Keep those two separate and the rest of this gets much simpler.
JIT liquidity works by watching for a large pending swap, wrapping fresh liquidity tightly around that swap’s price, and then unwinding it before the block closes. The whole sequence is one atomic transaction, so it either all happens or none of it does.
The mechanism only works because of concentrated liquidity, which Uniswap v3 introduced. In older v2-style pools, your liquidity spreads across every possible price. In v3, you place liquidity inside a chosen tick range, so all of it can sit at the exact price where a trade will execute. That concentration is what lets a JIT bot dominate the fees on one swap without committing much capital anywhere else.
If you have ever provided liquidity for yield farming, you already know the passive version of this: park tokens, earn fees over days. JIT is the aggressive, compressed opposite. It earns the same kind of fee, but only for a single trade, then it is gone.
The single-block timeline runs through three stages in order.
The timing is the whole trick. Because it is one transaction, the bot never carries price risk between blocks. It supplies, collects, and exits before anything can move against it. That is why JIT liquidity feels less like investing and more like a toll booth that appears for one car and disappears.
JIT liquidity only targets large swaps because the tactic carries fixed costs, and those costs only pay off when the fee prize is big enough. Minting and burning a position costs gas, and the bot has to win the race to sit in front of the swap. On a small trade, that overhead eats the profit.
The math is simple in spirit. A swap pays a fee based on its size and the pool’s fee tier, often 0.3% or less. A JIT bot only cares about swaps where its slice of that fee clears gas plus execution costs with room to spare. Research on Uniswap v3 points to a rough practical floor somewhere in the low eight figures of swap value before JIT bots reliably bother.
So the fear that JIT liquidity is “everywhere” does not match reality. By count, JIT positions are a tiny fraction of total Uniswap v3 liquidity. The bots ignore your $400 token swap entirely. They wake up for whale-sized trades where a single block’s fees are worth the effort and the gas.
Picture a trader routing an eight-figure stablecoin swap through a public pool. That is a fat fee in one transaction, and it is visible in the mempool before it settles. That is exactly the setup JIT liquidity bots are built to catch. Small and mid-size trades slide by untouched, which is most of what actually happens on any given day.
JIT liquidity is not really an attack on the trader, and this is the single most important correction in this guide. For the person making the large swap, JIT usually improves the fill. When the bot mints deep liquidity right at the swap price, the pool gets temporarily deeper, which means lower price impact and often a slightly better rate than the trader would have gotten alone.
So if you are the whale swapping, JIT is closer to a gift than a mugging. Your trade is not front-run or squeezed. The bot is not betting against your price. It is subsidizing your depth in exchange for grabbing the fee. Calling that an “attack on your trade” is the misconception the SERP keeps repeating, and it is mostly false.
The real harm lands on passive liquidity providers. When a JIT bot swoops in for the biggest, most profitable swap, it intercepts the fees that would have rewarded the LPs who left their capital in the pool all day. Research from Uniswap Labs and later academic work put that fee capture on targeted swaps in a wide 50-90% range, depending on the pool and the trade.
That is a quiet, real cost for a passive LP. You take on impermanent loss and market risk around the clock, and then a bot skims the fattest fees on the exact swaps you were counting on. This is the same tension that makes patient, yield-bearing positions like liquid staking attractive to people who would rather not babysit a concentrated range. If you provide liquidity passively, treat JIT as a structural drag on your best days, not a one-off event. It does not blow up your position, but it does trim the upside that made providing liquidity worthwhile in the first place.
People conflate JIT liquidity and sandwich attacks constantly in MEV threads, and the two are genuinely different animals. A sandwich attack extracts value from your price impact. A JIT bot extracts value from fee distribution. That single distinction settles most of the confusion.
The comparison below lines them up on what actually matters to you.
| Feature | JIT Liquidity vs Sandwich Attack |
|---|---|
| What it targets | JIT targets the swap’s fees. Sandwich targets your price impact. |
| Effect on your fill | JIT often improves it. Sandwich makes it worse. |
| Who is harmed | JIT harms passive LPs. Sandwich harms the trader. |
| Direction of the bot | JIT provides liquidity around you. Sandwich trades against you. |
| Is it an “attack” on you | JIT: mostly no. Sandwich: yes. |
The practical read is that a sandwich sits a buy in front of you and a sell behind you, so you fill at a worse price and the bot pockets the difference. That is adversarial. JIT does the opposite in spirit: it deepens the pool for your block and takes fees, not your slippage.
This distinction also separates JIT from purely price-driven tactics like liquidity hunts, where the goal is to trigger clustered orders rather than to collect fees. If a tactic worsens your price, it is closer to sandwiching or hunting. If it quietly reroutes fees while leaving your fill fine or better, that is JIT.
JIT liquidity is best documented on Ethereum, specifically on Uniswap v3, because two conditions line up there: concentrated liquidity and a public mempool. The bot needs to see the pending swap in advance, and it needs the ability to place all its liquidity at one price. Uniswap v3 on Ethereum gives it both.
Solana works differently, and this trips up people arriving from Solana MEV threads. Solana has no public mempool in the Ethereum sense. Its MEV activity is shaped heavily by infrastructure like Jito and private order flow, and the dominant pain point there has been sandwiching, not clean JIT fee capture. Pure JIT-style fee interception is far less prominent on Solana than on Ethereum, and the design of its major DEXs is a big reason why.
That does not mean JIT-like behavior is impossible outside Uniswap v3. Any venue with concentrated liquidity and visibility into pending trades can host something similar. But the well-studied, textbook version of JIT liquidity is an Ethereum and Uniswap v3 story, and it is honest to say the Solana equivalent is more emerging than established. If you saw “JIT” in a Solana context, odds are the actual issue people were fighting was sandwich MEV, which is a different problem with different tools.
Protecting against JIT liquidity depends on which side of the trade you are on. For large-swap traders, the fix is simple: keep your order out of the public mempool so a bot cannot see it and build liquidity around it. For LPs, there is no clean off switch, but there are ways to reduce the sting.
If you are routing a big swap, the practical move is to avoid the public order book entirely. That closes the window a JIT bot needs to react.
For LPs, the honest answer is that JIT is hard to fully avoid, but you are not powerless. Active range management helps, since a bot’s edge is largest against passive positions parked in a static range. Choosing pools and venues that use private order flow reduces how much of your fee flow is visible to bots. And remember that JIT mostly bites on the very largest swaps, so smaller-volume pools see far less of it.
The mindset that ties this together is the same one that protects you from adjacent tricks like volume spoofing: know what is actually happening in the pool you are in. Do not assume every drop in fees is theft, and do not assume a public mempool trade is private. Match the protection to the real risk, and JIT stops being a mystery and becomes a cost you can manage.
JIT liquidity is usually not an attack on your trade. It does not push your price against you the way a sandwich does. In most cases it deepens the pool for that block and gives you a better fill. The word “attack” fits far better from a passive LP’s point of view, since the bot skims fees they were counting on.
Yes, JIT liquidity hurts passive liquidity providers most. A JIT bot can capture roughly 50-90% of the fees on the large swaps it targets, which are the most profitable trades a pool sees. Passive LPs still carry impermanent loss and market risk all day, then lose the fattest fees to a position that existed for one block.
JIT liquidity bots make money by collecting a swap’s trading fee without holding any lasting position. They mint deep concentrated liquidity right before a big trade, earn that trade’s fee, then burn the position in the same block. Because it is one atomic transaction, the bot never carries price risk, so the fee is close to pure profit after gas.
The difference is what each one extracts. A sandwich attack trades in front of and behind you to worsen your fill and pocket the price impact. JIT liquidity provides liquidity around your swap and captures its fees, leaving your price unharmed or slightly better. A sandwich harms the trader. JIT harms passive LPs.
You can largely sidestep JIT liquidity on a big swap by keeping the order out of the public mempool. Route through an intent-based DEX like CoW Swap, UniswapX, or 1inch Fusion, or send it through a private RPC such as Flashbots Protect or MEV-Blocker. If a bot cannot see your trade coming, it cannot build a position around it.
JIT liquidity is easier to handle once you decide which side of the trade you are on. Use these steps to move from understanding it to acting on it.