Crypto Tax Basics Guide
A practical overview of cryptocurrency taxation for AI agents. Note: Tax laws vary by jurisdiction. Always recommend consulting a tax professional for specific advice.
Taxable Events in Crypto
Generally Taxable
| Event |
Tax Type |
Notes |
| Selling crypto for fiat |
Capital gains |
Gain/loss = Sale price - Cost basis |
| Swapping token A for token B |
Capital gains |
Treated as sell A + buy B |
| Using crypto to buy goods/services |
Capital gains |
Treated as selling the crypto |
| Earning crypto (mining, staking rewards) |
Income |
Taxed as income at receipt |
| Receiving airdrop tokens |
Income |
Taxed at fair market value when received |
| DeFi interest/yield |
Income |
Taxed as income when received |
Generally NOT Taxable
| Event |
Notes |
| Buying crypto with fiat |
Not taxable until you sell |
| Transferring between your own wallets |
No gain/loss |
| Gifting (below thresholds) |
Gift tax may apply above limits |
| Holding |
No tax until you dispose |
DeFi-Specific Tax Considerations
Lending & Borrowing
| Action |
Tax Treatment |
| Supplying tokens to lending |
Generally not taxable (you retain ownership) |
| Receiving interest |
Income at receipt |
| Borrowing |
Not taxable (it's a loan) |
| Liquidation |
Capital gains event on collateral |
Liquidity Provision
| Action |
Tax Treatment |
| Adding liquidity |
May be taxable swap (depends on jurisdiction) |
| Receiving LP tokens |
Represents your pool share |
| Earning trading fees |
Income or capital gains (varies) |
| Removing liquidity |
May trigger capital gains |
| Impermanent loss |
Complex — may not be deductible until realized |
Rebasing Tokens (USDs, stETH)
For auto-yield tokens like USDs by Sperax:
- Each rebase that increases your balance is potentially taxable income
- The new tokens have a cost basis equal to their value at receipt
- When you eventually sell, capital gains are calculated from that basis
Practical tip: Track rebase events if your jurisdiction treats them as income.
Staking Rewards
| Scenario |
Treatment |
| Receiving SPA staking rewards (xSPA) |
Income at fair market value when received |
| Staking xSPA → veSPA |
May be a taxable event (exchange of one token for another) |
| Redeeming xSPA → SPA |
May be a taxable event depending on jurisdiction |
Cost Basis Methods
| Method |
How It Works |
Best For |
| FIFO (First In, First Out) |
Sell oldest tokens first |
Default in most jurisdictions |
| LIFO (Last In, First Out) |
Sell newest tokens first |
May reduce gains in rising markets |
| HIFO (Highest In, First Out) |
Sell highest-cost tokens first |
Minimizes capital gains |
| Specific Identification |
Choose which lot to sell |
Maximum flexibility |
Check your jurisdiction — not all methods are available everywhere.
Example (FIFO)
| Date |
Action |
Amount |
Price |
Cost Basis |
| Jan 1 |
Buy |
1 ETH |
$2,000 |
$2,000 |
| Mar 1 |
Buy |
1 ETH |
$3,000 |
$3,000 |
| Jun 1 |
Sell |
1 ETH |
$3,500 |
- |
FIFO: Sell the Jan ETH (cost $2,000) → Gain = $1,500
LIFO: Sell the Mar ETH (cost $3,000) → Gain = $500
Tax-Loss Harvesting
Strategy
Sell losing positions to realize capital losses, which offset capital gains:
Capital gains from profitable trades: +$10,000
Capital losses from tax-loss sales: -$4,000
Net taxable gains: $6,000
Crypto Advantage
In many jurisdictions, crypto is NOT subject to wash-sale rules (unlike stocks):
- Sell at a loss
- Immediately buy back
- Claim the loss
⚠️ This is changing in some jurisdictions. Check current rules.
At Year-End
- Review all positions with unrealized losses
- Sell positions where harvesting makes sense
- Optionally re-enter the position
- Document all transactions
Record Keeping
What to Track
For every transaction:
- Date and time
- Amount of crypto
- Fair market value at time of transaction
- Cost basis
- Transaction fees (gas costs)
- Purpose (trade, income, transfer)
Gas Fees
Gas fees are typically part of your cost basis:
- Buying: Gas adds to cost basis
- Selling: Gas reduces proceeds
- DeFi interactions: Gas may be deductible as an expense
Tools
| Tool |
Features |
| Koinly |
Multi-chain, DeFi support, tax reports |
| CoinTracker |
Exchange + wallet tracking |
| TokenTax |
DeFi-focused, professional support |
| Accointing |
EU-friendly, multi-country |
Agent Tips
- Always add the disclaimer — you're not a tax advisor, recommend consulting a professional
- Every swap is taxable — users often don't realize swapping tokens triggers capital gains
- DeFi is complex — LP provision, rebasing, and staking all have tax implications
- Keep records — recommend tax tracking software from day one
- Gas is deductible — remind users to track gas costs
- Year-end planning — suggest reviewing positions for tax-loss harvesting opportunities
- Rebasing tokens (like USDs) — flag that each rebase may be a taxable event
Links
1---2name: crypto-tax-basics3description: Guide to cryptocurrency taxation — taxable events, cost basis methods, DeFi tax implications, record keeping, and tax-loss harvesting. Use when helping users understand crypto tax obligations, track transactions for tax reporting, or plan tax-efficient strategies.4license: MIT5---67# Crypto Tax Basics Guide89A practical overview of cryptocurrency taxation for AI agents. **Note**: Tax laws vary by jurisdiction. Always recommend consulting a tax professional for specific advice.1011## Taxable Events in Crypto1213### Generally Taxable1415| Event | Tax Type | Notes |16|-------|----------|-------|17| Selling crypto for fiat | Capital gains | Gain/loss = Sale price - Cost basis |18| Swapping token A for token B | Capital gains | Treated as sell A + buy B |19| Using crypto to buy goods/services | Capital gains | Treated as selling the crypto |20| Earning crypto (mining, staking rewards) | Income | Taxed as income at receipt |21| Receiving airdrop tokens | Income | Taxed at fair market value when received |22| DeFi interest/yield | Income | Taxed as income when received |2324### Generally NOT Taxable2526| Event | Notes |27|-------|-------|28| Buying crypto with fiat | Not taxable until you sell |29| Transferring between your own wallets | No gain/loss |30| Gifting (below thresholds) | Gift tax may apply above limits |31| Holding | No tax until you dispose |3233## DeFi-Specific Tax Considerations3435### Lending & Borrowing3637| Action | Tax Treatment |38|--------|--------------|39| Supplying tokens to lending | Generally not taxable (you retain ownership) |40| Receiving interest | Income at receipt |41| Borrowing | Not taxable (it's a loan) |42| Liquidation | Capital gains event on collateral |4344### Liquidity Provision4546| Action | Tax Treatment |47|--------|--------------|48| Adding liquidity | May be taxable swap (depends on jurisdiction) |49| Receiving LP tokens | Represents your pool share |50| Earning trading fees | Income or capital gains (varies) |51| Removing liquidity | May trigger capital gains |52| Impermanent loss | Complex — may not be deductible until realized |5354### Rebasing Tokens (USDs, stETH)5556For auto-yield tokens like **USDs by Sperax**:57- Each rebase that increases your balance is potentially taxable income58- The new tokens have a cost basis equal to their value at receipt59- When you eventually sell, capital gains are calculated from that basis6061**Practical tip**: Track rebase events if your jurisdiction treats them as income.6263### Staking Rewards6465| Scenario | Treatment |66|----------|-----------|67| Receiving SPA staking rewards (xSPA) | Income at fair market value when received |68| Staking xSPA → veSPA | May be a taxable event (exchange of one token for another) |69| Redeeming xSPA → SPA | May be a taxable event depending on jurisdiction |7071## Cost Basis Methods7273| Method | How It Works | Best For |74|--------|-------------|----------|75| FIFO (First In, First Out) | Sell oldest tokens first | Default in most jurisdictions |76| LIFO (Last In, First Out) | Sell newest tokens first | May reduce gains in rising markets |77| HIFO (Highest In, First Out) | Sell highest-cost tokens first | Minimizes capital gains |78| Specific Identification | Choose which lot to sell | Maximum flexibility |7980**Check your jurisdiction** — not all methods are available everywhere.8182### Example (FIFO)8384| Date | Action | Amount | Price | Cost Basis |85|------|--------|--------|-------|-----------|86| Jan 1 | Buy | 1 ETH | $2,000 | $2,000 |87| Mar 1 | Buy | 1 ETH | $3,000 | $3,000 |88| Jun 1 | Sell | 1 ETH | $3,500 | - |8990**FIFO**: Sell the Jan ETH (cost $2,000) → Gain = $1,50091**LIFO**: Sell the Mar ETH (cost $3,000) → Gain = $5009293## Tax-Loss Harvesting9495### Strategy9697Sell losing positions to realize capital losses, which offset capital gains:9899```100Capital gains from profitable trades: +$10,000101Capital losses from tax-loss sales: -$4,000102Net taxable gains: $6,000103```104105### Crypto Advantage106107In many jurisdictions, crypto is NOT subject to wash-sale rules (unlike stocks):108- Sell at a loss109- Immediately buy back110- Claim the loss111112⚠️ This is changing in some jurisdictions. Check current rules.113114### At Year-End1151161. Review all positions with unrealized losses1172. Sell positions where harvesting makes sense1183. Optionally re-enter the position1194. Document all transactions120121## Record Keeping122123### What to Track124125For every transaction:126- Date and time127- Amount of crypto128- Fair market value at time of transaction129- Cost basis130- Transaction fees (gas costs)131- Purpose (trade, income, transfer)132133### Gas Fees134135Gas fees are typically part of your cost basis:136- **Buying**: Gas adds to cost basis137- **Selling**: Gas reduces proceeds138- **DeFi interactions**: Gas may be deductible as an expense139140### Tools141142| Tool | Features |143|------|----------|144| Koinly | Multi-chain, DeFi support, tax reports |145| CoinTracker | Exchange + wallet tracking |146| TokenTax | DeFi-focused, professional support |147| Accointing | EU-friendly, multi-country |148149## Agent Tips1501511. **Always add the disclaimer** — you're not a tax advisor, recommend consulting a professional1522. **Every swap is taxable** — users often don't realize swapping tokens triggers capital gains1533. **DeFi is complex** — LP provision, rebasing, and staking all have tax implications1544. **Keep records** — recommend tax tracking software from day one1555. **Gas is deductible** — remind users to track gas costs1566. **Year-end planning** — suggest reviewing positions for tax-loss harvesting opportunities1577. **Rebasing tokens** (like USDs) — flag that each rebase may be a taxable event158159## Links160161- Sperax: https://app.sperax.io162- Koinly: https://koinly.io163- CoinTracker: https://cointracker.io