cost-basis-engine

Installation
SKILL.md

Cost Basis Engine

Compute cost basis for crypto trades using multiple accounting methods and compare the resulting tax liability across methods. This skill handles the full complexity of on-chain activity: partial sells, token migrations, airdrops, staking rewards, LP entry/exit, and multi-hop swaps.

Disclaimer: This skill provides computational tools for informational purposes only. It does not constitute tax, legal, or financial advice. Consult a qualified tax professional for your specific situation. Tax law varies by jurisdiction and changes frequently.

Prerequisites

  • Python 3.10+
  • No external dependencies required (standard library only)
  • Trade history as a list of dicts or CSV with columns: date, action, token, quantity, price_usd, fee_usd

Methods Overview

Method Logic Best For
FIFO First lots purchased are sold first Simplicity, many jurisdictions' default
LIFO Last lots purchased are sold first Deferring gains when prices rise over time
HIFO Highest-cost lots are sold first Minimizing current tax liability
Related skills
Installs
48
GitHub Stars
20
First Seen
Mar 21, 2026