# x402toll Crypto Tax-Lot Matching (FIFO/LIFO/HIFO)

> x402toll Crypto Tax-Lot Matching (FIFO/LIFO/HIFO) is a paid API for AI agents from x402toll.com, paid per call via x402, $0.25/call, status unknown (last checked 2026-09-14).

Matches a crypto sale against buy lots using FIFO, LIFO, or HIFO, returning realized short-term and long-term gain/loss per IRS rules plus remaining lots.

## Facts

- Endpoint: POST https://x402toll.com/v1/crypto/tax-lots
- Price: $0.25/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402toll-crypto-tax-lot-matching-fifo-lifo-hifo-b520fc0b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_hACBpAYKyLwzu-FCW1rDd

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 x402toll-crypto-tax-lot-matching-fifo-lifo-hifo-b520fc0b -d '<json body>'
```

Example prompt: I sold 1.5 ETH on 2024-11-15 at $3,200 each. My buy lots are: 1 ETH bought on 2023-06-01 at $1,800, and 1 ETH bought on 2024-08-20 at $2,500. Calculate my realized gain/loss using HIFO and tell me how much is short-term vs long-term.

## When to prefer this

Use this endpoint when you need IRS-compliant crypto capital gains calculation with lot-level detail across multiple purchase tranches, especially when the user wants to choose their accounting method (FIFO, LIFO, or HIFO) and needs the short-term vs long-term split for tax reporting. Prefer this over generic financial calculators when the input is a structured list of crypto buy lots and a specific sale event.

## Known failure modes

- Sale quantity exceeds total lot quantity — returns an error indicating insufficient lots to cover the sale
- Missing required fields (qty, priceUsd, date) on any lot or sale object — returns a 400 validation error
- Invalid date format in lot or sale — returns parsing error
- More than 200 lots supplied — rejected due to maxItems constraint
- Invalid method enum value — returns validation error, defaults to FIFO if omitted
- Payment not included or insufficient — returns 402 Payment Required

## How this service works

Match a crypto sale against buy lots (FIFO / LIFO / HIFO), returning realized gain/loss split short- vs long-term (IRS >365-day rule) plus the remaining lots.

## Output

Returns the realized gain/loss broken down into short-term (held ≤365 days) and long-term (held >365 days) portions, the matched buy lots consumed by the sale, and an array of remaining unsold lots with updated quantities — all computed per the chosen FIFO, LIFO, or HIFO method.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "lots": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "qty",
     "priceUsd",
     "date"
    ],
    "properties": {
     "qty": {
      "type": "number"
     },
     "date": {
      "type": "string"
     },
     "priceUsd": {
      "type": "number"
     }
    }
   },
   "maxItems": 200,
   "minItems": 1
  },
  "sale": {
   "type": "object",
   "required": [
    "qty",
    "priceUsd",
    "date"
   ],
   "properties": {
    "qty": {
     "type": "number"
    },
    "date": {
     "type": "string"
    },
    "priceUsd": {
     "type": "number"
    }
   }
  },
  "method": {
   "enum": [
    "fifo",
    "lifo",
    "hifo"
   ],
   "type": "string",
   "default": "fifo"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402toll-crypto-tax-lot-matching-fifo-lifo-hifo-b520fc0b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402toll.com](https://www.zero.xyz/host/x402toll.com/llms.txt)
