A deep dive into Just-In-Time (JIT) liquidity, an advanced MEV strategy on Uniswap v3 where liquidity is added and removed in the same block to capture.

Just-In-Time (JIT) liquidity represents a strategy In DeFi and Maximal Extractable Value (MEV). This approach is particularly effective on concentrated liquidity decentralized exchanges (DEXs) such as Uniswap v3. It involves using an MEV bot to add liquidity to a pool for a specified trade, then removing it immediately within the same block.
The strategy aims to capture trading fees from a significant, known-pending transaction while avoiding the long-term capital risks associated with market making. By executing this operation in a single atomic action, JIT liquidity exemplifies a method of extracting value in decentralized finance.
To grasp JIT liquidity, one must first understand the innovation of concentrated liquidity in Uniswap v3. Unlike its predecessor, Uniswap v2, which spreads liquidity across an entire price spectrum, v3 allows LPs to concentrate their liquidity in specific, narrow price ranges. Fees from trades are allocated to LPs based on the amount of liquidity they provide within the active price range of a trade.
The Victim's Swap: A user, Carol, intends to swap a significant amount of ETH for USDC. She submits her transaction to the public mempool. This trade is substantial enough to affect the price across multiple ticks in the Uniswap v3 pool.
The MEV Bot Observes: A JIT liquidity bot continuously monitors the mempool. It identifies Carol's large transaction.
The Calculation: The bot simulates Carol's trade, determining the exact price path it will take and identifying the specific ticks the trade will traverse.
The Atomic Transaction Bundle: The bot constructs a sequence of three actions to execute atomically within a single block:
addLiquidity: The bot submits a transaction to inject a large volume of liquidity in a very narrow range that aligns perfectly with Carol's price trajectory. To gain priority, it pays an improve gas fee to the block producer.removeLiquidity: The bot submits a final transaction to withdraw its liquidity and collected fees immediately after Carol's transaction.The Result:- Within a single block, the bot has added liquidity, captured nearly all fees from Carol's trade, and removed its capital.
JIT liquidity relies on several key factors:
| Factor | Description |
|---|---|
| Transparent Mempool | The ability to monitor large pending swaps before they are executed provides a tactical advantage. |
| Concentrated Liquidity | Uniswap v3's design allows for precision targeting of liquidity, enabling JIT bots to dominate other passive LPs. |
| Atomic Transactions | The capability to bundle actions into a single transaction ensures the strategy remains risk-free for the bot. |
The rise of JIT liquidity has sparked considerable debate within the DeFi community.
Argument Against: Critics argue that JIT strategies effectively prey on passive LPs. These liquidity providers bear the risk of impermanent loss while contributing to the usability of the pool. JIT bots extract the most profitable fees and exit, resulting in diminished returns for the long-term contributors. This dynamic can disincentivize passive liquidity provision over time.
Argument For: Proponents claim that JIT liquidity can enhance the trading experience for users. By injecting significant liquidity, even temporarily, JIT bots may reduce the price impact of large trades, leading to lower slippage. However, the primary motivation for these bots remains fee extraction rather than user benefit.
The prevailing consensus suggests that JIT liquidity represents an extractive form of MEV that undermines the sustainability of the liquidity pool ecosystem by diverting rewards from committed, long-term participants.
A: Realistically, no. Executing a JIT liquidity strategy demands sophisticated infrastructure, deep knowledge of blockchain mechanics, and advanced bots that compete in a high-speed, automated environment.
A: A sandwich attack capitalizes on a user's slippage by executing trades before and after the victim's transaction. In contrast, JIT liquidity exploits trading fees by providing liquidity for the victim's trade and subsequently withdrawing it. Both strategies are forms of MEV that take advantage of pending transactions.
A: Any DEX using a concentrated liquidity model may be vulnerable to JIT liquidity strategies.
A: Research is ongoing in this area. Potential solutions include:
Explore more guides and career playbooks