Query editor
-- Daily Resolutions by Category (Resolution Oracle)-- Source: https://interface.cournot.ai/cournot/dune/daily_resolution_by_category-- Pulled live inside the query with Dune LiveFetch (http_get).-- The current (incomplete) UTC day is excluded, and any duplicate (day, category)-- rows returned by the API are summed so each series has one point per day.WITH api AS (SELECT json_parse(http_get('https://interface.cournot.ai/cournot/dune/daily_resolution_by_category')) AS body),items AS (SELECT itemFROM apiCROSS JOIN UNNEST(CAST(json_extract(body, '$.data.items') AS array(json))) AS t(item)),parsed AS (SELECT CAST(json_extract_scalar(item, '$.date') AS date) AS day,json_extract_scalar(item, '$.category') AS category,CAST(json_extract_scalar(item, '$.count') AS bigint) AS resolutionsFROM items)SELECT day,category,SUM(resolutions) AS resolutionsFROM parsedWHERE day < current_dateGROUP BY 1, 2ORDER BY 1, 2