Query editor
/* stETH native: 0xae7ab96520de3a18e5e111b5eaab095312d7fe84instETH: 0x7fa768e035f956c41d6aeaa3bd857e7e5141cad5instETH/stETH pool contract: 0x5378c23f4cf85fc28fddea16153cf9213aefe9beinstETH/stETH pool contract deployment : timestamp '2024-03-22' *//* wstETH Native: 0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0inwstETH: 0x8e0789d39db454dbe9f4a77acef6dc7c69f6d552inwstETH/wstETH pool Contract: 0x5fc50c99e175dfeb8faa7613e050645583ac1501inwstETH/wstETH pool Contract deployment: timestamp '2024-04-05' */with config as (select 18 as decimals, 'hour' as granularity, 0x8e0789d39db454dbe9f4a77acef6dc7c69f6d552 as token_address, -- insteth addresstimestamp '2024-03-22' as deployment_timestamp),time_series as (select cast(block_time as timestamp) as block_timefrom unnest(sequence(timestamp '2024-03-22', cast(current_timestamp as timestamp (0)), interval '1' hour)) as t (block_time)),supply as (select block_time, sum( sum(if("from" = 0x0000000000000000000000000000000000000000, value,-value))) over (order by block_time)/power(10, decimals) as supplyfrom time_seriescross join configleft join erc20_ethereum.evt_transfer on (block_time = date_trunc('hour', evt_block_time) and contract_address = token_address and evt_block_time >= deployment_timestampand ("from" = 0x0000000000000000000000000000000000000000 or to = 0x0000000000000000000000000000000000000000 or to = 0x000000000000000000000000000000000000dead))group by block_time, decimals),trades_with_liquidity as (select date_trunc(granularity, evt_block_time) as block_time, coalesce(sum(volume_wstETH*inwstETH_price_wstETH*price), 0) as volume_usd, avg(reserve_wstETH*price) as wstETH_liquidity_usd,avg(reserve_inwstETH*inwstETH_price_wstETH*price) as token_liquidity_usdfrom query_4633341 -- Curve inwstETH/wstETH LPcross join configleft join prices.usd on (prices.usd.blockchain = 'ethereum' and contract_address = 0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0 -- wstETHand minute = date_trunc('minute', evt_block_time))group by 1)select date_trunc('day', block_time) as block_time, 'inwstETH/wstETH' as pool_symbol, wstETH_liquidity_usd, token_liquidity_usd, wstETH_liquidity_usd+token_liquidity_usd as total_liquidity_wstETH_inwstETH,volume_usd, sum(volume_usd) over (order by block_time) as cumulative_volume_usdfrom trades_with_liquidityorder by block_time desclimit 1