The market in code
Developers and testers
Turn the business into data models and verifiable rules, to test MIMS and prepare the matching engine.
0/120 of 12 done
- The domain in ten objectsOrder, book, execution, position, cash account, settlement: the market’s objects, their relationships and where the engine stops.10 min10 min
- Modelling an orderA type, integers rather than floats, a rank rather than a time, and the rules that keep an order valid.12 min12 min
- The book, a sorted structureTwo sides sorted by price then rank, aggregated into levels, and the cost of possible structures.11 min11 min
- Continuous trading, line by lineReading Carnet.passer: walk the opposite side, stop at the right moment, store or drop the remainder.12 min12 min
- The auction in codeCandidate prices, cumulative curves, tie-break rules and allocation: predict the output before the engine.13 min13 min
- An engine’s invariantsConservation, uncrossed book, limits, priority, timestamps, determinism, and the property-based tests that guard them.13 min13 min
- From business rule to test caseTurn a rule into “Given, when, then”, choose data that proves it, cover the edge cases.12 min12 min
- Order life cycle and the FIX protocolA state machine for the order, then the FIX messages that carry it and the session that numbers them.14 min14 min
- From engine to MIMS: checking a sessionFrom executions to positions and cash: what a tester checks after a session.12 min12 min
- Amending and cancelling an orderKeeping or losing time priority, writing an amendment with annuler and passer, and the traps of cancellation.10 min10 min
- Logging and replaying a sessionAn append-only log, a replay up to time t, fingerprints, and the snapshot that forgets the rank counter.11 min11 min
- From an execution to entriesSecurities movements, cash movements, commissions and reversal: the conversion on the back-office side.10 min10 min
- Sheet: the engine contractThe @criee/marche API, guarantees and known limits, on one page.ReferenceReference
- Sheet: invariants and test casesThe six invariants as assertions, the shape of a test case and the list of edge cases.ReferenceReference
Terms in this track
OrderLimit orderMarket orderOrder bookPrice-time priorityExecutionContinuous tradingAuction (fixing)Equilibrium priceSpreadPositionCash accountSettlementCentral securities depositoryInvariantDeterminismTimestampingProperty-based testTest caseOrder life cycleFIX protocolMutation testingShrinkingOrder amendmentEvent logReplayFingerprintSnapshotMovementReversal
End-of-track assessment
15 questions drawn from the lessons, pass mark 70%, printable certificate.
Take the assessment