---
title: "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."
method: POST
path: "/v1/crypto/tax-lots"
tags: ["Crypto & DeFi"]
---

# 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.

`POST /v1/crypto/tax-lots`

## Request

- Base URL: `` (relative, and it does not resolve against the document’s source URL)
- URL: `/v1/crypto/tax-lots`
- Auth: none declared

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.

Payment: x402 ($0.25 USDC on eip155:8453). Call unpaid to receive an HTTP 402 with requirements, then retry with the PAYMENT-SIGNATURE header. Method: order lots by method (FIFO=oldest, LIFO=newest, HIFO=highest cost); consume the sale qty; per matched portion gain = qty*(sellPrice - lotPrice), term = long if held > 365 days else short

## Request body

- object
  - `method` 'fifo' | 'lifo' | 'hifo'
  - `lots` object[], required
    - `qty` number, required
    - `priceUsd` number, required
    - `date` string, required
  - `sale` object, required
    - `qty` number, required
    - `priceUsd` number, required
    - `date` string, required

## Response `200`

Verified result + provenance (formula, sources, reproducible SHA-256 hash).

## Other responses

- `400`: Invalid input (no charge) — body echoes the JSON Schema.
- `402`: Payment required — PAYMENT-REQUIRED header carries the x402 accepts[] quote.

---

[API](https://skmtc.dev/x402toll/apis/tollbooth-verified-calculators-for-ai-agents.md) · [All operations](https://skmtc.dev/x402toll/apis/tollbooth-verified-calculators-for-ai-agents/llms.txt) · [OpenAPI document](https://skmtc.dev/x402toll/apis/tollbooth-verified-calculators-for-ai-agents/revisions/60cb70a3e1a5?raw)
