Query editor
with accounts as (select * from query_5156279 where "group" in ('Sky Frontier Foundation') and chain = 'eth'),-- balances as (-- select-- sum(b.balance) as balance,-- b.day,-- b.token_symbol-- from stablecoins_evm.balances b-- -- JOIN instead of IN (subquery)-- inner join accounts a on b.address = a.account-- where b.blockchain = 'ethereum'-- and b.day >= date '2024-09-01'-- group by b.day, b.token_symbol-- union all-- select-- balance,-- day,-- 'sUSDS' as token_symbol-- from dune.virady.result_sky_s_usds_adoption_by_holding_group_materialized_all-- where "group" = 'Sky Frontier Foundation'-- ),lockstake_supplied as (select balance, block_date as day from query_6158493 where "group" = 'Sky Frontier Foundation'),lockstake_supplied_usds as (select balance, block_date as day from query_8372906 where "group" = 'Sky Frontier Foundation'),days as (select timestamp as day from utils.days where timestamp >= (select min(day) from lockstake_supplied)),-- sky_held as (-- select * from "query_6127312(timeframe='all')" where "group" = 'Sky Frontier Foundation'-- ),-- sky_usds_univ2 as (-- select * from query_6910793-- ),-- sky_usds_univ2_held as (-- select-- sum(sum(case-- when "to" in (select account from accounts) then value-- when "from" in (select account from accounts) then -value-- end)) over (order by evt_block_date rows between unbounded preceding and current row) as balance,-- evt_block_date as day-- from uniswap_v2_multichain.uniswapv2pair_evt_transfer-- where (-- "to" in (select account from accounts)-- or "from" in (select account from accounts)-- ) and contract_address = 0x2621CC0B3F3c079c1Db0E80794AA24976F0b9e3c-- group by evt_block_date-- ),sky_price as (-- pull SKY price data from chainlink, use day's average to price it-- since we have daily resolutionselect * from dune.virady.result_sky_daily_average_sky_price),-- univ2_combined as (-- select