{"uid":"cap_qO5grEQwfHLVAucI5mhEM","slug":"api-quantoracle-dev-9a12768e","name":"QuantOracle Cointegration Test","description":"QuantOracle: stats/cointegration","url":"https://api.quantoracle.dev/v1/stats/cointegration","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"series_x":{"type":"array","items":{"type":"number"},"title":"Series X","description":"First time series"},"series_y":{"type":"array","items":{"type":"number"},"title":"Series Y","description":"Second time series"},"significance":{"enum":["0.01","0.05","0.10"],"type":"string","title":"Significance","default":"0.05","description":"Significance level for the test"}}},"responseSchema":null,"example":{"request":{"degree":2,"series_x":[100.1,100.5,101.2,100.8,101.5,102,101.7,102.3,101.9,102.5,103.1,102.8,103.4,103.9,103.6,104.2,104.8,104.5,105.1,105.6,105.3,105.9,106.4,106.1,106.7,107.2,106.9,107.5,108,107.7],"series_y":[50.05,50.25,50.6,50.4,50.75,51,50.85,51.15,50.95,51.25,51.55,51.4,51.7,51.95,51.8,52.1,52.4,52.25,52.55,52.8,52.65,52.95,53.2,53.05,53.35,53.6,53.45,53.75,54,53.85]},"response":{"ms":19.48,"_meta":{"url":"https://quantoracle.dev","docs":"https://api.quantoracle.dev/docs","powered_by":"QuantOracle"},"half_life":9999,"intercept":0,"spread_std":0,"hedge_ratio":0.5,"spread_mean":0,"cointegrated":false,"significance":"0.05","adf_statistic":0,"critical_value":-3.34,"current_zscore":0}},"exampleRequest":{"degree":2,"series_x":[100.1,100.5,101.2,100.8,101.5,102,101.7,102.3,101.9,102.5,103.1,102.8,103.4,103.9,103.6,104.2,104.8,104.5,105.1,105.6,105.3,105.9,106.4,106.1,106.7,107.2,106.9,107.5,108,107.7],"series_y":[50.05,50.25,50.6,50.4,50.75,51,50.85,51.15,50.95,51.25,51.55,51.4,51.7,51.95,51.8,52.1,52.4,52.25,52.55,52.8,52.65,52.95,53.2,53.05,53.35,53.6,53.45,53.75,54,53.85]},"tags":["x402"],"displayCostAmount":"0.008","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.008/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.008","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.008","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_OdMwktN298hppGtrJrPNG","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.008","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Tests whether two time series are cointegrated using the Engle-Granger/ADF method, returning hedge ratio, spread statistics, z-score, half-life, and critical values","exampleAgentPrompt":"Check if SPY and IVV are cointegrated using my last 30 daily closing prices — SPY: [100.1, 100.5, 101.2, ...] and IVV: [50.05, 50.25, 50.6, ...] — at the 0.05 significance level, and tell me the hedge ratio and current z-score.","exampleUseCases":null,"resultDescription":"Returns a boolean cointegration result, ADF test statistic, critical value at the chosen significance level, hedge ratio, spread mean and standard deviation, current z-score of the spread, mean-reversion half-life in bars, and intercept. Also includes response latency in milliseconds.","failureModes":["Series length mismatch — series_x and series_y must have equal length","Too few observations — ADF test requires sufficient data points (typically 20+)","Invalid significance level — must be a recognized threshold like 0.01, 0.05, or 0.10","Non-numeric values in series arrays cause parsing errors","Server timeout for very long series"],"whenToPreferThis":"Use this endpoint when you need a statistically rigorous Engle-Granger cointegration test with full spread diagnostics including hedge ratio, z-score, and mean-reversion half-life — ideal for pairs trading signal generation and stat-arb strategy construction. Prefer over generic regression endpoints when you specifically need cointegration verdict, ADF statistic, and spread mean-reversion metrics in a single call.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T00:42:46.144Z","isFirstParty":false}