{"uid":"cap_9qigUhgeyFldCHzVmzVWz","slug":"finmath-correlation-23be74f8","name":"finmath Correlation","description":"Deterministic finance and crypto math for AI agents: TradFi (NPV, IRR, XIRR, Black-Scholes + Greeks, bonds, VaR, Sharpe) and DeFi (impermanent loss, perp liquidation, funding, Uniswap v3, health factor, cost basis). Exact, model-free arithmetic that LLMs get wrong — priced per call in USDC.","url":"https://finmath.qzqh5rrbkz.workers.dev/v1/correlation","method":"POST","headers":{},"bodySchema":{"type":"object","required":["x","y"],"properties":{"x":{"type":"array","description":"x"},"y":{"type":"array","description":"y"}}},"responseSchema":{"type":"object","required":["result","meta"],"properties":{"meta":{"type":"object"},"result":{}}},"example":{"request":{"x":[0.02,-0.01,0.03,0.05,-0.02,0.01],"y":[0.015,-0.005,0.025,0.04,-0.01,0.008]},"response":{"meta":{"tool":"correlation","disclaimer":"Deterministic calculation utility. Not financial, investment, or trading advice.","deterministic":true},"result":0.9962175012779345}},"exampleRequest":{"x":[0.02,-0.01,0.03,0.05,-0.02,0.01],"y":[0.015,-0.005,0.025,0.04,-0.01,0.008]},"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_sQxYxJr9YrLJeYyZ6cS-k","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes the Pearson correlation coefficient between two numerical arrays using exact arithmetic","exampleAgentPrompt":"What's the correlation between these two return series? X: [0.02, -0.01, 0.03, 0.05, -0.02, 0.01] and Y: [0.015, -0.005, 0.025, 0.04, -0.01, 0.008] — I need an exact number, not an LLM estimate.","exampleUseCases":null,"resultDescription":"Returns a result object containing the computed Pearson correlation coefficient between the two input arrays, along with a meta object with call metadata. The correlation value is a deterministic, exact arithmetic result between -1 and 1.","failureModes":["Arrays x and y have different lengths — mismatched array sizes will cause an error","Empty arrays passed as input — no data to correlate","Non-numeric values in arrays — arrays must contain numbers only","Single-element arrays — correlation is undefined with fewer than 2 data points","Payment failure — endpoint requires $0.002 USDC per call via x402 protocol"],"whenToPreferThis":"Use this endpoint when you need a deterministic, exact correlation computation rather than relying on an LLM's approximate arithmetic. Ideal for financial return series, portfolio analytics, risk factor correlation, or any quantitative workflow where numeric precision matters. Prefer this over general-purpose LLM math when the arrays have many elements or precision is critical.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:36:27.679Z","isFirstParty":false}