t+1-settlement-prep
You hand over a trade file. The skill computes the T+1 settlement date
for each row, walks the next 90 days of holidays + corporate actions,
and emits an exception report listing only the trades that need
operations attention before settlement.
This is the operations-desk workflow that runs at end of trading day,
between T and T+1. SEC moved US equities to T+1 in May 2024; the
margin for error on settlement is now one business day, not three.
A trade that crosses a long weekend or settles on a half-day session
can break cash forecasting if nobody flagged it.
When to invoke
- Operations says "prep tonight's trades for settlement" or "run T+1
checks on this blotter"
- Treasury asks "is cash going to be where it needs to be tomorrow"
- A long weekend is coming up (3-day weekend, July 4, Thanksgiving)
and ops wants visibility into which trades push into the following
week
- A corporate action calendar shows an ex-date inside the next two
business days and you want to know which trades are exposed
What you need
- A trade CSV with columns:
ticker, side (BUY/SELL/SHORT/COVER),
qty, trade_date (YYYY-MM-DD)
MASSIVE_API_KEY exported. Stocks Basic is enough; the three
endpoints this skill uses (/v1/marketstatus/upcoming,
/v3/reference/dividends, /v3/reference/splits) are all on the
free tier.
What this skill flags
Six categories. A trade can hit more than one.
Holiday adjacency (holiday_adjacency). T+1 lands on a US
equity-market holiday; settlement pushes to the next business day.
Operations needs to refund cash forecasts and notify treasury for
the adjusted date.
Weekend crossing (weekend_crossing). T+1 lands on a Saturday
or Sunday; settlement pushes to Monday. Treated as a separate flag
from holiday_adjacency because cash desks model them differently
(regular weekend vs irregular three-day weekend).
Short-sale locate (short_sale_locate). Side is SHORT. Reg
SHO requires a locate before the trade can settle. The skill cannot
read the prime broker's locate file, so this flag is a confirmation
prompt rather than a hard break.
Ex-dividend in window (ex_dividend_in_window). The ticker has
an ex-dividend date between trade_date and computed_settlement_date.
Under T+1, ex-date and record-date are the same day, so the buyer's
dividend entitlement turns on whether they purchased before the
ex-date. The skill computes the dollar impact (qty * cash_amount)
so operations can confirm the dividend allocation flag on the trade
ticket.
Corporate action overlap (corp_action_overlap). A split or
reverse split has an ex-date in the settlement window. DTCC handles
the share-count adjustment automatically, but the post-action
delivered quantity differs from the recorded trade quantity. Flagged
as informational so settlement and position-reporting teams aren't
surprised. Not a hard break.
Half-day settlement (half_day_settlement). Settlement date is
a US equity early-close session (Thanksgiving Friday, Christmas Eve,
July 3 when 7/4 falls on Saturday). DTCC's cutoff is earlier than
the normal 15:00 ET deadline, typically 12:30 ET. Cash-management
teams tighten their windows accordingly.
What you get back
Two output layers.
Layer 1: canonical JSON matching output-schema.json.
Per flagged trade: ticker, side, qty, trade_date, computed settlement
date, reason codes, impact text, suggested next action, plus typed
substructures for dividend, corp_action, and session_info when
those reasons fire. Per run: scan_params, settlement window dates,
counts by reason. UI dashboards and downstream agents consume this.
Layer 2: rendered exception report. Header with run metadata. One
BREAK block per flagged trade. Summary block with counts by reason and
the settlement-window date range. See references/rendering.md
for the full format.
A short example:
T+1 settlement prep: 12 trades checked · 4 BREAKs flagged · run 2026-06-25 16:42 UTC
BREAK 1: NVDA SHORT 200 · trade 2026-06-25 · settlement 2026-06-26
Reason: Short sale; locate confirmation required
Impact: Trade may fail without locate on file before T+1 cutoff
Suggest: Confirm locate ticket with prime broker before EOD
How it works
- Pull the holiday calendar from
/v1/marketstatus/upcoming once
per run. Cache the response; the API returns one row per exchange
per event (NYSE and NASDAQ each emit their own row for the same
holiday). The skill de-dupes by date and treats NYSE as canonical.
Half-day sessions appear as status: "early-close" with open and
close UTC timestamps. Full closures are status: "closed" with no
open/close.
- For each trade, compute the naive settlement date as
trade_date + 1 calendar day. Then walk forward: if the candidate
is a weekend or a holiday, step one day and re-check. The first
business day that survives is the computed settlement date.
- Set flag codes:
weekend_crossing if naive settlement was Sat or Sun
holiday_adjacency if naive settlement was a closed market day
(or computed settlement was pushed past one). These are tracked
separately because cash desks model them differently.
short_sale_locate if side == "SHORT"
- Pull the dividend calendar for each ticker via
/v3/reference/dividends?ticker={t}&ex_dividend_date.gte=.... If
any ex-date falls inside [trade_date, computed_settlement_date],
flag ex_dividend_in_window and populate the dividend substructure
with cash_amount, pay_date, and dollar impact (qty * amount).
- Pull the splits calendar for each ticker via
/v3/reference/splits?ticker={t}&execution_date.gte=.... If any
ex-date falls in the window, flag corp_action_overlap and
populate the corp_action substructure with ratio and the
post-adjustment quantity. This is informational; DTCC handles the
share-count delivery automatically.
- Check half-day settlement. If
computed_settlement_date is in
the holiday calendar with status: "early-close", flag
half_day_settlement and populate session_info with the close
time and the DTCC cutoff time (typically 12:30 ET).
- Emit JSON and rendered output. Only trades with at least one
reason code appear. Summary block tallies counts by reason and
reports the settlement window date range.
Foundations used
Endpoints used
GET /v1/marketstatus/upcoming (holiday + half-day calendar, one
pull per run, cached)
GET /v3/reference/dividends (one paginated call per ticker;
filtered to ex-dates in the settlement window)
GET /v3/reference/splits (one paginated call per ticker; same
filter)
All three are in Stocks Basic. The free tier's 5-calls-per-minute cap
makes a 20-trade file take roughly 10 minutes; any paid tier eliminates
the wait.
Example
# Trade file with 12 rows
cat examples/sample-trades.csv
# Invoke from Claude Code
# > /t+1-settlement-prep examples/sample-trades.csv
The skill streams findings as it walks each trade, so the operator
sees BREAK blocks as they're computed instead of waiting for the full
report.
Doesn't handle (yet)
- Symbol changes and delistings. A trade in a ticker that changes
symbol or delists between trade and settlement still settles
correctly, but operations needs the new identifier. Detecting this
requires reading
/v3/reference/tickers over the window and
comparing last_updated_utc to the trade date. Deferred to v2 of
the skill.
- Cash-vs-margin reconciliation. The skill flags ex-dividend
exposure as a dollar impact but does not project the account-level
cash delta. That's the cash-management system's job.
- Locate-file ingest. The skill flags every SHORT row for locate
confirmation. An operator with a CSV export of the prime broker's
locate file can extend the skill with a second optional input to
auto-confirm; today's v1 is a prompt, not a check.
- International equities. Settlement calendars in EU (T+1 from
October 2027), Japan (T+1 since 2024), India (T+0 in pilot) are
different. The skill assumes US equities only.
- Options assignment cash flow. OCC delivery on an assigned
option settles T+1 like the underlying, but the workflow is
different (premium debit, share delivery, exercise notice). A
future
options-settlement-prep skill would handle that.
Add these in a PR if you need them. The calendar walking and
ref-data pulls carry over.
1---2name: t-1-settlement-prep3description: Take a trade file (recent trades that haven't settled yet) and walk every line against the business-day calendar plus the corporate-action calendar to flag trades with settlement risk. Catches holiday adjacency, weekend crossing, short-sale locate prompts, ex-dividend in the settlement window, mid-settlement splits, and half-day DTCC cutoffs. Exception-report mode. Runs on a free Stocks Basic key.4---56# t+1-settlement-prep78You hand over a trade file. The skill computes the T+1 settlement date9for each row, walks the next 90 days of holidays + corporate actions,10and emits an exception report listing only the trades that need11operations attention before settlement.1213This is the operations-desk workflow that runs at end of trading day,14between T and T+1. SEC moved US equities to T+1 in May 2024; the15margin for error on settlement is now one business day, not three.16A trade that crosses a long weekend or settles on a half-day session17can break cash forecasting if nobody flagged it.1819## When to invoke2021- Operations says "prep tonight's trades for settlement" or "run T+122 checks on this blotter"23- Treasury asks "is cash going to be where it needs to be tomorrow"24- A long weekend is coming up (3-day weekend, July 4, Thanksgiving)25 and ops wants visibility into which trades push into the following26 week27- A corporate action calendar shows an ex-date inside the next two28 business days and you want to know which trades are exposed2930## What you need3132- A trade CSV with columns: `ticker`, `side` (BUY/SELL/SHORT/COVER),33 `qty`, `trade_date` (YYYY-MM-DD)34- `MASSIVE_API_KEY` exported. Stocks Basic is enough; the three35 endpoints this skill uses (`/v1/marketstatus/upcoming`,36 `/v3/reference/dividends`, `/v3/reference/splits`) are all on the37 free tier.3839## What this skill flags4041Six categories. A trade can hit more than one.42431. **Holiday adjacency** (`holiday_adjacency`). T+1 lands on a US44 equity-market holiday; settlement pushes to the next business day.45 Operations needs to refund cash forecasts and notify treasury for46 the adjusted date.47482. **Weekend crossing** (`weekend_crossing`). T+1 lands on a Saturday49 or Sunday; settlement pushes to Monday. Treated as a separate flag50 from holiday_adjacency because cash desks model them differently51 (regular weekend vs irregular three-day weekend).52533. **Short-sale locate** (`short_sale_locate`). Side is SHORT. Reg54 SHO requires a locate before the trade can settle. The skill cannot55 read the prime broker's locate file, so this flag is a confirmation56 prompt rather than a hard break.57584. **Ex-dividend in window** (`ex_dividend_in_window`). The ticker has59 an ex-dividend date between trade_date and computed_settlement_date.60 Under T+1, ex-date and record-date are the same day, so the buyer's61 dividend entitlement turns on whether they purchased before the62 ex-date. The skill computes the dollar impact (qty * cash_amount)63 so operations can confirm the dividend allocation flag on the trade64 ticket.65665. **Corporate action overlap** (`corp_action_overlap`). A split or67 reverse split has an ex-date in the settlement window. DTCC handles68 the share-count adjustment automatically, but the post-action69 delivered quantity differs from the recorded trade quantity. Flagged70 as informational so settlement and position-reporting teams aren't71 surprised. Not a hard break.72736. **Half-day settlement** (`half_day_settlement`). Settlement date is74 a US equity early-close session (Thanksgiving Friday, Christmas Eve,75 July 3 when 7/4 falls on Saturday). DTCC's cutoff is earlier than76 the normal 15:00 ET deadline, typically 12:30 ET. Cash-management77 teams tighten their windows accordingly.7879## What you get back8081Two output layers.8283**Layer 1: canonical JSON** matching [`output-schema.json`](./output-schema.json).84Per flagged trade: ticker, side, qty, trade_date, computed settlement85date, reason codes, impact text, suggested next action, plus typed86substructures for `dividend`, `corp_action`, and `session_info` when87those reasons fire. Per run: scan_params, settlement window dates,88counts by reason. UI dashboards and downstream agents consume this.8990**Layer 2: rendered exception report**. Header with run metadata. One91BREAK block per flagged trade. Summary block with counts by reason and92the settlement-window date range. See [`references/rendering.md`](./references/rendering.md)93for the full format.9495A short example:9697```98T+1 settlement prep: 12 trades checked · 4 BREAKs flagged · run 2026-06-25 16:42 UTC99100BREAK 1: NVDA SHORT 200 · trade 2026-06-25 · settlement 2026-06-26101 Reason: Short sale; locate confirmation required102 Impact: Trade may fail without locate on file before T+1 cutoff103 Suggest: Confirm locate ticket with prime broker before EOD104```105106## How it works1071081. **Pull the holiday calendar** from `/v1/marketstatus/upcoming` once109 per run. Cache the response; the API returns one row per exchange110 per event (NYSE and NASDAQ each emit their own row for the same111 holiday). The skill de-dupes by `date` and treats NYSE as canonical.112 Half-day sessions appear as `status: "early-close"` with `open` and113 `close` UTC timestamps. Full closures are `status: "closed"` with no114 open/close.1152. **For each trade**, compute the naive settlement date as116 `trade_date + 1 calendar day`. Then walk forward: if the candidate117 is a weekend or a holiday, step one day and re-check. The first118 business day that survives is the computed settlement date.1193. **Set flag codes**:120 - `weekend_crossing` if naive settlement was Sat or Sun121 - `holiday_adjacency` if naive settlement was a closed market day122 (or computed settlement was pushed past one). These are tracked123 separately because cash desks model them differently.124 - `short_sale_locate` if `side == "SHORT"`1254. **Pull the dividend calendar** for each ticker via126 `/v3/reference/dividends?ticker={t}&ex_dividend_date.gte=...`. If127 any ex-date falls inside `[trade_date, computed_settlement_date]`,128 flag `ex_dividend_in_window` and populate the `dividend` substructure129 with `cash_amount`, `pay_date`, and dollar impact (qty * amount).1305. **Pull the splits calendar** for each ticker via131 `/v3/reference/splits?ticker={t}&execution_date.gte=...`. If any132 ex-date falls in the window, flag `corp_action_overlap` and133 populate the `corp_action` substructure with ratio and the134 post-adjustment quantity. This is informational; DTCC handles the135 share-count delivery automatically.1366. **Check half-day settlement**. If `computed_settlement_date` is in137 the holiday calendar with `status: "early-close"`, flag138 `half_day_settlement` and populate `session_info` with the close139 time and the DTCC cutoff time (typically 12:30 ET).1407. **Emit JSON and rendered output**. Only trades with at least one141 reason code appear. Summary block tallies counts by reason and142 reports the settlement window date range.143144## Foundations used145146- [`massive-api-patterns`](../massive-api-patterns) for REST auth and147 rate limiting148149## Endpoints used150151- `GET /v1/marketstatus/upcoming` (holiday + half-day calendar, one152 pull per run, cached)153- `GET /v3/reference/dividends` (one paginated call per ticker;154 filtered to ex-dates in the settlement window)155- `GET /v3/reference/splits` (one paginated call per ticker; same156 filter)157158All three are in Stocks Basic. The free tier's 5-calls-per-minute cap159makes a 20-trade file take roughly 10 minutes; any paid tier eliminates160the wait.161162## Example163164```bash165# Trade file with 12 rows166cat examples/sample-trades.csv167168# Invoke from Claude Code169# > /t+1-settlement-prep examples/sample-trades.csv170```171172The skill streams findings as it walks each trade, so the operator173sees BREAK blocks as they're computed instead of waiting for the full174report.175176## Doesn't handle (yet)177178- **Symbol changes and delistings.** A trade in a ticker that changes179 symbol or delists between trade and settlement still settles180 correctly, but operations needs the new identifier. Detecting this181 requires reading `/v3/reference/tickers` over the window and182 comparing `last_updated_utc` to the trade date. Deferred to v2 of183 the skill.184- **Cash-vs-margin reconciliation.** The skill flags ex-dividend185 exposure as a dollar impact but does not project the account-level186 cash delta. That's the cash-management system's job.187- **Locate-file ingest.** The skill flags every SHORT row for locate188 confirmation. An operator with a CSV export of the prime broker's189 locate file can extend the skill with a second optional input to190 auto-confirm; today's v1 is a prompt, not a check.191- **International equities.** Settlement calendars in EU (T+1 from192 October 2027), Japan (T+1 since 2024), India (T+0 in pilot) are193 different. The skill assumes US equities only.194- **Options assignment cash flow.** OCC delivery on an assigned195 option settles T+1 like the underlying, but the workflow is196 different (premium debit, share delivery, exercise notice). A197 future `options-settlement-prep` skill would handle that.198199Add these in a PR if you need them. The calendar walking and200ref-data pulls carry over.