DeFi, Accounting·

DeFi Accounting: How to Track Yields, Swaps, and LP Positions

DeFi transactions don't fit neatly into traditional accounting categories. This guide covers how to record yields, liquidity pools, swaps, and staking rewards for tax and compliance purposes.

DeFi Accounting: How to Track Yields, Swaps, and LP Positions

If you've ever tried to reconcile a month of DeFi activity in a spreadsheet, you know the problem. A single yield farming position can generate dozens of micro-transactions — reward claims, auto-compounds, rebalances — none of which map cleanly to traditional accounting categories.

This guide explains how to approach DeFi accounting in practice, whether you're a startup running treasury through DeFi or an individual with multiple positions.

Why DeFi is hard to account for

Traditional accounting assumes clear transactions: you buy something, you sell something, money moves from A to B. DeFi breaks that model in several ways:

  • Token swaps generate a disposal and an acquisition in a single transaction
  • Liquidity pool deposits involve giving up tokens in exchange for LP tokens — is that a trade? A deposit? It depends on your jurisdiction
  • Yield farming rewards may be taxable income the moment they're received, even if you haven't sold them
  • Impermanent loss is real economic loss but has no clear accounting treatment under most standards
  • Rebasing tokens (like stETH or OHM) change your balance without any visible transaction

Each of these needs to be recorded, categorized, and — eventually — reported to tax authorities.

Token swaps and DEX trades

Every swap on a DEX (Uniswap, SushiSwap, Curve, etc.) is a taxable event in most jurisdictions. You're disposing of one asset and acquiring another.

What to record:

  • Date and time of the swap
  • Amount and fair market value of the token you gave up
  • Amount and fair market value of the token you received
  • Gas fees paid (these may be deductible as transaction costs)
  • The DEX and chain used

Cost basis matters. If you acquired ETH at different prices over time, the cost basis method you use (FIFO, LIFO, HIFO) changes your tax liability. Pick a method and stick with it.

Liquidity pool accounting

Providing liquidity is where things get complicated. When you deposit tokens into a pool, you typically receive LP tokens in return. When you withdraw, the ratio of tokens you get back may differ from what you put in.

On deposit

Record the fair market value of tokens deposited and the LP tokens received. In most frameworks, this is treated as an exchange.

While in the pool

You may earn:

  • Trading fees — accrued continuously, reflected in the value of your LP tokens
  • Farming rewards — separate tokens (like CRV, SUSHI) distributed as incentives
  • Impermanent loss — if the price ratio of your deposited tokens changes

Farming rewards are generally treated as income at the time of receipt. Trading fees embedded in LP token value are typically recognized on withdrawal.

On withdrawal

When you remove liquidity, compare the fair market value of what you receive against your cost basis. The difference is your gain or loss, which includes impermanent loss.

Staking and restaking

Staking ETH (or other PoS tokens) and receiving rewards is generally taxable income. The question is when it becomes income:

  • At receipt: Most tax authorities (IRS, HMRC) treat staking rewards as income when you gain control of them
  • At sale: Some argue rewards should only be taxed when sold (this is contested)

With liquid staking (Lido, Rocket Pool), you receive a derivative token (stETH, rETH) that appreciates in value. The accounting treatment depends on whether your jurisdiction treats the initial stake as a disposal.

Restaking (EigenLayer and similar) adds another layer. You're staking an already-staked asset, creating a chain of derivative positions. Each layer needs separate tracking.

Yield farming and reward tokens

Yield farming typically generates two types of returns:

  1. Base yield from the protocol (interest, trading fees)
  2. Incentive tokens distributed by the protocol

Both may be taxable, but at different times and rates. Incentive tokens are usually income at receipt. Base yield may be recognized on withdrawal depending on the mechanism.

Auto-compounding vaults (Yearn, Beefy) add complexity: rewards are automatically reinvested, creating new cost basis events with each compound. If a vault compounds daily, that's 365 micro-transactions per year per position.

Practical approaches

Manual tracking (don't)

With more than a few DeFi positions, manual tracking in spreadsheets becomes unworkable. A single Curve gauge position with weekly claims and re-deposits generates hundreds of entries per year.

On-chain accounting tools

This is where purpose-built tools matter. Wag3s Ledger connects to 20+ blockchains and automatically categorizes DeFi transactions — swaps, LP deposits/withdrawals, staking rewards, and farming income — into standard accounting entries.

The AI categorization learns your patterns: if you regularly claim CRV rewards and swap them to USDC, the system recognizes the pattern and categorizes future transactions accordingly.

What to look for in a tool

  • Multi-chain support (your DeFi positions are probably on 3+ chains)
  • Protocol-specific parsing (a Uniswap V3 position is different from a Curve gauge)
  • Cost basis tracking across all positions
  • Export formats compatible with your accounting software (QuickBooks, Xero, SAP)
  • Tax report generation for your jurisdiction

Common mistakes

  1. Ignoring gas fees — they're deductible in most jurisdictions and add up fast
  2. Missing reward claims — if you claimed rewards but didn't record them, you have unreported income
  3. Wrong cost basis on LP withdrawals — you need to track what you put in, not just what you took out
  4. Treating impermanent loss as a tax deduction — it's generally only realized when you withdraw
  5. Forgetting about airdrops — many DeFi protocols airdrop governance tokens to LPs, and these are taxable

Where DeFi accounting is headed

Accounting standards for DeFi are still being written. The IFRS Foundation and FASB are both working on crypto asset guidance, but specific DeFi rules are likely years away. In the meantime, the practical approach is to:

  • Record everything on-chain (it's immutable — use it)
  • Apply the most defensible tax treatment for your jurisdiction
  • Keep clear documentation of your methodology
  • Use tools that can adapt as rules change

This article is for informational purposes only and does not constitute financial or tax advice. DeFi tax treatment varies by jurisdiction — consult a qualified professional for guidance specific to your situation.