Functional Delta: YU17-otc-rates (vs YU16-cdm-instruments)
Everything inherited from YU16 and its ancestry is carried forward unchanged unless listed here.
Addedβ
Market data, the trading session, and replayβ
- A session phase machine in consensus;
CLOSED,PRE_OPEN,OPEN; sequenced and snapshotted. The phase moves by a control command, so every member agrees on it. An order arriving inPRE_OPENis accepted and held in a replicated queue rather than entering a book; opening releases the queue in sequence, and a halt back toCLOSEDcancels it, so a client is never left holding an order the venue has quietly dropped. - A price band that follows the market, anchored on the reference rather than on a book's first order.
The reference is the feed price, else the last trade, else the first limit; so a stray order can
no longer decide a security's tradeable range for a whole epoch. The band re-centres lazily, only
when a limit it refuses is one the reference says is admissible. Orders stranded by a re-anchor
are cancelled through the existing unsolicited-cancel path carrying reason
PRICE_COLLAR, andbandReanchorsandbandStrandedCancelscount both halves for the operator. - A price-derived book grid: an empty book takes its tick size from the reference price, by decade.
A fraction-of-par instrument and a several-hundred-dollar one are each quoted at a usable
granularity, instead of sharing one venue-wide tick. The tick is stored in
T_BOOK, so a restoring member reads the book's geometry instead of re-deriving it. - An external reference replayed on a stateless clock, resampled offline from a licensed historical tape.
Replay position is derived as
(now - epochStart) x compressionand never stored, so a publisher restart resumes at the right point with no coordination and no persisted cursor. Each tick carries asourceand anasOfbeside the existingsimulatedflag, because a real price at a fabricated time is neither live nor invented and a boolean cannot say which it is. - Replayed prints entering as order flow, sampled to a target rate and matched as ordinary orders. They are submitted through dedicated replay accounts, so the engine matches, fills and moves positions on activity that genuinely occurred. The side is not present in the source data and is inferred by the tick rule, which is labelled as inferred rather than presented as fact. Members gain operator-scoped counters; the replayed halves of the order-ref generator and the trade counter; so a global reading minus its external half is an operator-only reading that a continuous replayed feed cannot move.
GET /bboon each member: best bid, offer and mark derived from the book and served beside consensus. It is not sequenced, because every member can compute it from the log it has already applied. A side holding no resting orders is omitted from the response rather than zero-filled, so an empty side cannot be misread as a price of zero.
OTC swapsβ
POST /swapson the cluster gateway: books a vanilla fixed-float OTC interest-rate swap. It takesaccountId,payReceive,notional,fixedRate,effectiveDate,maturityDate,conventionsand an optionalclientOrderId. Returns{"contractId":"SW-<N>","sequence":N, "booked":true}, 422 with aRiskReasonwhen the gate refuses, 400 when a term cannot be represented, 504 when no decision committed.TYPE_SWAP_BOOK(12) on the inheritedInputEventMessage(SBE template 1): a sequenced consensus command. It carries the swap's economics in the record's existing slots, is applied inMatchingEngineClusteredService, and is never handed toMatchingEngine.- A replicated OTC contract store:
{contractId, accountId, payFixed, notional, fixedRateTicks, conventionIndex, effectiveEpochDay, maturityEpochDay, productType, expiryEpochDay, exerciseStyle}in booking order, capped at 4096 and refusing at capacity withRiskReason.CAPACITY.contractIdis the booking's own consensus sequence. SwapConventions: a compile-time table of five market conventions (float index, payment frequency, day count, currency) addressed by index, append-only, stored nowhere in replicated state. An index this build does not know aborts the render rather than resolving to another.BlpRiskState.decideSwapBooking: the ordered admission pipeline with the swap's notional measured directly, and without the four checks that read state a swap does not have (ADR-063).T_CONTRACT(12) snapshot records, restoring in booking order and failing closed on an id beyond the restored applied sequence or out of ascending order.- A
#contractssection in the cut after the position rows, with the count declared in the cut header, emitted even when the store is empty. - A second EOD artifact,
seq-<N>-contracts.csv: one row per contract carrying direction, notional, fixed rate, both dates, float index, frequency, day count, currency, counterparty and netting set; and no valuation of any kind. RiskExtractMain --rebuild <cut> <positions.csv> <contracts.csv>: an optional fourth argument rebuilding the contracts artifact from the same stored cut.RISK-EXTRACT-CUTlog lines carrycontracts=<C>, so cross-member agreement on the contract store is readable from the pod logs alongside the position row count.KIND_SWAP_BOOKED(102) egress ack, correlated by theclientOrderKeyit echoes.
Swaptions (phase 2)β
POST /swaptions: the swap body plusexpiryDateandexerciseStyle. Every other field describes the UNDERLYING swap, sofixedRateis the strike andpayReceiveis the direction of the underlying's fixed leg.TYPE_SWAPTION_BOOK(13): a distinct command type, so the product is the COMMAND and never the presence or value of a field. Every slot keeps itsTYPE_SWAP_BOOKmeaning; the option wrapper ridessecurityIdas convention index / exercise style / expiry epoch-day.- An exercise-style table beside the convention table in
SwapConventions;EUROPEAN,BERMUDAN,AMERICAN; index-addressed, append-only, with the same knowing refusal for an unknown index. - Three columns on the contract record:
productType,expiryEpochDay,exerciseStyle, zero for a swap. - Contract ids
SWPT-<consensusSequence>for swaptions.
Changedβ
risk.extract.readygainscontractsSchema,contractsUri,contractsandcontractsSha256, alongside the existing fields.consensusSequence,sessionDateandcutSha256are shared by both artifacts.RiskExtractCut.rendertakes the contract tuples and emits the second section;SCHEMAmoves 1 β 2.RiskExtractCsv.renderstops at the first#-prefixed line after the position rows. The netted extract's ownSCHEMAstays at 3 and no column changes.RiskExtractGcsSink.putdelivers both fixtures in one call and returns both URIs; the file sink writes both beside the single stored cut, both write-once.SNAPSHOT_FORMAT4 β 5 (theT_CONTRACTrecord) β 6 (its option-wrapper columns) β 7 (theT_FX_RATErecord the credit gate values non-USD notionals with) β 8 (the book's derived tick inT_BOOK) β 9 (the replayed halves of the ref and trade counters inT_HEADER).T_CONTRACTrestore reads a record at the width its FORMAT declares, because the record carries no length of its own.MIN_READABLE_SNAPSHOT_FORMAT3 β 8 β 9, the first raises in this lineage. Formats 5, 6 and 7 only added a record type and rolled forward untouched; 8 changed how a book's geometry is derived and 9 changed what the header must carry, and in both cases restoring an older snapshot would have produced a wrong answer silently rather than a legible refusal. Both are deterministic-core changes, so neither can be rolled gradually: a fresh epoch is mandatory.- Cut schema 2 β 3 and contracts-artifact schema 1 β 2: the option columns append to both. The netted extract stays at CSV schema 3 with no column change.
Retained unchangedβ
- Every order, cancel, replace, trade, price, control and extract-marker path, including the matching engine, the book, the position model and the netted extract's schema and columns.
- The symbol table and its 1024-entry capacity: a swap gets no entry.
- Every NATS subject, stream and payload shape; no subject is added, removed or renamed.
- The order hot path, and therefore the allocation gates and the Epsilon-GC proofs.
Not modelledβ
- Contract lifecycle: no resets, coupon payments, accrual, amortisation, unwinds or terminations, and no swaption EXERCISE. A contract past its maturity or expiry date is listed exactly as booked. Exercise STYLE is modelled, because it is a term rather than an event.
- Valuation: no NPV, mark, discount factor, curve, par rate or sensitivity.
- Matching: there is no swap order book and no crossing path.