Skip to the article

Crypto markets, protocols and policy

How to Record DeFi Swaps by Chain for Tax Reporting

Record DeFi swaps for crypto taxes with a per-trade ledger of hashes, chains, UTC times, token amounts, fiat values and gas, reconciled to explorer exports.

The CryptoWeek Editors5 min read

How to Record DeFi Swaps by Chain for Tax Reporting

To keep DeFi swaps usable for tax reporting, record each trade’s chain, UTC time, transaction hash, tokens and amounts in and out, their fiat values, gas, wallet and platform, then reconcile the ledger against explorer exports.

  • Capture each swap’s transaction details and fiat values at the time it happened.
  • Export each wallet address separately on every chain it used.
  • Reconcile imports, failed transactions, approvals and cross-chain activity regularly.

Use the checklist below after each trading session or monthly, while the transactions are easy to match to your wallets. The result should be a per-swap ledger your tax tool or accountant can work from.

  • UTC timestamp: Establishes when the swap occurred and helps match it to the explorer record.
  • Chain: Identifies which network’s transaction history to check.
  • Transaction hash: Gives a direct reference for verifying the on-chain event.
  • Token and amount in: Records the asset disposed of and how much entered the swap.
  • Token and amount out: Records the asset received and its quantity.
  • Fiat value of each: Captures the value of both sides at the transaction time, using a consistent currency and valuation method.
  • Gas in native token and fiat: Separates the network fee from the swapped amounts and records its value.
  • Wallet address: Shows which address made the transaction and supports a complete per-address export.
  • Platform used: Identifies the interface or aggregator involved, such as KyberSwap.

How do I build a complete DeFi swap ledger?

A complete DeFi swap ledger pairs each trade’s on-chain identity with its amounts, values and costs. For a KyberSwap trade, record the route’s resulting transaction hash and the actual tokens and amounts transferred; the aggregator finds routes across supported liquidity sources and networks, while the chain records the transaction.

KyberSwap’s KNC token adds background on the platform associated with some trades. Keep that context separate from the swap’s transaction evidence, which is the hash, chain and token movement.

Start with one row per transaction, not one row per trading session. If a transaction has multiple token movements, preserve the relevant in and out amounts for that swap rather than collapsing them into a daily net figure. Keep the timestamp in UTC and retain the wallet address even if you already group records by wallet in your tax software.

For each amount, keep the unit as well as the fiat value. Record gas in the chain’s native token and its fiat value separately. This makes the cost visible without mistaking it for a token received through the swap.

How do I export DeFi activity from each chain?

Export each address from each chain separately, because block explorers show network-specific histories. For Ethereum, Arbitrum and Base, use Etherscan, Arbiscan and BaseScan respectively, and save the address history CSVs alongside the ledger.

Compare the CSVs with your tax tool’s imports. Include the normal transaction list as well as token-transfer data: a reverted swap can consume gas while moving no tokens, so it may be absent from token-transfer exports. Find it in the normal transaction list, mark it as reverted, and record the gas cost with no swap amounts.

Say you review an address that traded on Arbitrum. First, export its Arbiscan history; the state is a saved chain-specific file. Next, match each swap hash to the ledger and add missing amounts or values; the state is a ledger tied to explorer records. Then inspect the normal transaction list for reverted attempts and add any gas-only entries; the state includes costs that token-transfer data missed.

Tag token approvals as gas-only costs, not trades. An approval authorizes a contract to use tokens; it is distinct from the later swap. For a cross-chain swap, record both the source-chain and destination-chain hashes, then link the two rows with a shared note or reference. That leaves evidence for both sides of the movement.

Tag ETH-to-WETH wraps separately from swaps. Their tax treatment varies by country, so preserve the wrap transaction and its amounts for review instead of deciding that it is taxable or non-taxable in the ledger.

The ledger is ready for handoff when every address and chain has been exported, each trade can be matched to its hash, and the fiat values and gas fields are populated or clearly marked for follow-up. The tax tool depends on that complete transaction set; without it, an import can omit reverted gas costs or activity on another chain. Reconcile the tool’s import against the explorer CSVs each month and resolve mismatches while the activity is recent.

Related

Is a crypto-to-crypto swap taxable?

A crypto-to-crypto swap can be a disposal for tax purposes. The IRS treats crypto as property under Notice 2014-21, and HMRC treats exchanging one cryptoasset for another as a disposal; treatment depends on the applicable jurisdiction, so keep the transaction record without assuming a universal result.

Which crypto tax software reads DeFi wallets?

Crypto tax software needs to support the chains and wallet imports you use, or accept the relevant explorer CSVs. Check that its import includes swaps, token transfers and normal transactions, then compare the imported activity with your own exports.

How long should crypto tax records be kept?

Keep crypto tax records for the retention period required in the relevant jurisdiction. The period can depend on local rules and circumstances, so retain the hashes, exports and valuation evidence with the ledger until you have confirmed the applicable requirement.