MiniCTRMSearch

MiniCTRM - Build Tutorial 645: Valuing 100,000 trades: capacity, measured, and the design that scales

→ to begin · N for the speaker notes

On a phone: Next or a swipe left to begin, Notes for the words.

What you'll learn

A system of your own that books a hundred thousand seeded test trades, values them in chunks on several workers with the same answer as one, holds its lists to a flat number of queries, reports how its time grows with the book on your own hardware, and a written list of what you would add on the way to production.

  • How big is 100,000? – What a book of a hundred thousand trades is in rows, bytes and arithmetic, beside what the same computers do every day.
  • What a valuation does – One trade's valuation, step by step, and where a computer spends its time: CPU, memory, disk, network, waiting.
  • Measure the growth – A benchmark at two sizes, and the one question that matters: does twice the book take twice the time?
  • What a large book finds – Three places time grows faster than the book, how each is found by sampling, and the fix.
  • The design that scales – One market read once, the book in chunks, read-only workers side by side, the same answer as one worker, one write at the end.
  • Watching it – Progress as events, and the Valuation Monitor.
  • The numbers – Each flaw in and fixed, and the design at 2,000, 5,000, 10,000 and 100,000 deals.
  • Your system – Eight prompts: test trades, a benchmark, the hot spot, small sessions, one market, chunks, the same answer, flat lists.
  • When the next limit comes – Which limit comes next, how to tell, and what to add: cores, memory, a server database, several machines.
  • On the way to production – What a system a firm relies on adds: budgets, a capacity run on your own hardware, memory limits, cancel, alerts.
  • Ship it – Every test, the benchmark's numbers in docs/capacity.md, committed.

Before you start

The lessons this one builds on: 601 Valuation and reports: mark-to-market, valuation runs, position, day-over-day change, 621 End of day: close the market, run the valuation, automate the night, 631 Performance: compress market data, keep a save fast, 644 Many jobs at once: one limit for the whole system, steps that start together, one writer shared.

Copyright 2026-2027 Brian Shydlo. MiniCTRM is source-available under the PolyForm Strict License 1.0.0 (https://polyformproject.org/licenses/strict/1.0.0): free for learning and other noncommercial use; no changes and no redistribution; commercial use needs permission.

Welcome

The question everyone asks

1 / 50
The question everyone asks
Welcome

The short answer, before the long one

2 / 50
The short answer, before the long one
How big is 100,000?

A hundred thousand trades, in rows

3 / 50
A hundred thousand trades, in rows
How big is 100,000?

A hundred thousand trades, in arithmetic

4 / 50
A hundred thousand trades, in arithmetic
How big is 100,000?

What the same machines do every day

5 / 50
What the same machines do every day
What a valuation does

One trade's valuation, step by step

6 / 50
One trade's valuation, step by step
What a valuation does

Where a computer spends its time

7 / 50
Where a computer spends its time
What a valuation does

The shape of the time

8 / 50
The shape of the time
Measure the growth

A benchmark at two sizes

9 / 50
A benchmark at two sizes
Measure the growth

Measure on your own machine

10 / 50
Measure on your own machine
What a large book finds

Three flaws a large book finds

11 / 50
Three flaws a large book finds
What a large book finds

How to find where the time goes: sampling

12 / 50
How to find where the time goes: sampling
What a large book finds

Flaw one: a check that grows with the book

13 / 50
Flaw one: a check that grows with the book
What a large book finds

Flaw two: one transaction for a thousand trades

14 / 50
Flaw two: one transaction for a thousand trades
What a large book finds

Flaw three: the list that asked one question per trade

15 / 50
Flaw three: the list that asked one question per trade
What a large book finds

What the three have in common

16 / 50
What the three have in common
The design that scales

From fixed to fast: the design

17 / 50
From fixed to fast: the design
The design that scales

One market, read once

18 / 50
One market, read once
The design that scales

The book in chunks

19 / 50
The book in chunks
The design that scales

Workers, side by side

20 / 50
Workers, side by side
The design that scales

The same answer as one worker

21 / 50
The same answer as one worker
The design that scales

Read in parallel, write once

22 / 50
Read in parallel, write once
The design that scales

Memory that stays flat

23 / 50
Memory that stays flat
The design that scales

A failure stays in its chunk

24 / 50
A failure stays in its chunk
The design that scales

Risk, and a hundred trades on one contract

25 / 50
Risk, and a hundred trades on one contract
Watching it

Progress as events

26 / 50
Progress as events
Watching it

The Valuation Monitor

27 / 50
The Valuation Monitor
The numbers

Each flaw, in and fixed

28 / 50
Each flaw, in and fixed
The numbers

Ten thousand and a hundred thousand

29 / 50
Ten thousand and a hundred thousand
The numbers

A fourth flaw, found by the numbers

30 / 50
A fourth flaw, found by the numbers
The numbers

What more workers buy

31 / 50
What more workers buy
Your system

Your system: eight prompts

32 / 50
Your system: eight prompts
Your system

A hundred thousand test trades

33 / 50
A hundred thousand test trades
Your system

A capacity benchmark that reports growth

34 / 50
A capacity benchmark that reports growth
Your system

Find the hot spot by sampling

35 / 50
Find the hot spot by sampling
Your system

Small sessions and read-only reads

36 / 50
Small sessions and read-only reads
Your system

One market snapshot

37 / 50
One market snapshot
Your system

The book in chunks, on workers

38 / 50
The book in chunks, on workers
Your system

The same answer, proved

39 / 50
The same answer, proved
Your system

Lists held to a flat number of queries

40 / 50
Lists held to a flat number of queries
Your system

Optional: a monitor that demos well

41 / 50
Optional: a monitor that demos well
When the next limit comes

Which limit comes next

42 / 50
Which limit comes next
When the next limit comes

Up before out

43 / 50
Up before out
When the next limit comes

When several machines are worth it

44 / 50
When several machines are worth it
When the next limit comes

Does the database have to change?

45 / 50
Does the database have to change?
On the way to production

What production adds

46 / 50
What production adds
On the way to production

Budgets, a capacity run, and the checklist

47 / 50
Budgets, a capacity run, and the checklist
On the way to production

What MiniCTRM has today

48 / 50
What MiniCTRM has today
Ship it

Ship it

49 / 50
Ship it
What you have now

A hundred thousand trades, measured

50 / 50
A hundred thousand trades, measured

You have finished lesson 645, Valuing 100,000 trades: capacity, measured, and the design that scales.

Where next?

← → move · N notes · Home / End