Query editor
with wstETH_supply as (select time, net_trend, sum(net_trend) over (order by time) as cum_supply_wstETHfrom (select date_trunc('day', evt_block_time) as time, sum(value/1e18) as net_trendfrom (select evt_block_time, (cast(value as double)) as valuefrom erc20_polygon.evt_Transferwhere contract_address = 0x03b54A6e9a984069379fae1a4fC4dBAE93B3bCCD -- wstETHand "to" != 0x0000000000000000000000000000000000000000 -- Null Addressand evt_block_time >= date('2022-08-25') -- contract deployedunion allselect evt_block_time,(-1)*(cast(value as double)) as valuefrom erc20_polygon.evt_Transferwhere contract_address = 0x03b54A6e9a984069379fae1a4fC4dBAE93B3bCCD -- wstETHand "from" != 0x0000000000000000000000000000000000000000 -- Null Addressand evt_block_time >= date('2022-08-25') -- contract deployed) xgroup by 1order by 1 desc) t),wstETH_ratio as (select date_trunc('day', block_time) as time, avg(ratio) as avg_ratiofrom( select block_time, token_bought_amount/token_sold_amount as ratio, amount_usdfrom dex.trades where blockchain = 'polygon' and project = 'balancer' and version = '2'and project_contract_address = 0x65Fe9314bE50890Fb01457be076fAFD05Ff32B9A -- https://app.balancer.fi/#/polygon/pool/0x65fe9314be50890fb01457be076fafd05ff32b9a000000000000000000000a96and token_sold_symbol = 'wstETH'and (token_sold_amount != 0 or token_bought_amount != 0)union allselect block_time, token_bought_amount/token_sold_amount as ratio, amount_usdfrom dex.trades where blockchain = 'polygon' and project = 'balancer' and version = '2'and project_contract_address = 0x65Fe9314bE50890Fb01457be076fAFD05Ff32B9A -- https://app.balancer.fi/#/polygon/pool/0x65fe9314be50890fb01457be076fafd05ff32b9a000000000000000000000a96and token_bought_symbol = 'WETH'and (token_sold_amount != 0 or token_bought_amount != 0)) xgroup by 1order by 1 desc),wETH_price as (select day as time, round(avg(price), 2) as avg_pricefrom(select date_trunc('day', minute) as day, pricefrom prices.usd where blockchain = 'polygon' and symbol = 'WETH') xgroup by 1order by 1 desc),wstETH_price as (select time, (avg_ratio * avg_price) as wstETH_pricefrom wstETH_ratioleft join wETH_price using (time)order by 1 desc),avg_daily_volume_last_quarter as (select time,avg(total_usd_volume) over (order by time rows between 89 preceding and current row) as average_daily_volumefrom (select date_trunc('day', block_time) as time, sum(amount_usd) as total_usd_volumefrom dex.trades