Can you explain what Just-in-time (JIT) liquidity is?

Just-in-Time (JIT) Liquidity Explained

Just-in-Time (JIT) liquidity is a specific strategy used by liquidity providers (LPs) to optimize trade execution and capture trading fees, particularly on decentralized exchanges (DEXs) like Uniswap and perpetual trading platforms like Drift 12.

JIT Liquidity on Automated Market Makers (AMMs)

On AMM-based DEXs, JIT liquidity providers observe a pending swap transaction in the public mempool 1. The JIT LP then performs a sequence of actions, often bundled into a single block, to profit from the trade 1:
  1. Add Liquidity: The LP adds liquidity to the pool immediately before the swap is executed 1. This liquidity is typically highly concentrated in the exact price range (or "tick") that the swap will utilize 1.
  2. Execute Swap: The pending swap executes, using the newly provided JIT liquidity and paying a fee to the LP 1.
  3. Remove Liquidity: Immediately after the swap, the LP removes the liquidity and the accrued fees 1.
  4. Hedge: Simultaneously, the LP executes a hedging transaction in a different venue to offset any inventory risk, earning the difference between the hedging transaction fees and the LP fee from the Uniswap pool 1.
This strategy is designed to optimize trade execution by reducing slippage within the trade's chosen price range 3. Data from Q4 2022 on Uniswap showed a significant increase in the share of trading revenue attributable to JIT LPs for the USDC/ETH pair, peaking at approximately 60% to 70% 3. JIT liquidity can provide significantly tighter spreads, accounting for the majority share of liquidity in tight ranges for pairs like WETH/USDC on Uniswap v3 4.

JIT Liquidity in Hybrid Mechanisms

On platforms like Drift, JIT liquidity is part of a hybrid liquidity mechanism that also includes an orderbook and a Backstop Automated Market Maker (AMM) 2.
In this context, JIT liquidity is provided by market makers during a short-term auction that occurs for every market trade (spot and perpetual) 2.
  • Auction Process: When a market order is placed, it is routed through a short-term auction, which defaults to about five seconds 2.
  • Dutch Auction: The auction is run as a Dutch Auction, where the price starts favoring the taker (the user placing the order) and gradually moves toward a set worse end price 2.
  • Market Maker Competition: Market makers compete to fill the order at or better than the auction price, providing liquidity "just-in-time" 2.
  • Backstop: If JIT liquidity fails to fill the pending trade within the auction period, the trade is routed to the protocol's Backstop AMM Liquidity (BAL) for execution .
This mechanism allows market makers to see retail flow five seconds before it hits the market, giving them an opportunity to bid to fill the order 6. This dynamic sourcing of liquidity from both market makers and the AMM optimizes order execution and minimizes market impact or slippage for the trader 7.
You're viewing a shared conversation. Your questions will start a new chat.