ウォッシュセール検出
2025年の米国暗号資産税制における「仮装売買」を検出し、61日間の監視期間、損益不算入処理、安全な再参入までのカウントダウンを行い、税務上の損失を不当に計上することを防ぐSkill。
📜 元の英語説明(参考)
Wash sale detection under 2025 US crypto rules with 61-day window monitoring, disallowed loss tracking, and safe re-entry countdown
🇯🇵 日本人クリエイター向け解説
2025年の米国暗号資産税制における「仮装売買」を検出し、61日間の監視期間、損益不算入処理、安全な再参入までのカウントダウンを行い、税務上の損失を不当に計上することを防ぐSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o wash-sale-detection.zip https://jpskill.com/download/10454.zip && unzip -o wash-sale-detection.zip && rm wash-sale-detection.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/10454.zip -OutFile "$d\wash-sale-detection.zip"; Expand-Archive "$d\wash-sale-detection.zip" -DestinationPath $d -Force; ri "$d\wash-sale-detection.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
wash-sale-detection.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
wash-sale-detectionフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
洗い替え(Wash Sale)検出
現在の米国の暗号資産税制(2025年施行)に基づき、洗い替えを検出し、実現損失が発生した日から前後61日間の期間を監視し、損金不算入となった損失を調整後の取得価額で追跡し、安全な再参入までのカウントダウンを計算します。
免責事項: このスキルは情報分析のみを提供します。税務に関するアドバイスではありません。お客様の具体的な状況については、資格のある税務専門家または公認会計士にご相談ください。税法は複雑であり、暗号資産への洗い替えルールの適用は、個々の状況、IRS(内国歳入庁)のガイダンスの更新、および裁判所の判決によって異なる場合があります。
背景
2025年以前は、暗号資産は有価証券ではなく財産として分類されていたため、洗い替えルールは適用されませんでした。インフラ投資雇用法およびその後のIRSの規則制定により、2025年1月1日からデジタル資産に洗い替え処理が適用されることになりました。
IRC(内国歳入法)第1091条(デジタル資産向けに修正)に基づき、暗号資産を損失で売却または処分し、実質的に同一の資産を61日間の期間(売却の30日前から売却の30日後まで)に取得した場合、その損失は税務上の目的で損金不算入となります。損金不算入となった損失は、代替ポジションの取得価額に加算されます。
主要な概念
61日間の期間
Day -30 ................. Day 0 ................. Day +30
|--- 30 days before ---|--- sale day ---|--- 30 days after ---|
^ ^ ^
Window opens Loss realized Window closes
- Day 0: ポジションを実現損失で売却した日
- Days -30 to -1: この範囲での購入は、遡及的に洗い替えを発生させます
- Days +1 to +30: この範囲での購入は、将来的に洗い替えを発生させます
- この期間は、取引日ではなく暦日です
実質的に同一の資産
暗号資産の場合、「実質的に同一」とは一般的に同じトークンを意味します。損失でSOLを売却し、30日以内にSOLを購入することは洗い替えとなります。SOLを売却し、ETHを購入することは洗い替えではありません(これらは異なる資産です)。
精査される可能性のあるエッジケース:
- 同じトークンのラップ版とアンラップ版(例:SOL vs wSOL)
- 異なるチェーン上のトークン(例:Solana上のUSDC vs Ethereum上のUSDC)
- 同じ原資産を追跡するデリバティブトークン(例:stSOLとSOL)
損金不算入の損失と取得価額の調整
洗い替えが発生した場合:
- 実現損失は損金不算入となります — 当該課税年度に控除することはできません
- 損金不算入の損失は、代替ポジションの取得価額に加算されます
- 元のポジションの保有期間が代替ポジションに引き継がれる場合があります
例:
- 10 SOLを1つあたり100ドルで購入(取得価額:1,000ドル)
- 10 SOLを1つあたり80ドルで売却(売却代金:800ドル、損失:200ドル)
- 15日以内に10 SOLを85ドルで購入(洗い替えが発生)
- 新しい取得価額:850ドル + 200ドルの損金不算入の損失 = 1,050ドル
- 200ドルの損失は消えたわけではありません — 新しいポジションに繰り延べられます
前提条件
- Python 3.10+
- 外部依存関係は不要(標準ライブラリのみ)
- 次の情報を含むCSVまたは構造化された形式の取引履歴データ:date、action(buy/sell)、token、quantity、price、proceeds、cost basis
機能
- 洗い替えスキャン — 取引履歴を分析し、すべての洗い替え違反にフラグを立てます
- 61日間の期間の監視 — 最近の損失を生み出した売却について、オープンな期間を追跡します
- 損金不算入の損失の計算 — 洗い替えごとの正確な損金不算入額を計算します
- 取得価額の調整の追跡 — 代替ポジションの調整後の取得価額を表示します
- 安全な再参入までのカウントダウン — 損失で売却されたトークンごとに、安全に再参入できるまでの残り日数を表示します
- 自動化の危険性の検出 — 誤って洗い替えを発生させる可能性のあるコピートレードシステムまたはボット戦略にフラグを立てます
クイックスタート
from datetime import date
# Define your trade history
trades = [
{"date": date(2025, 3, 1), "action": "buy", "token": "SOL", "qty": 10, "price": 100.0},
{"date": date(2025, 3, 15), "action": "sell", "token": "SOL", "qty": 10, "price": 80.0},
{"date": date(2025, 3, 25), "action": "buy", "token": "SOL", "qty": 10, "price": 85.0},
]
# Check for wash sales
from scripts.wash_sale_scanner import WashSaleScanner
scanner = WashSaleScanner(trades)
results = scanner.scan()
for ws in results.wash_sales:
print(f"WASH SALE: {ws.token} — Loss ${ws.disallowed_loss:.2f} disallowed")
print(f" Sale: {ws.sale_date} | Re-entry: {ws.replacement_date}")
print(f" Adjusted basis: ${ws.adjusted_basis:.2f}")
# Check safe re-entry countdowns
for countdown in results.countdowns:
print(f"{countdown.token}: {countdown.days_remaining} days until safe re-entry")
ユースケース
1. 年末の税務レビュー
税務申告を行う前に、1年間の取引活動全体をスキャンして、すべての洗い替えを特定します。損金不算入の損失の合計と調整後の取得価額を示すレポートを生成します。
2. リアルタイム監視
買い注文を出す前に、トークンに最近の損失による洗い替え期間が開いているかどうかを確認します。カウントダウンが終了するまで待って、不注意による洗い替えを回避します。
3. コピートレードとボットの監査
自動取引システム(コピートレードボット、DCAボット、グリッドボット)は、同じトークンを繰り返し売買するため、洗い替えを頻繁に発生させます。ボットの取引エクスポートでこのスキャナーを実行して、税務上の影響を定量化します。
4. 税務上の損失の実現の調整
税務上の損失の実現戦略を実行する場合は、安全な再参入までのカウントダウンを使用して、ポジションに再参入できる時期を計画します。市場へのエクスポージャーを維持したい場合は、30日間の期間中に非同一資産に交換します。
5. 複数アカウントの洗い替え検出
洗い替えルールは、同じ納税者が管理するすべてのアカウントに適用されます。複数の取引所またはウォレットでSOLを取引する場合は、スキャンする前に取引履歴を集計します。
エッジケースと自動化の危険性
DCAボットとグリッドボット
トークンを毎週購入するドルコスト平均法ボットは、同じ期間中にトークンが損失で売却された場合、ほぼ確実に洗い替えを発生させます。
(原文がここで切り詰められています)
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Wash Sale Detection
Detect wash sales under current US crypto tax rules (effective 2025), monitor the 61-day window around realized losses, track disallowed losses with basis adjustments, and compute safe re-entry countdowns.
Disclaimer: This skill provides informational analysis only. It is NOT tax advice. Consult a qualified tax professional or CPA for guidance on your specific situation. Tax law is complex, and the application of wash sale rules to cryptocurrency may vary based on individual circumstances, IRS guidance updates, and court rulings.
Background
Before 2025, cryptocurrency was not subject to the wash sale rule because digital assets were classified as property rather than securities. The Infrastructure Investment and Jobs Act and subsequent IRS rulemaking extended wash sale treatment to digital assets beginning January 1, 2025.
Under IRC Section 1091 (as amended for digital assets), if you sell or dispose of a cryptocurrency at a loss and acquire a substantially identical asset within a 61-day window (30 days before the sale through 30 days after), the loss is disallowed for tax purposes. The disallowed loss is added to the cost basis of the replacement position.
Key Concepts
The 61-Day Window
Day -30 ................. Day 0 ................. Day +30
|--- 30 days before ---|--- sale day ---|--- 30 days after ---|
^ ^ ^
Window opens Loss realized Window closes
- Day 0: The day you sell a position at a realized loss
- Days -30 to -1: Purchases in this range trigger a wash sale retroactively
- Days +1 to +30: Purchases in this range trigger a wash sale prospectively
- The window is calendar days, not trading days
Substantially Identical Assets
For crypto, "substantially identical" generally means the same token. Selling SOL at a loss and buying SOL within 30 days is a wash sale. Selling SOL and buying ETH is not (they are different assets).
Edge cases that may be scrutinized:
- Wrapped vs unwrapped versions of the same token (e.g., SOL vs wSOL)
- Tokens across different chains (e.g., USDC on Solana vs USDC on Ethereum)
- Derivative tokens that track the same underlying (e.g., stSOL and SOL)
Disallowed Loss and Basis Adjustment
When a wash sale occurs:
- The realized loss is disallowed — you cannot deduct it in the current tax year
- The disallowed loss is added to the cost basis of the replacement position
- The holding period of the original position may carry over to the replacement
Example:
- Buy 10 SOL at $100 each (cost basis: $1,000)
- Sell 10 SOL at $80 each (proceeds: $800, loss: $200)
- Buy 10 SOL at $85 within 15 days (wash sale triggered)
- New cost basis: $850 + $200 disallowed loss = $1,050
- The $200 loss is not gone — it is deferred into the new position
Prerequisites
- Python 3.10+
- No external dependencies required (standard library only)
- Trade history data in CSV or structured format with: date, action (buy/sell), token, quantity, price, proceeds, cost basis
Capabilities
- Wash Sale Scanning — Analyze a trade history and flag all wash sale violations
- 61-Day Window Monitoring — Track open windows for recent loss-generating sales
- Disallowed Loss Calculation — Compute the exact disallowed amount per wash sale
- Basis Adjustment Tracking — Show adjusted cost basis for replacement positions
- Safe Re-Entry Countdown — For each token sold at a loss, show days remaining until safe to re-enter
- Automation Hazard Detection — Flag copy-trade systems or bot strategies that may inadvertently trigger wash sales
Quick Start
from datetime import date
# Define your trade history
trades = [
{"date": date(2025, 3, 1), "action": "buy", "token": "SOL", "qty": 10, "price": 100.0},
{"date": date(2025, 3, 15), "action": "sell", "token": "SOL", "qty": 10, "price": 80.0},
{"date": date(2025, 3, 25), "action": "buy", "token": "SOL", "qty": 10, "price": 85.0},
]
# Check for wash sales
from scripts.wash_sale_scanner import WashSaleScanner
scanner = WashSaleScanner(trades)
results = scanner.scan()
for ws in results.wash_sales:
print(f"WASH SALE: {ws.token} — Loss ${ws.disallowed_loss:.2f} disallowed")
print(f" Sale: {ws.sale_date} | Re-entry: {ws.replacement_date}")
print(f" Adjusted basis: ${ws.adjusted_basis:.2f}")
# Check safe re-entry countdowns
for countdown in results.countdowns:
print(f"{countdown.token}: {countdown.days_remaining} days until safe re-entry")
Use Cases
1. End-of-Year Tax Review
Scan your full year of trading activity to identify all wash sales before filing taxes. Generate a report showing total disallowed losses and adjusted cost bases.
2. Real-Time Monitoring
Before placing a buy order, check whether the token has an open wash sale window from a recent loss. Avoid inadvertent wash sales by waiting for the countdown to expire.
3. Copy-Trade and Bot Audit
Automated trading systems (copy-trading bots, DCA bots, grid bots) frequently trigger wash sales because they buy and sell the same tokens repeatedly. Run this scanner on bot trade exports to quantify the tax impact.
4. Tax-Loss Harvesting Coordination
When executing a tax-loss harvesting strategy, use the safe re-entry countdown to plan when you can re-enter positions. Swap into a non-identical asset during the 30-day window if you want to maintain market exposure.
5. Multi-Account Wash Sale Detection
The wash sale rule applies across all accounts controlled by the same taxpayer. If you trade SOL on multiple exchanges or wallets, aggregate the trade history before scanning.
Edge Cases and Automation Hazards
DCA Bots and Grid Bots
Dollar-cost averaging bots that buy a token weekly will almost certainly trigger wash sales if the token is also sold at a loss during the same period. The scanner flags overlapping buy/sell patterns within the 61-day window.
Copy-Trading
If a copy-trade system sells a token at a loss and the leader re-enters within 30 days, your copied trades inherit the wash sale. There is no "I didn't place the trade" exception.
Partial Fills and Multiple Lots
When a sale at a loss is followed by multiple smaller purchases, the wash sale applies to each purchase up to the quantity of the loss-generating sale. The scanner handles partial matching.
Cross-Wallet Transfers
Transferring tokens to another wallet you control and selling there does not avoid the wash sale rule. The rule follows the taxpayer, not the account.
Safe Re-Entry Strategy
After selling a token at a loss:
- Wait 31 calendar days before repurchasing the same token
- During the waiting period, consider holding a non-identical substitute (e.g., sell SOL, hold ETH for exposure to crypto broadly)
- Use the countdown timer to know exactly when re-entry is safe
- Set calendar reminders for window expiration dates
Token: SOL
Sale Date: 2025-03-15
Loss: $200.00
Window Closes: 2025-04-14
Days Remaining: 12
Status: DO NOT BUY — wash sale window active
Basis Adjustment Walkthrough
Detailed step-by-step basis adjustment example:
TRADE 1: Buy 100 SOL @ $150.00 → Basis: $15,000.00
TRADE 2: Sell 100 SOL @ $120.00 → Proceeds: $12,000.00, Loss: $3,000.00
TRADE 3: Buy 100 SOL @ $125.00 → Basis before adjustment: $12,500.00
(within 30 days of Trade 2)
WASH SALE TRIGGERED:
Disallowed loss: $3,000.00
Adjusted basis: $12,500.00 + $3,000.00 = $15,500.00
Effective price: $155.00 per SOL (not $125.00)
Later sale at $160.00:
Proceeds: $16,000.00
Adj. basis: $15,500.00
Gain: $500.00 (not $3,500.00)
The $3,000 loss is recovered through the higher basis.
Files
References
references/planned_features.md— Wash sale rules in depth, 61-day window mechanics, basis adjustment examples, automation edge cases, IRS guidance references
Scripts
scripts/wash_sale_scanner.py— Complete wash sale scanner: loads trade history, identifies wash sales, computes disallowed losses and basis adjustments, shows safe re-entry countdowns. Run with--demofor example scenarios.
Limitations
- This tool implements a simplified interpretation of wash sale rules as applied to crypto
- "Substantially identical" determination for wrapped tokens and derivatives may require professional judgment
- The scanner does not handle options, futures, or other derivative instruments on crypto
- Multi-account detection requires you to aggregate trade data manually
- Rules may change as IRS issues further guidance on digital asset wash sales
- State tax rules may differ from federal treatment