Query editor
-- part of a query repo-- query name: wld_unlock_schedule-- query link: https://dune.com/queries/4150241withconstants as (selectdate '2023-07-24' as launch_date,date '2025-07-24' as tfh_reserve_unlock_start_date,date '2027-07-24' as tfh_reserve_unlock_end_date,date '2026-07-24' as community_endy3,date '2029-07-24' as community_endy6,date '2032-07-24' as community_endy9,date '2038-07-24' as community_endy15),dates as (select *from unnest(sequence(date '2023-07-24',date '2038-07-24',interval '1' day)) as dates("date")),team_investors as (selectcast("date" as timestamp) as "date",team_unlocked,investor_liquid-- from query_4145675 -- MOCK DATAfrom dune.world.token_unlocks_summary),totals as (selectmax(team_unlocked) as team_unlocked, max(investor_liquid) as investor_liquidfrom team_investors)selectd."date",casewhen d."date" < c.community_endy3 then 0.5e9 + cast(date_diff('day', c.launch_date, d."date") as real) / date_diff('day', c.launch_date, c.community_endy3) * 3.5e9when d."date" < c.community_endy6 then 4.0e9 + cast(date_diff('day', c.community_endy3, d."date") as real) / date_diff('day', c.community_endy3, c.community_endy6) * 1.75e9when d."date" < c.community_endy9 then 5.75e9 + cast(date_diff('day', c.community_endy6, d."date") as real) / date_diff('day', c.community_endy6, c.community_endy9) * 0.875e9when d."date" < c.community_endy15 then 6.625e9 + cast(date_diff('day', c.community_endy9, d."date") as real) / date_diff('day', c.community_endy9, c.community_endy15) * 0.875e9else 7.5e9end as "World Community",coalesce(ti.team_unlocked, 0) as "Initial Development Team",coalesce(ti.investor_liquid, 0) as "TFH Investors",least(1, greatest(0, (cast(date_diff('day', c.tfh_reserve_unlock_start_date, d."date") as double)+1) / date_diff('day', c.tfh_reserve_unlock_start_date, c.tfh_reserve_unlock_end_date))) * (2.5e9 - t.team_unlocked - t.investor_liquid) as "TFH Reserve"from dates dcross join constants ccross join totals tleft join team_investors tion d."date" = ti."date"where d."date" <= date '2029-07-24'