Query editor
WITHdhedge_v2_pools AS (select * from (values(0xfec2adfa296fe189f53089fd5ccd8c28dd559cf2, 'mStable Pendled sUSDe - Ethereum', 'ethereum'),(0xa6525bfbca069b680b7b7e01646abb2291e274eb, 'mStable Pendled USDe - Ethereum', 'ethereum'),(0xad0fcdb111705c9fdceaa4f92a5c0b43243ff0bd, 'Stablecoin Yield - Ethereum', 'ethereum')) as p (fund_address, fund_name, chain)),--arbitrumpool_deposits AS (SELECTfund_name,contract_address,fund_value,DATE_TRUNC('day',date) as date,block_number,indexFROM(SELECT*,Row_Number() over (Partition by contract_address,dateORDER Byblock_number DESC,index DESC) RNFROM(SELECTDISTINCT dhedge_v2_pools.fund_name as fund_name,contract_address,cast(bytearray_to_uint256(bytearray_substring(data, 129, 32))as double) / 1e18 as fund_value,block_time as date,block_number,indexFROMevms.logs,dhedge_v2_poolsWHEREcontract_address = dhedge_v2_pools.fund_addressAND topic0 = 0x97e6c213c123075e233a6f2323f33d8319141b993ab05e9e2f7eb2eda08cb944 -- Deposit event topic) e) pWHEREp.RN <= 1),pool_withdrawals AS (SELECTfund_name,contract_address,fund_value,DATE_TRUNC('day',date) as date,block_number,