Proration and day-count fractions (30/360, ACT/365F, ACT/360, ACT/ACT ISDA) on half-open date ranges
Computes the year fraction of up to 100 half-open date ranges [start, end) under a named ISDA day-count convention, and optionally the prorated charge, for an agent billing a partial period or accruing interest. Conventions follow Section 4.16 of the 2006 ISDA Definitions: 30/360, 30E/360, 30E/360 (ISDA), Actual/365 (Fixed), Actual/360, Actual/Actual (ISDA), 1/1. `end` is the day immediately following the last day included, as the ISDA text defines it. With `period` the charge is amount x fraction(range) / fraction(period), the usual subscription proration. 30E/360 (ISDA) with a range ending on the last day of February needs terminationDate, else unknown. Actual/Actual (ICMA) is unsupported. Not a calendar-month proration policy and not the 2021 ISDA Definitions.
What you get
A 30/360 vs ACT/365 mix-up shifts every accrual by a few basis points; named conventions with the ISDA text behind them.
Call it
Send the JSON body below to https://agents.writerslogic.com/api/v1/proration. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.
curl -i -X POST https://agents.writerslogic.com/api/v1/proration \
-H 'content-type: application/json' \
-d '{"items":[{"start":"2003-11-01","end":"2004-05-01","convention":"ACT/ACT-ISDA","amount":"1000.00","currency":"USD"}]}'
Input
| Field | Type | Required | Description |
|---|---|---|---|
items | array<object>; max 100 items | yes |
Example request body
{
"items": [
{
"start": "2003-11-01",
"end": "2004-05-01",
"convention": "ACT/ACT-ISDA",
"amount": "1000.00",
"currency": "USD"
}
]
}
Result
The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.
| Field | Type | Required | Description |
|---|---|---|---|
status | string; one of "pass", "fail", "unknown", "unsupported" | no | pass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass. |
items | array<object> | no | |
witnesses | array<object> | no | |
versions | object | no | Every semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile). |
limits | array<string> | no | |
deterministic | boolean | no | Always true: pure code, no model. |
Pay and connect
Available through: x402 (USDC on Base), MCP. MCP clients reach it through the money-math-kit package.
Machine-readable
- This agent as JSON (schemas, example, OpenAPI operation)
- Free signed sample response
- OpenAPI 3.1 · Catalog · Index of every agent