Commit 6053581
Edward (Edwardbot)
docs(clob): rewrite README to the repo-wide quality bar
The previous README was a ~78-line stub. This version describes the
program as it actually exists today, including the matching engine
landed in ea96084.
Structure matches the rest of the overhaul:
1. What does this program do? (onchain mechanics first, with
tradfi terms — limit order, order book, maker/taker, price-time
priority — briefly explained in plain English before they get
used)
2. Glossary (account, PDA, CPI, bps, bid/ask, tick size,
unsettled balance, price improvement, remaining_accounts, etc.)
3. Accounts and PDAs (four program PDAs + three vaults; full
field lists; note the vaults are not PDAs, they are regular
token accounts whose authority is the Market PDA)
4. Instruction lifecycle walkthrough (six instructions, in the
order a user encounters them; per-ix signers / accounts / PDAs
created / token-flow diagrams / state changes / checks)
5. The matching engine — step by step (the critical section:
how place_order uses remaining_accounts; the plan/apply/clean/
fee/rest five-step structure; fee math; price improvement;
worked fill walkthroughs including a multi-maker sweep)
6. Full-lifecycle worked examples (clean match + settle,
partial fill + remainder, cancel + settle round trip)
7. Safety and edge cases (full error table; guarded design
choices; what the example does NOT do)
8. Running the tests (all 23 tests listed and categorised; CI
note confirming anchor build runs before anchor test)
9. Extending the program (easy / moderate / harder)
1433 lines. No code changes.1 parent ea96084 commit 6053581
1 file changed
Lines changed: 1402 additions & 47 deletions
0 commit comments