{"uid":"cap_eiPM0Ov5AAvmBDlTlLSXC","slug":"compound-returns-965c7d9d","name":"Compound Returns","description":"Compound a list of period returns into a total growth factor. Call when multi-period performance rollups from return series you already have. Returns compounded factor and total return as deterministic JSON for $0.001 USDC via x402 on Base. First-party local math only—no RPC, live market feed, API keys, storage, or mediagen. Advisory only; the caller owns capital, risk, and production controls.","url":"https://api.delx.ai/api/v1/x402/compound-return","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"returns":{"type":"array","description":"Input field: returns."}}},"responseSchema":{"type":"json","example":{"n":3,"factor":1.025049,"schema":"delx/util-compound-return/v1","total_return":0.0250490000000001}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_hc-q-b9jD5812Y7uwZCk0","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Compounds a list of period returns into a total growth factor and cumulative return via local deterministic math.","exampleAgentPrompt":"Can you compound these monthly returns for me — [0.02, -0.01, 0.03, 0.015, -0.005, 0.04] — and tell me the total growth factor and cumulative return?","exampleUseCases":[{"title":"Annual portfolio performance rollup","prompt":"I have 12 monthly returns for my portfolio: [0.03, -0.02, 0.015, 0.04, -0.01, 0.025, 0.01, 0.03, -0.005, 0.02, 0.04, 0.015]. Can you compound them all together and give me the total annual return?"},{"title":"Backtesting strategy cumulative return","prompt":"I ran a backtest and have daily returns for 30 trading days: [0.001, -0.002, 0.003, 0.0005, -0.001, 0.002, 0.0015, -0.0005, 0.001, 0.002, -0.001, 0.0025, 0.001, -0.0015, 0.002, 0.0005, 0.003, -0.001, 0.002, 0.001, -0.0005, 0.0015, 0.002, -0.001, 0.003, 0.0005, -0.002, 0.001, 0.002, -0.001]. What's the compounded growth factor and total return over the period?"},{"title":"Quarterly fund return aggregation","prompt":"My fund had four quarterly returns this year: 4.2%, -1.8%, 3.5%, and 2.1%. Can you compound those together to get the full-year growth factor and total return?"}],"resultDescription":"Returns a deterministic JSON object containing the compounded growth factor (product of all (1 + r) terms) and the total return as a percentage or decimal, computed purely from the input return series with no external data sources.","failureModes":["Empty or missing 'returns' array returns an error or undefined result","Non-numeric values in the returns array cause computation failure","Extremely large arrays may hit request size limits","Returns expressed as percentages vs decimals may yield incorrect results if format is inconsistent","Network timeout or x402 payment failure prevents the call from completing"],"whenToPreferThis":"Choose this endpoint when you already have a series of period returns in hand and need a quick, deterministic, server-side computation of the compounded total — especially in agentic pipelines where you want a cost-effective ($0.001 USDC), stateless, no-API-key math operation without standing up your own calculation logic. Prefer this over general-purpose code execution when you want a guaranteed deterministic JSON response with no side effects.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T01:16:00.307Z","isFirstParty":false}