# Investing Math: DCA vs Lump Sum Comparator

> Investing Math: DCA vs Lump Sum Comparator is a paid API for AI agents from invest-math.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-30).

Compares dollar-cost averaging (equal periodic buys) against a single lump-sum investment on the first date, given a series of prices, returning returns, units acquired, and a verdict on which strategy won.

## Facts

- Endpoint: GET https://invest-math.x402tookit.com/dca-vs-lump?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/investing-math-dca-vs-lump-sum-comparator-65ac958b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_io5PjDNc1i7ajxpHA30n0

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability investing-math-dca-vs-lump-sum-comparator-65ac958b
```

Example prompt: Compare dollar-cost averaging $500 per period versus investing the full amount as a lump sum at the start, using these prices: 100,105,98,110,115,108,120,125,118,130.

## When to prefer this

Use this endpoint when you need a fast, deterministic head-to-head comparison of periodic DCA investing versus a single lump-sum purchase over a known price series. It is ideal for backtesting investment timing strategies, validating personal finance decisions, or explaining to a user which approach would have yielded better returns given historical prices. Prefer this over building your own simulation when you want a ready-made verdict, reasons, and summary narrative alongside the raw numbers.

## Known failure modes

- Fewer than 2 or more than 600 prices provided — validation error
- Non-numeric values in the prices string — parse error
- Missing required perBuy or prices parameters — 400 bad request
- Payment failure or missing x402 payment header — 402 payment required
- Extremely large or zero perBuy values may produce edge-case results

## How this service works

Compare equal periodic buys (dollar-cost averaging) with one lump sum on the first date, over a list of prices.

## Output

Returns a structured comparison including: DCA stats (units acquired, average cost, final value, return %), lump sum stats (cost, units, final value, return %), total amount invested, final asset price, price change %, a winner field indicating which strategy outperformed, a human-readable summary and verdict, supporting reasons, and optional disclaimers or degraded-mode flags.

## Request schema (JSON Schema)

```json
{
 "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": [
      "prices",
      "perBuy"
     ],
     "properties": {
      "perBuy": {
       "type": "number",
       "description": "Amount invested at each date"
      },
      "prices": {
       "type": "string",
       "description": "Price at each buy date, comma separated, 2 to 600 values"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "dca": {
       "type": [
        "null",
        "object"
       ],
       "properties": {
        "units": {
         "type": [
          "null",
          "number"
         ]
        },
        "returnPct": {
         "type": [
          "null",
          "number"
         ]
        },
        "finalValue": {
         "type": [
          "null",
          "number"
         ]
        },
        "averageCost": {
         "type": [
          "null",
          "number"
         ]
        }
       }
      },
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "buys": {
       "type": [
        "null",
        "number"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "winner": {
       "type": [
        "null",
        "string"
       ]
      },
      "lumpSum": {
       "type": [
        "null",
        "object"
       ],
       "properties": {
        "cost": {
         "type": [
          "null",
          "number"
         ]
        },
        "units": {
         "type": [
          "null",
          "number"
         ]
        },
        "returnPct": {
         "type": [
          "null",
          "number"
         ]
        },
        "finalValue": {
         "type": [
          "null",
          "number"
         ]
        }
       }
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/investing-math-dca-vs-lump-sum-comparator-65ac958b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from invest-math.x402tookit.com](https://www.zero.xyz/host/invest-math.x402tookit.com/llms.txt)
