Query editor
withtimeline as (select timestamp as dayfrom utils.dayswhere timestamp >= timestamp '2024-10-29'), ekubo_swaps_ethereum as (select *from "query_5432702"where block_time >=casewhen '{{timeframe}}' = 'last 3 months' then greatest(current_date - interval '3' month, timestamp '2025-03-14')else timestamp '2025-03-14'end), taker_excl as (select *from "query_5254724"), trading_volume_ethereum as (selectt.block_date as day, t.blockchain, t.project as dex, sum(t.amount_usd) as volume_usdfrom dex.trades as tleft join taker_excl as eon t.taker = e.takerand t.blockchain = e.blockchainwhere t.block_time >=casewhen '{{timeframe}}' = 'last 3 months' then greatest(current_date - interval '3' month, timestamp '2024-10-29')else timestamp '2024-10-29'endand t.blockchain = 'ethereum'and t.project <> 'ekubo'and e.taker is null -- exclude outliersgroup by 1, 2, 3-- select-- vp.day-- , vp.blockchain-- , case-- when vp.dex = 'fluid' then vp.dex-- when rnk > 9 then 'others'-- else vp.dex-- end as dex-- , sum(vp.volume_usd) as volume_usd-- from (-- select-- t.block_date as day-- , t.blockchain-- , t.project as dex-- , sum(t.amount_usd) as volume_usd-- from dex.trades as t-- where t.block_date >=