Query editor
WITH deposit_assets AS (SELECT SUM(assets) AS total_assets_depositFROM goatfi_arbitrum.ycsusdc_evt_deposit),withdraw_assets AS (SELECT SUM(assets) AS total_assets_withdrawFROM goatfi_arbitrum.ycsusdc_evt_withdraw),profit AS (SELECT SUM(gain) AS total_gain, SUM(loss) AS total_lossFROM goatfi_arbitrum.ycsusdc_evt_strategyreported)SELECT (deposit_assets.total_assets_deposit - withdraw_assets.total_assets_withdraw + profit.total_gain - profit.total_loss) / 1e6 AS totalAssetsFROM deposit_assets, withdraw_assets, profit