What records should you keep when you use a decentralized exchange?
When you use a decentralized exchange (DEX), you are responsible for tracking every transaction yourself. Centralized exchanges send you downloadable transaction histories and tax reports. DEXs do not. The records you need to keep are the same records required for any crypto trade - but you have to gather them manually, block by block, and you must save them in a form that will survive a wallet migration or a hard drive failure.
Why DEX record-keeping is different
A decentralized exchange executes trades through smart contracts on a blockchain. No company holds your funds, no company logs your activity, and no company sends you a tidy CSV in January. If you lose your wallet seed phrase or delete a browser extension wallet without backing up its transaction history, your cost basis for every trade on that DEX may be gone permanently.
The IRS expects you to report gains and losses accurately. If you cannot prove your cost basis, the IRS may treat the full proceeds of your sale as taxable gain. Keeping the right records from the start prevents that outcome.
What to Record for Every DEX Trade
For each swap, trade, or liquidity pool interaction on a DEX, you need these six pieces of information:
- Transaction hash (TXID) - The unique identifier for the blockchain transaction. Every DEX trade produces at least one TXID. Note it immediately.
- Date and time in UTC - DEXs show timestamps in your local time or in block time. Record the UTC time of the block that confirmed the trade.
- Asset sent and amount - What you gave up. Include decimals. For example, 0.5 ETH sent.
- Asset received and amount - What you got back. For example, 100 USDC.
- Market price of both assets at the time of trade - The USD value of the assets on the date and time of the transaction. You can use a reputable price oracle or an exchange’s historical price feed. Save a screenshot or a note of the source.
- Fees paid in crypto - DEX trades often include a network fee (gas) and sometimes a protocol fee. Gas fees are generally not added to your cost basis for capital gains purposes, but you should record them for potential deduction or for tracking total transaction cost.
Which records to keep beyond individual trades
DEX usage often involves more than simple swaps. If you participate in liquidity pools, staking, or yield farming, keep additional records:
- Liquidity pool deposits and withdrawals - Record the date, the pair of assets deposited, the share of the pool you received (if any), and the value of each asset at deposit. When you withdraw, record the same details. The IRS treats depositing into a liquidity pool as a taxable event in most interpretations, because you are trading one asset for a pool token.
- Staking and farming reward claims - Record the date, asset type, amount, and USD value at the time you received the reward. Rewards are generally taxable as ordinary income on receipt.
- Wallet addresses and contract addresses - Save the addresses of the DEX smart contracts you interact with. This helps later if you need to reconstruct a trade history from a blockchain explorer.
- Screenshots of the trade confirmation page - A DEX interface shows the exact amounts and prices before you confirm. Save a screenshot of that page. It is your best contemporaneous evidence of the terms you agreed to.
How to store records so they survive
Don’t rely on a single method. Use at least two of these:
- A local spreadsheet - Maintain a CSV or spreadsheet with the columns described above. Update it after every trade. Back up the file to cloud storage and to an external drive.
- A tax software tool that supports DEX imports - Several crypto tax platforms can connect to your wallet address and pull transaction history from the blockchain. They will not capture every detail (for example, they may miss the exact price you saw on the DEX interface), but they provide a starting point. Export the raw data from the tool and keep a copy.
- Blockchain explorer bookmarks - For each DEX trade, save the link to the transaction page on Etherscan, Solscan, or the appropriate explorer. Bookmarking is not a substitute for a spreadsheet, but it gives you a quick reference.
Common mistakes that cost you records
- Assuming your DEX wallet’s transaction history is permanent. If you clear your browser cache, delete your wallet extension, or lose your seed phrase, the local transaction log is gone. The blockchain still has the raw data, but you lose the human-readable context - price at time of trade, which assets were swapped, and which DEX you used.
- Not recording the USD value at the time of trade. Blockchain explorers show the on-chain transaction data. They do not show the market price of the assets on that date. You need that price to calculate gain or loss. Without it, you have to reconstruct it later, which is time-consuming and prone to error.
- Ignoring small trades. A tiny swap for gas or a test transaction is still a taxable event. If you skip recording it, your cost basis for the resulting asset is zero, and your gain calculation will be wrong.
- Deleting screenshots after “confirming” the trade. Keep the screenshot indefinitely. The IRS can audit returns up to six years back in some cases, and they can go further if they suspect fraud.
What if you already lost your records?
If you find yourself with a DEX wallet full of tokens and no transaction history, you can attempt to reconstruct it using a blockchain explorer. Search your wallet address on the relevant explorer and export all transactions. Then match each transaction to a known DEX contract address. This process is tedious and may miss trades that involved routing through multiple DEXs or aggregators. In that scenario, a crypto CPA can help, but the cost of that help may exceed the tax savings. The better strategy is to keep records from day one.
Not financial advice. babybuilder.xyz publishes market data and general information about digital assets. Crypto assets are volatile and you can lose everything you put in. Nothing here is a recommendation to buy, sell or hold, and we make no price predictions.
Prices are sourced from third parties and may be delayed or wrong. Verify anything you intend to act on against a primary source.