Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Trade

A real-time perps trade fill from the subscribe_perps_trades stream. Keys are camelCase (indexer wire shape).

Definition

class Trade(TypedDict):
    orderId: str
    pairId: str
    user: str
    fillPrice: str
    fillSize: str
    closingSize: str
    openingSize: str
    realizedPnl: str
    fee: str
    createdAt: str
    blockHeight: int
    tradeIdx: int
    fillId: str | None
    isMaker: bool | None

Fields

orderIdstr. The chain order id this fill belongs to.

pairIdstr.

userstr. The user address that owns the order.

fillPrice/fillSizestr. 6-decimal strings.

closingSize/openingSizestr. The fill's split between closing an existing position and opening new size.

realizedPnl/feestr. Realised PnL and fee in USD.

createdAtstr. ISO-8601 datetime.

blockHeight/tradeIdxint.

fillIdstr | None. Stable per-fill id; pairs the maker and taker rows.

isMakerbool | None. True for the maker's view of the fill, False for the taker's. Each match emits both rows.

See also