Query editor
select case when inventory < 50_000 then 'Others'when token is null or token = '' then 'Others'else token end as token,SUM(inventory) as inventory from (select case when token in ('USDT', 'USDC', 'DAI', 'BUSD', 'USDbC', 'USDP') then 'Stables' else token end as token, SUM(balance_usd) as inventory from (-- MAINNETselect blockchain, balance_usd, token_symbol as tokenfrom tokens_ethereum.balances_dailywhere balance_usd is not nulland day = date_trunc('day', now())and address in (0x51C72848c68a965f66FA7a88855F9f7784502a7F,0x77d5f03822f94B39ad6117F6a46761EC5879031b,0x0000006daea1723962647b7e189d311d757Fb793,0x00000000AE347930bD1E7B0F35588b92280f9e75,0xAF0B0000f0210D0f421F0009C72406703B50506B,0x6BE36e53242A2224942826afa2D24960419f84Ee)-- ARBITRUMunion allselect blockchain, balance_usd, token_symbol as tokenfrom tokens_arbitrum.balances_dailywhere balance_usd is not nulland day = date_trunc('day', now())and address in (0x51C72848c68a965f66FA7a88855F9f7784502a7F,0x77d5f03822f94B39ad6117F6a46761EC5879031b,0x0000006daea1723962647b7e189d311d757Fb793,0x00000000AE347930bD1E7B0F35588b92280f9e75,0xAF0B0000f0210D0f421F0009C72406703B50506B,0x6BE36e53242A2224942826afa2D24960419f84Ee)-- OPTIMISMunion allselect blockchain, balance_usd, token_symbol as tokenfrom tokens_optimism.balances_dailywhere balance_usd is not nulland day = date_trunc('day', now())and address in (0x51C72848c68a965f66FA7a88855F9f7784502a7F,0x77d5f03822f94B39ad6117F6a46761EC5879031b,0x0000006daea1723962647b7e189d311d757Fb793,0x00000000AE347930bD1E7B0F35588b92280f9e75,0xAF0B0000f0210D0f421F0009C72406703B50506B,0x6BE36e53242A2224942826afa2D24960419f84Ee)-- BASEunion allselect blockchain, balance_usd, token_symbol as tokenfrom tokens_base.balances_dailywhere balance_usd is not nulland day = date_trunc('day', now())and address in (0x51C72848c68a965f66FA7a88855F9f7784502a7F,0x77d5f03822f94B39ad6117F6a46761EC5879031b,0x0000006daea1723962647b7e189d311d757Fb793,0x00000000AE347930bD1E7B0F35588b92280f9e75,0xAF0B0000f0210D0f421F0009C72406703B50506B,0x6BE36e53242A2224942826afa2D24960419f84Ee)