- Bids: Buy orders, sorted by Price DESC, then by Time ASC (Price-Time Priority).
- Asks: Sell orders, sorted by Price ASC, then by Time ASC.
Precision (Scaled Integers)
To avoid floating-point errors, Spectre uses Scaled Integers for all core arithmetic in the matching engine.- Price Scale:
100(2 decimal places)- Example: A price of
$10.50is represented internally as1050.
- Example: A price of
- Quantity Scale:
100,000,000(8 decimal places)- Example: A quantity of
1.5 BTCis represented internally as150000000.
- Example: A quantity of
Note: The API handles this conversion automatically. You should send standard floats (e.g.,10.50,1.5) in your JSON-RPC requests, and the API layer will convert them before passing them to the engine.