# Saylor Innovations Data Desk – Crypto Capital Gains Calculator

> Saylor Innovations Data Desk – Crypto Capital Gains Calculator is a paid API for AI agents from saylorinnovations.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-30).

Calculates capital gains or losses from a crypto sale by lot using FIFO, LIFO, or HIFO, returning cost basis, proceeds, gain/loss, and short-term vs long-term classification per lot.

## Facts

- Endpoint: GET https://saylorinnovations.com/api/tax/crypto-gains?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/saylor-innovations-data-desk-crypto-capital-gains-calculator-fd44788e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_1qzBi0f43UKyasiGVgjDi

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability saylor-innovations-data-desk-crypto-capital-gains-calculator-fd44788e
```

Example prompt: I sold 0.5 BTC on 2024-11-15 at $88,000 per coin. I bought it in two lots: 0.3 BTC on 2021-03-10 at $55,000 with a $20 fee, and 0.2 BTC on 2023-07-22 at $30,000 with a $10 fee. Can you calculate my capital gains using HIFO and show me how much is short-term vs long-term?

## When to prefer this

Use this endpoint when you need a per-lot breakdown of crypto capital gains with FIFO, LIFO, or HIFO matching and explicit short-term vs long-term classification. It is ideal for tax preparation, accountant review, or harvesting strategy analysis where lot-level detail matters. Prefer this over generic financial calculation APIs when cryptocurrency tax lot accounting with IRS-style term classification is the specific requirement.

## Known failure modes

- Missing required parameters (lots, sell_qty, sell_price, sell_date) returns an error
- Invalid date format (not YYYY-MM-DD) causes parsing failure
- Sell quantity exceeds total available lot quantity, resulting in an error or partial fill
- Malformed lots JSON array causes a parse error
- Unsupported method value (not fifo, lifo, or hifo) may default to FIFO or return an error

## How this service works

Capital gain from a crypto sale by lot using FIFO, LIFO or HIFO, with cost basis, proceeds and the short-term and long-term split per lot.

## Output

Returns total capital gain or loss, total proceeds, the lot matching method used, and a per-lot breakdown including: quantity consumed, cost basis, proceeds attributed, gain/loss, holding days, and short-term or long-term classification. Also includes a plain-language note on how to interpret the result and a source attribution.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "lots",
      "sell_qty",
      "sell_price",
      "sell_date"
     ],
     "properties": {
      "lots": {
       "type": "string",
       "description": "JSON array of purchases: [{\"date\":\"YYYY-MM-DD\",\"qty\":1,\"price\":40000,\"fee\":0}]"
      },
      "method": {
       "type": "string",
       "description": "optional fifo, lifo or hifo, default fifo"
      },
      "sell_qty": {
       "type": "string",
       "description": "quantity sold"
      },
      "sell_date": {
       "type": "string",
       "description": "sale date YYYY-MM-DD"
      },
      "sell_price": {
       "type": "string",
       "description": "sale price per unit"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "json"
    },
    "example": {
     "type": "object",
     "required": [
      "total_gain",
      "lots_used"
     ],
     "properties": {
      "note": {
       "type": "string",
       "description": "Plain-language caveat about how to read and use the result"
      },
      "method": {
       "type": "string",
       "description": "Lot matching method used"
      },
      "source": {
       "type": "string",
       "description": "Where the data or formula comes from"
      },
      "proceeds": {
       "type": "number",
       "description": "Sale proceeds after the selling fee"
      },
      "lots_used": {
       "type": "array",
       "items": {
        "type": "object",
        "properties": {
         "lot": {
          "type": [
           "number",
           "null"
          ],
          "description": "Position of the lot in the supplied list"
         },
         "gain": {
          "type": [
           "number",
           "null"
          ],
          "description": "Gain or loss on it"
         },
         "term": {
          "type": [
           "string",
           "null"
          ],
          "description": "short or long"
         },
         "bought": {
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/saylor-innovations-data-desk-crypto-capital-gains-calculator-fd44788e/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from saylorinnovations.com](https://www.zero.xyz/host/saylorinnovations.com/llms.txt)
