{"uid":"cap_1qzBi0f43UKyasiGVgjDi","slug":"saylor-innovations-data-desk-crypto-capital-gains-calculator-fd44788e","name":"Saylor Innovations Data Desk – Crypto Capital Gains Calculator","description":"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.","url":"https://saylorinnovations.com/api/tax/crypto-gains?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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":{"type":["string","null"],"description":"Purchase date"},"proceeds":{"type":["number","null"],"description":"Sale proceeds attributed to it"},"quantity":{"type":["number","null"],"description":"Quantity taken from the lot"},"cost_basis":{"type":["number","null"],"description":"Cost of that quantity including fees"},"holding_days":{"type":["number","null"],"description":"Days held"}}},"description":"The purchase lots matched to the sale"},"sell_date":{"type":"string","description":"Sale date"},"cost_basis":{"type":"number","description":"Cost of the matched lots including fees"},"sell_price":{"type":"number","description":"Sale price per unit"},"total_gain":{"type":"number","description":"Proceeds minus cost basis"},"sell_quantity":{"type":"number","description":"Quantity sold"},"long_term_gain":{"type":"number","description":"Gain on lots held longer than the threshold"},"short_term_gain":{"type":"number","description":"Gain on lots held no longer than the threshold"},"average_cost_per_unit":{"type":"number","description":"Cost basis divided by quantity sold"},"long_term_threshold_days":{"type":"number","description":"Days after which a gain counts as long-term"}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_6SrkjTaFUpmx7_GDfv-8C","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"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.","exampleAgentPrompt":"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?","exampleUseCases":[{"title":"Year-end crypto tax reporting","prompt":"I need to figure out my capital gains for tax season. I sold 1.0 ETH on 2024-12-20 at $3,400. I have three purchase lots: 0.4 ETH on 2022-05-01 at $2,800 with a $5 fee, 0.3 ETH on 2023-09-15 at $1,600 with a $3 fee, and 0.3 ETH on 2024-06-01 at $3,100 with a $4 fee. Use FIFO and break down my short-term and long-term gains by lot."},{"title":"Tax-loss harvesting strategy comparison","prompt":"I'm considering selling 2 SOL on 2024-10-01 at $155 each. My lots are: 1 SOL bought 2024-01-10 at $95 with no fee, and 1 SOL bought 2024-08-05 at $170 with a $1 fee. Can you run the capital gains calculation using both FIFO and HIFO so I can see which method gives me a better tax outcome?"},{"title":"Accountant crypto gain verification","prompt":"My client sold 0.25 BTC on 2024-04-15 at $64,000 per coin. Their purchase history is: 0.1 BTC on 2020-06-01 at $9,500 with a $10 fee, and 0.15 BTC on 2022-11-20 at $16,000 with a $15 fee. Please calculate the gains using LIFO, showing cost basis, proceeds, and whether each lot qualifies as short-term or long-term."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T00:38:25.585Z","isFirstParty":false,"canonicalSlug":"saylor-innovations-data-desk-crypto-capital-gains-calculator-fd44788e"}