FinBlocks Tech
Platform · Module 01

Matching Engine

The heart of the system: one price–time priority matching model serving six asset classes, differentiated by configuration rather than by custom code. Every order, amendment, cancellation, trade and session transition is sequenced, journaled and exactly replayable.

Priority model
Price–time (FIFO)
Asset classes
Six on one model
Order types
Market, Limit, Auction, Iceberg
Validity
DAY, GTD, GTC, IOC, FOK

Coverage

Six asset classes, one matching model.

Equities, fixed income, futures, options, rights and ETFs are all served by the same matching model. They are differentiated by configuration — instrument definitions, tick tables, lot sizes, price bands, session schedules and risk profiles — and not by custom code, so introducing a new market or a new instrument class does not require a software change.

Matching is price–time priority (FIFO). The matching algorithm itself is pluggable per instrument, so an alternative scheme such as pro-rata allocation can be introduced for a specific instrument class without disturbing the rest of the market.

Sessions are equally configurable. Continuous and auction-style trading sessions are schedulable at market and instrument level, including per-day overrides for IPOs and special events. The seven session types, and what each one admits, are set out on the market model page.

Controls that run before the book sees an order

  • Tick alignment: a price that is not a multiple of the applicable tick is rejected on entry.
  • Price bands, and minimum and maximum order size, per instrument.
  • Session admission: whether the current session accepts orders at all, and whether it accepts this order type with this validity.
  • Position and buying-power limits, evaluated by risk management at clearing member, trading member and end-investor level.

One model serves

EquitiesFixed incomeFuturesOptionsRightsETFs

How a match resolves

An aggressive order walks the book and stops at its limit.

The book is swept in priority order, level by level, until the order is filled or the next price would breach its limit. Nothing about the outcome depends on timing or on which server ran the match.

ACME.EQ · Order bookseq 18,442,907
IncomingBUY 5,000 @ 148.30 LIMIT DAYleaves 5,000
148.451,400
148.403,700
148.35900
148.302,400
148.252,600
148.201,800
4,300148.15
2,100148.10
5,800148.05
1,100148.00
Prints0 of 3
  • awaiting first execution…
Filled0 / 5,000
Average price
Trade IDs
output digest f19343b3identical across 1 run
Figure 1One matching cycle. An aggressive buy order sweeps the ask side in price–time order and stops at its limit; the residual volume rests in the book. Illustrative data. Press replay and the fills, the average price and the digest come out identical — the property the journal depends on.

Order model

Four order types, five validity options.

An order’s behaviour is defined by its type and its validity. Which combinations a session admits is itself part of the market model, and the full matrix is published on the market model page.

Order types
TypeBehaviour
MarketAn unpriced order that executes against the best available prices. Market orders have priority over all priced orders.
LimitAn anonymous priced order, fully displayed in the order book, that may execute at prices equal to or better than its limit price.
AuctionA priced order with price priority over all other priced orders during an auction. Any unexecuted remainder is deleted automatically when the auction completes.
IcebergPublicly displays only a portion — the peak — of its total volume. Hidden size never leaks into public market data, but participates fully in auction price discovery.
Order validity (time-in-force)
CodeNameBehaviour
DAYDayExpires at the end of the day on which it was entered. Assumed when no validity is stated.
GTDGood Till DateExpires at the end of trading on the specified day. Maximum expiry is the date of entry plus 89 calendar days.
GTCGood Till CancelledRests across days until filled or cancelled.
IOCImmediate or CancelExecutes on entry; any unexecuted volume expires immediately.
FOKFill or KillExecutes in full on entry, or is immediately expired in full.

Tick size

The tick size is the minimum valid increment in which order prices can be entered and displayed. Each tick is a numeric amount representing a multiple of the unit of currency the instrument is listed in, and it may vary by price band — a wide-band instrument can trade in fine increments at low prices and coarser ones higher up.

If the price of an order is not a multiple of the applicable tick on entry, the order is rejected — immediately, before it can affect the market. Tick tables are configured per instrument from the Market Control Panel.

The remainder of an order

What happens to unexecuted volume is a property of the validity, not of the engine’s mood. An IOC order’s residue expires immediately; an FOK order either fills in full on entry or is expired in full; a DAY, GTD or GTC order rests in the book.

An Auction order does not persist into regular trading: any unexecuted remainder is deleted automatically when the auction completes. A GTD order with an expiry beyond the date of entry plus 89 calendar days is rejected.


Priority

Four tiers, each reached only on a tie.

The book resolves priority in four passes. Each pass applies only where the previous one ties, so the final tie-break — arrival sequence — settles cases that price, order type and volume disclosure have left level.

The four priority tiersThe order book resolves priority in four passes, each applied only when the previous one ties: price first, then order type, then volume disclosure, then time of arrival. Each tier is indented further to show it is reached only on a tie.Each pass applies only where the previous one ties01PriceHighest bid and lowest offer rank first in their queues.Any change to price forfeits priority — the order re-enters as new.02Order typeMarket orders outrank all priced orders. In an auction, Auction orders outrank other priced types.An unpriced order cannot be beaten on price by a priced one.03Volume disclosureAt the same price, fully visible orders rank ahead of iceberg orders.Increasing quantity forfeits priority; decreasing it does not.04TimeArrival sequence is the final tie-break.The sequence is the journal’s, so the tie-break is reproducible.
Figure 2The four priority tiers. Price, then order type, then volume disclosure, then time. Each tier is indented to show it is reached only when the tier above it ties.
Order placement priority, in order of application
RankTierRule
FirstPriceThe highest bid and lowest offer rank first in their respective queues. Any change to an order’s price forfeits its priority; the order re-enters as new.
SecondOrder typeMarket orders have priority over all priced orders. During an auction, Auction orders outrank other priced order types.
ThirdVolume disclosureFully visible orders have priority over iceberg orders at the same price. Increasing quantity forfeits priority; decreasing it does not.
FourthTimeThe arrival sequence of the order is the final tie-break.

Volume disclosure

The market sees the peak. The engine holds the whole order.

An iceberg order publicly displays only a portion of its total volume — the peak. The displayed amount and the total size are both specified by the participant, subject to configured minimums, and hidden size never leaks into public market data.

When the peak is exhausted the engine refills it, and the order re-enters at the back of the time queue at its price level. Price, size and expiry can all be amended; if the disclosed quantity is set above the currently visible peak, the order loses time priority.

In auctions the distinction is deliberately dropped: the entire iceberg volume participates in price discovery, not just the displayed peak. Concealment is a protection against being read in continuous trading, not a way to withhold liquidity from an uncrossing.

Anatomy of an iceberg orderAn iceberg order of 20,000 with a disclosed peak of 2,000. Public market data shows only the 2,000 peak at 148.20 with no indication of the remaining 18,000. The engine holds the full 20,000. When the peak is exhausted the engine refills it and the order re-enters at the back of the time queue at its price level. In an auction the entire 20,000 participates in price discovery.Public market dataAsk side · ACME.EQ148.303,400148.251,100148.202,000no indication that 18,000 more rests behind the 2,000Engine stateDisplayed peak2,000Hidden18,000total order20,000Peak exhausted → refilled, and the order re-enters atthe back of the time queue at its price level.In an auctionThe entire 20,000 participatesprice discovery uses full volume, not the peakPriority costRaising the disclosed quantityabove the visible peak forfeits time priority
Displayed peakHidden volume, held by the engine
Figure 3Iceberg anatomy. The displayed peak against the total order volume. Hidden size is invisible in public market data, ranks behind fully visible orders at the same price, and still contributes in full to auction price discovery.

Modification

What an amendment costs in priority.

Order volume, order price, validity date and time, and the client reference can all be updated — from the Client Trading Front-End or over the participant interface. Some amendments are free; others send the order to the back of the queue. The rule is published rather than inferred.

Effect of a modification on priority
Modified fieldModificationEffect on priority
Order volumeIceberg total increased, visible peak unchangedNone
Order volumeIncrease in volume of other ordersTime priority is lost
Order volumeAny decrease in volumeNone
Order priceChange to a better pricePrice priority increased; time priority lost
Order priceChange to a worse pricePrice priority lost; time priority lost
Validity date/timeAny changeNone

Execution

Trades are categorized by the session that produced them.

Every print carries a trade type, so a downstream consumer never has to infer from a timestamp whether a price came out of continuous trading, an uncrossing or a fixed-price session.

AT
Trade in a regular (continuous) trading session.
UT
Trade at the end of an auction (uncrossing).
PT
Trade in a fixed-price session, such as trade-at-last after the closing auction.

Regular trading price monitoring

Order books can move very fast. The engine tracks the prices at which automatic executions are due to occur and intervenes if the configured price-movement tolerances would be breached. The intervention is a refusal to print, not a correction after the fact.

  • If a potential execution price is more than a defined percentage above or below the applicable reference price, no execution occurs at that price.
  • Automatic execution is temporarily suspended, so the market operator can review the instrument — typically via a volatility auction — before returning it to regular trading.
  • If suspension is triggered midway through the execution of a persistent order, any residual volume is added to the order book.
  • Non-persistent FOK orders that would otherwise breach a threshold are expired, and no suspension occurs — a single fill-or-kill order cannot halt an instrument.

The applicable reference price

Dynamic reference price
The volume-weighted price of the last order-book execution — or the previous closing price, if that is more recent — prior to submission of the incoming order. It moves with the book during the session.
Static reference price
The most recent closing price from the previous business day. It does not move during the session, so it bounds the day rather than the moment.
Operator-set reference price
The market operator may set a reference price manually from the Market Control Panel — for a newly listed instrument, for example, or following a corporate action.
Scalability

Independent instruments never contend.

Two instruments that do not interact do not compete for the same resources, so order books distribute across servers as the instrument count grows — from five on a single commodity server to several thousand across many. The configuration surface is the same at both ends of that range.

In memory, no locks

The matching path is entirely in memory, with no I/O and no locks on the critical path. Typical order round-trips are sub-millisecond to low-millisecond on commodity server hardware — no exotic hardware, no specialised network cards, no kernel tuning.

Deterministic and replayable

Every accepted command is processed in a single gap-free sequence and journaled before it executes. The same ordered input produces identical trades and book states, on any server and on any replay. Matching contains no randomness.

Fail-stop, not fail-wrong

On any internal inconsistency the affected market segment halts rather than emit an incorrect trade. In a regulated market, a fast-but-occasionally-wrong matcher is worthless.

Next step

Tell us about your market. We will show you the engine matching.

A live demonstration runs about an hour: the order book, the Control Panel, an auction uncrossing, and a replay of the journal that produced it.