Monte Carlo retirement or savings goal API

Project a contribution/withdrawal plan with mulberry32 Monte Carlo paths and report success probability and terminal wealth percentiles.

The Monte Carlo retirement or savings goal operation is part of the Portfolio TWR Risk Attribution Analytics API on BRAINIAC.software. Project a contribution/withdrawal plan with mulberry32 Monte Carlo paths and report success probability and terminal wealth percentiles. It is exposed as POST /api/v1/portfolio-analytics/monte-carlo-goal and priced at $0.05 USDC on Base. Payment uses the x402 exact scheme: an unpaid call returns HTTP 402 with payment requirements; after paying the exact USDC amount, retry the same request with a payment-signature header and Idempotency-Key. No account and no API key are required. Data sources for this product: Caller-supplied holdings, valuations, returns, factor series and transactions processed locally IRS Publication 550 (2025) wash-sale rules for wash-sale-detect Limitations: Pure computation on caller input: no custodian, price, factor or market-data feed is called at request time. Outputs are calculations for human review. They are not investment, tax or legal advice. Monte Carlo endpoints use the documented mulberry32 generator so seeded runs are reproducible. Portfolio values and money amounts are decimals in one currency (not minor units) unless an endpoint states otherwise. Outputs are compliance prechecks, drafts, or data lookups for human review. They are not official determinations, legal advice, identity confirmation, or certified filings. Related operations in this group include Time-weighted and money-weighted returns, Volatility, Sharpe, Sortino and drawdown, Value-at-Risk and Expected Shortfall, Brinson-Fachler attribution. Open the group documentation for the full request schema, field notes, and response examples before integrating.

POST$0.05 USDC
/api/v1/portfolio-analytics/monte-carlo-goal

Example request

curl -i -X POST "https://www.brainiac.software/api/v1/portfolio-analytics/monte-carlo-goal" \
  -H 'content-type: application/json' \
  -H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
  --data-binary @- <<'JSON'
{
  "startValue": 500000,
  "years": 30,
  "annualContribution": 0,
  "annualWithdrawal": 30000,
  "timing": "start",
  "meanReturn": 0.05,
  "volatility": 0.12,
  "inflation": 0,
  "paths": 2000,
  "seed": 42,
  "percentiles": [
    10,
    50,
    90
  ]
}
JSON

An unpaid probe returns HTTP 402 with x402 payment requirements. After paying the exact USDC amount on Base, retry the identical request with a payment-signature header.

FAQ

  • Do I need an API key? No. Pay the listed USDC amount with x402.
  • What network? Base (eip155:8453), USDC.
  • Is this an official determination? No. Results are for human review against the cited sources.

Related APIs

Portfolio TWR Risk Attribution Analytics APIFull docsHow it works