Short answer: Crypto accounting software turns exchange records, wallet histories and blockchain data into one ledger of movements and cost lots, then produces tax reports, financial statements and reconciliations from it. The hard part is the pipeline: fees charged in another asset, transfers between your own wallets, lots tracked per wallet and a trail from every number back to a raw record. Rules differ by country; this guide covers engineering, not tax advice.
In the tested sample below, the same hypothetical buys, transfer and sales give a realized result of 140.00 when cost lots are tracked per wallet and 338.00 when all wallets share one pool, so software must state which scope it used.
Disclosure: Fincode sells this kind of work, so this guide is not neutral on that point. Naming a platform is not a recommendation, and no software vendor is compared.
What crypto accounting software does, stage by stage
It turns raw records into one ledger, cost lots, reconciliations and reports.
| Stage | Output | Typical failure |
|---|---|---|
| Ingest | Raw responses and exports, unchanged, with fetch time | Gaps from query windows and paging |
| Normalize | One row per movement, UTC time, exact decimals | Mixed time zones, floats |
| Pair transfers | Each withdrawal linked to its deposit | Own transfer booked as a sale plus income |
| Value | Price with its source and time | Missing prices filled silently |
| Assign lots | Each disposal linked to the lots it used | Wrong method or wrong scope |
| Reconcile and report | Open differences, tax lots, book values | Totals that cannot be traced to rows |
Exchange endpoints for ingestion are in crypto portfolio tracker API.
Why exchange exports and APIs disagree
Each venue splits trades, fees and transfers differently, and its documentation leaves gaps.
| Source | What the page says | Pipeline rule |
|---|---|---|
Binance Spot myTrades | Fee as commission plus its own commissionAsset; start and end time at most 24 hours apart | Book the fee as its own movement |
| Binance withdrawal history | amount and transactionFee are separate fields, and the page does not say whether the amount includes the fee; applyTime is a UTC string; transferType 1 means internal | Check gross or net against a withdrawal you can verify |
| Binance deposit history | No fee field; an integer example for insertTime, with no unit or time zone stated | Convert all times to UTC before sorting |
| Kraken ledger | Each entry has a refid for its parent trade, deposit or withdrawal; the type list has 21 values, including staking, reward and conversion | Group by refid; stop on an unknown type |
| Ethereum JSON-RPC | Receipts report gasUsed and effectiveGasPrice, the base fee plus tip per unit of gas | Take the network fee from the receipt |
For readers in Turkey, Article 99/A of Capital Markets Law No. 6362 treats activity by foreign crypto-asset platforms directed at Turkish residents as unauthorized. For integration work in general, see Fincode's read-only reporting service; naming Binance or Kraken here does not mean Fincode integrates them or has built on them.
Transfers between your own wallets
Pair each withdrawal with exactly one deposit, by transaction hash first, and check that the amount received equals the amount sent minus the network fee.
Amount-and-time matching breaks when two equal transfers overlap, so use it only to propose pairs for a person to confirm. A withdrawal that matches no deposit, or two, should stop the lot engine. A deposit with no withdrawal needs a label first: a wallet not loaded yet, income or a payment from someone else. The network fee consumes units from a lot; whether it is a disposal, part of cost or an expense depends on local rules, so report it separately.
Cost basis lots: FIFO per wallet in Python
A lot engine removes units in a stated order, and the rules, not the software, set that order and its scope.
| Source | What it says |
|---|---|
| IRS Revenue Procedure 2024-28 | From 1 January 2025, Treasury Regulations section 1.1012-1(j) applies specific identification or first in, first out (FIFO) within each wallet or account; the procedure covers the transition |
| IRS Instructions for Form 1099-DA (2026), updated 30 April 2026 | A digital asset acquired before 2026 is noncovered, and without customer identification brokers generally report the earliest units purchased as sold first |
| HMRC Cryptoassets Manual CRYPTO22200, updated 28 November 2025 | For individuals, each type of token has its own pool, after same-day and 30-day matching |
The sample runs FIFO in both scopes:
from collections import Counter, defaultdict, deque
from decimal import Decimal, InvalidOperation, getcontext
getcontext().prec = 100 # 28-digit default rounds 18-decimal balances
def amount(text): # exact decimal from text, never a float
if not isinstance(text, str):
raise TypeError("amounts must arrive as text")
try:
value = Decimal(text)
except InvalidOperation:
value = Decimal("NaN")
if not value.is_finite() or not -30 < value.adjusted() < 30 or value < 0:
raise ValueError(f"bad amount: {repr(text)}")
return value
def clean(rows): # collapse identical replays, refuse empty or reused IDs
unique = list(dict.fromkeys(rows))
bad = [i for i, n in Counter(r[0] for r in unique).items() if not i or n > 1]
if bad:
raise ValueError(f"empty or reused IDs: {bad}")
return sorted(unique, key=lambda r: r[1]) # one UTC text format; ties keep file order
def take(pool, qty, ref, audit): # oldest lots first, log every lot touched
if qty > sum(lot[2] for lot in pool):
raise ValueError(f"{ref}: more units out than in; history is missing")
pieces = []
while qty:
lot_id, acquired, units, cost = pool[0]
used = min(units, qty)
part = cost if used == units else (cost * used / units).quantize(Decimal("0.01"))
pieces.append([lot_id, acquired, used, part])
audit.append((ref, *pieces[-1]))
pool[0] = [lot_id, acquired, units - used, cost - part]
if used == units:
pool.popleft()
qty -= used
return pieces
def run(rows, scope):
rows, lots, audit, result, matched = clean(rows), defaultdict(deque), [], {}, set()
deposits = defaultdict(list)
for r in rows:
if r[3] == "deposit":
deposits[r[6]].append(r)
for rid, time, wallet, kind, qty, usd, txh, fee in rows:
qty, usd, fee = amount(qty), amount(usd), amount(fee)
pool = lots[{"wallet": wallet, "universal": "all"}[scope]]
if kind in ("buy", "sell") and not qty:
raise ValueError(f"{rid}: zero units")
if kind == "buy":
pool.append([rid, time, qty, usd])
elif kind == "sell":
result[rid] = usd - sum(p[3] for p in take(pool, qty, rid, audit))
elif kind == "withdraw":
found = deposits.pop(txh, []) if txh else []
if not (len(found) == 1 and amount(found[0][4]) == qty - fee):
raise ValueError(f"{rid}: {len(found)} deposits match, or not sent minus fee")
matched.add(found[0][0])
take(pool, fee, rid + ":fee", audit) # own line in reports
if scope == "wallet": # units keep their cost and acquisition date
dest = lots[found[0][2]]
dest.extend(take(pool, qty - fee, rid + ":move", audit))
lots[found[0][2]] = deque(sorted(dest, key=lambda lot: lot[1]))
elif kind == "deposit":
if rid not in matched:
raise ValueError(f"{rid}: deposit without an earlier withdrawal")
else:
raise ValueError(f"{rid}: unknown kind {repr(kind)}")
return result, audit, lots
ROWS = [ # synthetic, one made-up asset; USD = cost with fees (buy), proceeds after fees (sell)
# id, time (UTC), wallet, kind, units, USD, tx hash, network fee
("A-1", "2025-01-10", "A", "buy", "2.0", "200.00", "", "0"),
("B-1", "2025-02-10", "B", "buy", "1.0", "300.00", "", "0"),
("A-2", "2025-03-01", "A", "withdraw", "1.5", "0", "0xaa", "0.01"),
("W-1", "2025-03-01", "W", "deposit", "1.49", "0", "0xaa", "0"),
("B-2", "2025-04-01", "B", "sell", "1.0", "280.00", "", "0"),
("W-2", "2025-05-01", "W", "sell", "1.0", "260.00", "", "0"),
("B-2", "2025-04-01", "B", "sell", "1.0", "280.00", "", "0"), # page fetched twice
]
for scope in ("wallet", "universal"):
result, audit, _ = run(ROWS, scope)
print(scope, "scope, realized:", {k: str(v) for k, v in result.items()})
for ref, lot_id, acquired, units, cost in audit:
print(f" {ref:<9} lot {lot_id} ({acquired}) units {units:<5} cost {cost}")Output:
wallet scope, realized: {'B-2': '-20.00', 'W-2': '160.00'}
A-2:fee lot A-1 (2025-01-10) units 0.01 cost 1.00
A-2:move lot A-1 (2025-01-10) units 1.49 cost 149.00
B-2 lot B-1 (2025-02-10) units 1.0 cost 300.00
W-2 lot A-1 (2025-01-10) units 1.0 cost 100.00
universal scope, realized: {'B-2': '180.00', 'W-2': '158.00'}
A-2:fee lot A-1 (2025-01-10) units 0.01 cost 1.00
B-2 lot A-1 (2025-01-10) units 1.0 cost 100.00
W-2 lot A-1 (2025-01-10) units 0.99 cost 99.00
W-2 lot B-1 (2025-02-10) units 0.01 cost 3.00Hypothetical example. Per wallet, the sale on B uses B's own lot at 300.00, a loss of 20.00, and the sale on W uses units carried from lot A-1 with their original date and 100.00 of cost. In one pool, both sales draw on the older A-1 lot first. Totals: 140.00 and 338.00, a 198.00 difference from scope alone.
In both runs, cost used plus cost left equals the 500.00 paid. Each failure path raises an error: an empty or reused ID, an unknown kind or scope, amounts such as 1e400, 1e-400, NaN or a float, a buy or sale of zero units, a withdrawal matching zero deposits, two, or one already claimed, received not equal to sent minus fee, a sale larger than the lots, and a deposit dated before its withdrawal, a sign of a time-zone error. Turkish treatment is in Turkey crypto tax.
Crypto ledger reconciliation against exchanges and the chain
Reconciliation compares the ledger's balance per wallet and asset with the exchange and the chain, and keeps each difference open until its cause is recorded.
Store the time of every balance call. On Ethereum, eth_getBalance takes a block number or a tag such as latest or finalized, so a period-end figure should name its block. Whether old blocks can still be queried depends on your node, so capture balances when the period ends. Book each explained difference as a labeled adjustment row, not an edit. Break handling is covered in position reconciliation.
Crypto treasury management: book values and audit trail
For a company, the same ledger feeds financial statements as well as tax lots, and the two can use different methods.
- US GAAP. FASB ASU 2023-08 (December 2023), effective for fiscal years beginning after 15 December 2024, measures in-scope crypto assets at fair value, with changes recognized in net income each reporting period. It requires name, cost basis, fair value and units for each significant holding, and each year a rollforward of additions, dispositions, gains and losses and the cost basis method, which it does not prescribe.
- IFRS. The IFRS Interpretations Committee concluded in June 2019 that IAS 2 applies to cryptocurrencies held for sale in the ordinary course of business, and IAS 38 otherwise.
The pipeline therefore needs period-end prices with source and time, a rollforward built from the same rows as the lots, and locked closed periods, so a correction becomes a new row with a reason. Price sources are covered in crypto price APIs. Framework questions belong with your auditor.
Tax software for crypto or a custom build: a checklist
Write down sources, history, methods and outputs before comparing products or quotes.
What to specify
- Every account, sub-account, product, wallet address and chain in scope.
- History back to the first acquisition of anything still held. For US filers, units acquired before 2026 are noncovered, so brokers need not report their basis.
- Tax method and scope per jurisdiction, book method, reporting currency and price source.
- Outputs: disposals by lot, rollforward, reconciliation with open items, raw-data export.
What to ask
- Trace one reported disposal back to its raw record.
- Show what happens to a deposit that matches no withdrawal, or two.
- Show where a fee paid in a third asset is booked, and how a closed period is corrected.
Compare quotes on the same source list, history and outputs, and ask who updates connectors when an exchange changes its API. Effort drivers are in fintech app development cost.
Red flags
- Transfers classified automatically with no review queue, or quantities stored as floats.
- Requests for trading or withdrawal permission, when reading needs read-only keys; see API key security.
- Tax-ready claims that name no method or scope, or advice on which method lowers your tax, which belongs with a qualified adviser.
Related guide: Wealth management software development.
Frequently asked questions
Is crypto accounting software the same as tax software for crypto?
Not quite. Tax software applies one country's rules to produce figures for a return, while accounting software also keeps book values, reconciliations and an audit trail. Both rest on the same ledger and lots.
Which cost basis method should my software use?
The rules where you report decide, and some also set the scope, such as per wallet or account in the US from 1 January 2025. Keep the method configurable, label it on every report and ask a qualified tax adviser.
Can I build on exchange CSV exports instead of APIs?
Yes, as one source, if each file is kept unchanged with its download date and checked for trades, fees and transfers in every product in scope.
How often should crypto ledger reconciliation run?
At every period end at least, and ideally after every sync, while a difference is still easy to trace. Mark affected totals provisional until it is explained.
Sources
- Binance Spot API documentation: REST API, Account trade list (myTrades) (opens in a new tab)
- Binance Wallet API: Capital (deposit and withdrawal history) (opens in a new tab)
- Kraken API reference: Get Ledgers Info (opens in a new tab)
- ethereum.org: JSON-RPC API (eth_getBalance, eth_getTransactionReceipt), last updated 28 June 2026 (opens in a new tab)
- IRS Revenue Procedure 2024-28: allocating digital asset basis to wallets and accounts (opens in a new tab)
- IRS: Instructions for Form 1099-DA (2026), updated 30 April 2026 (opens in a new tab)
- HMRC Cryptoassets Manual: CRYPTO22200, pooling (updated 28 November 2025) (opens in a new tab)
- FASB Accounting Standards Update 2023-08: Crypto Assets (Subtopic 350-60), December 2023 (opens in a new tab)
- IFRS Interpretations Committee agenda decision: Holdings of Cryptocurrencies, June 2019 (opens in a new tab)
- Capital Markets Law No. 6362, consolidated text, Article 99/A (Turkish) (opens in a new tab)
This guide is general information about software and markets, not investment, legal or tax advice. Automated trading can lose money, past or backtested performance does not guarantee future results, and the rules that apply depend on your jurisdiction and your exchange's terms. Sources, checks and corrections: see the editorial policy.