Query editor
-- JIT volume: total & percentage of LPs doing JIT over time, as well as profitability overall & on an individual basis.-- CHAINS:-- Ethereum-- Arbitrum-- Polygon-- Optimism-- BNB-- prob not worth including rn:-- Celo-- Base-- Avalanche-------- ETHEREUM ---------- first get mint-burn events for the same nft that happen in the same blockwith eth_jit_events as (selecti.evt_block_number as block_number,i.evt_block_time as block_time,date_trunc('minute', i.evt_block_time) as block_minute,i.evt_tx_hash as mint_tx_hash,i.tokenId as tokenId,i.amount0 as mint_amount0,i.amount1 as mint_amount1,d.evt_tx_hash as burn_tx_hash,d.amount0 as burn_amount0,d.amount1 as burn_amount1,'ethereum' as blockchainfromuniswap_v3_ethereum.NonfungibleTokenPositionManager_evt_IncreaseLiquidity iinner join uniswap_v3_ethereum.NonfungibleTokenPositionManager_evt_DecreaseLiquidity doni.evt_block_number = d.evt_block_number -- same blockand i.tokenId = d.tokenId -- same LP token idand i.evt_index < d.evt_index -- mint before burn),-- get pool_address from pool mint-burn eventseth_jit_pools as (selectj.*,m.contract_address as pool_addressfrometh_jit_events jinner join uniswap_v3_ethereum.Pair_evt_Mint mon j.mint_tx_hash = m.evt_tx_hashinner join uniswap_v3_ethereum.Pair_evt_Burn bon j.burn_tx_hash = b.evt_tx_hashwhere m.contract_address = b.contract_address -- ensure mint and burn same token pair),-- get the token0 and token1 addresses from pool creation eventseth_jit_tokens as (selectj.*,f.token0 as token0,f.token1 as token1frometh_jit_pools jinner join uniswap_v3_ethereum.Factory_evt_PoolCreated fon j.pool_address = f.pool),