BetaYou're exploring an early version of tPay365. Features and content may change as we refine the experience.

Yield Engine

Accrue interest on ring-fenced vault balances, aggregate yields across accounts, and forecast future earnings. All calculations use decimal.js with ROUND_HALF_UP precision.

/api/v1/engine/yield

Endpoints

POST
/api/v1/engine/yield/accrueSoon

Calculate and apply interest accrual for a vault

GET
/api/v1/engine/yield/aggregate/{user_id}Soon

Get total yield across all user vaults

GET
/api/v1/engine/yield/vault/{vault_id}Soon

Get yield details for a specific vault

POST
/api/v1/engine/yield/forecastSoon

Forecast yield over a given time horizon

Parameters

ParameterTypeRequiredDescription
user_idstringRequiredUser identifier
horizon_monthsintegerRequiredForecast horizon in months (max 60)
include_reinvestmentbooleanOptionalWhether to compound yield (default: true)

Example

Request
http
POST /api/v1/engine/yield/forecast HTTP/1.1
Host: api.tpay365.com
Authorization: Bearer sk_live_abc123
Content-Type: application/json

{
  "user_id": "usr_8821-9920",
  "horizon_months": 12,
  "include_reinvestment": true
}
Response
json
{
  "current_balance": 1250000,
  "projected_yield": 43750,
  "effective_apy": "3.50",
  "monthly_breakdown": [
    { "month": 1, "accrued": 3646, "balance": 1253646 },
    { "month": 2, "accrued": 3656, "balance": 1257302 }
  ],
  "forecast_date": "2027-02-10T00:00:00Z"
}