Query editor
-- 7-day settled perpetual funding rate history across 7 venues (normalized to 365d APR)-- Compares hourly Perp DEX settlement (Hyperliquid) against 4h/8h CEX & Aster cadences-- Reproducible audit baseline: https://perpspread.com/audit/btc-7dWITH raw_api AS (SELECT json_parse(http_get(CONCAT('https://perpspread.com/api/v1/history?symbol=',UPPER(TRIM('{{symbol}}')),'&days=7&source=settled&format=json'))) AS body),venues AS (SELECTjson_extract_scalar(h, '$.exchange') AS exchange,TRY_CAST(json_extract_scalar(h, '$.avg7dAprPct') AS DOUBLE) AS avg_7d_apr_pct,CAST(json_extract(h, '$.points') AS ARRAY(JSON)) AS ptsFROM raw_apiCROSS JOIN UNNEST(CAST(json_extract(body, '$.histories') AS ARRAY(JSON))) AS t(h)WHERE json_extract_scalar(h, '$.status') = 'ok')SELECTfrom_iso8601_timestamp(json_extract_scalar(p, '$.timestampUtc')) AS settled_time,UPPER(exchange) AS venue,ROUND(TRY_CAST(json_extract_scalar(p, '$.ratePct') AS DOUBLE), 5) AS raw_rate_pct,ROUND(TRY_CAST(json_extract_scalar(p, '$.aprPct') AS DOUBLE), 2) AS annualized_apr_pct,ROUND(avg_7d_apr_pct, 2) AS avg_7d_apr_pctFROM venuesCROSS JOIN UNNEST(pts) AS pt(p)ORDER BY settled_time DESC