Query editor
/* wstETH Native: 0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0inwstETH: 0x8e0789d39db454dbe9f4a77acef6dc7c69f6d552inwstETH/wstETH pool Contract: 0x5fc50c99e175dfeb8faa7613e050645583ac1501inwstETH/wstETH pool Contract deployment: timestamp '2024-04-05' */with swaps as (select evt_block_time,if (bought_id = 1, /*wstETH*/ cast(tokens_bought as double)/tokens_sold, cast(tokens_sold as double)/tokens_bought) as inwstETH_price_wstETH,if (bought_id = 1, /*wstETH*/ tokens_bought, tokens_sold)/1e18 as volume_wstETH, evt_tx_hashfrom inception_ethereum.curvestableswapng_inwsteths_wsteth_evt_tokenexchange),token_transfers as (select evt_block_time, if (contract_address = 0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0, /*wstETH*/if ("to" = 0x5fc50c99e175dfeb8faa7613e050645583ac1501, /*inwstETH/wstETH pool Contract*/ value,-value)/1e18, null) as wstETH_delta,if(contract_address = 0x8e0789d39db454dbe9f4a77acef6dc7c69f6d552, /*inwstETH*/if("to" = 0x5fc50c99e175dfeb8faa7613e050645583ac1501, /*inwstETH/wstETH pool Contract*/ value,-value)/1e18, null) as inwstETH_delta, evt_tx_hashfrom erc20_ethereum.evt_transfer where evt_block_time >= cast('2024-04-05' as timestamp) -- inwstETH/wstETH pool Contract deploymentand (contract_address = 0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0 /*wstETH*/ or contract_address = 0x8e0789d39db454dbe9f4a77acef6dc7c69f6d552 /*inwstETH*/)and ("to" = 0x5fc50c99e175dfeb8faa7613e050645583ac1501 /*inwstETH/wstETH pool Contract*/ or "from" = 0x5fc50c99e175dfeb8faa7613e050645583ac1501 /*inwstETH/wstETH pool Contract*/)),lp_token_mints_and_burns as (select evt_block_time, if("from" = 0x0000000000000000000000000000000000000000, value,- value)/1e18 as lp_token_supply_delta, evt_tx_hashfrom erc20_ethereum.evt_transfer where evt_block_time >= cast('2024-04-05' as timestamp) -- inwstETH/wstETH pool Contract deploymentand contract_address = 0x5fc50c99e175dfeb8faa7613e050645583ac1501 /*inwstETH/wstETH pool Contract*/and ("to" = 0x0000000000000000000000000000000000000000 or "from" = 0x0000000000000000000000000000000000000000)),lp_reserve_deltas as (select evt_block_time, sum(wstETH_delta) as wstETH_delta, sum(inwstETH_delta) as inwstETH_delta, evt_tx_hashfrom token_transfersgroup by evt_block_time, evt_tx_hash),lp_token_supply_deltas as (select evt_block_time, sum(lp_token_supply_delta) as lp_token_supply_delta, evt_tx_hashfrom lp_token_mints_and_burnsgroup by evt_block_time, evt_tx_hash),-- aggregate handle multi-swap txsaverage_inwstETHprice_wstETH_per_tx as (select evt_block_time, avg(inwstETH_price_wstETH) as inwstETH_price_wstETH, sum(volume_wstETH) as volume_wstETH, evt_tx_hashfrom swapsgroup by evt_block_time, evt_tx_hash),lp_reserve_and_lp_token_supply_deltas as (select lp_reserve_deltas.evt_block_time, inwstETH_price_wstETH, volume_wstETH, wstETH_delta, inwstETH_delta, lp_token_supply_delta, lp_reserve_deltas.evt_tx_hashfrom lp_reserve_deltasleft join lp_token_supply_deltas on lp_reserve_deltas.evt_tx_hash = lp_token_supply_deltas.evt_tx_hashleft join average_inwstETHprice_wstETH_per_tx on lp_reserve_deltas.evt_tx_hash = average_inwstETHprice_wstETH_per_tx.evt_tx_hash),ranked_prices as (select evt_block_time, inwstETH_price_wstETH, count(inwstETH_price_wstETH) over (order by evt_block_time asc rows between unbounded preceding and current row) as non_null_rank, evt_tx_hashfrom lp_reserve_and_lp_token_supply_deltas),filled_prices as (