# Create new order

`POST /orders`

Places an order and returns it as the trading engine stored it. Increase orders (`market`, `limit`, `stop_market`, `stop_limit`) open or grow a position;
close orders (`stop`, `take`, `trailing_stop`) attach to an existing position through `positionId`.

`amount` is read in a different unit by each of the two: on an increase order it is a quote amount reserved from the free balance, on a close
order it is the base asset size of the position to close, with nothing reserved. The rest of the size fields (`expectedAmount`, `sizeMode`,
`baseSize`, `leverage`) belong to increase orders only.

Beyond the field-level schema the request is checked for:

- **Shape for the type.** Every rejection here is a `400` whose code names the field combination at fault:
  - size — `amount_not_positive`, `base_size_required`, `base_size_negative`, `base_size_not_allowed`;
  - leverage — `leverage_required`, `leverage_negative`;
  - trigger price — `trigger_price_required`, `trigger_price_negative`;
  - stop-loss / take-profit attached to an increase order — `stop_trigger_price_negative`, `take_trigger_price_negative`,
    `stop_trigger_price_gt_trigger_price`, `stop_trigger_price_lt_trigger_price`, `take_trigger_price_gt_trigger_price`,
    `take_trigger_price_lt_trigger_price`;
  - stop-limit price — `stop_limit_price_required`, `stop_limit_price_negative`, `stop_limit_price_gt_trigger_price`,
    `stop_limit_price_lt_trigger_price`;
  - trailing stop — `trailing_stop_activation_price_negative`, `trailing_stop_offset_required`, `trailing_stop_offset_conflict`,
    `trailing_stop_offset_negative`, `trailing_stop_offset_percent_negative`, `trailing_stop_offset_percent_gte_one`;
  - `trailing_stop_offset_too_large` — an absolute LONG trailing offset would produce a zero or negative trigger price;
  - close orders — `position_id_required`.
- **Leverage** of an increase order. Must stay within market bounds: not below the market minimum and not above the phase maximum,
  with `invalid_leverage` (`leverage` plus `minLeverage` or `maxLeverage` in the body).
- **Account.** Must belong to the caller and be in a trading status; increase orders are additionally refused while the account is locked by the managed
  capital limit, and need `amount` available as free balance.
- **Market.** Must be open and inside the category the account may trade (crypto or RWA). A close-only market takes nothing but a `take` order created
  without a trigger price.
- **Position**, when `positionId` is given: it must exist (`position_not_found`), be open, sit on the same account, belong to the same
  market and run in the same direction as the order (`position_not_available`).
- **Trigger price**, against the current market price and — for `stop` / `take` — against the liquidation price of the position
  (`trigger_price_gt_current`, `trigger_price_lt_current`, `trigger_price_gt_liquidation`, `trigger_price_lt_liquidation`).
  A `market` order with an attached stop-loss / take-profit is checked against the liquidation price its position would have after the fill:
  `market_price_unavailable` when there is no current price to check against, `order_validation_invariant` when the size fields needed for
  that projection are missing.
- **Notional** of an increase order. `(amount − fee) × leverage` must fit the max open notional the market allows in that direction
  (`order_exceeds_max_open_notional`).

A deferred order is not executed here, so it can still fail when its trigger fires later: it then ends up with status `canceled_by_error` and an
`errorCode` (`insufficient_reserve_at_execution`, `order_below_min_notional`, `order_exceeds_market_depth`, `order_exceeds_max_open_notional`,
`order_exceeds_max_price_impact`, `order_zero_size_at_execution`, `slippage_tolerance`, `market_close_only_at_execution`), and its reserve is released.
An increase order is also cancelled with `order_exceeds_max_price_impact` when its price impact without the static spread exceeds the market
`maxPriceImpact` (`0` means no limit).

Send an `x-idempotency-key` header to make the call replay-safe: inside the replay window stated on that header, the same key on the same route replays the stored response (marked with `X-Idempotency-Cached: true` and `X-Idempotency-Timestamp`) instead of acting again, and a second call arriving while the first one is still running gets `409` (`idempotency_key_in_flight`).

## Authorization

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

## Parameters

- header: x-idempotency-key (string; optional). Idempotency key — any opaque string, a uuid v4 works well. Repeating the call with the same key on this route within 1 hour replays the stored response instead of acting again; a replay carries `X-Idempotency-Cached: true` and `X-Idempotency-Timestamp`. Omit the header to opt out.

Type: string

Example: "9f1c2b7e-5a3d-4f61-9b0e-2c7d4a8e1f35"

## Request body · OrderCreateRequest

application/json · required

Schema: OrderCreateRequest

Type: object

Required fields: accountId, marketId, type, direction, amount

Required field types: accountId (string · uuid; required), marketId (string · uuid; required), type (string · enum; required), direction (string · enum; required), amount (string · fp9; required)

- accountId (string · uuid; required)

accountId example: 00000000-0000-4000-8000-000000000000

accountId.Type: string · uuid

accountId.Trader account the order is placed on. Must belong to the caller.

accountId.format: uuid

accountId.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})$

- marketId (string · uuid; required)

marketId example: 00000000-0000-4000-8000-000000000000

marketId.Type: string · uuid

marketId.Market the order is placed on, as returned by `GET /v2/markets`.

marketId.format: uuid

marketId.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})$

- type (string · enum; required)

type example: market

type.Type: string · enum

type.Order type. Increase (position-opening) types: `market`, `limit`, `stop_market`, `stop_limit`. Close types, attached to an existing position: `stop`, `take`, `trailing_stop`. `liquidation` is raised by the platform itself and `add_margin` / `remove_margin` are legacy — none of the three is accepted here.

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

- direction (string · enum; required)

direction example: long

direction.Type: string · enum

direction.Order direction. For a close order it must match the direction of the position it is attached to.

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

- positionId (string · uuid · nullable; optional)

positionId example: 00000000-0000-4000-8000-000000000000

positionId.Type: string · uuid · nullable

positionId.Position a close order (`stop`, `take`, `trailing_stop`) is attached to. Required for those types, ignored for increase orders.

positionId.format: uuid

positionId.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})$

- amount (string · fp9; required)

amount example: 100000000000

amount.Type: string · fp9

amount.What the order is sized by, fp9 raw — the unit depends on the order class. On an increase order (`market`, `limit`, `stop_market`, `stop_limit`) it is a **quote** amount reserved from the free balance (margin, fee, spread and buffer): the account must hold at least this much, and the reserve is released when the order is cancelled. On a close order (`stop`, `take`, `trailing_stop`) it is the **base asset** size of the position to close and nothing is reserved; a size larger than the position holds closes it in full.

amount.format: fp9

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

- expectedAmount (string · fp9 · nullable; optional)

expectedAmount example: 0

expectedAmount.Type: string · fp9 · nullable

expectedAmount.Slippage tolerance for increase orders: the position size the caller expects for `amount`, fp9 raw. Execution outside the tolerance fails with `slippage_tolerance`. Omitted or `0` — no tolerance check. Not applicable to close orders.

expectedAmount.format: fp9

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

- leverage (string · fp9 · nullable; optional)

leverage example: 10000000000

leverage.Type: string · fp9 · nullable

leverage.Leverage, fp9 raw (`10000000000` = 10x). Required for increase orders and must be within the leverage bounds of the market.

leverage.format: fp9

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

- triggerPrice (string · fp9 · nullable; optional)

triggerPrice example: 65000000000000

triggerPrice.Type: string · fp9 · nullable

triggerPrice.Price at which the order fires, fp9 raw. Required for `limit`, `stop`, `take`, `stop_market` and `stop_limit`, and ignored for `market`. `stop` needs a positive price. `take` with `0` closes `amount` of the position at market right away; it is the only order a close-only market accepts.

triggerPrice.format: fp9

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

- stopTriggerPrice (string · fp9 · nullable; optional)

stopTriggerPrice example: 1000000000

stopTriggerPrice.Type: string · fp9 · nullable

stopTriggerPrice.Stop-loss attached to an increase order, fp9 raw. Must sit below the entry trigger price for `long` and above it for `short`.

stopTriggerPrice.format: fp9

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

- takeTriggerPrice (string · fp9 · nullable; optional)

takeTriggerPrice example: 1000000000

takeTriggerPrice.Type: string · fp9 · nullable

takeTriggerPrice.Take-profit attached to an increase order, fp9 raw. Must sit above the entry trigger price for `long` and below it for `short`.

takeTriggerPrice.format: fp9

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

- trailingStopActivationPrice (string · fp9 · nullable; optional)

trailingStopActivationPrice example: 1000000000

trailingStopActivationPrice.Type: string · fp9 · nullable

trailingStopActivationPrice.Price at which a `trailing_stop` starts trailing, fp9 raw. Omitted — the order trails from the moment it is created.

trailingStopActivationPrice.format: fp9

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

- trailingStopOffset (string · fp9 · nullable; optional)

trailingStopOffset example: 1000000000

trailingStopOffset.Type: string · fp9 · nullable

trailingStopOffset.Trailing distance as an absolute quote amount, fp9 raw. Exactly one of `trailingStopOffset` / `trailingStopOffsetPercent` is required.

trailingStopOffset.format: fp9

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

- trailingStopOffsetPercent (string · fp9 · nullable; optional)

trailingStopOffsetPercent example: 950000000

trailingStopOffsetPercent.Type: string · fp9 · nullable

trailingStopOffsetPercent.Trailing distance as a price multiplier, fp9 raw: one minus the percent, so 5% is `950000000`. The stop trails at the best price × multiplier for `long` and at the best price × (2 − multiplier) for `short`. Strictly below `1000000000`. Exactly one of `trailingStopOffset` / `trailingStopOffsetPercent` is required.

trailingStopOffsetPercent.format: fp9

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

- stopLimitPrice (string · fp9 · nullable; optional)

stopLimitPrice example: 1000000000

stopLimitPrice.Type: string · fp9 · nullable

stopLimitPrice.Limit price a `stop_limit` order is placed at once its trigger fires, fp9 raw. Required for that type; must be at or below the trigger price for `long` and at or above it for `short`.

stopLimitPrice.format: fp9

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

- sizeMode (string · enum; optional)

sizeMode example: quote

sizeMode.Type: string · enum

sizeMode.How the size of an increase order is expressed: `quote` (default) sizes it by `amount`, `base` sizes it by `baseSize` while `amount` stays the reserve. Increase orders only — a close order is always sized by `amount` in base asset units.

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

- baseSize (string · fp9 · nullable; optional)

baseSize example: 1000000000

baseSize.Type: string · fp9 · nullable

baseSize.Order size in base asset units, fp9 raw. Required when `sizeMode` is `base` and rejected otherwise, and meaningful for increase orders only.

baseSize.format: fp9

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

Example



```json
{
  "accountId": "00000000-0000-4000-8000-000000000000",
  "marketId": "00000000-0000-4000-8000-000000000000",
  "type": "market",
  "direction": "long",
  "amount": "100000000000"
}
```

## Example · cURL

```bash
curl --request POST 'https://api.upscale.trade/orders' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "accountId": "00000000-0000-4000-8000-000000000000",
  "marketId": "00000000-0000-4000-8000-000000000000",
  "type": "market",
  "direction": "long",
  "amount": "100000000000"
}'
```

## Example · JavaScript

```javascript
const response = await fetch("https://api.upscale.trade/orders", {
  method: "POST",
  headers: {
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: "{\n  \"accountId\": \"00000000-0000-4000-8000-000000000000\",\n  \"marketId\": \"00000000-0000-4000-8000-000000000000\",\n  \"type\": \"market\",\n  \"direction\": \"long\",\n  \"amount\": \"100000000000\"\n}",
});
console.log(response.status, await response.text());
```

## Example · Python

```python
import requests

response = requests.request(
    "POST",
    "https://api.upscale.trade/orders",
    headers={"Accept":"application/json","Authorization":"Bearer YOUR_API_KEY","Content-Type":"application/json"},
    data="{\n  \"accountId\": \"00000000-0000-4000-8000-000000000000\",\n  \"marketId\": \"00000000-0000-4000-8000-000000000000\",\n  \"type\": \"market\",\n  \"direction\": \"long\",\n  \"amount\": \"100000000000\"\n}",
    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`). Trading on the account is over in its current status (`challenge_closed`), or the account is locked by the managed capital limit (`funded_limit_trading_locked`). The market is paused (`market_paused`) or accepts closing orders only (`market_close_only`).

## Response 404

**404**  — No such account, market, or position.

## Response 409

**409**  — Another call with the same `x-idempotency-key` is still running (`idempotency_key_in_flight`). Retry once it finishes.

## 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 · OrderResponse

**default** application/json — Response

Schema: OrderResponse

Type: object

Required fields: id, trader, market, status, type, direction, triggerPrice, requestedTriggerPrice, stopPrice, limitPrice, stopTriggerPrice, takeTriggerPrice, trailingStopActivationPrice, trailingStopOffset, trailingStopOffsetPercent, leverage, positionId, parentOrderId, amount, indexPrice, recentVolume, priceImpact, createdAt, realizedPnl, rawRealizedPnl, profitAdjustmentApplied, sizeMode, baseSize, reservedAmount, errorCode, reason, vpi

Required field types: id (string · uuid; required), trader (string · uuid; required), market (string · uuid; required), status (string · enum; required), type (string · enum; required), direction (string · enum; required), triggerPrice (string · fp9; required), requestedTriggerPrice (string · fp9 · nullable; required), stopPrice (string · fp9; required), limitPrice (string · fp9; required), stopTriggerPrice (string · fp9; required), takeTriggerPrice (string · fp9; required), trailingStopActivationPrice (string · fp9; required), trailingStopOffset (string · fp9; required), trailingStopOffsetPercent (string · fp9; required), leverage (string · fp9 · nullable; required), positionId (string · nullable; required), parentOrderId (string · nullable; required), amount (string · fp9; required), indexPrice (string · fp9 · nullable; required), recentVolume (string · fp9 · nullable; required), priceImpact (string · fp9 · nullable; required), createdAt (string · date-time; required), realizedPnl (string · fp9 · nullable; required), rawRealizedPnl (string · fp9 · nullable; required), profitAdjustmentApplied (boolean; required), sizeMode (string · enum; required), baseSize (string · fp9 · nullable; required), reservedAmount (string · fp9 · nullable; required), errorCode (string · nullable; required), reason (string · enum · nullable; required), vpi (object · nullable; required)

- id (string · uuid; required)

id example: 00000000-0000-4000-8000-000000000000

id.Type: string · uuid

id.Order identifier.

id.format: uuid

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})$

- trader (string · uuid; required)

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

trader.Type: string · uuid

trader.Trader account the order 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})$

- market (string · uuid; required)

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

market.Type: string · uuid

market.Market the order is placed 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})$

- status (string · enum; required)

status example: active

status.Type: string · enum

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`.

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

- type (string · enum; required)

type example: market

type.Type: string · enum

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

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

- direction (string · enum; required)

direction example: long

direction.Type: string · enum

direction.Order direction.

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

- triggerPrice (string · fp9; required)

triggerPrice example: 1000000000

triggerPrice.Type: string · fp9

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

triggerPrice.format: fp9

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

- requestedTriggerPrice (string · fp9 · nullable; required)

requestedTriggerPrice example: 1000000000

requestedTriggerPrice.Type: string · fp9 · nullable

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.

requestedTriggerPrice.format: fp9

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

- stopPrice (string · fp9; required)

stopPrice example: 1000000000

stopPrice.Type: string · fp9

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

stopPrice.format: fp9

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

- limitPrice (string · fp9; required)

limitPrice example: 1000000000

limitPrice.Type: string · fp9

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

limitPrice.format: fp9

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

- stopTriggerPrice (string · fp9; required)

stopTriggerPrice example: 1000000000

stopTriggerPrice.Type: string · fp9

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

stopTriggerPrice.format: fp9

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

- takeTriggerPrice (string · fp9; required)

takeTriggerPrice example: 1000000000

takeTriggerPrice.Type: string · fp9

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

takeTriggerPrice.format: fp9

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

- trailingStopActivationPrice (string · fp9; required)

trailingStopActivationPrice example: 1000000000

trailingStopActivationPrice.Type: string · fp9

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

trailingStopActivationPrice.format: fp9

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

- trailingStopOffset (string · fp9; required)

trailingStopOffset example: 1000000000

trailingStopOffset.Type: string · fp9

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

trailingStopOffset.format: fp9

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

- trailingStopOffsetPercent (string · fp9; required)

trailingStopOffsetPercent example: 1000000000

trailingStopOffsetPercent.Type: string · fp9

trailingStopOffsetPercent.Trailing distance as a price multiplier, fp9 raw: one minus the percent, so 5% is `950000000`. `0` when the distance is absolute.

trailingStopOffsetPercent.format: fp9

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

- leverage (string · fp9 · nullable; required)

leverage example: 1000000000

leverage.Type: string · fp9 · nullable

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

leverage.format: fp9

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

- positionId (string · nullable; required)

positionId example: string

positionId.Type: string · nullable

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

- parentOrderId (string · nullable; required)

parentOrderId example: string

parentOrderId.Type: string · nullable

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.

- amount (string · fp9; required)

amount example: 1000000000

amount.Type: string · fp9

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.

amount.format: fp9

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

- indexPrice (string · fp9 · nullable; required)

indexPrice example: 1000000000

indexPrice.Type: string · fp9 · nullable

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

indexPrice.format: fp9

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

- recentVolume (string · fp9 · nullable; required)

recentVolume example: 1000000000

recentVolume.Type: string · fp9 · nullable

recentVolume.Volume of the previous opens and increases on the same account, market and direction that was still counted in the price impact of this order when it executed, USD fp9 raw. The recovery window is configurable, 60 seconds by default. Fixed at execution. Null for orders that have not executed, close orders and markets without dynamic price impact.

recentVolume.format: fp9

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

- priceImpact (string · fp9 · nullable; required)

priceImpact example: 1000000000

priceImpact.Type: string · fp9 · nullable

priceImpact.Price impact applied to this open or increase, excluding the static spread, as a fraction fp9 raw (`10000000` = 1%). Includes the recent volume in `recentVolume`. Fixed at execution. Null for orders that have not executed, close orders and markets without dynamic price impact.

priceImpact.format: fp9

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

- createdAt (string · date-time; required)

createdAt example: 2026-05-01T12:30:00.000Z

createdAt.Type: string · date-time

createdAt.When the order was accepted.

createdAt.format: date-time

- realizedPnl (string · fp9 · nullable; required)

realizedPnl example: 1000000000

realizedPnl.Type: string · fp9 · nullable

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.

realizedPnl.format: fp9

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

- rawRealizedPnl (string · fp9 · nullable; required)

rawRealizedPnl example: 1000000000

rawRealizedPnl.Type: string · fp9 · nullable

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

rawRealizedPnl.format: fp9

rawRealizedPnl.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 this order — inside a minute of an open or increase the position pnl cannot grow above what it was at that moment.

- sizeMode (string · enum; required)

sizeMode example: quote

sizeMode.Type: string · enum

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

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

- baseSize (string · fp9 · nullable; required)

baseSize example: 1000000000

baseSize.Type: string · fp9 · nullable

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

baseSize.format: fp9

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

- reservedAmount (string · fp9 · nullable; required)

reservedAmount example: 1000000000

reservedAmount.Type: string · fp9 · nullable

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.

reservedAmount.format: fp9

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

- errorCode (string · nullable; required)

errorCode example: string

errorCode.Type: string · nullable

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.

- reason (string · enum · nullable; required)

reason example: force_close

reason.Type: string · enum · nullable

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

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

- vpi (object · nullable; required)

vpi example: {
  "spread": "1000000000",
  "marketDepthLong": "45604631.000000000",
  "marketDepthShort": "38744214.000000000",
  "coefficientLong": "1000000000",
  "coefficientShort": "1000000000"
}

vpi.Type: object · nullable

vpi.Required fields: spread, marketDepthLong, marketDepthShort, coefficientLong, coefficientShort

vpi.Required field types: spread (string · fp9; required), marketDepthLong (string; required), marketDepthShort (string; required), coefficientLong (string · fp9; required), coefficientShort (string · fp9; required)

vpi.VPI parameters of the market at the moment the order executed. Null while the order has not executed.

- vpi.spread (string · fp9; required)

vpi.spread example: 1000000000

vpi.spread.Type: string · fp9

vpi.spread.Spread charged on top of the index price, fp9 raw fraction.

vpi.spread.format: fp9

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

- vpi.marketDepthLong (string; required)

vpi.marketDepthLong example: 45604631.000000000

vpi.marketDepthLong.Type: string

vpi.marketDepthLong.Depth on the long side, in whole USD — not fp9.

vpi.marketDepthLong.pattern: ^-?[0-9]+(\.[0-9]+)?$

- vpi.marketDepthShort (string; required)

vpi.marketDepthShort example: 38744214.000000000

vpi.marketDepthShort.Type: string

vpi.marketDepthShort.Depth on the short side, in whole USD — not fp9.

vpi.marketDepthShort.pattern: ^-?[0-9]+(\.[0-9]+)?$

- vpi.coefficientLong (string · fp9; required)

vpi.coefficientLong example: 1000000000

vpi.coefficientLong.Type: string · fp9

vpi.coefficientLong.Price-impact coefficient applied to long orders, fp9 raw.

vpi.coefficientLong.format: fp9

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

- vpi.coefficientShort (string · fp9; required)

vpi.coefficientShort example: 1000000000

vpi.coefficientShort.Type: string · fp9

vpi.coefficientShort.Price-impact coefficient applied to short orders, fp9 raw.

vpi.coefficientShort.format: fp9

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

Example



```json
{
  "id": "00000000-0000-4000-8000-000000000000",
  "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",
  "positionId": "string",
  "parentOrderId": "string",
  "amount": "1000000000",
  "indexPrice": "1000000000",
  "recentVolume": "1000000000",
  "priceImpact": "1000000000",
  "createdAt": "2026-05-01T12:30:00.000Z",
  "realizedPnl": "1000000000",
  "rawRealizedPnl": "1000000000",
  "profitAdjustmentApplied": true,
  "sizeMode": "quote",
  "baseSize": "1000000000",
  "reservedAmount": "1000000000",
  "errorCode": "string",
  "reason": "force_close",
  "vpi": {
    "spread": "1000000000",
    "marketDepthLong": "45604631.000000000",
    "marketDepthShort": "38744214.000000000",
    "coefficientLong": "1000000000",
    "coefficientShort": "1000000000"
  }
}
```