Query editor
-- GMGN on Base, daily. UTC. Fee is router-remitted: user -> router 0xd8ba9d1a -> collector 0xb8159.-- router_in = inflows to the router (proxy for user trade throughput; double-counts legs, treat as throughput not volume).-- fee = inflows to the GMGN collector on base (the actual fee take).WITH router_in AS (SELECT date(block_time) AS day,count(*) AS router_legs,count(distinct tx_hash) AS router_txs,count(distinct "from") AS users,count(distinct contract_address) AS tokens,sum(amount_usd) AS throughput_usdFROM tokens.transfersWHERE block_date >= current_date - interval '30' dayAND blockchain = 'base'AND "to" = 0xd8ba9d1a99fc21f0eca24e9b85737c28a194a4e2GROUP BY 1),fee AS (SELECT date(block_time) AS day,sum(amount_usd) AS fee_usd,count(*) AS fee_txsFROM tokens.transfersWHERE block_date >= current_date - interval '30' dayAND blockchain = 'base'AND "to" = 0xb8159ba378904f803639d274cec79f788931c9c8GROUP BY 1)SELECTCAST(COALESCE(f.day, r.day) AS date) AS day,ROUND(f.fee_usd, 2) AS fee_usd,f.fee_txs,ROUND(r.throughput_usd, 2) AS throughput_usd,r.users,r.tokens,ROUND(100.0 * f.fee_usd / NULLIF(r.throughput_usd, 0), 3) AS fee_pct_of_throughput,ROUND(f.fee_txs * 1.0 / NULLIF(r.users, 0), 1) AS trades_per_user,ROUND(f.fee_usd / NULLIF(r.users, 0), 3) AS fee_per_user_usdFROM fee fFULL OUTER JOIN router_in r ON f.day = r.dayWHERE COALESCE(f.day, r.day) < current_dateORDER BY 1 DESC