cost-basis-engine
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 |
More from agiprolabs/claude-trading-skills
pandas-ta
Technical analysis with 130+ indicators using pandas-ta for crypto market data
107risk-management
Portfolio-level risk controls, drawdown management, exposure limits, and circuit breakers for crypto trading
76feature-engineering
Feature construction from market data for ML trading models including price, volume, on-chain, and microstructure features
76trading-visualization
Professional trading charts including candlesticks, equity curves, drawdowns, correlation heatmaps, and return distributions
76signal-classification
ML trading signal classifiers using XGBoost and LightGBM with walk-forward validation, SHAP feature importance, and threshold optimization
73market-microstructure
DEX orderflow analysis, trade classification, buyer/seller pressure, and microstructure signals for Solana tokens
73