@somnia-chain/markets-sdk / index / OpenOrder
Type Alias: OpenOrder
OpenOrder =
object
Defined in: packages/sdk/src/orders.ts:138
A currently-open resting order (subset of the indexer Order entity), as
returned by SomniaMarketsClient.getOpenOrders. OrderRow extends it with the
lifecycle/fill-progress fields for order history.
Properties
id
id:
string
Defined in: packages/sdk/src/orders.ts:140
Order id (${pool}_${orderId}).
orderId
orderId:
string
Defined in: packages/sdk/src/orders.ts:142
uint128 OrderId as a decimal string (pass to trader.cancelOrder).
market
market:
string
Defined in: packages/sdk/src/orders.ts:153
The market's bytes32 marketId — the STABLE identity of the market this order belonged to, and the key to label a historical row by.
Use this, never pool alone: a binary pool is recycled across successive
markets, so the same pool names a different market depending on when the
order was placed. On SPOT/PERP the pool address IS the market id, so the
two agree there. Pass it straight to
client.getMarket for the full row.
marketInfo
marketInfo:
OrderMarket|null
Defined in: packages/sdk/src/orders.ts:158
The market's labelling context, so a row can be NAMED without a second query. Null only if the indexer has no market row for the order.
pool
pool:
string
Defined in: packages/sdk/src/orders.ts:163
Lower-cased pool address the order rests on. A TIME-VARYING binding — see
market for the identity that does not move.
side
side:
BinarySide|null
Defined in: packages/sdk/src/orders.ts:168
BINARY YES/NO classification; NULL on spot orders (the indexer only sets it
for binary). For a buy/sell distinction that works on BOTH kinds use isBid.
isBid
isBid:
boolean
Defined in: packages/sdk/src/orders.ts:173
True = bid (buy), false = ask (sell). The canonical buy/sell flag — set for
spot AND binary, unlike side which is null on spot. Colour/label off this.
price
price:
string
Defined in: packages/sdk/src/orders.ts:175
Limit price, raw quote units per whole base (binary: YES-probability scale).
quantityRemaining
quantityRemaining:
string
Defined in: packages/sdk/src/orders.ts:177
Unfilled remainder, raw base/outcome units.
userData
userData:
string
Defined in: packages/sdk/src/orders.ts:187
The opaque uint64 tag the PLACEMENT carried, as a decimal string; "0"
when the placement set none. The protocol stores it and never reads it, so
its meaning is the caller's — it is how a client correlates a returned row
with the order it sent, without keeping its own map from order ids.
A decimal string rather than a number: the full uint64 range does not fit a JavaScript number. Filter on it with OrdersOptions.userData.