Query editor
withtransactions as (selectdate_trunc('week', block_time) as date, 'withdraw_claim' as label, -1 * CAST(value/1e6 AS DOUBLE) as value, tx_hashfrom ethereum.logs aLEFT JOIN erc20_ethereum.evt_transfer b ON a.tx_hash = b.evt_tx_hashwhere a.contract_address = 0x9f96E4B65059b0398B922792d3fF9F10B4567533and a.topic0 = 0x8a2ffd57f4bc58588a6d2d3c00ab957a9a320d023d4616426815d4bddf0cc648and b.contract_address = 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48and a.block_time > timestamp '2025-08-02'and b.evt_block_time > timestamp '2025-08-02'union allselectdate_trunc('week', block_time) as date, 'deposit' as label, CAST(value/1e6 AS DOUBLE) as value, tx_hashfrom ethereum.logs aLEFT JOIN erc20_ethereum.evt_transfer b ON a.tx_hash = b.evt_tx_hashwhere a.contract_address = 0x9f96E4B65059b0398B922792d3fF9F10B4567533and topic0 = 0x5c6bc300f89297a4a9841d7aaa3a1aaed8198b98997f4b01cff715b61c625041and b.contract_address = 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48and a.block_time > timestamp '2025-08-02'and b.evt_block_time > timestamp '2025-08-02'--Remove since these are Requests for withdrawal-- union all-- select-- date_trunc('week', block_time) + INTERVAL '1' day as date-- , 'withdrawal_request' as label-- , NULL-- , tx_hash-- from ethereum.logs-- where contract_address = 0x7A859B5aa0E8294be505af730Ec75E81B14d2788-- and topic0 = 0x450ba6f00af16b450dd3b932e730b8988d247233c80f696553737c8551ee69a8)selecta.date + INTERVAL '1' day as date, label, SUM(value) as total_value_usd--, SUM(SUM(value * brktETH_price)) OVER (ORDER BY a.date + INTERVAL '1' day) as net_ignore, count(distinct tx_hash) as countfrom transactions agroup by 1,2