Query editor
WITH volume_json_data AS (SELECT json_parse(http_get('https://api.llama.fi/summary/derivatives/pacifica')) AS parsed_data),volume_array AS (SELECT json_extract(parsed_data, '$.totalDataChart') AS volume_jsonFROM volume_json_data),volume_unnested AS (SELECTfrom_unixtime(CAST(json_extract_scalar(item, '$[0]') AS bigint)) AS day,CAST(json_extract_scalar(item, '$[1]') AS double) AS daily_volume_usdFROM volume_arrayCROSS JOIN UNNEST(CAST(json_extract(volume_json, '$') AS array(json))) AS t(item)),volume_with_cumulative AS (SELECTday,daily_volume_usd,SUM(daily_volume_usd) OVER (ORDER BY day) AS cumulative_volume_usdFROM volume_unnested)SELECTday,daily_volume_usd,cumulative_volume_usdFROM volume_with_cumulativeWHERE day IS NOT NULLORDER BY day