StaticcounterExtracts the low-bit counter from an encoded order ID.
Encoded perpetuals order ID.
The counter portion as a bigint.
StaticisDetermines whether an encoded order ID represents an ask order.
Encoded perpetuals order ID.
true when the ID is below the protocol's 2^127 ask threshold.
StaticorderEncodes a fixed-point order price, counter, and side as an order ID.
Fixed-point price integer, usually scaled by 1e9.
Per-market order counter stored in the low bits.
PerpetualsOrderSide.Ask or PerpetualsOrderSide.Bid.
The encoded order ID as a bigint.
StaticpriceExtracts the fixed-point price from an encoded order ID.
Encoded perpetuals order ID.
The original fixed-point price integer as a bigint.
Encodes and decodes perpetuals order IDs.
An order ID stores a fixed-point price in the high bits and a counter in the low bits. Ask IDs store the price directly. Bid IDs store the 64-bit price complement, which lets isAsk distinguish the side from the highest bit.