You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@claude for fx marker can we add or check how we treat ON SN and TN. Do you know this quote meaning from Bloomberg?
Also you need to consider if it's one single forward or 2 legs swap so we know how to adjust per leg based on market quote. This will be used for pricing?
Can you also check what quantlib does so we are in line
Read CLAUDE.md and explore existing FX market code
Research ON/TN/SN Bloomberg conventions and QuantLib treatment
Add TN (Tom-Next) to Period enum with correct settlement date logic
Add near_date() method to Period for 2-leg swap support
Update FXForwardHelper documentation for single forward vs swap distinction
Update sample/tests to cover ON and TN
Bloomberg Quote Conventions: ON / TN / SN
The Bloomberg screen shows EUR/USD (spot ~1.1744, spot date 05/14/26). The three short-end tenors are 2-leg FX swap quotes:
Tenor
Bloomberg name
Near leg
Far leg
Bloomberg "Pts"
ON
Overnight
T (today)
T+1
swap pts for T→T+1 period
TN
Tom-Next
T+1 (tom)
T+2 (= spot for T+2 pairs)
swap pts for T+1→T+2 period
SN
Spot-Next
T+2 (spot)
T+3
swap pts for T+2→T+3 period
Bloomberg's "Pts" column = forward points for that individual overnight period (not cumulative).
Bloomberg's "Fwds" column = outright forward rate at the far-leg date.
From the image (EUR/USD, today 05/12/26):
ON far-leg date: 05/13/26, Fwds ≈ 1.1742 (below spot → negative forward pts, i.e. USD rates > EUR rates)
Settlement date logic for TN — base starts from T+1 (tom), then adds 1 day to land at the spot date (T+2):
let target_date = matchself{Period::ON => valuation_date,// base = TPeriod::TN => valuation_date + ONE_DAY,// base = T+1 ← NEW
_ => valuation_date + TWO_DAYS,// base = T+2 (spot)};
New near_date() API for pricing 2-leg swaps per-leg:
// Example: pricing an ON FX swaplet near = Period::ON.near_date(val_date,&cal)?;// Some(T)let far = Period::ON.settlement_date(val_date,&cal)?;// T+1let near_fwd = helper.get_forward(near.unwrap(),&cal)?;let far_fwd = helper.get_forward(far,&cal)?;// swap P&L = far_leg_payoff - near_leg_payoff
QuantLib Alignment
QuantLib's FxSwapRateHelper explicitly models both legs of an FX swap, with separate near/far settlement dates. The new near_date() + settlement_date() pair mirrors that dual-date structure. QuantLib also does not have a named "TN" constant but constructs it from a 1-day offset off the tom date — equivalent to what Period::TN now does here.
Files Changed
File
Change
src/time/period.rs
Added TN variant, near_date() method, updated all Add/Sub/Mul impls, 4 new tests
src/markets/forex/quotes/forwardpoints.rs
Extended FXForwardQuote doc with Bloomberg convention table + single-vs-swap explanation
src/tests/common.rs
Added Period::ON quote (negative pre-spot pts) to sample forward helper
Add TN (Tom-Next) period to enum — was missing from codebase
Add near_date() method for ON/TN/SN swap leg support
Add Bloomberg settlement date tests to period.rs
Add bloomberg_eurusd_fx_forward_helper() to tests/common.rs
Add Bloomberg forward curve tests to forwardpoints.rs
Commit and push
What was added
Period::TN (Tom-Next) — the variant was missing entirely from the enum. Added with correct settlement logic: base date = T+1 (tom), far-leg = T+2 = spot date.
Period::near_date() — returns the near-leg settlement date for 2-leg FX swaps:
ON → near = T (today)
TN → near = T+1 (tom)
SN → near = spot (T+2)
SPOT and longer → None (single outright, no near leg)
Bloomberg test data (EUR/USD, pricing date 2026-05-12, spot "Value 05/14/26"):
Tenor
Far-leg date (Bloomberg)
Fwds Bid
ON
2026-05-13
1.174188
TN
2026-05-14 = spot
1.174244
SN
2026-05-15
1.174354
1W
2026-05-21
1.174682
2W
2026-05-28
1.175068
2M
2026-07-14
1.177487
4M
2026-09-14
1.180255
New tests (9 total across period.rs and forwardpoints.rs):
test_bloomberg_eurusd_settlement_dates_20260512 — all far-leg dates match Bloomberg screen
test_bloomberg_eurusd_near_dates_20260512 — near-leg dates for ON/TN/SN
test_bloomberg_eurusd_settlement_dates — same in forwardpoints.rs via helper
test_bloomberg_eurusd_get_forward_exact — exact rate match at each tenor's date
test_bloomberg_eurusd_get_forward_interpolation — linear interp between 1W and 2W
test_bloomberg_eurusd_on_below_tn — ON outright < TN outright (negative ON swap pts)
Activity
claude commentedon May 12, 2026
Claude finished @thejerwang's task in 10m 2s —— View job •
claude/issue-67-20260512-1241• Create PR ➔Analysis & Implementation Complete
TN(Tom-Next) toPeriodenum with correct settlement date logicnear_date()method toPeriodfor 2-leg swap supportFXForwardHelperdocumentation for single forward vs swap distinctionBloomberg Quote Conventions: ON / TN / SN
The Bloomberg screen shows EUR/USD (spot ~1.1744, spot date 05/14/26). The three short-end tenors are 2-leg FX swap quotes:
ONTNSNBloomberg's "Pts" column = forward points for that individual overnight period (not cumulative).
Bloomberg's "Fwds" column = outright forward rate at the far-leg date.
From the image (EUR/USD, today 05/12/26):
Single Forward vs 2-Leg Swap
Single outright forward: one cash exchange at the far-leg date.
→ Use
FXForwardHelper::get_forward(settlement_date, cal)as before.2-leg FX swap (ON/TN/SN): simultaneous buy at near leg, sell at far leg (or vice versa).
→ Call
get_forwardfor each leg separately, using:Period::ON.near_date(val_date, cal)→ near leg date (T)Period::ON.settlement_date(val_date, cal)→ far leg date (T+1)What Was Missing / Fixed
TNwas absent from thePeriodenum.ONandSNexisted but notTN. Added insrc/time/period.rs:Settlement date logic for
TN— base starts from T+1 (tom), then adds 1 day to land at the spot date (T+2):New
near_date()API for pricing 2-leg swaps per-leg:QuantLib Alignment
QuantLib's
FxSwapRateHelperexplicitly models both legs of an FX swap, with separate near/far settlement dates. The newnear_date()+settlement_date()pair mirrors that dual-date structure. QuantLib also does not have a named "TN" constant but constructs it from a 1-day offset off the tom date — equivalent to whatPeriod::TNnow does here.Files Changed
src/time/period.rsTNvariant,near_date()method, updated allAdd/Sub/Mulimpls, 4 new testssrc/markets/forex/quotes/forwardpoints.rsFXForwardQuotedoc with Bloomberg convention table + single-vs-swap explanationsrc/tests/common.rsPeriod::ONquote (negative pre-spot pts) to sample forward helperthejerwang commentedon May 13, 2026
@claude can you add test cases of the screenshot
claude commentedon May 13, 2026
Claude finished @thejerwang's task in 9m 33s —— View job •
claude/issue-67-20260513-2106• Create PR ➔Adding test cases from the Bloomberg screenshot
TN(Tom-Next) period to enum — was missing from codebasenear_date()method for ON/TN/SN swap leg supportperiod.rsbloomberg_eurusd_fx_forward_helper()totests/common.rsforwardpoints.rsWhat was added
Period::TN(Tom-Next) — the variant was missing entirely from the enum. Added with correct settlement logic: base date = T+1 (tom), far-leg = T+2 = spot date.Period::near_date()— returns the near-leg settlement date for 2-leg FX swaps:ON→ near = T (today)TN→ near = T+1 (tom)SN→ near = spot (T+2)SPOTand longer →None(single outright, no near leg)Bloomberg test data (EUR/USD, pricing date 2026-05-12, spot "Value 05/14/26"):
New tests (9 total across
period.rsandforwardpoints.rs):test_bloomberg_eurusd_settlement_dates_20260512— all far-leg dates match Bloomberg screentest_bloomberg_eurusd_near_dates_20260512— near-leg dates for ON/TN/SNtest_bloomberg_eurusd_settlement_dates— same inforwardpoints.rsvia helpertest_bloomberg_eurusd_get_forward_exact— exact rate match at each tenor's datetest_bloomberg_eurusd_get_forward_interpolation— linear interp between 1W and 2Wtest_bloomberg_eurusd_on_below_tn— ON outright < TN outright (negative ON swap pts)•
claude/issue-67-20260513-2106