PARQdb 19:23:47Z · 25ms

Order infrastructure

PARK SIZE.
MOVE LIQUIDITY.

Size sits still until someone can take the other side of it. PARQ holds the order, looks for the counterpart, and moves the status only when the system — never the screen — says it may.

Park an order · phase 2See the floor

The floor · 96 bays

101 orders in the table

parkedmatchingmatchedsettledempty bay

Each lit bay is one row in the orders table, drawn in the order it was parked.

Act 01

PARK

An order enters the system and stops. It is written down, given a reference, and held. Nothing about it moves until a counterpart exists.

What parking actually writes

refa reference a person can quote back
qtybase units, bigint — never a float
pricenumeric(24,9) — 0.42 is 0.42, not 0.41999…
parked_atrequired by the schema, or priority is undefined
eventone append-only row: → PARKED

The rule, written before the code

a BUY matches a SELL when

  asset          equal
  buy.maxPrice   >=  sell.price
  fillable       =   min(remaining)
  fillable       >   0

fill price  =  sell.price     the resting order wins
tie-break   =  parked_at ascending
rule        =  match/1

Act 02

MATCH

A separate process reads the floor and pairs what fits. It runs outside the web app, so no page load can trigger a match and two readers can never be handed the same order.

Every pairing records both order ids, the quantity, the price, whose price it was, and the rule version that produced it. A match with no readable reason is a row that looks exactly like a correct one.

Act 03

SETTLE

The transfer completes and the order is finished.

Not reachable yet, and the code agrees

SETTLING and SETTLED exist in the database enum so the state machine is complete, and no code path produces them. Nothing on chain can settle a PARQ order today, so nothing here will claim to.

In phase 2 the machine stops at MATCHED and says so. Settlement is phase 4, after a program exists and has been reviewed.

System, read on this request

101

orders in the table

1

parked right now

40

matched

24

matches recorded

assets listed 12 · tradable 11orders with an unlogged status: 0read in 25ms

The last figure is the schema’s own audit view. It counts orders whose current status has no event recording how it got there, and it is meant to be zero forever. If it is ever not, something wrote a status without logging it — the exact failure this design exists to prevent, so it is printed here rather than kept in a dashboard nobody opens.