Query editor
WITHarbitrum_elastic_pools AS (SELECT-- 'arbitrum' as chain,-- 'elastic_v2' as version,output_pool as pool_address,swapFeeUnits as fee_tier , tokenA, tokenBFROM kyber_arbitrum.ElasticFactoryV2_call_createPoolWHERE date(call_block_time) >= date('2023-05-19')),trades as (select block_date, amount_usd, project_contract_address as pool_address, tx_hashfrom dex.trades twhere project='kyberswap'and blockchain='arbitrum'and block_date >= date('2023-05-19')),fees as (SELECT block_date, amount_usd, amount_usd*fee_tier/100000 as fee_usd, fee_tier, tx_hashFROM trades tINNER join arbitrum_elastic_pools p on t.pool_address = p.pool_address)select block_date as date, sum(fee_usd) as feefrom feesgroup by block_dateorder by block_date desclimit 1000