Query editor
WITH dates AS (SELECT dayFROM unnest(sequence(DATE '2024-03-15', -- Start dateDATE '2024-08-15', -- End dateINTERVAL '1' day)) AS s(day)),strategy_info AS (SELECT * FROM (VALUES(0xAe60d8180437b5C34bB956822ac2710972584473, 'lsETH', 'LST'),(0x8CA7A5d6f3acd3A7A8bC468a8CD0FB14B6BD28b6, 'sfrxETH', 'LST'),(0x298aFB19A105D59E74658C4C334Ff360BadE6dd2, 'mETH', 'LST'),(0x1bee69b7dfffa4e2d53c2a2df135c388ad25dcd2, 'rETH', 'LST'),(0x93c4b944d05dfe6df7645a86cd2206016c51564d, 'stETH', 'LST'),(0x54945180db7943c0ed0fee7edab2bd24620256bc, 'cbETH', 'LST'),(0x57ba429517c3473b6d34ca9acd56c0e735b94c02, 'osETH', 'LST'),(0x0fe4f44bee93503346a3ac9ee5a26b130a5796d6, 'swETH', 'LST'),(0xa4c637e0f704745d182e4d38cab7e7485321d059, 'oETH', 'LST'),(0x7ca911e83dabf90c90dd3de5411a10f1a6112184, 'wBETH', 'LST'),(0x13760f50a9d7377e4f20cb8cf9e4c26586c658ff, 'ankrETH', 'LST'),(0x9d7ed45ee2e8fc5482fa2428f15c971e6369011d, 'ETHx', 'LST'),(0xaCB55C530Acdb2849e6d4f36992Cd8c9D50ED8F7, 'EIGEN', 'EIGEN'),(0x6075546538c3efbd607ea6afc24149fccfb2edf4, 'reALT', 'erc20'),(0xbeac0eeeeeeeeeeeeeeeeeeeeeeeeeeeeeebeac0, 'ETH', 'native eth')) AS t(strategy, token_symbol, type)),increased AS (SELECToperator,strategy,staker,date(evt_block_time) as date,SUM(shares/1e18) as balanceFROM eigenlayer_ethereum.DelegationManager_evt_OperatorSharesIncreasedWHERE date(evt_block_time) BETWEEN DATE '2024-03-15' AND DATE '2024-08-15'GROUP BY operator, strategy, staker, date(evt_block_time)),decreased AS (SELECToperator,strategy,staker,date(evt_block_time) as date,SUM(shares/1e18) as balanceFROM eigenlayer_ethereum.DelegationManager_evt_OperatorSharesDecreasedWHERE date(evt_block_time) BETWEEN DATE '2024-03-15' AND DATE '2024-08-15'GROUP BY operator, strategy, staker, date(evt_block_time)),daily_balance AS (SELECTd.day as date,co.operator,co.strategy,co.staker,COALESCE(i.balance, 0) - COALESCE(de.balance, 0) AS daily_balanceFROM dates dCROSS JOIN (SELECT DISTINCT operator, strategy, staker FROM increased UNION SELECT DISTINCT operator, strategy, staker FROM decreased) coLEFT JOIN increased i ON co.operator = i.operator AND co.strategy = i.strategy AND co.staker = i.staker AND d.day = i.date