Query editor
withbnb_alpha_tokens as (SELECTtoken_sold_address AS token_address,token_sold_symbol AS symbolFROM dex.tradesWHEREblock_date >= cast('2025-01-01' as timestamp)AND blockchain IN ('bnb')AND tx_to = from_hex('6aba0315493b7e6989041c91181337b662fb1b90')AND token_sold_address NOT IN (from_hex('c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'), -- WETH (Ethereum)from_hex('bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c'), -- WBNB (BNB)from_hex('4200000000000000000000000000000000000006'), -- WETH (Base)from_hex('55d398326f99059ff775485246999027b3197955'), -- Binance-Peg USDT (BSC)from_hex('dac17f958d2ee523a2206206994597c13d831ec7'), -- USDT (Ethereum)from_hex('a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'), -- USDC (Ethereum)from_hex('8ac76a51cc950d9822d68b83fe1ad97b32cd580d'), -- Binance-Peg USDC (BSC)from_hex('833589FCD6EDB6E08F4C7C32D4F71B54BDA02913'), -- USDC (Base)from_hex('039e2fB66102314Ce7b64Ce5Ce3E5183bc94aD38'), -- wS (Sonic)from_hex('50c42dEAcD8Fc9773493ED674b675bE577f2634b'), -- WETH (Sonic)from_hex('29219dd400f2Bf60E5a23d13Be72B486D4038894'), -- USDC.e (Sonic)from_hex('0000000000000000000000000000000000000000'), -- ETH/BNB (native)from_hex('8d0d000ee44948fc98c9b98a4fa4921476f08b0d'), -- USD1 (Ethereum/BSC)from_hex('e9e7CEA3DedcA5984780Bafc599bD69ADd087D56') -- BUSD (BNB))group by1,2),bsc_token_monthly as (selectblock_month,casewhen token_bought_address in (select token_address from bnb_alpha_tokens) then 'bnb alpha'when token_sold_address in (select token_address from bnb_alpha_tokens) then 'bnb alpha'else 'not bnb alpha' end as alpha_group,casewhen token_bought_address in (select token_address from bnb_alpha_tokens) then token_bought_addresswhen token_sold_address in (select token_address from bnb_alpha_tokens) then token_sold_addresselse nullend as alpha_token,casewhen token_bought_address in (select token_address from bnb_alpha_tokens) then token_bought_symbolwhen token_sold_address in (select token_address from bnb_alpha_tokens) then token_sold_symbolelse 'not alpha'end as alpha_symbol,sum(amount_usd) as monthly_volfromdex.tradeswhereblockchain = 'bnb'and block_month >= cast('2025-01-01' as timestamp)group byblock_month,token_bought_address,token_bought_symbol,token_sold_address,token_sold_symbol)