Query editor
-- Source: https://api.prod.flash.trade/dune/openIntrestWITH raw AS (SELECT http_get('https://api.prod.flash.trade/dune/openIntrest') AS body), pairs AS (SELECT CAST(json_parse(json_query(body,'lax $.keyvalue()' WITH ARRAY WRAPPER EMPTY ARRAY ON EMPTY)) AS array(json)) AS entriesFROM raw), picked AS (SELECT json_extract(entry, '$["value"]') AS oi_array_jsonFROM pairsCROSS JOIN UNNEST(entries) AS t(entry)WHERE json_extract_scalar(entry, '$["name"]') = 'openInterest'), arr AS (SELECT CAST(oi_array_json AS array(json)) AS entriesFROM picked), base AS (SELECTjson_extract_scalar(e, '$["token"]') AS token,TRY_CAST(json_extract_scalar(e, '$["long"]') AS DOUBLE) AS long_oi,TRY_CAST(json_extract_scalar(e, '$["short"]') AS DOUBLE) AS short_oi,TRY_CAST(json_extract_scalar(e, '$["total"]') AS DOUBLE) AS total_oi,TRY_CAST(json_extract_scalar(e, '$["longPercentage"]') AS DOUBLE) AS long_percentage,TRY_CAST(json_extract_scalar(e, '$["shortPercentage"]') AS DOUBLE) AS short_percentageFROM arrCROSS JOIN UNNEST(entries) AS t(e))SELECTtoken,long_oi,short_oi,total_oi,long_percentage,short_percentage,SUM(long_oi) OVER () AS combined_long_oi,SUM(short_oi) OVER () AS combined_short_oi,SUM(total_oi) OVER () AS combined_total_oiFROM baseORDER BY token;