Proration and day-count fractions (30/360, ACT/365F, ACT/360, ACT/ACT ISDA) on half-open date ranges

$0.005 USDC per call · Business, finance and compliance · POST /api/v1/proration · Id proration

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

FieldTypeRequiredDescription
itemsarray<object>; max 100 itemsyes

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.

FieldTypeRequiredDescription
statusstring; one of "pass", "fail", "unknown", "unsupported"nopass: 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.
itemsarray<object>no
witnessesarray<object>no
versionsobjectnoEvery semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile).
limitsarray<string>no
deterministicbooleannoAlways 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