Query editor
selectt1.*,COALESCE(t2.balance, 0) as balance,COALESCE(t2.balance_usd, 0) as balance_usdfrom(selectsum(amount_usd) as total_sold_in_usd,tx_from as addressfrom(selectamount_usd,tx_fromfromdex.tradeswhereblockchain = 'ethereum'and block_date > cast('2023-02-19' as timestamp)and token_sold_symbol = 'RLB'UNIONselectamount_usd * -1,tx_fromfromdex.tradeswhereblockchain = 'ethereum'and block_date > cast('2023-02-19' as timestamp)and token_bought_symbol = 'RLB')group bytx_from) t1left join (selectaddress,sum(value) as balance,sum(value) * (selectmedian_pricefromdex.priceswherecontract_address = 0x046EeE2cc3188071C02BfC1745A6b17c656e3f3dand day = (selectmax(day)fromdex.priceswherecontract_address = 0x046EeE2cc3188071C02BfC1745A6b17c656e3f3d)and hour = (selectmax(hour)fromdex.priceswherecontract_address = 0x046EeE2cc3188071C02BfC1745A6b17c656e3f3d