← ClaudeAtlas

cost-basis-enginelisted

Multi-method cost basis computation including specific identification, FIFO, LIFO, HIFO, and proportional average cost with partial sell handling
Serennity007/claude-trading-skills-67 · ★ 0 · AI & Automation · score 75
Install: claude install-skill Serennity007/claude-trading-skills-67
# 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 | | **Specific ID** | Trader selects which lots to sell | Maximum control, requires record-keeping | | **Average Cost** | Weighted average of all held lots | Simplicity, required in some jurisdictions | --- ## 1. FIFO (First-In, First-Out) Sell the oldest lots first. This is the default method in the US if no other method is elected. ```python def fifo_sell