@somnia-chain/markets-sdk


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

Type Alias: PerpOrderHistoryRow

PerpOrderHistoryRow = PerpPortfolioOrder & object

Defined in: packages/sdk/src/perp/portfolio.ts:249

A terminal (no longer working) perp order — the history counterpart to PerpPortfolioOrder, which is open-orders only.

Same fields plus the lifecycle ones that only matter once an order has stopped working: how it ended and when.

Type Declaration

status

status: OrderStatus

How the order ended.

Closed is terminal, not transitional: every pool places an order as Closed and a following OrderRested promotes it to Open, so an IOC that partially filled without resting stays Closed forever. Reading it as "still working" would show a finished order as live.

rested

rested: boolean

Whether the order ever rested on the book (an OrderRested fired).

expireTimestampNs

expireTimestampNs: string

Expiry as a uint64 NANOsecond timestamp (decimal string) — note the unit, the rest of this row is unix seconds. GTC carries type(uint64).max.

lastUpdatedAtTimestamp

lastUpdatedAtTimestamp: string

Unix seconds of the last state change — effectively when the order ended.