Query editor
-- h/t https://dune.com/eliasimos-- Original Query: https://dune.com/queries/148280/292490-- Modified - kept tokens pegged 1-1 w/ eth, removed reward-bearing tokens, added fraxwith st_to as (selectdate_trunc('day', block_time) as day,sum(token_a_amount) as stETH,sum(token_b_amount) as ETHfrom (select *from dex.tradeswhere token_a_symbol = 'stETH'and (token_b_symbol = 'ETH'or token_b_symbol = 'WETH')) zwhere (token_a_amount != 0or token_b_amount != 0)group by 1),st_from as (selectdate_trunc('day', block_time) as day,sum(token_b_amount) as stETH,sum(token_a_amount) as ETHfrom (select *from dex.tradeswhere token_b_symbol = 'stETH'and (token_a_symbol = 'ETH'or token_a_symbol = 'WETH')) zwhere (token_a_amount != 0or token_b_amount != 0)group by 1),st_peg as (select day, 'stETH' as token, 1-(stETH/eth) as pegfrom (select * from st_from union allselect * from st_to) z),rck_to as (selectdate_trunc('day', block_time) as day,sum(token_a_amount) as stETH,sum(token_b_amount) as ETHfrom (select *from dex.tradeswhere token_a_symbol = 'rETH'and (token_b_symbol = 'ETH'or token_b_symbol = 'WETH')) zwhere (token_a_amount != 0or token_b_amount != 0)