Query editor
-- Hipo — unstake volume (hGRAM burned)-- Tags: hipo, liquid-staking, ton, hgram-- Metric: hGRAM burned per day (from jetton_events burns) valued in GRAM at the EXACT daily-- rate (from the treasury-rate dataset). The GRAM column is a valuation of the burns.-- Days before the dataset's first snapshot use its earliest rate (approximate) until the-- CSV is backfilled from historical reward logs.-- Caveat: like mints, Hipo's burns are custom (non-TEP-74), so ton.jetton_events may-- under-capture some burns — treat this as a lower bound on unstake volume. (A fully exact-- unstake series would need decoding the treasury's withdrawal messages — future work.)-- Sources: ton.jetton_events (burns) + dune.hipofinance.dataset_treasury_rate (rate).-- >>> Update the master address on a parent upgrade. <<<WITH burns AS (SELECT block_date, SUM(CAST(amount AS double)) / 1e9 AS hgram_burnedFROM ton.jetton_eventsWHERE jetton_master = '0:CF76AF318C0872B58A9F1925FC29C156211782B9FB01F56760D292E56123BF87'AND type = 'burn'AND NOT tx_abortedGROUP BY 1),rate AS (-- ts is an ISO-8601 varchar in the uploaded dataset; parse before casting.-- One row per round (~18h), so pick the latest rate when two rounds share a date.SELECTCAST(from_iso8601_timestamp(ts) AS date) AS d,MAX_BY(rate, ts) AS rateFROM dune.hipofinance.dataset_treasury_rateGROUP BY 1),filled AS (-- Forward-fill the last known rate; for days before the dataset's first snapshot-- (it builds forward from its first run), backfill with the earliest known rate —-- an approximation until the CSV is backfilled from historical reward logs.SELECTb.block_date,b.hgram_burned,COALESCE(LAST_VALUE(r.rate) IGNORE NULLS OVER (ORDER BY b.block_date ROWS UNBOUNDED PRECEDING),FIRST_VALUE(r.rate) IGNORE NULLS OVER (ORDER BY b.block_date ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)) AS rateFROM burns bLEFT JOIN rate r ON b.block_date = r.d)SELECTblock_date,hgram_burned,hgram_burned * rate AS gram_out_estFROM filledORDER BY block_date