Query editor
with dex_trade as (select date_trunc('month', block_time) as time, token_bought_amount as usdc_amount, token_sold_amount as dusd_amount, amount_usd, projectfrom dex.trades where blockchain = 'polygon'and token_bought_address = 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174 -- USDC token contractand token_sold_address = 0xEC38621e72D86775a89C7422746de1f52bbA5320-- DUSD token contractunion allselect date_trunc('month', block_time) as time, token_sold_amount as usdc_amount, token_bought_amount as dusd_amount, amount_usd, projectfrom dex.trades where blockchain = 'polygon'and token_sold_address = 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174 -- USDC token contractand token_bought_address = 0xEC38621e72D86775a89C7422746de1f52bbA5320 -- DUSD token contract)select time, round(sum(amount_usd), 2) as usd_amount, projectfrom dex_tradegroup by time,projectorder by time desc