Query editor
with raw as (SELECTfrom_unixtime(CAST(item['date'] AS double)) AS dt,CAST(item['tvl'] AS double) AS tvlFROM UNNEST(CAST(json_parse(HTTP_GET('https://api.llama.fi/v2/historicalChainTvl/Mantle')) AS ARRAY(MAP(VARCHAR, JSON)))) AS t (item)where from_unixtime(CAST(item['date'] AS double)) >= date('2025-01-01')), t1 as(select *,tvl/1000000 as tvl_a,LAG(tvl,1) OVER (ORDER BY dt) AS tvl_1,LAG(tvl,7) OVER (ORDER BY dt) AS tvl_7from raw)SELECTdt,tvl as def_tvl,tvl_a,(tvl/tvl_1 -1)*100 as change_1d,(tvl/tvl_7 -1)*100 as change_7dFROM t1where dt < current_dateorder by 1 desc