@somnia-chain/markets-sdk


@somnia-chain/markets-sdk / index / OpenOrder

Type Alias: OpenOrder

OpenOrder = object

Defined in: packages/sdk/src/orders.ts:134

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:136

Order id (${pool}_${orderId}).


orderId

orderId: string

Defined in: packages/sdk/src/orders.ts:138

uint128 OrderId as a decimal string (pass to trader.cancelOrder).


market

market: string

Defined in: packages/sdk/src/orders.ts:149

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:154

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:159

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:164

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:169

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:171

Limit price, raw quote units per whole base (binary: YES-probability scale).


quantityRemaining

quantityRemaining: string

Defined in: packages/sdk/src/orders.ts:173

Unfilled remainder, raw base/outcome units.