Query editor
WITH fixed_usdc_tvl AS (SELECT((SELECT COUNT(*) FROM veil_base.VEIL_200_USDC_evt_Deposit)- (SELECT COUNT(*) FROM veil_base.VEIL_200_USDC_evt_Withdrawal)) * 200.0 AS net_usdc),gen2_deposits AS (SELECT SUM(CAST(json_extract_scalar(_extData, '$.extAmount') AS DOUBLE)) / 1e6 AS totalFROM veil_base.veilusdcpool_call_depositusdc),gen2_withdrawals AS (SELECT -SUM(CAST(json_extract_scalar(_extData, '$.extAmount') AS DOUBLE)) / 1e6 AS totalFROM veil_base.veilusdcpool_call_withdrawusdc)SELECTROUND(COALESCE((SELECT net_usdc FROM fixed_usdc_tvl), 0)+ COALESCE((SELECT total FROM gen2_deposits), 0)- COALESCE((SELECT total FROM gen2_withdrawals), 0),2) AS usdc_tvl