# BRAINIAC Repayment Waterfall Simulator

> BRAINIAC Repayment Waterfall Simulator is a paid API for AI agents from www.brainiac.software, paid per call via x402, $0.04/call, status unknown (last checked 2026-11-14).

Simulates how available cash is allocated across multiple loan facilities in priority order, applying configurable payment buckets (fees, arrears, interest, principal) per facility.

## Facts

- Endpoint: POST https://www.brainiac.software/api/v1/fintech/repayment-waterfall-simulate?utm_source=zero.xyz
- Price: $0.04/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/brainiac-repayment-waterfall-simulator-5502d5a0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_R9EGHe2SnDnGzmotnE2Nn

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 brainiac-repayment-waterfall-simulator-5502d5a0 -d '<json body>'
```

Example prompt: Simulate a repayment waterfall with $25,000 USD available cash across two facilities: a senior tranche (priority 1, $50,000 principal, $1,000 interest, $300 fees, payment order fees then interest then principal) and a mezzanine tranche (priority 2, $30,000 principal, $600 interest, $150 fees, payment order interest then principal then fees).

## When to prefer this

Use this endpoint when you need deterministic, auditable, step-by-step simulation of a multi-facility loan repayment waterfall with configurable per-facility payment ordering and priority sequencing. It is ideal for loan servicers, structured finance agents, or compliance tools that need to show exact allocation math without connecting to any bank or external data source. Prefer it over spreadsheet models when you need machine-readable output with formula-level traceability per bucket.

## Known failure modes

- Invalid currency code (not 3 uppercase letters) returns validation error
- Facility missing required fields (id, currency, priority, principal) causes rejection
- Priority values out of range 1–10000 fail schema validation
- payment_order array contains invalid bucket names or exceeds 4 items
- available_cash exceeds safe integer maximum
- More than 200 facilities in array triggers maxItems violation
- Payment via x402 fails if insufficient USDC balance on Base

## How this service works

Pay-per-call APIs for AI agents: OFAC sanctions screening, compliance checks, token security, and Base chain data via x402. No account. Fixed USDC price. MCP-ready.

## Output

Returns a JSON object with per-facility allocations showing: amounts due and paid per bucket (fees, arrears, interest, principal), step-by-step calculation formulas with remaining cash after each step, total paid per facility, remaining due per facility, overall unallocated cash, and plain-English explanations of the waterfall logic applied.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "currency": {
   "type": "string",
   "pattern": "^[A-Z]{3}$"
  },
  "facilities": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "id",
     "currency",
     "priority",
     "principal"
    ],
    "properties": {
     "id": {
      "type": "string",
      "maxLength": 120,
      "minLength": 1
     },
     "fees": {
      "type": "integer",
      "maximum": 9007199254740991,
      "minimum": 0
     },
     "arrears": {
      "type": "integer",
      "maximum": 9007199254740991,
      "minimum": 0
     },
     "currency": {
      "type": "string",
      "pattern": "^[A-Z]{3}$"
     },
     "priority": {
      "type": "integer",
      "maximum": 10000,
      "minimum": 1
     },
     "principal": {
      "type": "integer",
      "maximum": 9007199254740991,
      "minimum": 0
     },
     "payment_order": {
      "type": "array",
      "items": {
       "enum": [
        "fees",
        "arrears",
        "interest",
        "principal"
       ],
       "type": "string"
      },
      "maxItems": 4,
      "minItems": 1
     },
     "accrued_interest": {
      "type": "integer",
      "maximum": 9007199254740991,
      "minimum": 0
     },
     "interest_rate_bps": {
      "type": "integer",
      "maximum": 1000000,
      "minimum": 0
     }
    },
    "additionalProperties": false
   },
   "maxItems": 200,
   "minItems": 1
  },
  "available_cash": {
   "type": "integer",
   "maximum": 9007199254740991,
   "minimum": 0
  },
  "default_payment_order": {
   "type": "array",
   "items": {
    "enum": [
     "fees",
     "arrears",
     "interest",
     "principal"
    ],
    "type": "string"
   },
   "maxItems": 4,
   "minItems": 1
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "currency": "USD",
  "allocations": [
   {
    "due": {
     "fees": 200,
     "arrears": 0,
     "interest": 500,
     "principal": 10000
    },
    "paid": {
     "fees": 200,
     "arrears": 0,
     "interest": 500,
     "principal": 10000
    },
    "steps": [
     {
      "due": 200,
      "paid": 200,
      "bucket": "fees",
      "formula": "paid = min(remaining_cash, due 200) = 200",
      "remaining_cash_after": 14800
     },
     {
      "due": 0,
      "paid": 0,
      "bucket": "arrears",
      "formula": "paid = min(remaining_cash, due 0) = 0",
      "remaining_cash_after": 14800
     },
     "…"
    ],
    "priority": 1,
    "total_paid": 10700,
    "facility_id": "senior",
    "payment_order": [
     "fees",
     "arrears",
     "…"
    ],
    "remaining_due": {
     "fees": 0,
     "arrears": 0,
     "interest": 0,
     "principal": 0
    }
   },
   {
    "due": {
     "fees": 100,
     "arrears": 0,
     "interest": 300,
     "principal": 8000
    },
    "paid": {
     "fees": 0,
     "arrears": 0,
     "interest": 300,
     "principal": 4000
    },
    "steps": [
     {
      "due": 300,
      "paid": 300,
      "bucket": "interest",
      "formula": "paid = min(remaining_cash, due 300) = 300",
      "remaining_cash_after": 4000
     },
     {
      "due": 8000,
      "paid": 4000,
      "bucket": "principal",
      "formula": "paid = min(remaining_cash, due 8000) = 4000",
      "remaining_cash_after": 0
     },
     "…"
    ],
    "priority": 2,
    "total_paid": 4300,
    "facility_id": "mezz",
    "payment_order": [
     "interest",
     "principal",
     "…"
    ],
    "remaining_due": {
     "fees": 100,
     "arrears": 0,
     "interest": 0,
     "principal": 4000
    }
   }
  ],
  "explanations": [
   "Facilities are paid in ascending priority, then id. Within a facility, buckets follow payment_order or default_payment_…",
   "Each step uses paid = min(remaining_cash, due). No bank balance is fetched and no FX is applied."
  ],
  "available_cash": 15000,
  "unallocated_cash": 0
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/brainiac-repayment-waterfall-simulator-5502d5a0/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from www.brainiac.software](https://www.zero.xyz/host/www.brainiac.software/llms.txt)
