Query editor
WITH bounds AS (SELECTdate_trunc('day',from_unixtime(try_cast(max(bucket_unix) AS bigint))) AS max_dayFROM dune.fidel_.dataset_clone_bridge_hourlyWHERE bucket_unix IS NOT NULL)SELECTCOALESCE(MAX(symbol), MAX(name)) AS asset,SUM(deposit_amount) AS total_deposits_amount,SUM(deposit_usd) AS total_deposits_usd,SUM(commission_amount) AS total_fees_amount,SUM(commission_usd) AS total_fees_usdFROM dune.fidel_.dataset_clone_bridge_hourly tCROSS JOIN bounds bWHEREt.bucket_unix IS NOT NULLAND date_trunc('day',from_unixtime(try_cast(t.bucket_unix AS bigint))) BETWEEN date_add('day', -6, b.max_day) AND b.max_dayGROUP BY symbolORDER BY total_deposits_usd DESC;