{"uid":"cap_R9EGHe2SnDnGzmotnE2Nn","slug":"brainiac-repayment-waterfall-simulator-5502d5a0","name":"BRAINIAC Repayment Waterfall Simulator","description":"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.","url":"https://www.brainiac.software/api/v1/fintech/repayment-waterfall-simulate?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"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}}},"responseSchema":{"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}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.04","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.04/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.04","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.04","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_6syuKGX5x0edN5Xc58Xjh","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.04","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Simulates how available cash is allocated across multiple loan facilities in priority order, applying configurable payment buckets (fees, arrears, interest, principal) per facility.","exampleAgentPrompt":"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).","exampleUseCases":[{"title":"Multi-tranche structured debt allocation","prompt":"I have USD 15,000 available and need to simulate the repayment waterfall across three facilities: a senior loan at priority 1 with $10,000 principal, $500 interest, $200 fees using payment order fees, interest, principal; a mezzanine loan at priority 2 with $8,000 principal, $300 interest using payment order interest then principal; and a junior tranche at priority 3 with $5,000 principal, $100 fees. Show me exactly how much gets paid to each bucket."},{"title":"Partial cash recovery modeling for distressed debt","prompt":"Model how $7,500 USD gets applied across two distressed facilities: facility A at priority 1 has $5,000 principal, $2,000 arrears, $400 fees with payment order arrears, fees, principal; facility B at priority 2 has $6,000 principal, $1,500 arrears with payment order arrears then principal. I want to see the step-by-step formulas and what remains unpaid."},{"title":"Loan servicer payment processing verification","prompt":"Verify the repayment waterfall for a single USD facility — priority 1, $20,000 principal, $800 accrued interest, $150 fees — with $21,500 available cash, payment order fees then interest then principal. I need the breakdown of exactly what goes to each bucket and confirmation of zero unallocated cash."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-14T18:34:35.437Z","isFirstParty":false,"canonicalSlug":"brainiac-repayment-waterfall-simulator-5502d5a0"}