Skip to main content

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

MicroSkills Reference

Calculate Sortino Ratio

performance.sortino_ratio

ProductionBounded custom (Class B)Deterministicstrictinstantv1.0.0
No network

Overview

Perform exact bounded sortino ratio from caller-supplied return values. Period alignment, cash-flow classification, and methodology remain caller-controlled.

You receive deterministic return arithmetic without hidden methodology for performance.sortino_ratio.

Reliability

DECIMAL_INVALID means a decimal is malformed or over limit; correct it. PERFORMANCE_INPUT_INVALID means a return, period, value, or policy violates the closed domain; correct it. ZERO_DENOMINATOR means a beginning value or price is zero; supply a non-zero value. ITEM_LIMIT_EXCEEDED means a return series exceeds 10,000; reduce it. This guidance applies specifically to performance.sortino_ratio.

Context footprint

The compact output replaces repeated return arithmetic for performance.sortino_ratio. A successful call costs 1 execution credit.

When to use it

When returns versus a target must be scaled only by downside shortfall, not total variance.

When total variance should penalize upside as well; use Sharpe ratio instead.

Scope

Note
Perform exact bounded sortino ratio from caller-supplied return values

Non-goals

  • Does not infer periods, cash-flow classification, benchmarks, or return methodology for performance.sortino_ratio.
  • Does not source prices, distributions, risk-free rates, or market returns for performance.sortino_ratio.

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

analysis

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
returnsarrayYesRequired one through 10,000 plain-decimal return strings; null elements are invalid.
targetReturnsarrayYesRequired one through 10,000 plain-decimal return strings; null elements are invalid.
downsideModestringYesRequired `ALL_OBSERVATIONS` or `NEGATIVE_OBSERVATIONS`; controls the squared-shortfall divisor.

Output schema

FieldTypeRequiredDescription
sortinostringYesCalculated normalized finite plain-decimal result.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"performance.sortino_ratio","input":{"returns":["-2","2","2","2"],"targetReturns":["0","0","0","0"],"downsideMode":"ALL_OBSERVATIONS"}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

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

const { output } = await sq.execute("performance.sortino_ratio", {"downsideMode":"ALL_OBSERVATIONS","returns":["-2","2","2","2"],"targetReturns":["0","0","0","0"]});

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.
PERFORMANCE_INPUT_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 periods, cash-flow classification, benchmarks, or return methodology for performance.sortino_ratio.
  • Does not source prices, distributions, risk-free rates, or market returns for performance.sortino_ratio.
  • Methodology selection, market sourcing, or period alignment for performance.sortino_ratio.

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "performance.sortino_ratio",
  "input": {
    "downsideMode": "ALL_OBSERVATIONS",
    "returns": [
      "-2",
      "2",
      "2",
      "2"
    ],
    "targetReturns": [
      "0",
      "0",
      "0",
      "0"
    ]
  }
}

Examples

Verified primary

Inputjson
{
  "downsideMode": "ALL_OBSERVATIONS",
  "returns": [
    "-2",
    "2",
    "2",
    "2"
  ],
  "targetReturns": [
    "0",
    "0",
    "0",
    "0"
  ]
}
Expected outputjson
{
  "sortino": "1"
}
Tip
Independent W14 vector.

Verified alternative

Inputjson
{
  "downsideMode": "NEGATIVE_OBSERVATIONS",
  "returns": [
    "-1",
    "1"
  ],
  "targetReturns": [
    "0",
    "0"
  ]
}
Expected outputjson
{
  "sortino": "0"
}
Tip
W14 boundary vector.
  • Exact return reperformance for performance.sortino_ratio.
  • Independent bounded investment-performance evidence for performance.sortino_ratio.

Avoid for

  • Methodology selection, market sourcing, or period alignment for performance.sortino_ratio.

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

investment-performancemathfinance