Calculate Long and Short Exposure
portfolio.long_short_exposure
Overview
Perform bounded exact-decimal long short exposure with every position input explicit. Closed bounded inputs and no inferred market data apply.
You receive deterministic position or exposure evidence without hidden portfolio assumptions for portfolio.long_short_exposure.
Reliability
DECIMAL_INVALID means a decimal is malformed or over limit; correct it. PORTFOLIO_INPUT_INVALID means a factor, collection, or identifier violates its domain; correct it. DUPLICATE_ID means two records use the same identifier and grouping would be ambiguous; supply unique record ids before retrying. CURRENCY_INVALID means an ISO code is unsupported or not uppercase; correct it. ITEM_LIMIT_EXCEEDED means a collection exceeds 10,000; reduce input. This guidance applies specifically to portfolio.long_short_exposure.
Context footprint
The compact result replaces repeated prompt portfolio arithmetic for portfolio.long_short_exposure. A successful call costs 1 execution credit.
When to use it
When signed exposures must be split into long and short totals.
When you need one net figure, not separate long and short totals.
Scope
Non-goals
- Does not fetch prices, FX rates, positions, or classifications for portfolio.long_short_exposure.
- Does not apply legal, regulatory, tax, or accounting policy for portfolio.long_short_exposure.
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 |
|---|---|---|---|
| exposures | array | Yes | Required ordered array of one through 10,000 signed decimal strings; null elements are invalid and bounds are checked before arithmetic. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| longExposure | string | Yes | Calculated result returned as a normalized finite plain-decimal string. |
| shortExposure | string | Yes | Calculated result returned as a normalized finite plain-decimal string. |
| grossExposure | string | Yes | Calculated result returned as a normalized finite plain-decimal string. |
| netExposure | string | Yes | Calculated result returned as a normalized finite plain-decimal string. |
| count | integer | Yes | Number of exposure values. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"portfolio.long_short_exposure","input":{"exposures":["10","-4","2"]}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("portfolio.long_short_exposure", {"exposures":["10","-4","2"]});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. |
| PORTFOLIO_INPUT_INVALID | 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 fetch prices, FX rates, positions, or classifications for portfolio.long_short_exposure.
- Does not apply legal, regulatory, tax, or accounting policy for portfolio.long_short_exposure.
- Inferred prices, factors, currencies, or grouping for portfolio.long_short_exposure.
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "portfolio.long_short_exposure",
"input": {
"exposures": [
"10",
"-4",
"2"
]
}
}Examples
Verified calculation
{
"exposures": [
"10",
"-4",
"2"
]
}{
"longExposure": "12",
"netExposure": "8",
"shortExposure": "-4",
"grossExposure": "16",
"count": 3
}Alternative calculation
{
"exposures": [
"-3"
]
}{
"longExposure": "0",
"netExposure": "-3",
"shortExposure": "-3",
"grossExposure": "3",
"count": 1
}Recommended use cases
- Auditable position algebra for portfolio.long_short_exposure.
- Bounded explicit portfolio calculations for portfolio.long_short_exposure.
Avoid for
- Inferred prices, factors, currencies, or grouping for portfolio.long_short_exposure.
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.