Skip to main content

Squillify development is paused indefinitely. Read why, and discover what this experiment achieved. Read the story

MicroSkills Reference

Calculate Discount Factor

finance.discount_factor

ProductionBounded custom (Class B)Deterministicstrictinstantv1.0.0
No network

Overview

Perform bounded exact-decimal discount factor with every rate, factor, bound, and profile explicit. Fixed precision, closed input, typed failures, and no ambient financial data apply.

You receive an exact scalar result and explicit profile receipt for finance.discount_factor.

Reliability

DECIMAL_INVALID means a malformed or over-limit decimal; correct it. RATE_INVALID means a rate or rebate mode violates its domain; correct it. FACTOR_INVALID means time, year fraction, or factor is negative or malformed; correct it. PROFILE_INVALID means compounding mode, frequency, time, or exponent is invalid; select a valid profile. ZERO_DENOMINATOR means a discount denominator is zero; change rate or profile. BOUNDS_INVALID means a floor, cap, fee, or rebate is inconsistent; correct its bounds. ROUNDING_INVALID means mode or scale is unsupported; select a published mode and scale. ITEM_LIMIT_EXCEEDED means compound work exceeds 10,000 steps; reduce time or frequency. This guidance applies specifically to finance.discount_factor.

Context footprint

The compact result replaces repeated prompt arithmetic for finance.discount_factor. A successful call costs 1 execution credit.

When to use it

When a rate and year fraction must become the present-value multiplier, not a cash amount.

When you already hold the cash present value, or the rate is still a market quote to fetch.

Scope

Note
Perform bounded exact-decimal discount factor with every rate, factor, bound, and profile explicit

Non-goals

  • Does not infer rates, factors, calendars, compounding, tax, or accounting policy for finance.discount_factor.
  • Does not fetch market data, mutate records, or process unbounded input for finance.discount_factor.

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

math

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input64 KB

How we handle your data

Sensitive input, safe output
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.

Read the Microskill Data Handling Policy

Input schema

FieldTypeRequiredDescription
ratestringYesNominal annual or continuous rate. Required finite plain decimal without exponent notation.
timestringYesNon-negative time in years. Required finite plain decimal without exponent notation.
compoundingProfileobjectYesClosed object with `mode`; PERIODIC also requires integer `periodsPerYear` from 1 through 366.

Output schema

FieldTypeRequiredDescription
discountFactorstringYesCalculated periodic or continuous discount factor. Returned as a normalized plain-decimal string.
compoundingProfileobjectYesClosed resolved object with `mode`; PERIODIC also has integer `periodsPerYear`.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"finance.discount_factor","input":{"rate":"1","time":"1","compoundingProfile":{"mode":"PERIODIC","periodsPerYear":1}}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });

const { output } = await sq.execute("finance.discount_factor", {"compoundingProfile":{"mode":"PERIODIC","periodsPerYear":1},"time":"1","rate":"1"});

Errors

CodeHTTPRetryableDescription
VALIDATION_ERROR400NoThe request payload failed schema validation.
UNAUTHORIZED401NoMissing or invalid API key.
SKILL_NOT_ACCESSIBLE403NoThe API key is not granted access to this skill.
SKILL_NOT_AVAILABLE_FOR_PLAN403NoThis skill is not included in your current plan.
PLAN_ELIGIBILITY_UNAVAILABLE503YesPlan eligibility could not be decided. Retry after backoff.
SKILL_NOT_FOUND404NoThe requested skill or version does not exist.
TENANT_RATE_LIMITED429YesRequest rate limit exceeded. Retry after backoff.
QUOTA_EXCEEDED429YesPlan quota exhausted. Retryable once the quota period resets.
EXECUTION_TIMEOUT504YesExecution exceeded the allowed time budget.
DECIMAL_INVALID400NoThe request payload failed this skill's input validation.
RATE_INVALID400NoThe request payload failed this skill's input validation.
FACTOR_INVALID400NoThe request payload failed this skill's input validation.
PROFILE_INVALID400NoThe request payload failed this skill's input validation.
ZERO_DENOMINATOR400NoThe request payload failed this skill's input validation.
ITEM_LIMIT_EXCEEDED429NoA size, quota, rate, or time limit was exceeded.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • Does not infer rates, factors, calendars, compounding, tax, or accounting policy for finance.discount_factor.
  • Does not fetch market data, mutate records, or process unbounded input for finance.discount_factor.
  • Inferred rates, day counts, calendars, or accounting policy
  • Inputs outside the explicit scalar bounds for finance.discount_factor.

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "finance.discount_factor",
  "input": {
    "compoundingProfile": {
      "mode": "PERIODIC",
      "periodsPerYear": 1
    },
    "time": "1",
    "rate": "1"
  }
}

Examples

Verified calculation

Inputjson
{
  "compoundingProfile": {
    "mode": "PERIODIC",
    "periodsPerYear": 1
  },
  "time": "1",
  "rate": "1"
}
Expected outputjson
{
  "compoundingProfile": {
    "mode": "PERIODIC",
    "periodsPerYear": 1
  },
  "discountFactor": "0.5"
}
Tip
Returns the primary exact W05 vector.

Alternative calculation

Inputjson
{
  "compoundingProfile": {
    "mode": "CONTINUOUS"
  },
  "time": "3",
  "rate": "0"
}
Expected outputjson
{
  "compoundingProfile": {
    "mode": "CONTINUOUS"
  },
  "discountFactor": "1"
}
Tip
Returns a materially different exact W05 vector.
  • Auditable exact-decimal discount factor
  • Bounded rate-factor and fee calculations for finance.discount_factor.

Avoid for

  • Inferred rates, day counts, calendars, or accounting policy
  • Inputs outside the explicit scalar bounds for finance.discount_factor.

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.

Tags

feesmathfinanceinterest