One Trading API
REST API
WebSocket API
REST API
WebSocket API
  1. Futures
  • Public
    • Currencies
      GET
    • Instruments
      GET
    • Candlesticks
      GET
    • Fee Groups
      GET
    • Order Book
      GET
    • Market Ticker
      GET
    • Market Ticker For Instrument
      GET
    • Time
      GET
  • Trading
    • Balances
      GET
    • Fees
      GET
    • Get Orders
      GET
    • Create Order
      POST
    • Get Order by Order ID
      GET
    • Get Order by Client ID
      GET
    • Cancel All Orders
      DELETE
    • Cancel Order by Order ID
      DELETE
    • Cancel Order by Client ID
      DELETE
    • Get Trades for Order
      GET
    • Get Trades
      GET
    • Get Trade by Trade ID
      GET
  • Futures
    • Introduction
    • Funding Rate Methodology
    • Funding Payments
      GET
    • Positions
      GET
    • Position Trades
      GET
    • Position Funding Payments
      GET
    • Funding Rate Settings
      GET
    • Current Funding Rate
      GET
    • Funding Rate History
      GET
    • Futures Portfolio Summary
      GET
    • Get Futures Open Positions
      GET
  1. Futures

Positions

Developing
GET
https://api.onetrading.com/fast/v1/account/futures/positions-history
Retrieves closed futures positions that were opened between a requested date range.

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.

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)
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)
Date2025-09-26
instrument_codeStringBTC_USD_P (single)
ListBTC_USD_P,ETH_USD_P (comma-separated list)
orderStringDESC or ASC
limitInteger3
cursorStringeyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

Parameter Constraints#

ParameterConstraints
fromMust be between 2024-01-01 and present
toMust not be earlier than from
limitInteger between 1 and 10
orderDESC or ASC
instrument_codeOptional; must be valid market code(s)
cursorOptional; string returned by previous response

Parameter Defaults#

Parameter(s)Default Behavior
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 = 7 days earlier
instrument_codeDefaults to all perpetual markets
limitDefaults to 5

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Query Params

Responses

🟢200Success
application/json
Body

🟠400
🔴500
🟠403
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request 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' \
--header 'Authorization: Bearer <token>'
Response Response Example
200 - Example 1
{
    "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.01000",
            "total_entry_amount": "0.01000",
            "total_exit_amount": "0.01000",
            "entry_trade_count": 1,
            "exit_trade_count": 2,
            "average_entry_price": "89075.950",
            "average_exit_price": "69107.489",
            "entry_notional": "890.7595",
            "exit_notional": "691.0749",
            "closing_pnl": "-199.6846",
            "realised_pnl": "-198.8334",
            "total_trade_fees": "0.0000",
            "funding_payment_count": 93,
            "total_funding_payments": "0.4255",
            "has_liquidation_events": false
        },
        {
            "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.20000",
            "total_entry_amount": "0.20000",
            "total_exit_amount": "0.20000",
            "entry_trade_count": 1,
            "exit_trade_count": 1,
            "average_entry_price": "92432.750",
            "average_exit_price": "92479.010",
            "entry_notional": "18486.5500",
            "exit_notional": "18495.8020",
            "closing_pnl": "-9.2520",
            "realised_pnl": "-9.2536",
            "total_trade_fees": "0.0000",
            "funding_payment_count": 0,
            "total_funding_payments": "0.0000",
            "has_liquidation_events": false
        }
    ],
    "from": "2026-01-01T00:00:00.000000000Z",
    "to": "2026-02-01T00:00:00.000000000Z",
    "cursor": "eyJlcG9jaCI6IjE3NjgzMTczNzUxMjA2MDM0ODQiLCJjcW8iOiIyMTA5NjgzNjQxNTIyNTc2In0="
}
Previous
Funding Payments
Next
Position Trades
Built with