$npx -y skills add agiprolabs/claude-trading-skills --skill tax-liability-trackingReal-time tax liability analysis for active crypto traders with proportional cost basis, gain classification, and tax-aware trading signals
| 1 | # Tax Liability Tracking |
| 2 | |
| 3 | Real-time tax liability analysis purpose-built for active Solana traders. Track proportional cost basis across partial sells, classify realized vs unrealized gains, project quarterly tax obligations, and surface tax-aware signals that feed back into trading decisions. |
| 4 | |
| 5 | ## Why This Matters |
| 6 | |
| 7 | Active crypto traders generate hundreds of taxable events per year. Without real-time tracking: |
| 8 | |
| 9 | - You do not know your actual after-tax P&L until year-end |
| 10 | - Partial sells (the "house money" play) create cost basis confusion |
| 11 | - Short-term vs long-term classification shifts your effective tax rate by 15-20% |
| 12 | - Tax-loss harvesting windows close without you noticing |
| 13 | - Quarterly estimated payments become guesswork |
| 14 | |
| 15 | This skill keeps a running tax ledger alongside your trading activity so every decision incorporates its tax consequence. |
| 16 | |
| 17 | ## Core Concepts |
| 18 | |
| 19 | ### Proportional Cost Basis for Partial Sells |
| 20 | |
| 21 | This is the most critical concept. When you sell a portion of a position, the cost basis splits proportionally — it does not shift to zero for the remaining tokens. |
| 22 | |
| 23 | **Example — The Accumulate / House-Money Play:** |
| 24 | |
| 25 | 1. **Buy**: 1,000 tokens at $1.00 each. Total cost basis = $1,000. |
| 26 | 2. **Partial sell**: Sell 800 tokens at $1.25 each. Proceeds = $1,000. |
| 27 | 3. **What happened**: |
| 28 | - The 800 sold tokens had proportional cost basis = 800 x $1.00 = $800 |
| 29 | - Realized gain on the sale = $1,000 - $800 = **$200** |
| 30 | - The remaining 200 tokens retain cost basis = 200 x $1.00 = **$200** |
| 31 | - The remaining tokens are NOT "free" — they carry their original per-unit cost |
| 32 | |
| 33 | **Common mistake**: Recording the partial sell as "capital recovered, remaining basis = $0." This understates the realized gain on the partial sell and overstates the gain when the remaining tokens are eventually sold. The total tax owed is the same either way, but the timing and classification (short-term vs long-term) can differ significantly. |
| 34 | |
| 35 | ### Gain Classification |
| 36 | |
| 37 | | Classification | Holding Period | US Federal Rate (2024) | |
| 38 | |---|---|---| |
| 39 | | Short-term capital gain | < 1 year | Ordinary income rate (10-37%) | |
| 40 | | Long-term capital gain | >= 1 year | 0%, 15%, or 20% | |
| 41 | |
| 42 | Each tax lot tracks its own acquisition date. Partial sells consume lots in the order specified by your accounting method (FIFO, LIFO, or specific identification). |
| 43 | |
| 44 | ### SOL-Denominated Trading with USD Reporting |
| 45 | |
| 46 | Solana traders typically think in SOL but US tax obligations are denominated in USD. Every taxable event requires: |
| 47 | |
| 48 | 1. **SOL price at acquisition** — establishes USD cost basis |
| 49 | 2. **SOL price at disposition** — establishes USD proceeds |
| 50 | 3. **Token price in SOL at both events** — converted to USD via SOL/USD rate |
| 51 | |
| 52 | The skill tracks SOL/USD rates at each event timestamp to compute USD-denominated gains. |
| 53 | |
| 54 | ### Realized vs Unrealized Gains |
| 55 | |
| 56 | - **Realized**: Position closed (fully or partially). Taxable event occurred. |
| 57 | - **Unrealized**: Position still open. No tax event yet, but contributes to estimated liability if you plan to close before year-end. |
| 58 | |
| 59 | The after-tax P&L view shows both, with unrealized gains marked at current estimated tax rates. |
| 60 | |
| 61 | ## Capabilities |
| 62 | |
| 63 | ### Tax Lot Tracking |
| 64 | - Record buys, sells, and token-to-token swaps as taxable events |
| 65 | - Maintain per-lot cost basis with acquisition date |
| 66 | - Support FIFO, LIFO, and specific identification accounting methods |
| 67 | - Handle partial sells with proportional cost basis allocation |
| 68 | |
| 69 | ### Gain Classification Engine |
| 70 | - Classify each realized gain as short-term or long-term |
| 71 | - Track days remaining until long-term threshold for each open lot |
| 72 | - Flag positions approaching the 1-year boundary |
| 73 | |
| 74 | ### Quarterly Tax Projection |
| 75 | - Estimate federal tax liability using progressive bracket rates |
| 76 | - Include state tax estimate (configurable rate) |
| 77 | - Project Q1-Q4 estimated payment amounts |
| 78 | - Track cumulative realized gains by quarter |
| 79 | |
| 80 | ### Tax-Aware Trading Signals |
| 81 | - **Long-term threshold alert**: "Position crosses long-term threshold in N days" |
| 82 | - **Profit-taking cost**: "Taking profit here triggers $X short-term liability" |
| 83 | - **Loss harvesting**: "You have $X in unrealized losses available to harvest" |
| 84 | - **Timing value**: "Selling now vs waiting 30 days saves $X in taxes" |
| 85 | - **Wash sale warning**: "Repurchasing within 30 days may trigger wash sale rules" |
| 86 | |
| 87 | ### After-Tax P&L View |
| 88 | - Standard trading P&L alongside estimated after-tax P&L |
| 89 | - Per-position breakdown of pre-tax and after-tax returns |
| 90 | - Running year-to-date tax liability total |
| 91 | |
| 92 | ## Prerequisites |
| 93 | |
| 94 | - Python 3.10+ |
| 95 | - No external dependencies for core tracking (stdlib only) |
| 96 | - Historical SOL/USD prices for accurate USD conversion |
| 97 | - Trade history in structured format (timestamp, side, token, amount, price) |
| 98 | |
| 99 | ## Quick Start |
| 100 | |
| 101 | ```python |
| 102 | from tax_tracker import |