# Get all events by position

`GET /positions/{positionId}/history`

What happened to one position, newest first: increases, partial and full closes, liquidation, force close, margin changes.

- Funding payments are left out of this feed.
- A force close carries the market event behind it, which is where the reason for it lives.

## Authorization

bearer: http · bearer (required). Personal API key, prefixed with `usk_`.

## Parameters

- path: positionId (string · uuid; required). Position identifier. Its account must belong to the caller.

Type: string · uuid

format: uuid

## Example · cURL

```bash
curl --request GET 'https://api.upscale.trade/positions/{positionId}/history' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY'
```

## Example · JavaScript

```javascript
const response = await fetch("https://api.upscale.trade/positions/{positionId}/history", {
  method: "GET",
  headers: {
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_API_KEY"
  },
});
console.log(response.status, await response.text());
```

## Example · Python

```python
import requests

response = requests.request(
    "GET",
    "https://api.upscale.trade/positions/{positionId}/history",
    headers={"Accept":"application/json","Authorization":"Bearer YOUR_API_KEY"},
    timeout=30,
)
print(response.status_code, response.text)
```

## Response 401

**401**  — Unauthorized

## Response 403

**403**  — The account belongs to another user (`account_access_denied`), or the request is authenticated with an API key while `api_trading` is disabled on the account (`api_trading_not_enabled`).

## Response 404

**404**  — No position with this identifier.

## Response 429

**429**  — Rate limit of the API key exceeded (`api_key_rate_limit_exceeded`). `Retry-After` says when to come back; the body carries the bucket (`read` / `write`), the window that tripped, its limit and `retryAt`.

## Response default · PositionEventResponse

**default** application/json — Response

Type: object[]

[]Schema: PositionEventResponse

[]Type: object

[]Required fields: idx, txId, version, openedAt, lastUpdatedAt, closedAt, type, status, market, trader, size, notional, fraction, margin, pnl, funding, rolloverFee, settlementOraclePrice, fee, feeRate, exchangedQuote, exchangedBase, direction, eventName, pnlInEvent, rawPnlInEvent, profitAdjustmentApplied, holdingTimeMs, feeInEvent, fundingInEvent, rolloverFeeInEvent, executionFeeRate, executionFeeInEvent, executionFee, timestamp, isOnchain, roe, scalpingCoefficient, closeReason, order

[]Required field types: idx (string[]; required), txId (string[]; required), version (number; required), openedAt (string · date-time; required), lastUpdatedAt (string · date-time; required), closedAt (string · date-time · nullable; required), type (string · enum; required), status (string · enum; required), market (string · uuid; required), trader (string · uuid; required), size (string · int32; required), notional (string · int32; required), fraction (string · int32; required), margin (string · int32; required), pnl (string · int32 · nullable; required), funding (string · int32 · nullable; required), rolloverFee (string · int32; required), settlementOraclePrice (string · int32; required), fee (string · int32; required), feeRate (string · int32; required), exchangedQuote (string · int32; required), exchangedBase (string · int32; required), direction (string · enum; required), eventName (string · enum; required), pnlInEvent (string · int32; required), rawPnlInEvent (string · int32; required), profitAdjustmentApplied (boolean; required), holdingTimeMs (string[]; required), feeInEvent (string · int32; required), fundingInEvent (string · int32; required), rolloverFeeInEvent (string · int32; required), executionFeeRate (string · int32; required), executionFeeInEvent (string · int32; required), executionFee (string · int32; required), timestamp (string · date-time; required), isOnchain (boolean; required), roe (string · int32; required), scalpingCoefficient (string · int32; required), closeReason (string[]; required), order (object · nullable; required)

- []idx (string[]; required)

[]idx example: [
  "string"
]

[]idx.Type: string[]

[]idx.Position identifier. Same value as `txId`.

[]idx.[]Type: string

- []txId (string[]; required)

[]txId example: [
  "string"
]

[]txId.Type: string[]

[]txId.Position identifier. Kept for backward compatibility, always equal to `idx`.

[]txId.[]Type: string

- []version (number; required)

[]version example: 0

[]version.Type: number

[]version.Revision of the position: incremented by every event applied to it.

- []openedAt (string · date-time; required)

[]openedAt example: 2026-05-01T12:30:00.000Z

[]openedAt.Type: string · date-time

[]openedAt.When the position was opened.

[]openedAt.format: date-time

- []lastUpdatedAt (string · date-time; required)

[]lastUpdatedAt example: 2026-05-01T12:30:00.000Z

[]lastUpdatedAt.Type: string · date-time

[]lastUpdatedAt.When the last event was applied to the position.

[]lastUpdatedAt.format: date-time

- []closedAt (string · date-time · nullable; required)

[]closedAt example: 2026-05-01T12:30:00.000Z

[]closedAt.Type: string · date-time · nullable

[]closedAt.When the position was closed; null while it is still open.

[]closedAt.format: date-time

- []type (string · enum; required)

[]type example: long

[]type.Type: string · enum

[]type.Direction of the position. Same value as `direction`.

[]type.Allowed values: ["long","short"]

- []status (string · enum; required)

[]status example: opened

[]status.Type: string · enum

[]status.Whether the position is still open, closed by the trader, or liquidated.

[]status.Allowed values: ["opened","closed","liquidated"]

- []market (string · uuid; required)

[]market example: 00000000-0000-4000-8000-000000000000

[]market.Type: string · uuid

[]market.Market the position is held on.

[]market.format: uuid

[]market.pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$

- []trader (string · uuid; required)

[]trader example: 00000000-0000-4000-8000-000000000000

[]trader.Type: string · uuid

[]trader.Trader account the position belongs to.

[]trader.format: uuid

[]trader.pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$

- []size (string · int32; required)

[]size example: 1000000000

[]size.Type: string · int32

[]size.Position size in base asset units, fp9 raw.

[]size.format: int32

[]size.pattern: ^(?:-?[1-9][0-9]*|0)$

- []notional (string · int32; required)

[]notional example: 1000000000

[]notional.Type: string · int32

[]notional.Open notional of the position in quote currency, fp9 raw — size at entry price.

[]notional.format: int32

[]notional.pattern: ^(?:-?[1-9][0-9]*|0)$

- []fraction (string · int32; required)

[]fraction example: 1000000000

[]fraction.Type: string · int32

[]fraction.Always `0`. Kept for backward compatibility.

[]fraction.format: int32

[]fraction.pattern: ^(?:-?[1-9][0-9]*|0)$

- []margin (string · int32; required)

[]margin example: 1000000000

[]margin.Type: string · int32

[]margin.Margin currently backing the position, fp9 raw. Moves with pnl, funding and manual margin changes.

[]margin.format: int32

[]margin.pattern: ^(?:-?[1-9][0-9]*|0)$

- []pnl (string · int32 · nullable; required)

[]pnl example: 1000000000

[]pnl.Type: string · int32 · nullable

[]pnl.Realised pnl accumulated over every event of the position, fp9 raw.

[]pnl.format: int32

[]pnl.pattern: ^(?:-?[1-9][0-9]*|0)$

- []funding (string · int32 · nullable; required)

[]funding example: 1000000000

[]funding.Type: string · int32 · nullable

[]funding.Funding paid (negative) or received (positive) over the life of the position, fp9 raw.

[]funding.format: int32

[]funding.pattern: ^(?:-?[1-9][0-9]*|0)$

- []rolloverFee (string · int32; required)

[]rolloverFee example: 1000000000

[]rolloverFee.Type: string · int32

[]rolloverFee.Always `0`. Kept for backward compatibility.

[]rolloverFee.format: int32

[]rolloverFee.pattern: ^(?:-?[1-9][0-9]*|0)$

- []settlementOraclePrice (string · int32; required)

[]settlementOraclePrice example: 1000000000

[]settlementOraclePrice.Type: string · int32

[]settlementOraclePrice.Always `1000000000` (1.0). Kept for backward compatibility.

[]settlementOraclePrice.format: int32

[]settlementOraclePrice.pattern: ^(?:-?[1-9][0-9]*|0)$

- []fee (string · int32; required)

[]fee example: 1000000000

[]fee.Type: string · int32

[]fee.Trading fees charged over the life of the position, fp9 raw.

[]fee.format: int32

[]fee.pattern: ^(?:-?[1-9][0-9]*|0)$

- []feeRate (string · int32; required)

[]feeRate example: 1000000000

[]feeRate.Type: string · int32

[]feeRate.Fee rate applied to the position, fp9 raw fraction (`1000000` = 0.1%).

[]feeRate.format: int32

[]feeRate.pattern: ^(?:-?[1-9][0-9]*|0)$

- []exchangedQuote (string · int32; required)

[]exchangedQuote example: 1000000000

[]exchangedQuote.Type: string · int32

[]exchangedQuote.Quote amount exchanged by the most recent event, fp9 raw.

[]exchangedQuote.format: int32

[]exchangedQuote.pattern: ^(?:-?[1-9][0-9]*|0)$

- []exchangedBase (string · int32; required)

[]exchangedBase example: 1000000000

[]exchangedBase.Type: string · int32

[]exchangedBase.Base amount exchanged by the most recent event, fp9 raw.

[]exchangedBase.format: int32

[]exchangedBase.pattern: ^(?:-?[1-9][0-9]*|0)$

- []direction (string · enum; required)

[]direction example: long

[]direction.Type: string · enum

[]direction.Direction of the position.

[]direction.Allowed values: ["long","short"]

- []eventName (string · enum; required)

[]eventName example: addMargin

[]eventName.Type: string · enum

[]eventName.Type of the most recent event applied to the position.

[]eventName.Allowed values: ["addMargin","removeMargin","closePosition","increasePosition","liquidate","forceClose","payFunding"]

- []pnlInEvent (string · int32; required)

[]pnlInEvent example: 1000000000

[]pnlInEvent.Type: string · int32

[]pnlInEvent.Realised pnl of the most recent event, fp9 raw.

[]pnlInEvent.format: int32

[]pnlInEvent.pattern: ^(?:-?[1-9][0-9]*|0)$

- []rawPnlInEvent (string · int32; required)

[]rawPnlInEvent example: 1000000000

[]rawPnlInEvent.Type: string · int32

[]rawPnlInEvent.Realised pnl of the most recent event before the 60-second adjustment, fp9 raw. Differs from `pnlInEvent` only when the adjustment fired.

[]rawPnlInEvent.format: int32

[]rawPnlInEvent.pattern: ^(?:-?[1-9][0-9]*|0)$

- []profitAdjustmentApplied (boolean; required)

[]profitAdjustmentApplied example: true

[]profitAdjustmentApplied.Type: boolean

[]profitAdjustmentApplied.Whether the 60-second adjustment capped the profit of the most recent event — inside a minute of an open or increase the position pnl cannot grow above what it was at that moment.

- []holdingTimeMs (string[]; required)

[]holdingTimeMs example: [
  "string"
]

[]holdingTimeMs.Type: string[]

[]holdingTimeMs.How long the position was held before the most recent close, in milliseconds, counted from the open or the last increase. Null on events that are not closes.

[]holdingTimeMs.[]Type: string

- []feeInEvent (string · int32; required)

[]feeInEvent example: 1000000000

[]feeInEvent.Type: string · int32

[]feeInEvent.Fee charged by the most recent event, fp9 raw.

[]feeInEvent.format: int32

[]feeInEvent.pattern: ^(?:-?[1-9][0-9]*|0)$

- []fundingInEvent (string · int32; required)

[]fundingInEvent example: 1000000000

[]fundingInEvent.Type: string · int32

[]fundingInEvent.Funding settled by the most recent event, fp9 raw.

[]fundingInEvent.format: int32

[]fundingInEvent.pattern: ^(?:-?[1-9][0-9]*|0)$

- []rolloverFeeInEvent (string · int32; required)

[]rolloverFeeInEvent example: 1000000000

[]rolloverFeeInEvent.Type: string · int32

[]rolloverFeeInEvent.Always `0`. Kept for backward compatibility.

[]rolloverFeeInEvent.format: int32

[]rolloverFeeInEvent.pattern: ^(?:-?[1-9][0-9]*|0)$

- []executionFeeRate (string · int32; required)

[]executionFeeRate example: 1000000000

[]executionFeeRate.Type: string · int32

[]executionFeeRate.Always `0`. Kept for backward compatibility.

[]executionFeeRate.format: int32

[]executionFeeRate.pattern: ^(?:-?[1-9][0-9]*|0)$

- []executionFeeInEvent (string · int32; required)

[]executionFeeInEvent example: 1000000000

[]executionFeeInEvent.Type: string · int32

[]executionFeeInEvent.Always `0`. Kept for backward compatibility.

[]executionFeeInEvent.format: int32

[]executionFeeInEvent.pattern: ^(?:-?[1-9][0-9]*|0)$

- []executionFee (string · int32; required)

[]executionFee example: 1000000000

[]executionFee.Type: string · int32

[]executionFee.Always `0`. Kept for backward compatibility.

[]executionFee.format: int32

[]executionFee.pattern: ^(?:-?[1-9][0-9]*|0)$

- []timestamp (string · date-time; required)

[]timestamp example: 2026-05-01T12:30:00.000Z

[]timestamp.Type: string · date-time

[]timestamp.Timestamp of the most recent event. Same value as `lastUpdatedAt`.

[]timestamp.format: date-time

- []isOnchain (boolean; required)

[]isOnchain example: true

[]isOnchain.Type: boolean

[]isOnchain.Always `true`. Kept for backward compatibility.

- []roe (string · int32; required)

[]roe example: 1000000000

[]roe.Type: string · int32

[]roe.Return on equity of the position — realised pnl over the margin put up, fp9 raw fraction.

[]roe.format: int32

[]roe.pattern: ^(?:-?[1-9][0-9]*|0)$

- []scalpingCoefficient (string · int32; required)

[]scalpingCoefficient example: 1000000000

[]scalpingCoefficient.Type: string · int32

[]scalpingCoefficient.Dynamic spread multiplier the position was charged, fp9 raw (`1000000000` = 1.0). Above 1 when the trade fell inside the market scalping window.

[]scalpingCoefficient.format: int32

[]scalpingCoefficient.pattern: ^(?:-?[1-9][0-9]*|0)$

- []closeReason (string[]; required)

[]closeReason example: [
  "string"
]

[]closeReason.Type: string[]

[]closeReason.Why the platform closed the position (for example `weekly_session_risk_close`). Null for positions closed by the trader and for open ones.

[]closeReason.[]Type: string

- []order (object · nullable; required)

[]order example: {
  "id": "00000000-0000-4000-8000-000000000000",
  "txId": "string",
  "trader": "00000000-0000-4000-8000-000000000000",
  "market": "00000000-0000-4000-8000-000000000000",
  "status": "active",
  "type": "market",
  "direction": "long",
  "triggerPrice": "1000000000",
  "requestedTriggerPrice": "1000000000",
  "stopPrice": "1000000000",
  "limitPrice": "1000000000",
  "stopTriggerPrice": "1000000000",
  "takeTriggerPrice": "1000000000",
  "trailingStopActivationPrice": "1000000000",
  "trailingStopOffset": "1000000000",
  "trailingStopOffsetPercent": "1000000000",
  "leverage": "1000000000",
  "index": "string",
  "positionId": "string",
  "parentOrderId": "string",
  "expiration": "2026-05-01T12:30:00.000Z",
  "amount": "1000000000",
  "indexPrice": "1000000000",
  "settlementOraclePrice": "1000000000",
  "createdAt": "2026-05-01T12:30:00.000Z",
  "error": "string",
  "realizedPnl": "1000000000",
  "rawRealizedPnl": "1000000000",
  "profitAdjustmentApplied": true,
  "executedAfterPause": true,
  "sizeMode": "quote",
  "baseSize": "1000000000",
  "reservedAmount": "1000000000",
  "errorCode": "string",
  "reason": "force_close"
}

[]order.Type: object · nullable

[]order.Required fields: id, txId, trader, market, status, type, direction, triggerPrice, requestedTriggerPrice, stopPrice, limitPrice, stopTriggerPrice, takeTriggerPrice, trailingStopActivationPrice, trailingStopOffset, trailingStopOffsetPercent, leverage, index, positionId, parentOrderId, expiration, amount, indexPrice, settlementOraclePrice, createdAt, error, realizedPnl, rawRealizedPnl, profitAdjustmentApplied, executedAfterPause, sizeMode, baseSize, reservedAmount, errorCode, reason

[]order.Required field types: id (string · uuid; required), txId (string; required), trader (string · uuid; required), market (string · uuid; required), status (string · enum; required), type (string · enum; required), direction (string · enum; required), triggerPrice (string · int32; required), requestedTriggerPrice (string · int32 · nullable; required), stopPrice (string · int32; required), limitPrice (string · int32; required), stopTriggerPrice (string · int32; required), takeTriggerPrice (string · int32; required), trailingStopActivationPrice (string · int32; required), trailingStopOffset (string · int32; required), trailingStopOffsetPercent (string · int32; required), leverage (string · int32 · nullable; required), index (string; required), positionId (string · nullable; required), parentOrderId (string · nullable; required), expiration (string · date-time · nullable; required), amount (string · int32; required), indexPrice (string · int32 · nullable; required), settlementOraclePrice (string · int32; required), createdAt (string · date-time; required), error (string · nullable; required), realizedPnl (string · int32 · nullable; required), rawRealizedPnl (string · int32 · nullable; required), profitAdjustmentApplied (boolean; required), executedAfterPause (boolean; required), sizeMode (string · enum; required), baseSize (string · int32 · nullable; required), reservedAmount (string · int32 · nullable; required), errorCode (string · nullable; required), reason (string · enum · nullable; required)

[]order.Order that produced this event; null for events the platform raised on its own, such as funding or a force close.

- []order.id (string · uuid; required)

[]order.id example: 00000000-0000-4000-8000-000000000000

[]order.id.Type: string · uuid

[]order.id.Order identifier.

[]order.id.format: uuid

[]order.id.pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$

- []order.txId (string; required)

[]order.txId example: string

[]order.txId.Type: string

[]order.txId.Order identifier. Kept for backward compatibility, always equal to `id`.

- []order.trader (string · uuid; required)

[]order.trader example: 00000000-0000-4000-8000-000000000000

[]order.trader.Type: string · uuid

[]order.trader.Trader account the order belongs to.

[]order.trader.format: uuid

[]order.trader.pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$

- []order.market (string · uuid; required)

[]order.market example: 00000000-0000-4000-8000-000000000000

[]order.market.Type: string · uuid

[]order.market.Market the order is placed on.

[]order.market.format: uuid

[]order.market.pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$

- []order.status (string · enum; required)

[]order.status example: active

[]order.status.Type: string · enum

[]order.status.Lifecycle state: `active` while it waits, `executed` once filled, `canceled` when cancelled by the trader or the platform, `canceled_by_update` when replaced by an edit, `canceled_by_position` when the position it was attached to went away, `canceled_by_error` when execution failed — see `errorCode`.

[]order.status.Allowed values: ["active","canceled","canceled_by_update","canceled_by_error","canceled_by_position","executed"]

- []order.type (string · enum; required)

[]order.type example: market

[]order.type.Type: string · enum

[]order.type.Order type. `liquidation` marks an order the engine raised itself.

[]order.type.Allowed values: ["market","limit","stop","trailing_stop","take","stop_limit","stop_market","liquidation"]

- []order.direction (string · enum; required)

[]order.direction example: long

[]order.direction.Type: string · enum

[]order.direction.Order direction.

[]order.direction.Allowed values: ["long","short"]

- []order.triggerPrice (string · int32; required)

[]order.triggerPrice example: 1000000000

[]order.triggerPrice.Type: string · int32

[]order.triggerPrice.Price at which the order fires, fp9 raw. `0` when the order carries no trigger.

[]order.triggerPrice.format: int32

[]order.triggerPrice.pattern: ^(?:-?[1-9][0-9]*|0)$

- []order.requestedTriggerPrice (string · int32 · nullable; required)

[]order.requestedTriggerPrice example: 1000000000

[]order.requestedTriggerPrice.Type: string · int32 · nullable

[]order.requestedTriggerPrice.Trigger price as requested, before the engine pushed it out to the minimum stop distance, fp9 raw. Null when the requested price was kept as is.

[]order.requestedTriggerPrice.format: int32

[]order.requestedTriggerPrice.pattern: ^(?:-?[1-9][0-9]*|0)$

- []order.stopPrice (string · int32; required)

[]order.stopPrice example: 1000000000

[]order.stopPrice.Type: string · int32

[]order.stopPrice.Trigger price of a `stop_market` / `stop_limit` order, fp9 raw; `0` for every other type.

[]order.stopPrice.format: int32

[]order.stopPrice.pattern: ^(?:-?[1-9][0-9]*|0)$

- []order.limitPrice (string · int32; required)

[]order.limitPrice example: 1000000000

[]order.limitPrice.Type: string · int32

[]order.limitPrice.Price the order is placed at once triggered, fp9 raw: the stop-limit price, falling back to the trigger price.

[]order.limitPrice.format: int32

[]order.limitPrice.pattern: ^(?:-?[1-9][0-9]*|0)$

- []order.stopTriggerPrice (string · int32; required)

[]order.stopTriggerPrice example: 1000000000

[]order.stopTriggerPrice.Type: string · int32

[]order.stopTriggerPrice.Stop-loss attached to the order, fp9 raw. `0` when none is attached.

[]order.stopTriggerPrice.format: int32

[]order.stopTriggerPrice.pattern: ^(?:-?[1-9][0-9]*|0)$

- []order.takeTriggerPrice (string · int32; required)

[]order.takeTriggerPrice example: 1000000000

[]order.takeTriggerPrice.Type: string · int32

[]order.takeTriggerPrice.Take-profit attached to the order, fp9 raw. `0` when none is attached.

[]order.takeTriggerPrice.format: int32

[]order.takeTriggerPrice.pattern: ^(?:-?[1-9][0-9]*|0)$

- []order.trailingStopActivationPrice (string · int32; required)

[]order.trailingStopActivationPrice example: 1000000000

[]order.trailingStopActivationPrice.Type: string · int32

[]order.trailingStopActivationPrice.Price at which a trailing stop starts trailing, fp9 raw. `0` when it trails from creation.

[]order.trailingStopActivationPrice.format: int32

[]order.trailingStopActivationPrice.pattern: ^(?:-?[1-9][0-9]*|0)$

- []order.trailingStopOffset (string · int32; required)

[]order.trailingStopOffset example: 1000000000

[]order.trailingStopOffset.Type: string · int32

[]order.trailingStopOffset.Trailing distance as an absolute quote amount, fp9 raw. `0` when the distance is set as a percent.

[]order.trailingStopOffset.format: int32

[]order.trailingStopOffset.pattern: ^(?:-?[1-9][0-9]*|0)$

- []order.trailingStopOffsetPercent (string · int32; required)

[]order.trailingStopOffsetPercent example: 1000000000

[]order.trailingStopOffsetPercent.Type: string · int32

[]order.trailingStopOffsetPercent.Trailing distance as a fraction of price, fp9 raw. `0` when the distance is absolute.

[]order.trailingStopOffsetPercent.format: int32

[]order.trailingStopOffsetPercent.pattern: ^(?:-?[1-9][0-9]*|0)$

- []order.leverage (string · int32 · nullable; required)

[]order.leverage example: 1000000000

[]order.leverage.Type: string · int32 · nullable

[]order.leverage.Leverage of the order, fp9 raw. Null on close orders, which inherit the leverage of the position.

[]order.leverage.format: int32

[]order.leverage.pattern: ^(?:-?[1-9][0-9]*|0)$

- []order.index (string; required)

[]order.index example: string

[]order.index.Type: string

[]order.index.Order identifier. Kept for backward compatibility, always equal to `id`.

- []order.positionId (string · nullable; required)

[]order.positionId example: string

[]order.positionId.Type: string · nullable

[]order.positionId.Position a close order is attached to. Null for orders that open or grow a position.

- []order.parentOrderId (string · nullable; required)

[]order.parentOrderId example: string

[]order.parentOrderId.Type: string · nullable

[]order.parentOrderId.Order this one was spawned from: a stop or take created out of `stopTriggerPrice` / `takeTriggerPrice`, or the limit order a `stop_limit` turned into. Null when the order was submitted directly.

- []order.expiration (string · date-time · nullable; required)

[]order.expiration example: 2026-05-01T12:30:00.000Z

[]order.expiration.Type: string · date-time · nullable

[]order.expiration.Always null. Kept for backward compatibility — orders do not expire on their own.

[]order.expiration.format: date-time

- []order.amount (string · int32; required)

[]order.amount example: 1000000000

[]order.amount.Type: string · int32

[]order.amount.Size of the order, fp9 raw, in the unit its class uses: on an increase order a quote amount — the reserve while it waits, and what it actually spent once executed; on a close order (`stop`, `take`, `trailing_stop`) the base asset size it closes, as requested at creation.

[]order.amount.format: int32

[]order.amount.pattern: ^(?:-?[1-9][0-9]*|0)$

- []order.indexPrice (string · int32 · nullable; required)

[]order.indexPrice example: 1000000000

[]order.indexPrice.Type: string · int32 · nullable

[]order.indexPrice.Index price the order executed at, fp9 raw. Null while the order has not executed.

[]order.indexPrice.format: int32

[]order.indexPrice.pattern: ^(?:-?[1-9][0-9]*|0)$

- []order.settlementOraclePrice (string · int32; required)

[]order.settlementOraclePrice example: 1000000000

[]order.settlementOraclePrice.Type: string · int32

[]order.settlementOraclePrice.Always `1000000000` (1.0). Kept for backward compatibility.

[]order.settlementOraclePrice.format: int32

[]order.settlementOraclePrice.pattern: ^(?:-?[1-9][0-9]*|0)$

- []order.createdAt (string · date-time; required)

[]order.createdAt example: 2026-05-01T12:30:00.000Z

[]order.createdAt.Type: string · date-time

[]order.createdAt.When the order was accepted.

[]order.createdAt.format: date-time

- []order.error (string · nullable; required)

[]order.error example: string

[]order.error.Type: string · nullable

[]order.error.Always null. Kept for backward compatibility — use `errorCode`.

- []order.realizedPnl (string · int32 · nullable; required)

[]order.realizedPnl example: 1000000000

[]order.realizedPnl.Type: string · int32 · nullable

[]order.realizedPnl.Pnl realised by this order, fp9 raw. Set only on an executed close order; null while pending and on orders that open or grow a position.

[]order.realizedPnl.format: int32

[]order.realizedPnl.pattern: ^(?:-?[1-9][0-9]*|0)$

- []order.rawRealizedPnl (string · int32 · nullable; required)

[]order.rawRealizedPnl example: 1000000000

[]order.rawRealizedPnl.Type: string · int32 · nullable

[]order.rawRealizedPnl.Realised pnl before the 60-second adjustment, fp9 raw. Differs from `realizedPnl` only when the adjustment fired.

[]order.rawRealizedPnl.format: int32

[]order.rawRealizedPnl.pattern: ^(?:-?[1-9][0-9]*|0)$

- []order.profitAdjustmentApplied (boolean; required)

[]order.profitAdjustmentApplied example: true

[]order.profitAdjustmentApplied.Type: boolean

[]order.profitAdjustmentApplied.Whether the 60-second adjustment capped the profit of this order — inside a minute of an open or increase the position pnl cannot grow above what it was at that moment.

- []order.executedAfterPause (boolean; required)

[]order.executedAfterPause example: true

[]order.executedAfterPause.Type: boolean

[]order.executedAfterPause.Whether the order executed after a market pause. Not set by the current engine — always `false`.

- []order.sizeMode (string · enum; required)

[]order.sizeMode example: quote

[]order.sizeMode.Type: string · enum

[]order.sizeMode.How the size was expressed on creation: `quote` sizes the order by `amount`, `base` sizes it by `baseSize`.

[]order.sizeMode.Allowed values: ["quote","base"]

- []order.baseSize (string · int32 · nullable; required)

[]order.baseSize example: 1000000000

[]order.baseSize.Type: string · int32 · nullable

[]order.baseSize.Order size in base asset units, fp9 raw. Null for `quote`-sized orders.

[]order.baseSize.format: int32

[]order.baseSize.pattern: ^(?:-?[1-9][0-9]*|0)$

- []order.reservedAmount (string · int32 · nullable; required)

[]order.reservedAmount example: 1000000000

[]order.reservedAmount.Type: string · int32 · nullable

[]order.reservedAmount.Quote amount reserved when the order with sizeMode=base was created, fp9 raw. Stays at the original reserve after execution, while `amount` is rewritten to what was spent. Null for `quote`-sized orders, where `amount` is the reserve.

[]order.reservedAmount.format: int32

[]order.reservedAmount.pattern: ^(?:-?[1-9][0-9]*|0)$

- []order.errorCode (string · nullable; required)

[]order.errorCode example: string

[]order.errorCode.Type: string · nullable

[]order.errorCode.Why execution failed, set together with status `canceled_by_error` — for example `insufficient_reserve_at_execution`, `order_below_min_notional`, `order_exceeds_market_depth` or `slippage_tolerance`. Null otherwise.

- []order.reason (string · enum · nullable; required)

[]order.reason example: force_close

[]order.reason.Type: string · enum · nullable

[]order.reason.Why the platform cancelled the order itself, for example `force_close` or `weekly_session_risk_close`. Null for trader-driven cancellations.

[]order.reason.Allowed values: ["force_close","stop_accounts_fail","stop_accounts_freeze","stop_accounts_promote","stop_accounts_manual","weekly_session_risk_close",null]

Example



```json
[
  {
    "idx": [
      "string"
    ],
    "txId": [
      "string"
    ],
    "version": 0,
    "openedAt": "2026-05-01T12:30:00.000Z",
    "lastUpdatedAt": "2026-05-01T12:30:00.000Z",
    "closedAt": "2026-05-01T12:30:00.000Z",
    "type": "long",
    "status": "opened",
    "market": "00000000-0000-4000-8000-000000000000",
    "trader": "00000000-0000-4000-8000-000000000000",
    "size": "1000000000",
    "notional": "1000000000",
    "fraction": "1000000000",
    "margin": "1000000000",
    "pnl": "1000000000",
    "funding": "1000000000",
    "rolloverFee": "1000000000",
    "settlementOraclePrice": "1000000000",
    "fee": "1000000000",
    "feeRate": "1000000000",
    "exchangedQuote": "1000000000",
    "exchangedBase": "1000000000",
    "direction": "long",
    "eventName": "addMargin",
    "pnlInEvent": "1000000000",
    "rawPnlInEvent": "1000000000",
    "profitAdjustmentApplied": true,
    "holdingTimeMs": [
      "string"
    ],
    "feeInEvent": "1000000000",
    "fundingInEvent": "1000000000",
    "rolloverFeeInEvent": "1000000000",
    "executionFeeRate": "1000000000",
    "executionFeeInEvent": "1000000000",
    "executionFee": "1000000000",
    "timestamp": "2026-05-01T12:30:00.000Z",
    "isOnchain": true,
    "roe": "1000000000",
    "scalpingCoefficient": "1000000000",
    "closeReason": [
      "string"
    ],
    "order": {
      "id": "00000000-0000-4000-8000-000000000000",
      "txId": "string",
      "trader": "00000000-0000-4000-8000-000000000000",
      "market": "00000000-0000-4000-8000-000000000000",
      "status": "active",
      "type": "market",
      "direction": "long",
      "triggerPrice": "1000000000",
      "requestedTriggerPrice": "1000000000",
      "stopPrice": "1000000000",
      "limitPrice": "1000000000",
      "stopTriggerPrice": "1000000000",
      "takeTriggerPrice": "1000000000",
      "trailingStopActivationPrice": "1000000000",
      "trailingStopOffset": "1000000000",
      "trailingStopOffsetPercent": "1000000000",
      "leverage": "1000000000",
      "index": "string",
      "positionId": "string",
      "parentOrderId": "string",
      "expiration": "2026-05-01T12:30:00.000Z",
      "amount": "1000000000",
      "indexPrice": "1000000000",
      "settlementOraclePrice": "1000000000",
      "createdAt": "2026-05-01T12:30:00.000Z",
      "error": "string",
      "realizedPnl": "1000000000",
      "rawRealizedPnl": "1000000000",
      "profitAdjustmentApplied": true,
      "executedAfterPause": true,
      "sizeMode": "quote",
      "baseSize": "1000000000",
      "reservedAmount": "1000000000",
      "errorCode": "string",
      "reason": "force_close"
    }
  }
]
```