Just-in-Time (JIT) Liquidity Events

Fetch Uniswap V3 JIT Liquidity events with 1 line of code.

The Just-in-Time (JIT) liquidity events table contains DEX events from Uniswap V3 protocol for each JIT event.

JIT liquidity refers to the practice where liquidity is added and removed within the same block to capture trading fees and/or exploit arbitrage opportunities.

Each JIT event includes the following sequence of event

  • User A Minting LP

  • User B Swapping

  • User A Burning LP

Sample Query

Finding the volume of swaps on Uniswap V3 that were caught in between JIT swaps by liquidity pools.

select 
  date_trunc('week', block_timestamp) as date,
  pool_name,
  sum(jit_swap_volume_usd) as jit_swap_volume_usd
from ethereum.dex.jit_liquidity_events
where project = 'uniswap'
group by all 

Methodology

We use the dex.uniswap_v3_events table to construct this table. This table contains all log events emitted from UniswapV3 protocol liquidity pools.

We first identify the JIT events within the same block must meet the following criteria:

Minting and Burning of LP within the same block.

  • Occur within the same liquidity pool (mint.liquidity_pool_address = burn.liquidity_pool_address).

  • Are initiated by the same user (mint.transaction_from_address = burn.transaction_from_address).

  • Have the burn event occurring after the mint event (mint.transaction_index < burn.transaction_index).

We then identify swaps that occur within the JIT mint + burn event with the following criteria:

  • The JIT swap event should be performed within the same block as the burn-mint event

  • Occur within the same liquidity pool

    swap.liquidity_pool_address = mint.liquidity_pool_address
    swap.liquidity_pool_address = burnt.liquidity_pool_address
  • Occur between the mint and burn JIT

    swap.transaction_index > mint_transaction_index
    swap.transaction_index < burn_transaction_index

Exclusion of Outliers: This model excludes liquidity provision from rebalancing contracts by Popsicle Finance.

Table Columns

Last updated