Skip to content
Criée

Pre-trade risk checks

Price collar, quantity and value caps, funds, kill switch: rejecting the error before the book.

Lesson 39 min

By the end of this lesson

  • Calculate the bounds of a price collar and reject a limit outside them
  • Calculate the maximum quantity a value cap allows
  • Justify the order of the checks, from cheapest to most expensive
In this lesson5

One extra zero on the keyboard, and a buy at 10,200 becomes a buy at 102,000. A program stuck in a loop, and a hundred orders become millions. Pre-trade risk checks exist so that these errors die before they reach the book. What you will learn here: write the checks that reject an order outside the collar, above a cap or without funds, and know in which order to apply them.

Forty-five minutes

On 1 August 2012, during the first 45 minutes of trading, a US broker's order router sent more than 4 million orders into the market while trying to fill 212 customer orders. More than 397 million shares were traded and the loss exceeded 460 million dollars. The SEC found wrongly deployed code, a defective function left in place since 2005, and 97 automated emails that had flagged the error before the open without anyone acting (SEC, press release 2013-222). It was the first sanction under the US market access rule, which requires brokers to apply automated pre-trade controls against erroneous orders and credit breaches (Federal Register, 2010).

Pre-trade risk check

An automated check applied to each order before it enters the book; an order that fails is rejected with a reason and is never matched.

Two layers of checks

Checks exist at the member and at the venue:

  • At the member. For the BVMAC, the aggregator installed at the brokerage firm "checks the required parameters (amount, cap, price, quantity, etc.)" before sending (May 2025 tender).
  • At the venue. In Europe, each venue must apply three checks per instrument: a price collar order by order, a maximum value and a maximum volume; an order is rejected as soon as a limit is breached, limits can be readjusted during the session and a procedure allows an order above them at the member's request (Delegated Regulation (EU) 2017/584, art. 20).

The second layer does not trust the first: a member can get its own settings wrong.

Why does the venue check orders the brokerage firm has already checked?

What the BVMAC says

The general rules leave to a BVMAC instruction the maximum price moves between two sessions and the tick sizes (RG BVMAC 2025). That instruction was not found; in the official price list of 2 September 2026, the next session's limits are ±10% of the reference price for shares and ±6% for bonds (BOC no. 2586). Trading there is "exclusively cash", and the former 2008 rules required the buyer to hold the funds and the seller the securities when the order is placed.

The ±10% and ±6% limits are observed in a bulletin, not read in a text in force. The quantity and value caps used below are fictional values: the BVMAC does not publish any.

The gate, in code

Writing RR for the reference price, ss for the collar as a fraction (0.10 for ±10%), LL for the order's limit and qq for its quantity, the order passes the price collar if its limit stays between the two bounds, and its value VV is what is compared with the cap:

R×(1−s)≤L≤R×(1+s)V=q×LR \times (1 - s) \le L \le R \times (1 + s) \qquad V = q \times L
import type { Ordre } from '@criee/marche'

interface Parametres { reference: number; seuilPourcent: number; quantiteMax: number; valeurMax: number }
interface Compte { especes: number; titres: number }
type Verdict = { accepte: true } | { accepte: false; motif: string }

export function controler(o: Omit<Ordre, 'rang'>, p: Parametres, c: Compte): Verdict {
  if (o.limite !== null) {
    const bas = (p.reference * (100 - p.seuilPourcent)) / 100
    const haut = (p.reference * (100 + p.seuilPourcent)) / 100
    if (o.limite < bas || o.limite > haut) return { accepte: false, motif: 'seuil-de-prix' }
  }
  if (o.quantite > p.quantiteMax) return { accepte: false, motif: 'quantite-max' }
  const valeur = o.quantite * (o.limite ?? p.reference)
  if (valeur > p.valeurMax) return { accepte: false, motif: 'valeur-max' }
  if (o.sens === 'achat' && valeur > c.especes) return { accepte: false, motif: 'especes-insuffisantes' }
  if (o.sens === 'vente' && o.quantite > c.titres) return { accepte: false, motif: 'titres-insuffisants' }
  return { accepte: true }
}

The order of the tests is a choice: cheapest first. The collar and the caps read only the order; the funds check reads an account, which is shared state. Reject first what can be decided without looking anything up. A market order has no limit: it is valued at the reference price, which remains an approximation.

The animation applies exactly this function to six orders; accepted orders enter a @criee/marche book.

The risk-check gate1/6

reference 10,000 · ±10 % · quantity ≤ 5,000 · value ≤ 30,000,000

o1
100 × 10,200
pass

Book

bids: 100@10,200

offers: -

accepted 1 / 1

controler(...) → { accepte: true }

Accepted

Serge buys 100 shares at 10,200 at most. 1,020,000 XAF, he has 2,000,000: everything passes.

Six orders, two get throughFictional

Reference 10,000, collar ±10%, quantity ≤ 5,000, value ≤ 30,000,000 XAF.

  1. Serge buys 100 at 10,200: collar 9,000 to 11,000, value 1,020,000, cash 2,000,000. Accepted.
  2. Serge buys 100 at 102,000: 102,000 > 11,000. Price collar.
  3. Paulin sells 8,000 at 10,000: 8,000 > 5,000. Quantity.
  4. Paulin sells 4,000 at 10,000: 4,000 × 10,000 = 40,000,000 > 30,000,000. Value.
  5. Estelle buys 300 at 10,100: 3,030,000 > 2,000,000 of cash. Funds.
  6. Paulin sells 60 at 9,900: everything passes. In the book he meets Serge's buy and sells 60 shares at 10,200, the price of the resting order.

Serge's remaining 40 shares at 10,200 stay in the book.

The last resort: the kill switch

A check judges an order; it does not see a member gone haywire. In Europe, the venue must limit each member's orders per second, be able to suspend its access and have a kill functionality that cancels all its unexecuted orders, at its request or when duplicated orders are entered by mistake; alerts must go out within five seconds (Delegated Regulation (EU) 2017/584, art. 12 and 18). In code, it is one more entry in the sequencer's queue, { type: 'arret-membre', membre }, that the engine handles as a series of cancels: it is logged and replayable like the others.

A buy of 500 shares at 10,900, reference 10,000, collar ±10%, maximum value 5,000,000 XAF. Does it pass?

Your turn

Reference 20,000, collar ±10%. Which limit is rejected?

1Reference 20,000, collar ±10%. Which limit is rejected?

Why test the price collar before the funds?

2Why test the price collar before the funds?

The European delegated regulation requires venues to apply three checks per instrument:

3The European delegated regulation requires venues to apply three checks per instrument:

Maximum value 30,000,000 XAF. At most how many shares at 12,000?

4Maximum value 30,000,000 XAF. At most how many shares at 12,000?

A member's kill switch cancels...

5A member's kill switch cancels...

Read next: Règlement délégué (UE) 2017/584 (RTS 7), exigences organisationnelles des plateformes de négociation

A question? Ask your teacher, or an AI assistant, giving it the title of this lesson.

Share:WhatsAppLinkedIn

Going further