post_calc_finance
Exact financial + token math. POST {op:…}: compound (growth with per-period contributions), amortize (payment, total interest, schedule), npv, irr (deterministic bisection) — and token_units: exact decimal↔base-unit conversion via BigInt for any token decimals (ETH 18, USDC 6), the 18-decimal math that float64 silently corrupts. Iterative series computed exactly, never guessed. ($0.005 per call, paid via x402)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | Yes | compound | amortize | npv | irr | token_units | |
| to | No | token_units — base | decimal | |
| rate | No | annual %, e.g. 6.5 | |
| years | No | ||
| amount | No | token_units — decimal or base-unit string | |
| decimals | No | token_units — ETH 18, USDC 6 | |
| cashflows | No | npv/irr — period 0 first | |
| principal | No | ||
| periods_per_year | No | default 12 | |
| contribution_per_period | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | No | ||
| npv | No | ||
| decimal | No | ||
| irr_pct | No | ||
| schedule | No | ||
| base_units | No | ||
| future_value | No | ||
| total_interest | No | ||
| payment_per_period | No |