{"uid":"cap_XfJ7eG0YUSPZ_edVHQTyL","slug":"api-dripmetrics-ai-a60c567b","name":"DripMetrics Roll Spread","description":"DripMetricsAI (https://dripmetrics.ai/) provides on-demand crypto market microstructure metrics, Hyperliquid candle metrics, Polymarket diagnostics, and on-chain DefiLlama metrics for agents, dashboards, and trading workflows.","url":"https://api.dripmetrics.ai/metrics/roll-spread?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["pair","exchange","window"],"properties":{"pair":{"type":"string","description":"Exchange-native trading pair symbol such as BTCUSDT, ETH-USD, BTC, or xyz:TSLA."},"window":{"enum":["30m","1h","2h","3h"],"type":"string","description":"Lookback window. Hyperliquid supports 30m and 1h; 2h and 3h are currently BTCUSDT/BTC-USD only."},"exchange":{"enum":["binance","coinbase"],"type":"string","description":"Exchange adapter to source recent trades from."}},"additionalProperties":false}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","required":["metric","pair","exchange","window","value","computedAt","tradeCount","firstTradeTime","lastTradeTime","coverage"],"properties":{"pair":{"type":"string"},"value":{"type":"number"},"metric":{"type":"string"},"window":{"enum":["30m","1h","2h","3h"],"type":"string"},"coverage":{"type":"object","required":["requestedWindowMinutes","effectiveWindowMinutes","coverageRatio","partialData","completeFetch","errorMessage"],"properties":{"partialData":{"type":"boolean"},"errorMessage":{"type":["string","null"]},"completeFetch":{"type":"boolean"},"coverageRatio":{"type":"number","maximum":1,"minimum":0},"effectiveWindowMinutes":{"type":"number","minimum":0},"requestedWindowMinutes":{"type":"number","minimum":0}},"additionalProperties":false},"exchange":{"enum":["binance","coinbase"],"type":"string"},"components":{"type":"object","required":["covariance","absoluteCovariance","intervals","observations","mode","strictRollDefined","interpretation"],"properties":{"mode":{"enum":["absolute"],"type":"string"},"intervals":{"type":"integer"},"covariance":{"type":"number"},"observations":{"type":"integer"},"interpretation":{"enum":["absolute_covariance_proxy"],"type":"string"},"strictRollDefined":{"type":"boolean"},"absoluteCovariance":{"type":"number"}},"additionalProperties":false},"computedAt":{"type":"string","format":"date-time"},"tradeCount":{"type":"integer","minimum":1},"lastTradeTime":{"type":"string","format":"date-time"},"firstTradeTime":{"type":"string","format":"date-time"},"benchmarkCoverage":{"type":"object","required":["requestedWindowMinutes","effectiveWindowMinutes","coverageRatio","partialData","completeFetch","errorMessage"],"properties":{"partialData":{"type":"boolean"},"errorMessage":{"type":["string","null"]},"completeFetch":{"type":"boolean"},"coverageRatio":{"type":"number","maximum":1,"minimum":0},"effectiveWindowMinutes":{"type":"number","minimum":0},"requestedWindowMinutes":{"type":"number","minimum":0}},"additionalProperties":false}},"additionalProperties":false}}}}},"responseSchema":{"type":"json","example":{"pair":"BTC-USD","value":3.2145,"metric":"roll-spread","window":"30m","coverage":{"partialData":false,"errorMessage":null,"completeFetch":true,"coverageRatio":1,"effectiveWindowMinutes":30,"requestedWindowMinutes":30},"exchange":"coinbase","components":{"mode":"absolute","intervals":30,"covariance":2.583251,"observations":28,"interpretation":"absolute_covariance_proxy","strictRollDefined":false,"absoluteCovariance":2.583251},"computedAt":"2026-05-23T14:00:00.000Z","tradeCount":428,"lastTradeTime":"2026-05-23T13:59:58.000Z","firstTradeTime":"2026-05-23T13:00:02.000Z"}},"example":{"request":{"input":{"type":"http","method":"GET","queryParams":{"pair":"BTCUSDT","window":"1h","exchange":"binance"}}},"response":{"pair":"BTCUSDT","value":19.60741657,"metric":"roll-spread","window":"1h","exchange":"binance","components":{"intervals":60,"covariance":-96.112696105834,"observations":58},"computedAt":"2026-05-25T04:32:49.669Z","tradeCount":16252,"lastTradeTime":"2026-05-25T04:32:48.298Z","firstTradeTime":"2026-05-25T03:32:49.739Z"}},"exampleRequest":{"pair":"BTCUSDT","window":"1h","exchange":"binance"},"tags":["x402"],"displayCostAmount":"0.05","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":1,"rating":{"score":"0.75","successRate":"0.71","reviews":1,"stars":"4.0","state":"rated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.05/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_gOAdF68--mAVSSYvmjm-w","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.05","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Calculates the Roll spread proxy metric — an estimate of bid-ask spread derived from lagged price covariance — for a crypto trading pair on Binance or Coinbase over a 30m or 1h window.","exampleAgentPrompt":"What's the Roll spread for BTCUSDT on Binance over the last 1 hour? I want to estimate the implied bid-ask spread using lagged price covariance.","exampleUseCases":null,"resultDescription":"Returns a structured JSON object with the Roll spread value (a numeric spread proxy in price units), the covariance and number of intervals used in the computation, trade count, the pair/exchange/window parameters, and the timestamps of the first and last trade included plus when the metric was computed.","failureModes":["Unsupported exchange or pair symbol returns a 4xx error","Insufficient trade data in the window may yield low tradeCount or no result","Payment failure via x402 returns 402 Payment Required","Invalid window value (not '30m' or '1h') returns validation error","Network or upstream exchange data outage returns 5xx"],"whenToPreferThis":"Use this endpoint when you need a fast, on-demand, pay-per-call Roll spread estimate for Bitcoin or Ethereum pairs on Binance or Coinbase without managing subscriptions or API keys. Prefer it over subscription-based data feeds when cost efficiency and agent-native x402 micropayments matter, or when you specifically need the Roll (1984) covariance-based spread proxy rather than order book derived spreads.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":8,"lastUsedAt":"2026-06-15T13:54:26.182Z","lastSuccessfullyRanAt":"2026-06-15T13:54:26.182Z","lastHealthCheckAt":"2026-10-11T12:43:23.245Z","isFirstParty":false,"canonicalSlug":"api-dripmetrics-ai-a60c567b"}