Query editor
withswap as (select block_time,tx_hashfrom dex.tradeswhere 1=1and project = 'uniswap'and blockchain = '{{chain}}'),-- pools as (-- select-- version,-- pool,-- fee,-- token0,-- token1-- -- contract_address -- factory contract-- from dex.pools-- where 1=1-- and project = 'uniswap'-- and blockchain = '{{chain}}'-- ),pools as ( -- from pool creation evtselect evt_tx_hash,evt_block_time,pair as lp_address,token0,token1,contract_address as factory_contract,'v2' as versionfrom uniswap_v2_{{chain}}.UniswapV2Factory_evt_PairCreatedunion allselect evt_tx_hash,evt_block_time,pool as lp_address,token0,token1,contract_address as factory_contract,'v3' as versionfrom uniswap_v3_{{chain}}.UniswapV3Factory_evt_PoolCreated),liquidity_evt as (select distinct call_tx_hash as tx_hash, call_block_time as block_time, 'add' as liquidity_evt, 'v2' as versionfrom (select call_tx_hash, call_block_time from uniswap_v2_{{chain}}.UniswapV2Router02_call_addLiquidity where call_success = trueunion allselect call_tx_hash, call_block_time from uniswap_v2_{{chain}}.UniswapV2Router02_call_addLiquidityETH where call_success = true)union allselect distinct call_tx_hash as tx_hash, call_block_time as block_time, 'remove' as liquidity_evt, 'v2' as versionfrom (select call_tx_hash, call_block_time from uniswap_v2_{{chain}}.UniswapV2Router02_call_removeLiquidity where call_success = trueunion allselect call_tx_hash, call_block_time from uniswap_v2_{{chain}}.UniswapV2Router02_call_removeLiquidityETH where call_success = trueunion allselect call_tx_hash, call_block_time from uniswap_v2_{{chain}}.UniswapV2Router02_call_removeLiquidityETHSupportingFeeOnTransferTokens where call_success = trueunion allselect call_tx_hash, call_block_time from uniswap_v2_{{chain}}.UniswapV2Router02_call_removeLiquidityETHWithPermit where call_success = trueunion all