Query editor
-- This query has been migrated to run on DuneSQL.-- If you need to change back because you’re seeing issues, use the Query History view to restore the previous version.-- If you notice a regression, please email [email protected].WITHadd_liq AS (SELECTDATE_TRUNC('day', "evt_block_time") AS time,SUM(CAST(token_amounts[1] AS DOUBLE)) / 1e18 AS reth,SUM(CAST(token_amounts[2] AS DOUBLE)) / 1e18 AS wstethFROMcurvefi_ethereum.rETHwstETH_evt_AddLiquidityGROUP BY1),remove_liq AS (WITHremove_liq_all AS (SELECT"evt_block_time",- CAST(token_amounts[1] AS DOUBLE) AS reth,- CAST(token_amounts[2] AS DOUBLE) AS wstethFROMcurvefi_ethereum.rETHwstETH_evt_RemoveLiquidityUNION ALLSELECT"evt_block_time",- CAST(token_amounts[1] AS DOUBLE) AS reth,- CAST(token_amounts[2] AS DOUBLE) AS wstethFROMcurvefi_ethereum.rETHwstETH_evt_RemoveLiquidityImbalanceUNION ALLSELECT"evt_block_time",- CAST(token_amount AS DOUBLE) AS reth,0 AS wstethFROMcurvefi_ethereum.rETHwstETH_evt_RemoveLiquidityOneWHERE"evt_tx_hash" IN (SELECT"evt_tx_hash"FROMerc20_ethereum.evt_TransferWHERE"contract_address" = 0xae78736cd615f374d3085123a210448e74fc6393)UNION ALLSELECT"evt_block_time",0 AS reth,- CAST(token_amount AS DOUBLE) AS wstethFROMcurvefi_ethereum.rETHwstETH_evt_RemoveLiquidityOneWHERE"evt_tx_hash" IN (SELECT"evt_tx_hash"FROMerc20_ethereum.evt_Transfer