🔗 Decentralized Finance Guide

Master
DeFi Accounting

LP tokens, yield farming, staking rewards, impermanent loss-DeFi creates unique accounting challenges. This guide shows you how to handle them all.

Protocols Covered:
Uniswap Aave Compound Curve Lido +50 more
The Challenge

Why DeFi Accounting Is Complex

DeFi introduces accounting challenges that traditional crypto accounting doesn't address.

Multi-Token Positions

Single positions hold multiple assets that shift ratios continuously.

Continuous Accrual

Rewards and fees accrue every block, not at discrete intervals.

Position Lifecycles

Entry, modification, and exit all have distinct accounting treatments.

Cross-Protocol

Strategies span multiple protocols with nested positions.

Impermanent Loss

Hidden cost of liquidity provision that's hard to track and recognize.

Multi-Chain

Activity spans multiple networks requiring unified tracking.

Core DeFi

LP Token Accounting

Liquidity pool tokens represent ownership in DEX pools. Understanding the full lifecycle is essential for accurate accounting.

1

Deposit

  • Record disposal of deposited tokens
  • Recognize LP token receipt
  • Cost basis = Value of all deposited assets
2

Hold

  • Trading fees accrue to position
  • Token ratios shift with trades
  • Track impermanent loss
3

Withdraw

  • Calculate LP token cost basis
  • Record value of tokens received
  • Recognize total gain or loss

Example: Uniswap LP Position

Deposit
1 ETH @ $3,000
+
3,000 USDC @ $1.00
Cost Basis $6,000
Withdrawal (30 days later)
0.9 ETH @ $3,500
+
3,300 USDC @ $1.00
Received Value $6,450
+$450 Gain (incl. fees, net of IL)
Key Concept

Understanding Impermanent Loss

The hidden cost of liquidity provision that every DeFi accountant must track.

What Is Impermanent Loss?

The difference between the value of holding your tokens versus providing liquidity. IL occurs when token prices diverge from your deposit ratio.

IL = (Value if held) - (Value in LP)

For 50/50 Pools

When one token's price changes by factor k:

IL = 2 × √k / (1 + k) - 1

Accounting Treatment

Option 1: Realized at Withdrawal

Only recognize IL when exiting the position.

Option 2: Mark-to-Market

Recognize unrealized IL each period.

IL by Price Change

-0.6% 1.25x
-2.0% 1.5x
-5.7% 2x
-13.4% 3x
-20.0% 4x
-25.5% 5x

IL increases as price divergence grows. Fees may offset IL in active pools.

💰 Deposit Assets
🔄 Protocol
📈 Base APY
🎁 Bonus Tokens
🏛️ Governance
💱 Trading Fees
Revenue Streams

Yield Farming Accounting

Yield farming generates multiple reward types, each requiring distinct accounting treatment.

Recognition Timing

When Claimed

Recognize income at the moment rewards are claimed to your wallet.

Simplest
When Vested

Recognize when rewards become transferable, regardless of claim.

Common
As Earned

Continuous recognition as rewards accrue block-by-block.

Most Accurate
⚠️

Tax Treatment: Most jurisdictions treat yield as ordinary income at fair market value when received.

Proof of Stake

Staking Rewards Accounting

Validator and delegator rewards from proof-of-stake networks.

ETH Staking

Beacon chain validator rewards, MEV, and tips.

  • Consensus layer rewards
  • Execution layer tips
  • MEV rewards

SOL Staking

Validator delegation rewards on Solana.

  • Epoch rewards
  • Validator commission
  • Inflation rewards

DOT Nominating

Polkadot nomination pool rewards.

  • Era payouts
  • Validator selection
  • Unbonding periods

Liquid Staking

stETH, rETH, and other liquid staking derivatives.

  • Rebasing vs non-rebasing
  • Exchange rate changes
  • Wrapper tokens

What to Track

📊 Reward amounts
Receipt timestamps
💵 Fair market value
📝 Cost basis creation
Protocols

Lending Protocol Accounting

Track supply, borrow, and interest across Aave, Compound, and other lending protocols.

Supplying Assets

  1. Transfer assets to protocol
  2. Receive interest-bearing tokens (aTokens, cTokens)
  3. Track interest accrual continuously

Interest Recognition

  • Daily accrual - Most accurate
  • Claim-based - Simplest
  • Periodic - Monthly/quarterly

Borrowing

  1. Record liability when borrowing
  2. Track collateral positions
  3. Recognize interest expense
Supply 1,000 USDC 1,000 aUSDC
Interest Accrues +5.2% APY
Borrow Collateral: 1 ETH Borrow: 2,000 DAI
Digital Collectibles

NFT Accounting

Treatment varies based on your role: trader, collector, or creator.

📈

Trader

Classification: Inventory

  • Mark-to-market valuation
  • Ordinary income on sales
  • Frequent transaction volume
🖼️

Collector

Classification: Intangible Asset

  • Historical cost basis
  • Capital gains on sales
  • Impairment testing
🎨

Creator

Classification: Revenue

  • Initial sale as income
  • Royalty income recognition
  • Platform fee deductions

Cost Basis Components

Purchase Price +
Gas Costs +
Platform Fees =
Total Cost Basis
Infrastructure

Multi-Chain Tracking

DeFi activity spans multiple networks. Unified tracking is essential.

Ethereum
Polygon
Arbitrum
Optimism
Avalanche
BSC
Base
Solana
🌉

Bridge Matching

Match cross-chain transfers automatically

Gas Tracking

Chain-specific gas costs in native tokens

📊

Unified Reporting

Consolidated view across all chains

Automate Your DeFi Accounting

Coincile handles all major DeFi protocols with automatic position tracking, reward recognition, and impermanent loss calculations.

  • 50+ protocol integrations
  • Automatic IL calculations
  • Multi-chain support
  • Reward tracking