Query editor
WITH combined_events AS (SELECTDATE_TRUNC('day', evt_block_time) AS day,CAST(token_amounts[1] AS DOUBLE) / 1e18 AS amount,'add' AS event_typeFROM curvefi_ethereum.fraxusdp_evt_addliquidityUNION ALLSELECTDATE_TRUNC('day', evt_block_time) AS day,-CAST(token_amounts[1] AS DOUBLE) / 1e18 AS amount, -- dấu trừ cho remove'remove' AS event_typeFROM curvefi_ethereum.fraxusdp_evt_removeliquidity)SELECTday,SUM(amount) AS netflow_usdpFROM combined_eventsGROUP BY dayORDER BY day