JIT Liquidity

JIT (Just-In-Time) liquidity is an MEV strategy unique to Uniswap v3’s concentrated liquidity model in which a sophisticated bot observes a large pending swap in the Ethereum mempool, atomically adds concentrated liquidity at the exact price tick range where the swap will execute (just before the swap), earns a disproportionate share of the swap’s trading fees due to being the only tightly concentrated LP at that range, then immediately removes the liquidity in the same block or the next — turning short-term fee capture into a near-risk-free MEV extraction. Unlike sandwich attacks (which harm users by worsening their execution price), JIT liquidity does not change the swap’s output for the user — the user still gets the same amount of tokens they expected. The harm instead falls on passive liquidity providers: the JIT bot, by providing concentrated liquidity for exactly one swap and then withdrawing, “steals” fees that would otherwise have been distributed proportionally to all in-range LPs for that pool and tick range. JIT liquidity is a contested topic in DeFi: some argue it represents efficient market making (providing exactly the right liquidity where needed, at the right time), while others argue it is parasitic MEV that discourages long-term LP participation by undermining their fee income.


Key Facts

  • MEV type: MEV strategy (debated: harmful vs. efficiency-improving)
  • Protocol specific: Primarily Uniswap v3 (concentrated liquidity; JIT: not economical on v2 or constant-product AMMs)
  • User harm: None (user receives same swap output; potentially better due to more in-range liquidity)
  • LP harm: Yes (JIT captures fees that would have gone to passive LPs)
  • Typical JIT transaction sequence: add liquidity → (user’s swap) → remove liquidity (same block)
  • JIT feasibility: Requires: mempool visibility + MEV-Boost block building access; extremely low-latency execution
  • Frequency: 2,000-5,000 JIT events observed on Uniswap v3 (2022-2023 data)
  • Uniswap v4 change: Hooks architecture can implement minimum-duration LP rules (anti-JIT mechanism)

How JIT Liquidity Works

The following sections cover this in detail.

Step-by-Step Mechanism

Pool context: USDC/ETH pool on Uniswap v3; current price: 1 ETH = $3,000

  1. Mempool detection: JIT bot: monitors pending transactions; identifies: user’s large swap: “buy 500 ETH with 1,500,000 USDC”
  2. Price impact calculation: bot: simulates: large swap will push ETH price from $3,000 → $3,300 (~10% price impact)
  3. JIT execution (block bundle):
    Tx 1 (bot): Add 10,000,000 USDC + proportional ETH as concentrated liquidity: tightly at [$2,990 → $3,310] range
    Tx 2 (user): swap 1,500,000 USDC → ETH (executes through JIT’s just-added liquidity)
    Tx 3 (bot): Immediately remove all JIT liquidity + collect accrued fees
  4. Fee capture: Uniswap v3: distributes fees only to LPs whose position is in-range during the swap; JIT bot: provides massive liquidity at exact range → captures the majority of swap fees (0.05-1% of swap value)
  5. Impermanent loss: Since JIT bot: adds and removes in same block → price: returns to same level → no net position held → near-zero impermanent loss

Why It Works: Uniswap v3 Mechanics

In Uniswap v3’s concentrated liquidity model:

  • LPs: can specify a price range where their capital is active
  • Fees: distributed only to in-range LPs, proportional to their liquidity at the time of the swap
  • Large swap: consumes liquidity across multiple ticks
  • JIT: provides: massive concentrated liquidity at the exact tick range of the swap
  • Result: JIT’s in-range liquidity: overwhelms the liquidity from passive LPs at that range → JIT: captures vast majority of fees for that swap

Economic Analysis

The following sections cover this in detail.

JIT Bot’s P&L

|——|——-|

| Fees earned from swap | 0.3% × $1,500,000 = $4,500 |

| Gas cost (3 txs in 1 block) | ~$200-1,000 |

| Impermanent loss | ~$0 (same-block add/remove) |

| Builder payment (MEV bid) | 10-30% of gross (~$450-1,350) |

| Net profit per JIT event | ~$3,000-4,200 |

Passive LP’s Loss

With JIT: $4,500 split — JIT takes 80-95% → passive LPs: 5-20% of their expected share.


The JIT Debate: MEV or Efficient Market Making?

Here’s how the market structure works.

Argument: JIT is Parasitic MEV

  • JIT: extracts fees without bearing the IL risk that passive LPs accept for those same fees
  • High JIT occurrence → rational for LPs to reconsider providing liquidity → pool liquidity thins → users face worse prices on average swaps → bad for ecosystem
  • JIT represents: sophisticated capital (MEV bots with low-latency infra) exploiting structural advantages inaccessible to retail LPs

Argument: JIT is Efficient Market Making

  • Large swaps: get better prices with JIT liquidity (more in-range capital → less slippage)
  • Professional market makers in TradFi: also provide liquidity only to informed order flow they can manage → not categorically different
  • JIT: self-limiting: if passive LP capital decreases too much → per-swap JIT profit: decreases → JIT: becomes uneconomical → equilibrium
  • Efficient capital deployment: better than locked passive liquidity that isn’t needed

Empirical Observation


JIT in Context of Uniswap Versions

Feature Uniswap v2 Uniswap v3 Uniswap v4
LP model Constant product (full range) Concentrated liquidity (tick-range) Concentrated liquidity + Hooks
JIT feasibility No (can’t concentrate at exact tick) Yes (define exact tick range) Yes, but Hooks can restrict
JIT mitigation N/A None built-in Hooks: min LP duration rules

Uniswap v4 Hooks (Anti-JIT)

  • beforeAddLiquidity hook: check: how long has LP been in position? If < 1 block: reject or reduce fee share
  • afterRemoveLiquidity hook: detect: same-block add/remove → apply JIT penalty

Related Terms


Sources

  1. “Just-in-Time Liquidity on the Uniswap Protocol” — Uniswap Labs Research (2022). The first systematic analysis of JIT liquidity on Uniswap v3 — measuring the frequency of JIT events, the trade size threshold above which JIT becomes economical, the fraction of LP fees captured by JIT bots vs. passive LPs, and whether JIT provides net benefit (better prices for large swap users) or net harm (reduced fee income for LPs).
  1. “Concentrated Liquidity AMMs and MEV: A Taxonomy of Uniswap v3 Exploits” — EigenPhi MEV Research (2023). Comprehensive analysis of all MEV strategies specific to Uniswap v3’s concentrated liquidity architecture — including JIT, cross-tick arbitrage, sandwich attacks on v3 swaps, and LP position MEV (timing add/remove around rebalancing events) — with empirical frequency and profit estimates for each strategy.
  1. “The Economics of JIT Liquidity: When Does JIT Become Rational?” — Paradigm Research (2023). Game-theoretic analysis of JIT liquidity equilibria — modeling when JIT becomes economical as a function of swap size, pool fee tier, pool depth, gas costs, and builder bid requirements — and predicting what fraction of large swaps will be JIT-captured in equilibrium vs. how LP provision will adjust.
  1. “Uniswap v4 Hooks and JIT Mitigation: What Pool Managers Can Do” — Uniswap Foundation / Developer Documentation (2024). Technical analysis of how Uniswap v4’s Hooks architecture enables pool managers to implement anti-JIT logic — examining specific hook patterns (minimum LP duration, block-relative fee distribution, JIT detection and penalty), the tradeoffs of each approach, and whether hooks alone can solve JIT without introducing new issues (e.g., discriminating against legitimate active LP management).
  1. “JIT vs. Passive LP: Who Should Provide Liquidity on Concentrated AMMs?” — DeFi Research / LSP Working Paper (2024). Broader analysis of the competitive dynamics between professional JIT LPs and passive retail LPs in concentrated liquidity AMMs — examining whether professional market makers dominate LP fee income on Uniswap v3, how LP profitability differs between JIT operators and retail LPs after accounting for impermanent loss, and what this means for the long-term sustainability of AMM-based DEX liquidity.