Skip to main content

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

MicroSkills Reference

Match Tax Lots HIGHEST

tax_lot.match_highest_cost

ProductionBounded custom (Class B)Deterministicstrictfastv1.0.0
No network

Overview

Apply HIGHEST lot matching to one bounded opening inventory and ordered disposal batch while preserving lot and disposal identities, deterministic method order, and exact quantity conservation.

Identity, order, and quantity conservation are guaranteed for tax_lot.match_highest_cost within one business step.

Reliability

For tax_lot.match_highest_cost, TAX_LOT_INPUT_INVALID means an identifier, date, decimal, or closed shape is invalid; correct the batch. INSUFFICIENT_QUANTITY means eligible lots cannot fill a disposal; add quantity or reduce it. ITEM_LIMIT_EXCEEDED means lots, disposals, or matches exceed the published bound; split the business batch. Every failure is atomic.

Context footprint

One bounded call replaces per-disposal and per-lot agent loops. A successful call costs 1 execution credit.

When to use it

When you consume the highest remaining unit-cost lots first.

When cost is not the ranking key, or lots must be taken in acquisition-date order.

Scope

Note
Match one complete bounded ordered disposal batch against one explicit opening lot inventory using HIGHEST with atomic failure and exact quantity conservation.

Non-goals

  • Does not persist lot state or execute trades.
  • Does not infer tax jurisdiction or policy.

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 input1 MB

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
openingLotsarrayYesFrom 1 through 10,000 unique opening lots in stable input order.
disposalsarrayYesFrom 1 through 1,000 unique disposals processed atomically in caller order.

Output schema

FieldTypeRequiredDescription
disposalsarrayYesFrom 1 through 1,000 disposal receipts preserving input order.
remainingLotsarrayYesFrom 0 through 10,000 positive residual lots in original opening-lot order.
matchCountintegerYesTotal number of emitted match rows.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"tax_lot.match_highest_cost","input":{"openingLots":[{"lotId":"L1","acquisitionDate":"2026-01-01","quantity":"10","unitCost":"5"},{"lotId":"L2","acquisitionDate":"2026-02-01","quantity":"10","unitCost":"7"}],"disposals":[{"disposalId":"D1","tradeDate":"2026-03-01","quantity":"12"}]}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

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

const { output } = await sq.execute("tax_lot.match_highest_cost", {"openingLots":[{"lotId":"L1","acquisitionDate":"2026-01-01","quantity":"10","unitCost":"5"},{"lotId":"L2","acquisitionDate":"2026-02-01","quantity":"10","unitCost":"7"}],"disposals":[{"disposalId":"D1","tradeDate":"2026-03-01","quantity":"12"}]});

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.
TAX_LOT_INPUT_INVALID400NoThe request payload failed this skill's input validation.
INSUFFICIENT_QUANTITY400NoThe 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 persist lot state or execute trades.
  • Does not infer tax jurisdiction or policy.
  • Unbounded inventories or inferred disposal policy.

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "tax_lot.match_highest_cost",
  "input": {
    "openingLots": [
      {
        "lotId": "L1",
        "acquisitionDate": "2026-01-01",
        "quantity": "10",
        "unitCost": "5"
      },
      {
        "lotId": "L2",
        "acquisitionDate": "2026-02-01",
        "quantity": "10",
        "unitCost": "7"
      }
    ],
    "disposals": [
      {
        "disposalId": "D1",
        "tradeDate": "2026-03-01",
        "quantity": "12"
      }
    ]
  }
}

Examples

Verified batch

Inputjson
{
  "openingLots": [
    {
      "lotId": "L1",
      "acquisitionDate": "2026-01-01",
      "quantity": "10",
      "unitCost": "5"
    },
    {
      "lotId": "L2",
      "acquisitionDate": "2026-02-01",
      "quantity": "10",
      "unitCost": "7"
    }
  ],
  "disposals": [
    {
      "disposalId": "D1",
      "tradeDate": "2026-03-01",
      "quantity": "12"
    }
  ]
}
Expected outputjson
{
  "disposals": [
    {
      "disposalId": "D1",
      "requestedQuantity": "12",
      "matches": [
        {
          "lotId": "L2",
          "quantity": "10",
          "unitCost": "7",
          "acquisitionDate": "2026-02-01"
        },
        {
          "lotId": "L1",
          "quantity": "2",
          "unitCost": "5",
          "acquisitionDate": "2026-01-01"
        }
      ]
    }
  ],
  "matchCount": 2,
  "remainingLots": [
    {
      "lotId": "L1",
      "acquisitionDate": "2026-01-01",
      "quantity": "8",
      "unitCost": "5"
    }
  ]
}
Tip
Independent W20 quantity vector.

Repeated batch

Inputjson
{
  "openingLots": [
    {
      "lotId": "L1",
      "acquisitionDate": "2026-01-01",
      "quantity": "10",
      "unitCost": "5"
    },
    {
      "lotId": "L2",
      "acquisitionDate": "2026-02-01",
      "quantity": "10",
      "unitCost": "7"
    }
  ],
  "disposals": [
    {
      "disposalId": "D1",
      "tradeDate": "2026-03-01",
      "quantity": "12"
    }
  ]
}
Expected outputjson
{
  "disposals": [
    {
      "disposalId": "D1",
      "requestedQuantity": "12",
      "matches": [
        {
          "lotId": "L2",
          "quantity": "10",
          "unitCost": "7",
          "acquisitionDate": "2026-02-01"
        },
        {
          "lotId": "L1",
          "quantity": "2",
          "unitCost": "5",
          "acquisitionDate": "2026-01-01"
        }
      ]
    }
  ],
  "matchCount": 2,
  "remainingLots": [
    {
      "lotId": "L1",
      "acquisitionDate": "2026-01-01",
      "quantity": "8",
      "unitCost": "5"
    }
  ]
}
Tip
Deterministic repeat.
  • Deterministic tax-lot allocation.
  • Independent quantity-ledger verification.

Avoid for

  • Unbounded inventories or inferred disposal policy.

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

mathfinancetax-lot