Query editor
WITH erc20 AS (select token as contract_address, max(symbol) as symbol, max(decimals) as decimalsfrom dune.blackhole_foundation.result_bh_active_tokensgroup by 1),pool_list_auto AS (SELECTdate(evt_block_time) created_date,pair pool,token0,token1,False AS is_cl,stable,0 AS tickSpacingFROM blackhole_avalanche_c.pairgenerator_evt_paircreatedUNIONSELECTdate(evt_block_time) created_date,pool,token0,token1,True AS is_cl,False AS stable,case when deployer = 0x5d433a94a4a2aa8f9aa34d8d15692dc2e9960584 then 200when deployer in (0xdcfccf2e8c4efbba9127b80eac76c5a122125d29, 0x43c4b7bd4c173992c6711c631859a2eac84bf8db) then 1when deployer = 0xf9221de143a0e57c324bf2a0f281e605e845d767 then 100when deployer = 0x58b05074D52D1a84D8FfDAddA3c1b652e8C56994 then 50else 0 end tickSpacingFROM blackhole_avalanche_c.algebrafactory_evt_custompool),pool_list_upload AS (Selectdate('2025-06-30') created_date,pool_address pool,token0_address token0,token1_address token1,case when lower(pool_type) like '%cl%' then True else False end is_cl,case when lower(pool_type) like '%vamm%' then True else False end stable,case when lower(pool_type) like '%cl200%' then 200when lower(pool_type) like '%cl1%' or lower(pool_type) like '%cl-1%' then 1 else 0 end tickSpacingfrom dune.blackhole_foundation.dataset_blackhole_pools_details),v2 as (select * from pool_list_autounion distinctselect * from pool_list_uploadwhere pool not in (select pool from pool_list_auto where pool is not null)),gauges_auto as (select gm.pool, gauge, external_bribe, internal_bribefrom blackhole_avalanche_c.gaugemanager_evt_gaugecreated gmjoin v2 on v2.pool=gm.pool),gauges as (select * from gauges_autounion distinctselect pool_address pool, gauge_address gauge, external_bribes, internal_bribesfrom dune.blackhole_foundation.dataset_bh_pools_gauges_bribeswhere pool_address not in (select pool from gauges_auto where pool is not null)