Query editor
with vault_info as (select * from query_2208104-- manual address filter >>> name selectorwhere case when {{vault}} = 0x0000000000000000000000000000000000000000 then vaultName = '{{vaultName}}' else vault = {{vault}} end)-------------------------------------------------------------------------------------------- AUX TABLES ----------------------------------------------------------------------------------------------------------------------------------------------------------------------,pools as (select distinct m.contract_address as pool,p.evt_tx_hash,v.vault,cast(p.fee as double) / 1e6 as fee,case when p.token0 = v.token0 then true else false end as vault_order_flagfrom uniswap_v3_ethereum.Pair_evt_Mint as minner join vault_info as von v.deployBlock <= m.evt_block_number and v.vault = m.ownerinner join uniswap_v3_ethereum.Factory_evt_PoolCreated as pon p.evt_block_number > 12300000 and m.contract_address = p.pool -- after UniV3 factory deployment) --select * from pools,ignore as (select * from query_2219687union allselect distinct pool from pools)-- use ethereum blocks table (12sec/entry) to generate a timeseries with a 1min interval,time_series as (select distinct date_trunc('minute', b.time) as time_atfrom ethereum.blocks as binner join vault_info as von b.time >= v.deployedAt and b.time <= cast('{{end_time}}' as timestamp)) --select * from time_series order by 1 asc-------------------------------------------------------------------------------------------- GET POOL LIQUIDITY --------------------------------------------------------------------------------------------------------------------------------------------------------------,mint_burn as (-- mintselect date_trunc('minute', m.evt_block_time) as time_at,m.tickLower,m.tickUpper,cast(m.amount as double) as liquidity,m.contract_addressfrom uniswap_v3_ethereum.Pair_evt_Mint as minner join vault_info as von v.deployBlock <= m.evt_block_number and v.vault = m.ownerunion all-- burnselect date_trunc('minute', b.evt_block_time) as time_at,b.tickLower,b.tickUpper,-cast(b.amount as double) as liquidity,b.contract_addressfrom uniswap_v3_ethereum.Pair_evt_Burn as binner join vault_info as von v.deployBlock <= b.evt_block_number and v.vault = b.owner) --select * from mint_burn