Skip to content

Perps Orders

Organization API: Replace /v2/portfolio/ with /v2/organization/portfolios/{portfolioId}/. See Portfolio vs. Organization API.

Account endpoints return 503 on deployments where perps account reads are not yet enabled — see Availability.

Open Orders

Portfolio API: GET https://ddp.definitive.fi/v2/portfolio/perps/orders/open

Orders currently resting on the venue, including trigger orders and position TP/SL.

{
  orders: [
    {
      orderId: "31298744123",
      twapId: null, // set for TWAP parent orders
      symbol: "BTC",
      side: "buy", // buy | sell
      positionSide: "long_open", // long_open | long_close | short_open | short_close
      orderType: "limit", // market | limit | stop_market | stop_limit | take_profit_market | take_profit_limit | twap
      price: "64000", // limit price
      size: "0.01", // remaining size
      originalSize: "0.01",
      reduceOnly: false,
      isTrigger: false,
      isPositionTpsl: false,
      triggerPrice: null,
      triggerCondition: null,
      takeProfitPrice: null,
      stopLossPrice: null,
      timestamp: 1787100000000,
    },
  ];
}

Order History

Portfolio API: GET https://ddp.definitive.fi/v2/portfolio/perps/orders/history

Terminal and historical orders with their final status.

{
  orders: [
    {
      orderId: "31298744123",
      twapId: null,
      symbol: "BTC",
      side: "sell",
      positionSide: "short_open",
      orderType: "market",
      price: "68294",
      size: "0",
      originalSize: "0.01",
      reduceOnly: false,
      isTrigger: false,
      triggerPrice: null,
      timestamp: 1787100000000,
      status: "filled", // venue status string, e.g. filled | canceled | rejected
      statusTimestamp: 1787100002000,
      avgFillPrice: "68293",
    },
  ];
}