Query editor
with supply as (selectblock_date, tx_hash, asset, cast(amount as int256) as amount, 'supply' as actionfrom affluent_ton.supply), borrow as (selectblock_date, tx_hash, asset, -1 * cast(amount as int256) as amount, 'borrow' as actionfrom affluent_ton.borrow), repay as (selectblock_date, tx_hash, asset, cast(amount as int256) as amount, 'repay' as actionfrom affluent_ton.repay), withdraw as (selectblock_date, tx_hash, asset, -1 * cast(amount as int256) as amount, 'withdraw' as actionfrom affluent_ton.withdraw), overall as (select*from supplyunion allselect*from borrowunion allselect*from repayunion allselect*from withdraw), latest_price as (selecttoken_address, price_usd, row_number() over (partition bytoken_addressorder bytimestamp desc) as rankfrom ton.prices_daily)selectasset