Query editor
selectsubstr(report_date, 1, 7) as month,casewhen direction = 'deposit' then 'On-chain pay in'when direction = 'withdrawal' then 'On-chain pay out'else directionend as flow_direction,sum(total_amount) as total_tpvfrom dune.bpn_betterpaymentnetwork5188.dataset_ceffu_flow_daily_agg_dunewhere transaction_scope = 'ON_CHAIN'and asset_symbol in ('USDC', 'USDT')and direction in ('deposit', 'withdrawal')group by 1, 2order bymonth,case flow_directionwhen 'On-chain pay in' then 1when 'On-chain pay out' then 2else 9end