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

Five tiers, each reached only on a tie.

The book resolves priority in five passes, and order type leads rather than price: a resting market order is matched before the best priced order on its side, whatever that price is. Price decides everything after that, and each remaining pass applies only where the one above it ties, down to arrival sequence.

The five priority tiersThe order book resolves priority in five passes, each applied only when the previous one ties: resting market orders first, then price, then auction orders within a price level, then displayed quantity ahead of hidden iceberg reserve, 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 ties01Order type: marketA resting market order is matched before any priced order on its side.Price decides nothing until the market queue is empty.02PriceAmong priced orders, highest bid and lowest offer rank first.Any change to price forfeits priority, better or worse.03Order type: auctionWithin a price level, auction orders rank ahead of limit and iceberg.Only admissible in the pre-open and pre-close.04DisplayWithin a price level, displayed quantity ranks ahead of hidden reserve.Each refill from the reserve rejoins at the back of the queue.05TimeArrival sequence is the final tie-break.The sequence is the journal’s, so the tie-break is reproducible.
Figure 2The five priority tiers. Resting market orders, then price, then auction orders within a price level, then displayed quantity ahead of hidden iceberg reserve, 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
FirstOrder type: marketA resting market order is matched before any priced order on its side of the book, whatever the best price happens to be. Price only starts to decide once the market queue is empty.
SecondPriceAmong priced orders, the highest bid and the lowest offer rank first in their respective queues. Any change to an order’s price forfeits its priority, whether the new price is better or worse; the order re-enters as new.
ThirdOrder type: auctionWithin a price level, auction orders rank ahead of limit and iceberg orders. Auction orders are only accepted in the pre-open and pre-close, so this tier decides nothing during continuous trading.
FourthDisplayWithin a price level, displayed quantity ranks ahead of hidden quantity. An iceberg’s displayed peak queues by time alongside fully displayed orders; its hidden reserve only trades after a refill, which sends the order to the back of the queue.
FifthTimeThe arrival sequence of the order is the final tie-break.

Display

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

An iceberg order publicly displays only part of its total volume, the peak. The participant sets both the peak and the total, subject to configured minimums, and when the order is entered or amended the peak must be at least one hundredth of what remains. Hidden size never leaks into public market data.

The displayed peak queues by time alongside fully displayed orders at its price. A match takes at most the displayed slice, so no single trade is larger than the peak. When the slice is used up, the engine refills it from the hidden reserve, gives the order a new arrival time and sends it to the back of the queue at that price. A partly used slice keeps its place.

Adding only to the hidden reserve keeps the order’s place, because nothing anyone can see has changed. Raising the peak or changing the price loses it.

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. The 2,000 peak queues by time alongside fully displayed orders at 148.20. When the peak is used up the engine refills it from the hidden reserve, and the order goes to the back of the queue at its price level with a new arrival time. 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 used up → refilled from hidden, and the orderrejoins the back of the queue at its price level.In an auctionThe entire 20,000 participatesprice discovery uses full volume, not the peakPriority costRaising the displayed peakforfeits time priority; adding only hidden size does not
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, trades only after a refill at the back of the queue, and still contributes in full to auction price discovery.

Worked example

The iceberg that arrives first trades first, for what it shows.

One buy price, three resting orders, and a seller who sells 850 at that price. A is an iceberg of 1,000 showing 100, arriving at 09:00:00. B is a fully displayed order for 500, arriving five seconds later. C is an iceberg of 800 showing 100, arriving at 09:20:00.

An iceberg queue, trade by tradeOne buy price level. Iceberg A (1,000 in total, showing 100) arrives first, then fully displayed order B for 500, then iceberg C (800 in total, showing 100). A seller sells 850 at that price. The trades are A 100, B 500, C 100, A 100 and C 50. Each time an iceberg's displayed peak is used up it refills from its hidden reserve and goes to the back of the queue. C's last peak is only partly used, so it keeps its place. At the end A has 800 left showing 100, and C has 650 left showing 50.One buy price · the queue after each trade, front on the leftTo sellStartA seller arrives to sell 850A 100+900B 500C 100+700850Trade 1 · A 100A refills, goes to the backB 500C 100+700A 100+800750Trade 2 · B 500B is filled in fullC 100+700A 100+800250Trade 3 · C 100C refills, goes to the backA 100+800C 100+600150Trade 4 · A 100A refills, goes to the backC 100+600A 100+70050Trade 5 · C 50C partly filled, keeps its placeC 50+600A 100+7000
Iceberg, displayed peak Fully displayed orderJust refilled: new arrival time, back of the queue+700 · hidden reserve still behind the peak
Figure 4An iceberg queue, trade by trade. The queue at one buy price after each trade, front on the left. Each iceberg trades its displayed slice in turn; every refill takes a new arrival time and goes to the back. The figure under each iceberg is its hidden reserve.
The five trades, in the order they print
TradeOrder filledQuantityWhat happens next
1A, iceberg100A’s peak is used up. It refills from its hidden reserve, takes a new arrival time and goes to the back, behind B and C.
2B, fully displayed500B is filled in full and leaves the book.
3C, iceberg100C’s peak is used up. It refills and goes to the back, behind A.
4A, iceberg100A refills again and goes to the back, behind C.
5C, iceberg50The seller is done. C’s peak is only partly used, so C keeps its place at the front.

A arrived first, so A traded first, but only the 100 it showed. B, which showed everything, was filled in full before A’s reserve traded at all. No single trade was larger than the peak the order displayed. At the end, A has 800 left showing 100, and C has 650 left showing 50.

Hiding size does not cost an order its place. It costs the place of everything it did not show: each slice of the reserve joins the queue again, like a new order.


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, peak and price unchangedNone
Order volumeAny other increase in volumeTime priority is lost
Order volumeDecrease in volume, displayed state unchangedNone
Displayed peakIceberg peak increasedTime priority is lost
Displayed peakChange between displayed and fully hiddenTime priority is lost
Displayed peakChange between limit and iceberg that still displays, with neither peak nor total raisedNone
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 within its matching engine, 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.