---
title: "Wash-Sale Window Guard"
method: POST
path: "/v1/tools/compute_wash_sale_window_guard"
tags: ["wash-sale", "section-1091", "tax-lot", "window", "disallowed-loss", "ira-trap", "carryforward", "wealthtech", "zero network", "zero-PII"]
---

# Wash-Sale Window Guard

`POST /v1/tools/compute_wash_sale_window_guard`

## Request

- Base URL: `https://ainumbers.co`
- URL: `https://ainumbers.co/v1/tools/compute_wash_sale_window_guard`
- Auth: none declared

Deterministic wash-sale window arithmetic over caller-declared synthetic inputs: the declared 61-day acquisition window (sale date minus 30 days through sale date plus 30 days, inclusive) is applied to a declared lot sale and a declared replacement-purchase list; the node totals the disallowed loss at 2dp half-up, flags a replacement account declared tax-deferred inside the window, and raises a basis-carryforward flag on the flagged taxable path. Arithmetic of a named rule only — never advice, never an optimizer. Zero storage, zero network, no runtime clock.

**Tool URL:** https://ainumbers.co/chaingraph/art-687-wash-sale-window-guard.html
**AP2/Policy Mandate export:** yes

## Request body

- object
  - `sale` object, required: declared lot sale with lot_id, sale_date, realized_loss
  - `replacement_purchases` unknown[], required: declared replacement purchases, each with date and account_type
    - unknown

## Response `200`

Successful tool execution result

- object
  - `window_start` string, required: Sale date minus 30 days, ISO yyyy-mm-dd; window endpoint is inclusive.
  - `window_end` string, required: Sale date plus 30 days, ISO yyyy-mm-dd; window endpoint is inclusive.
  - `replacements_in_window` integer, required: Count of declared replacement purchases with dates inside the inclusive 61-day window.
  - `disallowed_loss` number, required: The declared realized loss rounded 2dp half-up when the window is non-empty, otherwise 0.
  - `ira_trap` boolean, required: True when an in-window replacement purchase is declared in a tax-deferred account.
  - `trace` string, required: Human-readable restatement of the declared arithmetic.
  - `overall` 'WASH_SALE_FLAGGED' | 'WASH_SALE_CLEAR', required: Sign-of-arithmetic verdict over the declared window arithmetic only.
  - `warnings` string[]: Conditional warning flags mirrored into the payload; present only when one fired (WSG_IRA_TRAP).

---

[API](https://skmtc.dev/ainumbers/apis/ainumbers-co-fintech-intelligence-suite.md) · [All operations](https://skmtc.dev/ainumbers/apis/ainumbers-co-fintech-intelligence-suite/llms.txt) · [OpenAPI document](https://skmtc.dev/ainumbers/apis/ainumbers-co-fintech-intelligence-suite/revisions/b462e4f5bb28?raw)
