Query editor
with wallets as (select * from query_5156279),sff_wallets as (select * from ( values(0x355CD90Ecb1b409Fdf8b64c4473C3B858dA2c310, 'Keel') -- (proxy) expenses (multisig)) as t(account, "group")),transfers as (select "from", "to", amount, symbol, block_time, block_number, blockchain from tokens.transferswhereblockchain = 'ethereum'and ("from" in (select account from sff_wallets)or "to" in (select account from sff_wallets))and contract_address in (0xa3931d71877C0E7a3148CB7Eb4463524FEc27fbD, -- usds0xdC035D45d973E3EC169d2276DDab16f1e407384F, -- susds0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48, -- usdc0xdac17f958d2ee523a2206206994597c13d831ec7 -- usdt)),transfers_by_code as (selectcoalesce(wa."group", case when "from" = 0x0000000000000000000000000000000000000000 then 'Zero Address' else concat('0x', lower(to_hex("from"))) end) as src,coalesce(wb."group", case when "to" = 0x0000000000000000000000000000000000000000 then 'Zero Address' else concat('0x', lower(to_hex("to"))) end) as dst,t.amount,t.symbol,t.block_timefrom transfers tleft join wallets wa on t."from" = wa.accountleft join wallets wb on t."to" = wb.accountorder by block_time desc)selectto_unixtime(date_trunc('month', month)) as date_unix,*from (selectsum(amount) as amount,symbol,src,dst,date_trunc('month', block_time) as monthfrom transfers_by_codegroup by 2, 3, 4, 5)