# Crypto Tax Calculator (MPP + x402): capital gains, cost basis, Form 8949, Canada ACB/Schedule 3 - from $0.01 > Pay-per-report crypto tax engine for agents and holders who would rather pay in stablecoins than buy a $49-$199 yearly plan: realized gains with FIFO, LIFO, HIFO, average or Canadian ACB (superficial-loss rule), short/long term, staking and airdrop income, IRS Form 8949 rows with the 2025+ digital-asset boxes G-L and Schedule D line totals, Canada Schedule 3 at 50% inclusion, tax-loss harvesting candidates, and Coinbase / Koinly-universal / generic CSV import. Up to 5,000 transactions per call; nothing stored. Pay with MPP on Tempo (USDC.e/pathUSD) or x402 on Base (USDC). Bad input returns 402 with the row errors and is not charged. Information, not tax advice. ## Docs (free) - Human docs with copy-paste examples: https://mpp-cryptotax.fmf-x402.workers.dev/docs - OpenAPI 3.1: https://mpp-cryptotax.fmf-x402.workers.dev/openapi.json - This file: https://mpp-cryptotax.fmf-x402.workers.dev/llms.txt - MCP server (Streamable HTTP): https://mpp-cryptotax.fmf-x402.workers.dev/mcp - Health: https://mpp-cryptotax.fmf-x402.workers.dev/health - Attribution counters (no PII): https://mpp-cryptotax.fmf-x402.workers.dev/stats/refs ## How to pay No account and no API key. Unpaid calls receive HTTP 402 with an MPP challenge on Tempo (USDC.e or pathUSD). Official clients pay the challenge and retry automatically. POST JSON (or GET with query params) to any paid route and pay the MPP 402 challenge on Tempo (USDC.e or pathUSD). Bad input or an upstream failure returns 402 with an error and you are not charged. Optional ?ref=channel or header X-FMF-Ref attributes the call for our coverage map (ignored by the tool). ## Quick start mppx CLI (creates/uses a Tempo account in your keychain): ```bash npx mppx https://mpp-cryptotax.fmf-x402.workers.dev/tax/import -X POST -H 'content-type: application/json' -d '{"csv":"date,type,asset,amount,price,fee\n2025-01-02,buy,BTC,0.1,90000,5\n2025-03-01,sell,BTC,0.05,95000,3\n"}' ``` TypeScript (mppx). After Mppx.create(), global fetch handles 402: ```ts import { Mppx, tempo } from 'mppx/client' import { privateKeyToAccount } from 'viem/accounts' Mppx.create({ methods: [tempo({ account: privateKeyToAccount(process.env.TEMPO_PRIVATE_KEY) })], }) // Global fetch now pays the 402 automatically. const res = await fetch('https://mpp-cryptotax.fmf-x402.workers.dev/tax/import', { method: 'POST', headers: { 'content-type': 'application/json', }, body: JSON.stringify({"csv":"date,type,asset,amount,price,fee\n2025-01-02,buy,BTC,0.1,90000,5\n2025-03-01,sell,BTC,0.05,95000,3\n"}), }) console.log(await res.json()) ``` Python (pympp): ```python # pip install pympp # Docs: https://mpp.dev/sdk/python import asyncio from mpp.client import Mpp from mpp.methods.tempo import TempoAccount from mpp.methods.tempo import client as tempo account = TempoAccount.from_key("0x...") async def main(): async with Mpp(methods=[tempo.charge(account=account)]) as mpp: response = await mpp.fetch("https://mpp-cryptotax.fmf-x402.workers.dev/tax/import", method="POST", json={"csv":"date,type,asset,amount,price,fee\n2025-01-02,buy,BTC,0.1,90000,5\n2025-03-01,sell,BTC,0.05,95000,3\n"}) print(await response.json()) asyncio.run(main()) ``` An unpaid curl shows the 402 (you are not charged): ```bash curl -i -X POST https://mpp-cryptotax.fmf-x402.workers.dev/tax/import -H 'content-type: application/json' -d '{"csv":"date,type,asset,amount,price,fee\n2025-01-02,buy,BTC,0.1,90000,5\n2025-03-01,sell,BTC,0.05,95000,3\n"}' ``` ## MCP Add this to Cursor / Claude Desktop / VS Code MCP settings (Streamable HTTP): ```json { "mcpServers": { "fmf-mpp-cryptotax": { "url": "https://mpp-cryptotax.fmf-x402.workers.dev/mcp" } } } ``` `tools/list` is free. `tools/call` requires an MPP Payment credential in the Authorization header (or just call the HTTP route with mppx). The wrapper does not settle payment on its own and stores nothing. ## Routes - POST https://mpp-cryptotax.fmf-x402.workers.dev/tax/gains ($0.05) Crypto capital gains & cost basis (FIFO/LIFO/HIFO/ACB): Full crypto tax calculation from your transaction history (up to 5,000 rows, JSON or Coinbase/Koinly/generic CSV): realized gains per disposal with lot matching (FIFO, LIFO, HIFO, average or Canadian ACB with the superficial-loss rule), short vs long term (US), per-year totals by asset, staking/airdrop/reward income, remaining holdings and cost basis, unrealized P&L, and warnings for missing purchase history. Crypto-to-crypto trades, crypto fees and spending are taxable disposals. Information, not tax advice. Example: `npx mppx https://mpp-cryptotax.fmf-x402.workers.dev/tax/gains -X POST -H 'content-type: application/json' -d '{"method":"fifo","country":"us","year":2025,"transactions":[{"date":"2024-01-05","type":"buy","asset":"BTC","amount":1,"price":40000,"fee":10},{"date":"2024-06-01","type":"buy","asset":"BTC","amount":1,"price":60000},{"date":"2025-03-01","type":"sell","asset":"BTC","amount":1.5,"price":80000,"fee":20},{"date":"2025-04-01","type":"income","asset":"ETH","amount":2,"price":2000},{"date":"2025-05-01","type":"trade","sell_asset":"ETH","sell_amount":1,"buy_asset":"USDC","buy_amount":2500,"value":2500}]}'` - POST https://mpp-cryptotax.fmf-x402.workers.dev/tax/form-8949 ($0.1) IRS Form 8949 + Schedule D lines for crypto (boxes G-L): US crypto tax report: Form 8949 rows (description, date acquired, date sold, proceeds, cost basis, gain/loss) split into Part I short-term and Part II long-term with the 2025+ digital-asset boxes G/H/I and J/K/L (set form_1099da per row; default I/L = no 1099-DA), plus per-box totals mapped to Schedule D lines 1b/2/3/8b/9/10. JSON or CSV. Uses your chosen lot method (FIFO default, HIFO, LIFO). Information, not tax advice. Example: `npx mppx https://mpp-cryptotax.fmf-x402.workers.dev/tax/form-8949 -X POST -H 'content-type: application/json' -d '{"method":"fifo","country":"us","year":2025,"transactions":[{"date":"2024-01-05","type":"buy","asset":"BTC","amount":1,"price":40000,"fee":10},{"date":"2024-06-01","type":"buy","asset":"BTC","amount":1,"price":60000},{"date":"2025-03-01","type":"sell","asset":"BTC","amount":1.5,"price":80000,"fee":20},{"date":"2025-04-01","type":"income","asset":"ETH","amount":2,"price":2000},{"date":"2025-05-01","type":"trade","sell_asset":"ETH","sell_amount":1,"buy_asset":"USDC","buy_amount":2500,"value":2500}]}'` - POST https://mpp-cryptotax.fmf-x402.workers.dev/tax/schedule-3 ($0.1) Canada crypto capital gains: ACB + Schedule 3 (superficial-loss aware): Canadian crypto report: adjusted cost base (ACB) pooled per coin, proceeds of disposition, gain/loss per disposition, superficial-loss denial (30-day rule) added back to ACB, Schedule 3 totals and taxable capital gain at the 50% inclusion rate, business-vs-capital not decided for you. Values must be in CAD. JSON or CSV. Information, not tax advice. Example: `npx mppx https://mpp-cryptotax.fmf-x402.workers.dev/tax/schedule-3 -X POST -H 'content-type: application/json' -d '{"method":"acb","country":"ca","year":2025,"transactions":[{"date":"2024-01-05","type":"buy","asset":"BTC","amount":1,"price":40000,"fee":10},{"date":"2024-06-01","type":"buy","asset":"BTC","amount":1,"price":60000},{"date":"2025-03-01","type":"sell","asset":"BTC","amount":1.5,"price":80000,"fee":20},{"date":"2025-04-01","type":"income","asset":"ETH","amount":2,"price":2000},{"date":"2025-05-01","type":"trade","sell_asset":"ETH","sell_amount":1,"buy_asset":"USDC","buy_amount":2500,"value":2500}],"currency":"CAD"}'` - POST https://mpp-cryptotax.fmf-x402.workers.dev/tax/harvest ($0.05) Crypto tax-loss harvesting candidates: From your history and current prices, list the lots (or ACB pools) sitting at an unrealized loss, largest first, with short/long term if sold today, plus total harvestable loss and the rules to watch (Canada superficial loss; US wash-sale check). Information, not tax advice. Example: `npx mppx https://mpp-cryptotax.fmf-x402.workers.dev/tax/harvest -X POST -H 'content-type: application/json' -d '{"method":"fifo","country":"us","year":2025,"transactions":[{"date":"2024-01-05","type":"buy","asset":"BTC","amount":1,"price":40000,"fee":10},{"date":"2024-06-01","type":"buy","asset":"BTC","amount":1,"price":60000},{"date":"2025-03-01","type":"sell","asset":"BTC","amount":1.5,"price":80000,"fee":20},{"date":"2025-04-01","type":"income","asset":"ETH","amount":2,"price":2000},{"date":"2025-05-01","type":"trade","sell_asset":"ETH","sell_amount":1,"buy_asset":"USDC","buy_amount":2500,"value":2500}],"prices":{"BTC":70000,"ETH":1500,"USDC":1}}'` - POST https://mpp-cryptotax.fmf-x402.workers.dev/tax/import ($0.01) Normalize exchange CSV (Coinbase, Koinly universal, generic) to transactions JSON: Parse a Coinbase transaction report, a Koinly universal-format CSV or a generic CSV into clean, dated, typed transaction JSON (buy/sell/trade/income/transfer, fees split out) that the other /tax routes accept. Catches bad dates, unknown types and missing valuations before you pay for a report. Example: `npx mppx https://mpp-cryptotax.fmf-x402.workers.dev/tax/import -X POST -H 'content-type: application/json' -d '{"csv":"date,type,asset,amount,price,fee\n2025-01-02,buy,BTC,0.1,90000,5\n2025-03-01,sell,BTC,0.05,95000,3\n"}'` ## Sources and licences No upstream data sources: every number is computed in the Worker from the transactions you send (papaparse, MIT). Rules: IRS Form 8949 (2025) instructions, boxes G-L for digital assets; CRA superficial-loss rule (ITA s.54) and 50% capital-gains inclusion rate. ## Sister services - [Doc Tools](https://mpp-docs.fmf-x402.workers.dev/docs?ref=cross-cryptotax): Pay-per-call PDF, Office, OCR, speech-to-text, voice memo and meeting notes - [Web & Data](https://mpp-agent-data.fmf-x402.workers.dev/docs?ref=cross-cryptotax): Pay-per-call scrape, extract, SEC filings, weather and FX - [Utility Tools](https://mpp-tools.fmf-x402.workers.dev/docs?ref=cross-cryptotax): Tempo chain, attestation, QR, DNS, email, IP, geo, timezone, tech detect, math - [AI Tools](https://mpp-ai.fmf-x402.workers.dev/docs?ref=cross-cryptotax): Pay-per-call chat, translation, embeddings and rerank, no API key - [Browser](https://mpp-browser.fmf-x402.workers.dev/docs?ref=cross-cryptotax): Pay-per-call headless Chrome screenshots, JS render and page-to-PDF - [Research](https://mpp-research.fmf-x402.workers.dev/docs?ref=cross-cryptotax): Papers, FDA drug labels, recalls, clinical trials and LEI - [EVM Decoder](https://mpp-chain.fmf-x402.workers.dev/docs?ref=cross-cryptotax): Pay-per-call calldata and event-log decoder, selectors, verified ABIs, no RPC - [Deepgram-compatible STT](https://mpp-stt.fmf-x402.workers.dev/docs?ref=cross-cryptotax): Drop-in /deepgram/transcribe and /v1/listen speech-to-text at $0.008, no API key - [Compat APIs](https://mpp-compat.fmf-x402.workers.dev/docs?ref=cross-cryptotax): OpenWeather-, Mapbox- and EDGAR-compatible routes at a third of the price (MPP + x402) - [Domain & Web Checks](https://mpp-domain.fmf-x402.workers.dev/docs?ref=cross-cryptotax): RDAP WHOIS, domain age and availability, HTTP status, security headers, SPF/DMARC (MPP + x402) - [Dev & Data Utils](https://mpp-utils.fmf-x402.workers.dev/docs?ref=cross-cryptotax): IBAN, GTIN, ISIN, crypto address, JWT, hash, cron, RRULE, semver, CSV at $0.001 (MPP + x402) - [MTG Sim](https://mtg-sim.fmf-x402.workers.dev/docs?ref=cross-cryptotax): Magic: The Gathering deck check, draw odds, land count and goldfish simulator - [Control-plane](https://controlplane-x402.fmf-x402.workers.dev/docs?ref=cross-cryptotax): Who controls this contract? MPP + x402 snapshots and Tempo token data - [Business Docs & Data](https://mpp-biz.fmf-x402.workers.dev/docs?ref=cross-cryptotax): Invoice/receipt PDFs with pay-in-crypto QR, payment URIs, phone validation, barcodes - [Pokémon TCG Sim](https://pokemon-tcg-sim.fmf-x402.workers.dev/docs?ref=cross-cryptotax): Pokémon TCG simulator: goldfish, prize and draw sims, free Standard/Expanded deck check - [Yu-Gi-Oh Sim](https://yugioh-sim.fmf-x402.workers.dev/docs?ref=cross-cryptotax): Yu-Gi-Oh! simulator: goldfish, combo and hand-trap odds, free TCG/OCG/GOAT banlist deck check - [Lorcana Sim](https://lorcana-sim.fmf-x402.workers.dev/docs?ref=cross-cryptotax): Disney Lorcana simulator: goldfish, ink and draw sims, free Core/Infinity deck check - [One Piece Sim](https://onepiece-sim.fmf-x402.workers.dev/docs?ref=cross-cryptotax): One Piece Card Game simulator: goldfish, DON!! curve, Life and draw odds, free deck check - [Hearthstone Sim](https://hearthstone-sim.fmf-x402.workers.dev/docs?ref=cross-cryptotax): Hearthstone simulator: mulligan odds, curve goldfish, draw odds, free deck check - [Chess Sim](https://chess-sim.fmf-x402.workers.dev/docs?ref=cross-cryptotax): Chess tools: forced-mate finder, best move, legal moves, free opening names and position check - [Dota 2 Sim](https://dota2-sim.fmf-x402.workers.dev/docs?ref=cross-cryptotax): Dota 2 simulator: right-click duel sim, build stats, EHP and DPS calculator - [CS2 Sim](https://cs2-sim.fmf-x402.workers.dev/docs?ref=cross-cryptotax): CS2 economy simulator: loss bonus, buy or eco, half simulation ## Attribution Append `?ref=your-channel` or send header `X-FMF-Ref: your-channel` on any request (including unpaid 402s and /docs). We count hits and paid successes per channel so we can see what actually drives calls. The parameter is ignored by the tool.