Calculate Weighted Average Life
fixed_income.weighted_average_life
Overview
Perform bounded weighted average life with explicit fixed-income inputs. All prices, cash flows, conventions, schedules, and factors are explicit.
Exact bounded fixed-income evidence avoids hidden market assumptions in fixed_income.weighted_average_life.
Reliability
For fixed_income.weighted_average_life, DECIMAL_INVALID means a decimal is malformed. FIXED_INCOME_INPUT_INVALID means shape, ordering, profile, or domain is invalid. ZERO_DENOMINATOR means a required divisor is zero. ITEM_LIMIT_EXCEEDED means a collection exceeds its published bound.
Context footprint
The compact receipt replaces repeated prompt arithmetic. A successful call costs 1 execution credit.
When to use it
When principal cash flows and times must become weighted-average life in a chosen time unit.
When you need Macaulay or modified duration rather than principal-weighted life.
Scope
Non-goals
- Does not source curves, rates, prices, schedules, or market data.
- Does not infer settlement, accounting, tax, or regulatory policy.
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
How we handle your data
What this means
This skill may receive sensitive content, but it does not target sensitive data and returns only a structured non-sensitive result.
Squillify guarantees
- Runs inside Squillify
- This skill runs inside Squillify.
- Payloads are not sent to an external service by this skill.
- Squillify does not permanently store submitted payloads.
- Telemetry records metadata only, not submitted content.
- Submitted payloads are not used for training.
- Submitted payloads are not reviewed by humans.
- This skill does not target sensitive data.
- The response does not contain submitted content.
Your responsibility
Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| principalCashFlows | array | Yes | Closed bounded principalCashFlows field documented by the canonical contract. |
| times | array | Yes | Closed bounded times field documented by the canonical contract. |
| timeUnit | string | Yes | Closed bounded timeUnit field documented by the canonical contract. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| weightedAverageLife | string | Yes | Output receipt field weightedAverageLife produced under the canonical bounded fixed-income contract. |
| totalPrincipal | string | Yes | Output receipt field totalPrincipal produced under the canonical bounded fixed-income contract. |
| count | integer | Yes | Output receipt field count produced under the canonical bounded fixed-income contract. |
| timeUnit | string | Yes | Output receipt field timeUnit produced under the canonical bounded fixed-income contract. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"fixed_income.weighted_average_life","input":{"principalCashFlows":["100","100"],"times":["1","3"],"timeUnit":"YEARS"}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("fixed_income.weighted_average_life", {"timeUnit":"YEARS","principalCashFlows":["100","100"],"times":["1","3"]});Errors
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
| DECIMAL_INVALID | 400 | No | The request payload failed this skill's input validation. |
| FIXED_INCOME_INPUT_INVALID | 400 | No | The request payload failed this skill's input validation. |
| ZERO_DENOMINATOR | 400 | No | The request payload failed this skill's input validation. |
| ITEM_LIMIT_EXCEEDED | 429 | No | A size, quota, rate, or time limit was exceeded. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not source curves, rates, prices, schedules, or market data.
- Does not infer settlement, accounting, tax, or regulatory policy.
- Market-data sourcing or convention inference.
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "fixed_income.weighted_average_life",
"input": {
"timeUnit": "YEARS",
"principalCashFlows": [
"100",
"100"
],
"times": [
"1",
"3"
]
}
}Examples
Verified contract vector
{
"timeUnit": "YEARS",
"principalCashFlows": [
"100",
"100"
],
"times": [
"1",
"3"
]
}{
"count": 2,
"timeUnit": "YEARS",
"weightedAverageLife": "2",
"totalPrincipal": "200"
}Repeated deterministic vector
{
"timeUnit": "YEARS",
"principalCashFlows": [
"100",
"100"
],
"times": [
"1",
"3"
]
}{
"count": 2,
"timeUnit": "YEARS",
"weightedAverageLife": "2",
"totalPrincipal": "200"
}Recommended use cases
- Auditable bounded fixed-income arithmetic.
- Independent fixed-income reperformance.
Avoid for
- Market-data sourcing or convention inference.
Related skills
Composable with
Safety & privacy
- Runs without calling any external service.
- Your payloads are never stored permanently.
- Telemetry captures metadata only — never your payload contents.
- We never train models on your payloads.
- No human reviews your payloads.