Skip to Content
Futures

Positions

GET
/v1/account/futures/positions-history

Retrieves closed futures positions that were opened within a requested date range. Only closed positions are returned.

Authentication: Bearer token; any valid API key (no specific scope required). This endpoint is rate-limited.

P&L Calculation

  • closing_pnl = profit or loss from all exit trades, based on notional values (exclusive of fees and funding payments)
  • realised_pnl = closing_pnl + total_funding_payments − total_trade_fees

Note: Liquidation fees are calculated at account level and are therefore not linked to individual positions.

Instrument type

Each position carries a type: DATED_FUTURE (with contract_expiry_date and contract_duration), EQUITY_FUTURE, EQUITY_INDEX_FUTURE, or PERP. Dated futures positions opened before 2026-04-23T11:00:00Z are reported as PERP.

from/to accept epoch (s, ms, µs or ns) or an ISO 8601 UTC timestamp ending in Z (or YYYY-MM-DD). from must be on or after 2024-01-01, not in the future, and strictly before to; to is exclusive.

cursor is an opaque string. Pass the value from the previous response unchanged; it is null (or absent) on the last page. If a position's statistics cannot be computed it is omitted, so a page can contain fewer than limit positions while cursor is not null.

Unknown query parameters are rejected with 400 UNEXPECTED_PARAMETERS.

Parameter Specification

ParameterAccepted FormatsExample Values
fromISO 86012025-09-25T13:45:30Z (s), 2025-09-25T13:45:30.123Z (ms), 2025-09-25T13:45:30.123456Z (us)
Epoch1695647130 (s), 1695647130123 (ms), 1695647130123456 (us), 1695647130123456789 (ns)
Date2025-09-25
toISO 86012025-09-26T18:00:00Z (s), 2025-09-26T18:00:00.456Z (ms), 2025-09-26T18:00:00.456789Z (us)
Epoch1695734400 (s), 1695734400456 (ms), 1695734400456789 (us), 1695734400456789012 (ns)
Date2025-09-26
instrument_codeStringBTC_USD_P (single)
ListBTC_USD_P,ETH_USD_P (comma-separated list)
orderStringDESC or ASC
limitInteger3
cursorStringeyJlcG9jaCI6IjE3NjgzMTczNzUxMjA2MDM0ODQiLCJjcW8iOiIyMTA5NjgzNjQxNTIyNTc2In0=

Parameter Constraints

ParameterConstraints
fromMust be between 2024-01-01 and present
toMust be strictly after from; the period between from and to must not exceed 31 days
limitInteger between 1 and 10
orderDESC or ASC
instrument_codeOptional; must be valid futures market code(s)
cursorOptional; string returned by previous response

Parameter Defaults

Parameter(s)Default Behaviour
from / toNeither provided: from = 7 days ago at midnight UTC, to = present time
from / toOnly from provided: to = 7 days later or present time, whichever is smaller
from / toOnly to provided: from = midnight UTC, 7 days earlier
instrument_codeDefaults to all futures markets
limitDefaults to 5
orderDefaults to DESC

Authorization

bearerAuth
headerAuthorizationBearer <token>

API key created in the One Trading UI, sent as Authorization: Bearer <token>. Each endpoint lists the key permission it needs.

Query Parameters

from?string

Specifies the start of the period (inclusive), matched against the position open time. Accepts date strings (YYYY-MM-DD), ISO 8601 UTC strings ending in Z, or numeric timestamps in seconds, milliseconds, microseconds or nanoseconds.

to?string

Specifies the end of the period (exclusive). The range between start and end cannot exceed 31 days. Same formats as from.

instrument_code?string

Instrument(s) to filter by: a single futures instrument code or a comma-separated list. Codes are case-insensitive; duplicates are rejected. Defaults to all futures markets.

limit?string

Sets the maximum number of results per page, 1 to 10 (default 5).

cursor?string

Opaque pointer to the next page, taken unchanged from the cursor of the previous response.

order?string

Sort order by timestamp: ASC or DESC (case-insensitive). Defaults to DESC (newest first).

Default"DESC"
Value in"ASC""DESC"

Response Body

OK

application/json
  1. response
positions*array<||>
from*string

Start of the queried range (ISO 8601, nanosecond precision).

to*string

End of the queried range, exclusive (ISO 8601, nanosecond precision).

cursor*|

Opaque cursor for the next page, or null on the last page.

Example Request
curl -X GET 'https://api.onetrading.com/fast/v1/account/futures/positions-history?from=2026-01-02&to=2026-02-01&instrument_code=&limit=10&cursor=eyJlcG9jaCI6IjE3NjgzMTczNzUxMjA2MDM0ODQiLCJjcW8iOiIyMTA5NjgzNjQxNTIyNTc2In0%3D&order=DESC'
Example Response
{  "positions": [    {      "account_id": "aaaba8bd-3195-4f72-87ff-98720a940f23",      "position_id": "2111199765938682",      "instrument_code": "BTC_USD_P",      "is_open": false,      "open_timestamp": "2026-01-28T08:19:25.380629346Z",      "close_timestamp": "2026-02-13T10:27:14.886985638Z",      "direction": "LONG",      "max_position_amount": "0.01",      "total_entry_amount": "0.01",      "total_exit_amount": "0.01",      "entry_trade_count": 1,      "exit_trade_count": 2,      "average_entry_price": "89075.95",      "average_exit_price": "69107.489",      "entry_notional": "890.7595",      "exit_notional": "691.0749",      "closing_pnl": "-199.6846",      "realised_pnl": "-199.2591",      "total_trade_fees": "0",      "funding_payment_count": 93,      "total_funding_payments": "0.4255",      "has_liquidation_events": false,      "type": "PERP"    },    {      "account_id": "aaaba8bd-3195-4f72-87ff-98720a940f23",      "position_id": "2109683641526368",      "instrument_code": "BTC_USD_P",      "is_open": false,      "open_timestamp": "2026-01-13T15:16:26.038074298Z",      "close_timestamp": "2026-01-13T15:16:36.081981640Z",      "direction": "SHORT",      "max_position_amount": "0.2",      "total_entry_amount": "0.2",      "total_exit_amount": "0.2",      "entry_trade_count": 1,      "exit_trade_count": 1,      "average_entry_price": "92432.75",      "average_exit_price": "92479.01",      "entry_notional": "18486.55",      "exit_notional": "18495.802",      "closing_pnl": "-9.252",      "realised_pnl": "-9.252",      "total_trade_fees": "0",      "funding_payment_count": 0,      "total_funding_payments": "0",      "has_liquidation_events": false,      "type": "PERP"    }  ],  "from": "2026-01-01T00:00:00.000000000Z",  "to": "2026-02-01T00:00:00.000000000Z",  "cursor": "eyJlcG9jaCI6IjE3NjgzMTczNzUxMjA2MDM0ODQiLCJjcW8iOiIyMTA5NjgzNjQxNTIyNTc2In0="}