---
title: "Crypto Cost Basis & Gain Calculator"
method: POST
path: "/v1/tools/crypto_cost_basis_gain_calculator"
tags: ["crypto-tax", "cost-basis", "capital-gain", "fifo", "lifo", "hifo", "spec-id", "1099-da", "carf", "dac8", "bitcoin", "digital-asset"]
---

# Crypto Cost Basis & Gain Calculator

`POST /v1/tools/crypto_cost_basis_gain_calculator`

## Request

- Base URL: `https://ainumbers.co`
- URL: `https://ainumbers.co/v1/tools/crypto_cost_basis_gain_calculator`
- Auth: none declared

Compute cost basis and realized gain/loss per disposal using FIFO, LIFO, HIFO, or specific-identification lot matching. Short/long-term split at 12-month threshold (IRC §1222). Per-wallet basis tracking as required for US taxpayers from 2025 (IRS Rev. Proc. 2024-28). Feeds IRS Form 1099-DA and CARF/DAC8 basis reporting. Tier 1 Policy Mandate + Tier 2 gain/loss schedule CSV. Client-side. Works offline. Zero PII.

**Tool URL:** https://ainumbers.co/tools/466-crypto-cost-basis-gain-calculator.html
**AP2/Policy Mandate export:** yes

## Request body

- object
  - `method` 'FIFO' | 'LIFO' | 'HIFO' | 'spec_id', required: Lot-matching method: FIFO=first-in-first-out; LIFO=last-in; HIFO=highest-cost-first; spec_id=taxpayer designates each lot
  - `wallet_by_wallet` boolean: Restrict lot matching to same wallet (required for US from 2025)
  - `lots` object[], required: Acquisition lots
    - `lot_id` string
    - `asset` string
    - `wallet` string
    - `date_acquired` string: YYYY-MM-DD
    - `qty` number
    - `cost_usd` number
  - `disposals` object[], required: Disposals to match
    - `disposal_id` string
    - `asset` string
    - `wallet` string
    - `date_disposed` string: YYYY-MM-DD
    - `qty` number
    - `proceeds_usd` number
    - `spec_lot_id` string: Required for spec_id method

## Response `200`

Successful tool execution result

- object
  - `total_proceeds_usd` number
  - `total_basis_usd` number
  - `net_gain_loss_usd` number
  - `short_term_gain_loss_usd` number
  - `long_term_gain_loss_usd` number
  - `gain_loss_schedule` object[]
    - `disposal_id` string
    - `proceeds_usd` number
    - `basis_usd` number
    - `gain_loss_usd` number
    - `term` 'short' | 'long' | 'unknown'
    - `date_acquired` string
    - `date_disposed` string

---

[API](https://skmtc.dev/ainumbers/apis/ainumbers-co-fintech-intelligence-suite.md) · [All operations](https://skmtc.dev/ainumbers/apis/ainumbers-co-fintech-intelligence-suite/llms.txt) · [OpenAPI document](https://skmtc.dev/ainumbers/apis/ainumbers-co-fintech-intelligence-suite/revisions/b462e4f5bb28?raw)
