Spire ProtocolSPIRE PROTOCOLDOCS

Data model

Five objects carry the whole lifecycle. Everything else in the API is a view over them.

Fill

What a venue sends. A fill is a statement that two participants agreed on a price, signed by the venue so that the claim can be attributed and replays can be rejected.

FieldTypeRequiredDescription
fillIdstringyesUnique inside the venue. Used for idempotency
venueIdstringyesIssued at onboarding
assetaddressyesContract address of the tokenised asset
buyeraddressyesMember or member sub-account
selleraddressyesMember or member sub-account
sizeuint256yesBase units of the asset
priceuint256yesSettlement asset per whole unit, 6 decimals
matchedAtuint64yesUnix seconds, venue clock
signaturebytesyesEIP-712 over the fields above

fillId is the idempotency key. Sending the same fillId twice returns the obligation created the first time, it does not create a second one.

Obligation

What the protocol returns. The bilateral trade is gone and two obligations against Spire Protocol exist in its place. See Novation.

FieldTypeDescription
obligationIdbytes32Assigned at novation
fillIdstringThe fill it came from
memberaddressWho owes or is owed
assetaddressTokenised asset
direction`"deliver" \"receive"`Which side of the obligation
sizeuint256Base units
cashint256Settlement asset leg, signed
windowIduint64Window it settles in, fixed at novation
stateStateSee below
novatedAtuint64Unix seconds, chain clock

One fill produces two obligations, one per side. They are independent from the moment they exist: the buyer's obligation does not fail because the seller's does.

State

matched -> novated -> netted -> settled

defaulted is reachable from novated and netted and routes into the default waterfall. No other transition exists, and no state is ever revisited.

StateMeaning
matchedFill received, signature not yet verified
novatedSpire Protocol is the counterparty, margin is held
nettedWindow finalised, this obligation is inside a net
settledDelivered on chain, terminal
defaultedCure period expired, terminal for the member

SettlementWindow

FieldTypeDescription
windowIduint64Monotonic, one per windowLength
opensAtuint64Unix seconds
closesAtuint64opensAt + windowLength
finalisedAtuint64Zero until finalisation completes
state`"open" \"finalising" \"settling" \"closed"`
obligationCountuint32Obligations assigned to this window

A window is the unit of netting. Nothing settles inside one, and nothing carries across one. See Netting.

Position

The net view of a member in one asset inside one window. This is derived, not stored as an independent truth.

FieldTypeDescription
memberaddress
assetaddress
windowIduint64
grossuint256Sum of absolute sizes before netting
netint256What actually moves, signed
requiredMarginuint256Against the net, not the gross
utilisationuint16Basis points of the member's limit in use

Margin is charged against the net. A member that buys and sells the same asset inside one window carries margin on the difference, which is the whole point of netting in time.

CollateralAccount

FieldTypeDescription
memberaddress
postedBalance[]Raw balances by collateral asset
haircutValueuint256Value after haircuts, in settlement asset
initialMarginuint256Currently held against open positions
defaultFunduint256Contribution, not available as margin
freeuint256haircutValue - initialMargin - defaultFund
limituint256Maximum novated notional

free going negative is a margin call, not an error. The member has marginCallCure seconds to post more or reduce. Values are in Parameters.

Last updated 31 August 2026 Docs source on GitHub