The documentation map¶
A high-precision C++20 market simulator that tests whether a strategy survives the queues, the fees and the latency of a
real venue -- the tiers, the path to take for a question, and which document owns which claim. The front door is
index.md; this page is the map behind it.
How the navigation groups these¶
The site's navigation puts the same documents on four shelves, because that is how a reader walks in: The Core -- how to run it and what each module is; Reference -- the numbers, the data and the tools; The Vault -- the retrospectives, the histories and the decisions; Project meta -- the plan, the design review and this map.
That is a different cut from the three tiers below, and the difference is worth stating rather than hiding. A tier is what a document may claim -- an answer, a reference, or evidence -- while a shelf is where a reader will look for it. So Architecture and Roadmap are tier 2 and sit on different shelves, and Design Review is tier 1 but sits under Project meta, because it is where a reader who asks "what does this project deliberately not do?" arrives. The tier table is the authority on what a document owns; the navigation is the route to it.
Three tiers¶
Twelve documents at one level was too many to read in any order, so they are in three tiers. The tier is the whole of the reading advice: read tier 1, look things up in tier 2, and open tier 3 only when you want the evidence for one specific claim.
| Tier | What it is | Documents | How to read it |
|---|---|---|---|
| 1. The answer and the argument | what the project found, why the instrument that found it is shaped the way it is, and what that line of work did not measure | Retrospective, Low-Latency Retrospective, Design Review, User Guide | in that order; about ninety minutes |
| 2. The reference | what exists, how to read the code, what each field means, what is left to do | Architecture, Main Line, Learning Path, Performance, Roadmap, Data Files, Tools | open the one that matches the question; none is meant to be read whole |
| 3. The evidence | the measurements in the order they were taken, the research record behind the closures, and one file per technical decision | Performance History and its three parts, Low-Latency Design, The studies, Research Notes, Decisions | search it; every part opens with the question it answers, and a decision is one file you can send as a link |
What this repository carries, and what it does not. Everything here is the instrument and the method: how a file
becomes an event, how a queue decides a fill, what a bar is, which lever was refused and why in mechanism terms, and the
command that re-derives each figure the documents quote — including the simulated results in basis points. It does not
carry an account's money: the live seat list, the size, a day's PnL in dollars, an equity line, a host's address or a key
live in an ignored private/ tree that no commit and no bundle carries, and tools/gate/check_leaks.py refuses one in
git ls-files. The test a page has to pass is not "does it mention money" but "could a reader reconstruct an account's
position or size from it": a fee schedule and a simulated capture in bps pass, a seat's name beside its live size does not.
The boundary itself, and the staged migration that is moving the rest, is
.clinerules section 7 and private/README.md.
Pick the path¶
| If you want to... | Read | Then |
|---|---|---|
| see what the project found | Retrospective | Design Review for how each closure was measured |
| see what could be reopened, and at what price | The frontier map | the row's own cheap test, which is the only part of it that costs anything |
| see what the engine work returned, and why it stopped | Low-Latency Retrospective | Performance for the rows |
| evaluate the design | Design Review | Architecture for what exists |
| understand market making | Learning Path | Design Review section 4 for the gate |
| read the code | Main Line | the module reference in Architecture |
| run it | User Guide | the Data Files note for the input contracts |
| review the plan | Roadmap | The studies for why each line is closed |
| find the tool behind a number | Tools | the marked block next to the number, which names the exact command |
| know what it costs | Performance | Low-Latency Design for why each change is faster |
| see how a number was obtained | Performance History | the part named in whichever document quoted it |
| send someone one decision | Decisions | the record's evidence section |
| find the meaning of a term in a table | Glossary | the field that prints it, in the Learning Path |
| look up a flag, or what it changes in a run | The L2 replay flags | the guide's part 1 for the run itself |
| write your own strategy | Writing your own strategy | the strategy layer for how the existing ones decide |
| put it on a server | Live and carry | the deploy section there: the host's three directories, deploy/bootstrap_server.sh, deploy/check_health.sh, deploy/rollback.sh, the two operator files at /etc/toyquant, and the SIGTERM sequence |
| know what may be published | Tools row for check_leaks.py |
the boundary itself is .clinerules section 7: what docs/ carries, what private/ carries, and what the scanner refuses |
Who owns what¶
Each document owns one kind of claim, and the last column is the part that keeps them from growing into each other. A document that starts explaining something in another document's row is the failure this table exists to prevent.
| Document | Tier | What it owns | Not the place for | Kept honest by |
|---|---|---|---|---|
| Retrospective | 1 | the eight closures, the number that closed each, the rules that came out of them, and the frontier map that sorts each closure by the kind of boundary it is | what exists in the code, or how to run it | prose linted |
| Low-Latency Retrospective | 1 | the engine line as a whole: what it was for, the order the attempts came in, what returned, the condition that stopped it, and what it never measured | a number, the mechanism of a change, or the measurement record | prose linted; every figure it needs is a link to a block the gate re-runs |
| The screening methodology | 1 | the funnel a new window, seat or size is judged by: the four stages, their sources, the measured limits of each, and the four inputs that stay the owner's | the numbers of a closed row, or how to run a sweep | prose linted; tools/study/significance.py recomputes its table |
| The expansion methodology | 1 | what the public one-to-five-person crypto market-making paradigms do, what this tree already does, the three real gaps, and the ladder from replay to a second seat with an entry condition per rung | a strategy's numbers, or the funnel's formulas | prose linted |
| Design Review | 1 | why the instrument is built this way, the C++ decisions with anchors, the headline results, the questions a reader asks, the limitations | the module reference, or the raw measurement records | prose linted; the size, test count, flags and tool paths it states are re-counted |
| User Guide | 1 | every mode, every flag, the data contracts, and the failure modes that waste an afternoon: an index over the eight pages in docs/using/ |
why anything is designed the way it is, or what a field means | prose linted, so a flag it forgets or invents fails the build |
| Architecture | 2 | what each module is, the contracts between them, the matching rules: an index over six parts in docs/architecture/ |
the rationale and the trade-offs | marked blocks re-run on every gate run |
| Main Line | 2 | the order to read the source in, the measured result each step produced, the verdict on what to keep, freeze or delete | how to run anything, or the mechanism behind a result | prose linted |
| Learning Path | 2 | the mechanisms the instrument has to model, and the field reference for each output line | engineering decisions, or how to run anything | prose linted |
| Performance | 2 | workloads, how to measure on this host, the current stage breakdown, and every optimisation attempted | the mechanism of a change, or the whole history | its ledger is paired measurements from tools/study/measure_l2_baseline.py |
| Roadmap | 2 | the maintained plan: coverage, backlog, gaps, stop line, what is deliberately not planned | what exists today, or the record of finished studies | prose linted |
| Data Files | 2 | the tick CSV format, the runtime outputs, the workflow that produces them | anything about the strategy or the design | the data directory it describes is the one the gate reads |
| Tools | 2 | which script answers which question, and which of them the gate runs | the results themselves | the documents that cite a tool are prose linted, so a moved script fails the build |
| Live operations | 1 | the four checklists a live window is run by: before the open, after the close, promoting a profile, and the emergency halt, each with the command that does it | the method or the results; this is the operator's page | prose linted; its flags are the operator tools' own |
What the project covers, and what it deliberately does not¶
The loop is feed adapters, an order book, a strategy, a pre-trade gate, one venue interface with four implementations behind it (the matcher, the paper broker, a live venue reached through a relay, and a recording replayed as one), execution reports, a portfolio, and a session that can be written down and taken over, in C++20 with CMake and a Python 3 toolchain for the measurement tools.
It is not a production exchange stack or a live-trading system. The connectivity is one order channel to a demo venue --
the relay holds the login, the orders subscription and the reconnect
(ADR 0005), which
ADR 0006 is moving into the engine slice by slice -- and no quoted number
was measured through it. There
is no market impact, no queue-position feedback from the strategy's own resting size, no calendar or contract lifecycle,
and no portfolio risk model beyond signed notional. The pre-trade risk pipeline is in-process (kill switch, fat finger,
rate, exposure, position), not a broker or exchange risk gateway. Each of those is a limitation in
the Design Review and a boundary with a reason in the
Roadmap, rather than a gap that nobody wrote down.
What keeps these tables true is mechanical, which is the only reason to trust them: tools/gate/lint_prose.py re-counts
every flag, queue model, tool path and size figure a document states and every file under tools/ that the tools page
leaves out, tools/gate/check_docs.py re-runs the command behind every quoted number, tools/gate/check_links.py follows
every link and anchor in the three tiers, and tools/gate/check_adr.py holds each decision's status to the table that
lists it.
How the tree is laid out¶
docs/ holds tiers 1 and 2 at the top level. using/ and architecture/ hold the parts of the two longest references --
the guide and the module reference -- and a part is split into smaller pages where it grew long. performance/ and archive/ hold tier 3: the measurement of the engine, and the research record.
adr/ holds one file per decision. Nothing in tier 3 is unfinished or disowned -- it is the material that made the
closures in tier 1 possible, kept because a reason that is not written down is a reason nobody can check.
| Performance History | 3 | the measurements in the order they were taken, superseded ones included: one index and four parts | the current conclusions | every marked block re-run on every gate run |
| Low-Latency Design | 3 | why each low-latency change is faster: the problem, the mechanism, the designs that were rejected | the numbers themselves, or the line's narrative | prose linted |
| The studies | 3 | the research record: the phases, the venues, the carry gates, the options line, the plan from a positive window to a running system | what is still open | prose linted |
| Research Notes | 3 | external cases of individual quantitative trading, and what a personal account can do about the fee | any measurement of this repository, or a plan | every external claim carries a [read], [reported] or [not verified] mark |
| Workflow History | 3 | the failures behind the rules the agent works under: the sequence, the date, the number and the tell that names the failure class | the rules themselves, which .clinerules carries | prose linted |
| Decisions | 3 | one file per technical decision that closed a question: the context, the decision, what it costs, and the two or three links that measure it | the numbers themselves, or the research behind a market | a record quotes no figure it does not own, so every number in it is a link to a block the gate re-runs and the record cannot drift |
| Glossary | 2 | the concepts behind the numbers: one formula per term, the sign convention, and the file that computes it | the field list, which the learning path owns, or the measurement record | prose linted; every formula names the file it comes from |
| The L2 replay flags | 2 | every flag l2_replay takes, grouped by what it changes, plus the eight whose semantics need more than a line -- two books, the recorder, the session snapshot, the order leg, the live order leg, the feed thread, the paper broker's faults, the gateway's timeouts | how to run a replay, which the guide's part 1 owns, or the numbers a run prints | prose linted, so a flag the parser accepts and this page forgets fails the build |
| Writing your own strategy | 1 | how a strategy reaches the binary: the interface, the two seams, registration, and what a strategy may not own | the strategy layer's design, which the architecture owns | prose linted, so a flag or a class it forgets or invents fails the build |