### Deposit Message Example Source: https://docs.onetrading.com/balance-adjustment-348525m0 Example JSON payload for a deposit event. It specifies the channel, type, status, instrument, amount, and resulting balance. Requires authentication and subscription to the TRADING channel. ```json { "channel_name": "TRADING", "type": "BALANCE_ADJUSTMENT", "event": "ACCOUNT", "status": "DEPOSITED", "instrument_code": "EUR", "time": 1743162435279363800, "amount": "1000", "new_balance": "93000.9853496", "assigned_margin": "0" } ``` -------------------------------- ### Funding Rate Payment Message Example Source: https://docs.onetrading.com/balance-adjustment-348525m0 Example JSON payload for a funding rate payment event. It includes details on the instrument, direction, volume, funding rate, payment amount, and account margin status. Requires authentication and subscription to the TRADING channel. ```json { "channel_name": "TRADING", "type": "FUNDING_PAYMENT", "event": "ACCOUNT", "status": "WITHDRAWN", "instrument_code": "BTC_EUR_P", "direction": "LONG", "open_volume": "1.02", "open_position": "90200.50", "pending_buy_size": "0", "pending_sell_size": "0", "funding_rate": "0.0002", "funding_payment": "1.84", "cash_balance": "98378.71", "maintenance_margin": "1000", "margin_used": "6621.295", "account_ratio": 14.85 } ``` -------------------------------- ### CREATE_ORDER API - Example with Reserve Price Source: https://docs.onetrading.com/move-order-348478m0 Illustrates a JSON request for creating an order, including the optional `reserve_price` parameter. This parameter is relevant for risk management in MOVE_ORDER operations, setting a maximum price limit. ```JSON { "type": "CREATE_ORDER", "order": { "instrument_code": "BTC_EUR", "type": "LIMIT", "side": "BUY", "amount": "0.01", "price": "85000", "time_in_force": "GOOD_TILL_CANCELLED", "reserve_price": "90000" } } ``` -------------------------------- ### Server Heartbeat Message Example Source: https://docs.onetrading.com/ping-pong-347234m0 An example of a heartbeat message sent periodically by the server to the client. Receiving this message prompts the client to send a ping request, confirming the connection's liveness as part of the ping-pong mechanism. ```json { "type": "HEARTBEAT", "time": 1738602951685555981 } ``` -------------------------------- ### ORDER_BOOK Channel Subscription and Confirmation Source: https://docs.onetrading.com/websocket/orderbook/introduction Examples of JSON messages used to subscribe to the ORDER_BOOK WebSocket channel and the subsequent confirmation received from the server. The subscription specifies the desired instrument codes, and the confirmation acknowledges the active subscription. ```JSON { "type": "SUBSCRIBE", "channels": [ { "name": "ORDER_BOOK", "instrument_codes": [ "BTC_EUR", "ETH_EUR" ] } ] } ``` ```JSON { "type": "SUBSCRIPTIONS", "channels": [ { "name": "ORDER_BOOK", "instrument_codes": [ "BTC_EUR", "ETH_EUR" ] } ], "time": 1732050545807000000 } ``` -------------------------------- ### Time Endpoint API Documentation Source: https://docs.onetrading.com/rest/public/time This entry documents the GET /time endpoint from the OpenAPI specification. It details the endpoint's purpose, parameters, responses, and provides an example of the expected output. The endpoint returns the current server time in both ISO 8601 format and as epoch milliseconds. ```APIDOC GET /time summary: Time description: Returns the current server time in UTC. tags: - One Trading Public REST API/Public - public parameters: [] responses: '200': description: '' content: application/json: schema: type: object properties: iso: type: string format: date-time epoch_millis: type: integer required: - iso - epoch_millis example: iso: '2024-11-12T13:43:12.237Z' epoch_millis: 1731418992237 security: [] x-apidog-folder: One Trading Public REST API/Public x-apidog-status: released x-run-in-apidog: https://app.eu.apidog.com/web/project/349694/apis/api-3612088-run servers: - url: https://api.onetrading.com/fast/v1 description: Production Env ``` -------------------------------- ### Withdrawal Message Example Source: https://docs.onetrading.com/balance-adjustment-348525m0 Example JSON payload for a withdrawal event. It details the channel, type, status, instrument, amount (negative), and updated balance. Requires authentication and subscription to the TRADING channel. ```json { "channel_name": "TRADING", "type": "BALANCE_ADJUSTMENT", "event": "ACCOUNT", "status": "WITHDRAWN", "instrument_code": "EUR", "time": 1743162442497232100, "amount": "-2000", "new_balance": "91000.9853496", "assigned_margin": "0" } ``` -------------------------------- ### Get Futures Open Positions API Source: https://context7_llms Provides all open futures positions for the authenticated user. It offers detailed information about each position, including size, direction, entry price, realized PnL, and timestamps. Designed for a consolidated view of active positions, reflecting minute-level settlements. ```APIDOC Get Futures Open Positions API: Endpoint: /futures/positions Method: GET Description: Provides all open futures positions for the authenticated user. It provides detailed information about each position, including size, direction, entry price, realised PnL, and the most recent trade and settlement timestamps. Designed for users who want a consolidated view of their active positions, this endpoint ensures that real-time data is available, reflecting the platform’s minute-level settlements. Authentication: Required (e.g., API Key, OAuth Token) Parameters: None explicitly mentioned for the GET request itself, but authentication credentials are required. Returns: - An array of position objects, each containing: - symbol: (string) The trading symbol for the futures contract. - quantity: (integer) The number of contracts in the position. - side: (string) The direction of the position ('BUY' or 'SELL'). - entryPrice: (number) The average price at which the position was entered. - realizedPnL: (number) The realized profit or loss for the position. - lastTradeTimestamp: (string) ISO 8601 timestamp of the last trade for this position. - settlementTimestamp: (string) ISO 8601 timestamp of the last settlement update. Example Response Structure: [ { "symbol": "ES", "quantity": 1, "side": "BUY", "entryPrice": 4500.00, "realizedPnL": 100.00, "lastTradeTimestamp": "2023-10-27T10:00:00Z", "settlementTimestamp": "2023-10-27T10:01:00Z" }, { "symbol": "NQ", "quantity": 2, "side": "SELL", "entryPrice": 15000.00, "realizedPnL": -50.00, "lastTradeTimestamp": "2023-10-27T09:55:00Z", "settlementTimestamp": "2023-10-27T10:01:00Z" } ] ``` -------------------------------- ### Currencies API Endpoint Documentation Source: https://docs.onetrading.com/rest/public/currencies This entry details the OpenAPI specification for the `/currencies` endpoint. It describes how to retrieve a list of all available currencies, including their properties like code, precision, and collateral percentage. The specification includes response schemas and examples. ```yaml openapi: 3.0.1 info: title: '' description: '' version: 1.0.0 paths: /currencies: get: summary: Currencies deprecated: false description: Get a list of all available currencies. operationId: currencies tags: - One Trading Public REST API/Public - public parameters: [] responses: '200': description: >- The request was successful, and the server has returned the requested resource in the response body. content: application/json: schema: type: array items: $ref: '#/components/schemas/Currency' example: - code: BTC precision: 8 unified_cryptoasset_id: 1 name: Bitcoin collateral_percentage: 0 - code: ETH precision: 8 unified_cryptoasset_id: 1027 name: Ethereum collateral_percentage: 0 - code: EUR precision: 2 unified_cryptoasset_id: 0 name: Euro collateral_percentage: 100 headers: {} x-apidog-name: OK security: [] x-apidog-folder: One Trading Public REST API/Public x-apidog-status: released x-run-in-apidog: https://app.eu.apidog.com/web/project/349694/apis/api-3612081-run components: schemas: Currency: type: object properties: code: type: string precision: type: integer unified_cryptoasset_id: type: integer name: type: string collateral_percentage: type: integer x-apidog-mock: '50' minimum: 0 maximum: 100 description: >- The percentage of the asset's value that can be used as collateral for futures positions. required: - code - precision - unified_cryptoasset_id - name - collateral_percentage description: Currency x-apidog-orders: - code - precision - unified_cryptoasset_id - name - collateral_percentage x-apidog-ignore-properties: [] x-apidog-folder: '' securitySchemes: {} servers: - url: https://api.onetrading.com/fast/v1 description: Production Env security: [] ``` -------------------------------- ### Market Ticker For Instrument API Endpoint Source: https://docs.onetrading.com/rest/public/market-ticker-instrument This OpenAPI specification defines the GET endpoint for retrieving market ticker data for a specific instrument. It includes path parameters, response schemas for success (200 OK) and error (404 Not Found) cases, and example data. ```APIDOC openapi: 3.0.1 info: title: '' description: '' version: 1.0.0 paths: /market-ticker/{instrument_code}: get: summary: Market Ticker For Instrument deprecated: false description: Get market statistics on a single market. tags: - One Trading Public REST API/Public - public parameters: - name: instrument_code in: path description: The market to get the market ticker data for required: true example: BTC_EUR schema: type: string responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/MarketTicker' example: base_volume: '0.00' high: '100000.00' highest_bid: '10000.00' instrument_code: BTC_EUR last_price: '100000.00' low: '100000.00' lowest_ask: '100000.00' price_change_percentage: '0.00' price_change: '0.00' quote_volume: '0.00' sequence: 1730900885466242800 state: ACTIVE headers: {} x-apidog-name: Success '404': description: '' content: application/json: schema: type: object properties: error: type: string x-apidog-orders: - error required: - error x-apidog-ignore-properties: [] example: error: The requested market INVALID_MARKET is not available. headers: {} x-apidog-name: Record Not Found security: [] x-apidog-folder: One Trading Public REST API/Public x-apidog-status: released x-run-in-apidog: https://app.eu.apidog.com/web/project/349694/apis/api-3612087-run components: schemas: MarketTicker: type: object properties: base_volume: type: string high: type: string highest_bid: type: string instrument_code: type: string last_price: type: string low: type: string lowest_ask: type: string price_change_percentage: type: string price_change: type: string quote_volume: type: string sequence: type: integer state: type: string required: - base_volume - high - highest_bid - instrument_code - last_price - low - lowest_ask - price_change_percentage - price_change - quote_volume - sequence - state x-apidog-orders: - base_volume - high - highest_bid - instrument_code - last_price - low - lowest_ask - price_change_percentage - price_change - quote_volume - sequence - state x-apidog-ignore-properties: [] x-apidog-folder: '' securitySchemes: {} servers: - url: https://api.onetrading.com/fast/v1 description: Production Env security: [] ``` -------------------------------- ### OpenAPI: POST /account/orders - Create Order Source: https://docs.onetrading.com/rest/trading/create-order This entry details the OpenAPI specification for creating a new order using the POST /account/orders endpoint. It covers order types (LIMIT), time-in-force options (GOOD_TILL_CANCELLED, IMMEDIATE_OR_CANCELLED, FILL_OR_KILL, POST_ONLY), minimum size requirements, precision limitations, and the use of client_id for order tracking. It also specifies the response structure including order_id, client_id, account_id, instrument_code, time, side, price, amount, type, and status. ```APIDOC openapi: 3.0.1 info: title: '' description: '' version: 1.0.0 paths: /account/orders: post: summary: Create Order deprecated: false description: > ## Create a New Order :::warning[] Ensure your API key has the `TRADE` scope. You can generate an API key through the One Trading UI. ::: This endpoint allows you to create a new order of type **LIMIT**. ### Time in Force Options For **LIMIT** orders, you can specify one of the following `time_in_force` options: - **GOOD_TILL_CANCELLED** (default): The order remains open until canceled. - **IMMEDIATE_OR_CANCELLED**: The order is filled immediately, either in full or partially, with any unfilled portion canceled. - **FILL_OR_KILL**: The order must be filled in full immediately; otherwise, it is canceled. - **POST_ONLY**: Ensures the order is added to the order book as a maker order and will be rejected if it would execute immediately as a taker order. If no `time_in_force` is specified, **GOOD_TILL_CANCELLED** is assumed. ### Order Size and Precision Each order must meet a minimum size requirement. You can retrieve this minimum, along with precision limitations, by querying the `/instruments` endpoint. **Note:** There is a global limit of 200 open orders per user across all markets. ### Client ID for Order Tracking Optionally, you can set a `client_id` to track orders without waiting for the assigned `order_id`. **Important:** You are responsible for ensuring the uniqueness of each `client_id`. If multiple orders share the same `client_id`, only the newest order can be canceled via `client_id`; older orders will require the specific `order_id` or use of the "Cancel All Orders" endpoint. tags: - One Trading Public REST API/Trading parameters: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateOrder' examples: {} responses: '200': description: '' content: application/json: schema: type: object properties: order_id: type: string format: uuid client_id: type: string format: uuid account_id: type: string format: uuid instrument_code: type: string format: uuid time: type: string format: date-time side: type: string enum: - BUY - SELL x-apidog-enum: - value: BUY name: '' description: '' - value: SELL name: '' description: '' price: type: string amount: type: string type: type: string enum: - LIMIT x-apidog-enum: - value: LIMIT name: '' description: '' time_in_force: type: string enum: - GOOD_TILL_CANCELLED - IMMEDIATE_OR_CANCELLED - FILL_OR_KILL x-apidog-enum: - value: GOOD_TILL_CANCELLED name: '' description: '' - value: IMMEDIATE_OR_CANCELLED name: '' description: '' - value: FILL_OR_KILL name: '' description: '' status: type: string x-apidog-orders: - order_id - client_id - account_id - instrument_code - time - side - price - amount - type - time_in_force - status required: - order_id - client_id - account_id - instrument_code - time - side - price - amount - type ``` -------------------------------- ### OpenAPI Specification for Account Balances Source: https://docs.onetrading.com/rest/trading/balances This OpenAPI 3.0.1 specification defines the GET endpoint `/account/balances` which retrieves account balance details. It includes the structure for balance information, specifying currency, available amount, locked amount, and last updated time. The specification also details the response schema and provides an example. ```APIDOC openapi: 3.0.1 info: title: '' description: '' version: 1.0.0 paths: /account/balances: get: summary: Balances deprecated: false description: Returns the balance details for an account. tags: - One Trading Public REST API/Trading - trading parameters: [] responses: '200': description: '' content: application/json: schema: type: object properties: account_id: type: string format: uuid balances: type: array items: $ref: '#/components/schemas/Balance' x-apidog-orders: - account_id - balances required: - account_id - balances x-apidog-ignore-properties: [] example: account_id: 483a880a-220a-d7f9-2355-0a21a67809ab balances: - currency_code: EUR available: '150000' locked: '0' time: '2024-12-18T15:57:49.900Z' - currency_code: BTC available: '0.95' locked: '0' time: '2025-03-27T02:18:13.868Z' headers: {} x-apidog-name: Success security: [] x-apidog-folder: One Trading Public REST API/Trading x-apidog-status: released x-run-in-apidog: https://app.eu.apidog.com/web/project/349694/apis/api-3612089-run components: schemas: Balance: type: object properties: currency_code: type: string description: Currency of the balance available: type: string description: The amount of the currency available to trade or withdraw locked: type: string description: The amount of the currency locked in orders time: type: string description: Time the balance was last updated x-apidog-orders: - currency_code - available - locked - time required: - currency_code - available - locked - time x-apidog-ignore-properties: [] x-apidog-folder: '' securitySchemes: {} servers: - url: https://api.onetrading.com/fast/v1 description: Production Env security: [] ``` -------------------------------- ### OpenAPI Specification for /fees Endpoint Source: https://docs.onetrading.com/rest/public/fee-groups This OpenAPI 3.0.1 specification defines the '/fees' endpoint for retrieving fee group details. It includes the GET method, response schemas for success (200) and errors (404), and example data for fee tiers across different product types like SPOT and FUTURES. ```APIDOC openapi: 3.0.1 info: title: '' description: '' version: 1.0.0 paths: /fees: get: summary: Fee Groups deprecated: false description: >- Returns details of all fee groups. Fee groups are separated into product types. tags: - One Trading Public REST API/Public - public parameters: [] responses: '200': description: '' content: application/json: schema: type: array items: $ref: '#/components/schemas/FeeGroup' example: - fee_group_id: SPOT display_text: The fee plan for spot trading. volume_currency: EUR fee_tiers: - volume: 0 fee_group_id: SPOT maker_fee: '0.1000' taker_fee: '0.2000' - volume: 10000 fee_group_id: SPOT maker_fee: '0.0400' taker_fee: '0.0600' - volume: 100000 fee_group_id: SPOT maker_fee: '0.0200' taker_fee: '0.0500' - volume: 1000000 fee_group_id: SPOT maker_fee: '0.0190' taker_fee: '0.0450' - volume: 5000000 fee_group_id: SPOT maker_fee: '0.0180' taker_fee: '0.0400' - volume: 25000000 fee_group_id: SPOT maker_fee: '0.0130' taker_fee: '0.0350' - volume: 100000000 fee_group_id: SPOT maker_fee: '0.0025' taker_fee: '0.0300' - volume: 500000000 fee_group_id: SPOT maker_fee: '0.0000' taker_fee: '0.0300' - volume: 1000000000 fee_group_id: SPOT maker_fee: '0.0000' taker_fee: '0.0280' - volume: 10000000000 fee_group_id: SPOT maker_fee: '0.0000' taker_fee: '0.0250' - fee_group_id: FUTURES display_text: The fee plan for futures trading. volume_currency: EUR fee_tiers: - volume: 0 fee_group_id: FUTURES maker_fee: '0.1000' taker_fee: '0.2000' - volume: 10000 fee_group_id: FUTURES maker_fee: '0.0400' taker_fee: '0.0600' - volume: 100000 fee_group_id: FUTURES maker_fee: '0.0200' taker_fee: '0.0500' - volume: 1000000 fee_group_id: FUTURES maker_fee: '0.0190' taker_fee: '0.0450' - volume: 5000000 fee_group_id: FUTURES maker_fee: '0.0180' taker_fee: '0.0400' - volume: 25000000 fee_group_id: FUTURES maker_fee: '0.0130' taker_fee: '0.0350' - volume: 100000000 fee_group_id: FUTURES maker_fee: '0.0025' taker_fee: '0.0300' - volume: 500000000 fee_group_id: FUTURES maker_fee: '0.0000' taker_fee: '0.0300' - volume: 1000000000 fee_group_id: FUTURES maker_fee: '0.0000' taker_fee: '0.0280' - volume: 10000000000 fee_group_id: FUTURES maker_fee: '0.0000' taker_fee: '0.0250' headers: {} x-apidog-name: Success '404': description: '' content: application/json: schema: title: '' type: object properties: error: type: string x-apidog-orders: - error required: - error x-apidog-ignore-properties: [] example: error: Not found. headers: {} x-apidog-name: Record Not Found security: [] x-apidog-folder: One Trading Public REST API/Public x-apidog-status: released ``` -------------------------------- ### Get Order by Client ID Source: https://docs.onetrading.com/rest/trading/get-order-client-id Get information about an existing order using the user or exchange generated client_id. Will only return orders from the last 30 days. ```APIDOC openapi: 3.0.1 info: title: '' description: '' version: 1.0.0 paths: /account/orders/client/{client_id}: get: summary: Get Order by Client ID deprecated: false description: >- Get information about an existing order using the user or exchange generated client_id. Will only return orders from the last 30 days. tags: - One Trading Public REST API/Trading parameters: - name: client_id in: path description: The client ID to fetch order details for required: true schema: type: string format: uuid responses: '200': description: '' content: application/json: schema: type: object properties: {} x-apidog-orders: [] headers: {} x-apidog-name: Success security: [] x-apidog-folder: One Trading Public REST API/Trading x-apidog-status: released x-run-in-apidog: https://app.eu.apidog.com/web/project/349694/apis/api-3612094-run components: schemas: {} securitySchemes: {} servers: - url: https://api.onetrading.com/fast/v1 description: Production Env security: [] ``` -------------------------------- ### Trading API Endpoints Source: https://context7_llms Enables users to manage their trading activities, including retrieving account balances and fees, placing, retrieving, and canceling orders, and accessing trade history. ```APIDOC GET /trading/balances Description: Returns the balance details for an account. GET /trading/fees Description: Returns the current fees for an account. Fees are calculated and combined across all subaccounts. GET /trading/get-orders Description: Returns a paginated list of orders. Parameters: - page (integer, optional): The page number for pagination. - limit (integer, optional): The number of orders per page. POST /trading/create-order Description: Create a new order. Parameters: - instrument_id (string): The unique identifier for the instrument. - side (string): The order side ('buy' or 'sell'). - type (string): The order type ('limit', 'market'). - quantity (string): The order quantity. - price (string, optional): The order price (required for limit orders). - client_id (string, optional): A unique identifier for the client. GET /trading/get-order-order-id Description: Get information about an existing order using the exchange-generated order_id. Parameters: - order_id (string): The exchange-generated order ID. GET /trading/get-order-client-id Description: Get information about an existing order using the user or exchange-generated client_id. Parameters: - client_id (string): The client-generated order ID. POST /trading/cancel-all-orders Description: Submits a cancel request for all open orders of an account. POST /trading/cancel-order-order-id Description: Submits a request to close an open order by providing a valid order_id. Parameters: - order_id (string): The exchange-generated order ID. POST /trading/cancel-order-client-id Description: Submits a request to cancel an open order by providing a valid client_id. Parameters: - client_id (string): The client-generated order ID. GET /trading/get-trades-for-order Description: Get a list of trades for a specific order. Parameters: - order_id (string): The exchange-generated order ID. GET /trading/get-trades Description: Returns a paginated list of trades. Parameters: - page (integer, optional): The page number for pagination. - limit (integer, optional): The number of trades per page. GET /trading/get-trade-by-trade-id Description: Get information about an executed trade using the exchange-generated trade_id. Parameters: - trade_id (string): The exchange-generated trade ID. ``` -------------------------------- ### Funding Rate Information APIs Source: https://docs.onetrading.com/futures/introduction Access real-time and historical funding rate data for perpetual futures contracts. Funding rates are settled every 4 hours and updated minutely. ```APIDOC GET /futures/current-funding-rate.md Description: Retrieves the latest calculated funding rate for perpetual futures contracts. Notes: - Provides the most up-to-date rate, updated minutely. - Essential for understanding current funding obligations/entitlements. ``` ```APIDOC GET /futures/funding-rate-history.md Description: Retrieves historical funding rates used for settlement payments. Notes: - Data reflects the 4-hour settlement periods. - Useful for auditing and understanding past funding transactions. ``` ```APIDOC /futures/funding-rate-methodology.md Description: Provides detailed information on the calculation methodology for funding rates. Notes: - Explains the factors and formulas used to determine funding rates. ``` -------------------------------- ### Futures Portfolio Summary API Source: https://context7_llms Provides a real-time summary of a user's futures portfolio on the exchange. It returns details about the current portfolio, including account equity, available margin, margin used, and positions. The summary is updated with settlements every minute. ```APIDOC Futures Portfolio Summary API: Endpoint: /futures/summary Method: GET Description: Provides a real-time summary of a user's futures portfolio on the exchange. It returns details about the current portfolio, including the user's account equity, available margin, margin used and positions. The summary is updated with settlements every minute. Authentication: Required (e.g., API Key, OAuth Token) Parameters: None explicitly mentioned for the GET request itself, but authentication credentials are required. Returns: - accountEquity: (number) Current account equity. - availableMargin: (number) Available margin. - marginUsed: (number) Margin currently in use. - positions: (array) Details of current futures positions. Example Response Structure: { "accountEquity": 15000.50, "availableMargin": 7500.25, "marginUsed": 7500.25, "positions": [ { "symbol": "ES", "quantity": 1, "side": "BUY", "entryPrice": 4500.00, "realizedPnL": 100.00, "lastTradeTimestamp": "2023-10-27T10:00:00Z", "settlementTimestamp": "2023-10-27T10:01:00Z" } ] } ``` -------------------------------- ### Futures Portfolio Summary API Endpoint Source: https://docs.onetrading.com/futures/summary This OpenAPI specification defines the GET request for the /account/futures/summary endpoint. It provides a real-time summary of a user's futures portfolio, including account equity, available margin, margin used, and details of open positions. The response schema includes account identifiers, financial metrics, and position-specific data like instrument code, direction, volume, and PNL. ```APIDOC Endpoint: /account/futures/summary Method: GET Summary: Futures Portfolio Summary Description: Provides a real-time summary of a user's futures portfolio on the exchange. It returns details about the current portfolio, including the user's account equity, available margin, margin used and positions. The summary is updated with settlements every minute, ensuring users have the most accurate and up-to-date information about their portfolio. Tags: One Trading Public REST API/Futures Parameters: [] Responses: '200': Description: '' Content: application/json: Schema: type: object properties: account_id: type: string format: uuid description: The unique identifier for the futures account. equity: type: string description: Total asset value in EUR that can be used as margin for futures positions. margin_available: type: string margin_used: type: string positions: type: array items: type: object properties: instrument_code: type: string description: The unique identifier for the futures market, e.g. `BTC_EUR_P`. direction: type: string description: Indicates whether the position is `LONG` or `SHORT`. open_volume: type: string description: The current open contract volume for the position. last_settlement: type: string description: The profit or loss settled for this position in the last minute settlement cycle, in the quote currency. mark_price: type: string description: The mark price used for calculating the last minutely settlement. realised_pnl: type: string description: The total realised profit or loss for this position, in the quote currency. quote_currency_balance: type: string description: The remaining balance of the account in the quote currency after accounting for open positions and settlements. settlement_currency: type: string description: The currency in which profits and losses for this position are settled. last_settlement_timestamp: type: string description: The timestamp of the last settlement applied to this position. open_position: type: string description: The notional value of the open position, expressed in the settlement currency. required: - instrument_code - direction - open_volume - open_position - last_settlement - mark_price - realised_pnl - quote_currency_balance - settlement_currency - last_settlement_timestamp ``` ```YAML openapi: 3.0.1 info: title: '' description: '' version: 1.0.0 paths: /account/futures/summary: get: summary: Futures Portfolio Summary deprecated: false description: >- This endpoint provides a real-time summary of a user's futures portfolio on the exchange. It returns details about the current portfolio, including the user's account equity, available margin, margin used and positions. The summary is updated with settlements every minute, ensuring users have the most accurate and up-to-date information about their portfolio. tags: - One Trading Public REST API/Futures parameters: [] responses: '200': description: '' content: application/json: schema: type: object properties: account_id: type: string format: uuid description: The unique identifier for the futures account. equity: type: string description: >- Total asset value in EUR that can be used as margin for futures positions. margin_available: type: string margin_used: type: string positions: type: array items: type: object x-apidog-refs: {} x-apidog-orders: - instrument_code - direction - open_volume - open_position - last_settlement - mark_price - realised_pnl - quote_currency_balance - settlement_currency - last_settlement_timestamp properties: instrument_code: type: string description: >- The unique identifier for the futures market, e.g. `BTC_EUR_P`. direction: type: string description: Indicates whether the position is `LONG` or `SHORT`. open_volume: type: string description: The current open contract volume for the position. last_settlement: type: string description: >- The profit or loss settled for this position in the last minute settlement cycle, in the quote currency. mark_price: type: string description: >- The mark price used for calculating the last minutely settlement. realised_pnl: type: string description: >- The total realised profit or loss for this position, in the quote currency. quote_currency_balance: type: string description: >- The remaining balance of the account in the quote currency after accounting for open positions and settlements. settlement_currency: type: string description: >- The currency in which profits and losses for this position are settled. last_settlement_timestamp: type: string description: >- The timestamp of the last settlement applied to this position. open_position: type: string description: >- The notional value of the open position, expressed in the settlement currency. required: - instrument_code - direction - open_volume - open_position - last_settlement - mark_price - realised_pnl - quote_currency_balance - settlement_currency - last_settlement_timestamp ``` -------------------------------- ### WebSocket Subscription Request Source: https://docs.onetrading.com/websocket/subscribe This JSON object represents a request to subscribe to a WebSocket channel. It specifies the type of operation and the channels to subscribe to, such as 'TRADING'. ```json { "type": "SUBSCRIBE", "channels": [ { "name": "TRADING" } ] } ``` -------------------------------- ### Successful WebSocket Subscription Response Source: https://docs.onetrading.com/websocket/subscribe This JSON object indicates a successful subscription to WebSocket channels. It confirms the subscribed channels and includes a timestamp for the confirmation. ```json { "type": "SUBSCRIPTIONS", "channels": [ { "name": "TRADING" } ], "time": 1731671164898119453 } ``` -------------------------------- ### OrderStatus Enum (APIDOC) Source: https://docs.onetrading.com/rest/trading/get-orders Enumerates the possible states an order can be in, such as BOOKED, FILL, FILLED_FULLY, CANCELLED, etc. ```APIDOC OrderStatus: type: string enum: - BOOKED - FILL - MOVED - FILLED_FULLY - FILLED_CLOSED - FILLED_REJECTED - CANCELLED - INSUFFICIENT_FUNDS - INSUFFICIENT_LIQUIDITY x-apidog-enum: - value: BOOKED name: '' description: '' - value: FILL name: '' description: '' - value: MOVED name: '' description: '' - value: FILLED_FULLY name: '' description: '' - value: FILLED_CLOSED name: '' description: '' - value: FILLED_REJECTED name: '' description: '' - value: CANCELLED name: '' description: '' - value: INSUFFICIENT_FUNDS name: '' description: '' - value: INSUFFICIENT_LIQUIDITY name: '' description: '' ``` -------------------------------- ### Example Candlestick Data Response Source: https://docs.onetrading.com/rest/public/candlesticks Illustrates a sample response containing candlestick data for a specific instrument and granularity. This data represents historical price and volume information. ```JSON [ { "last_sequence": 1730362835479252000, "instrument_code": "BTC_EUR", "granularity": { "unit": "MINUTES", "period": 30 }, "high": "100000", "low": "100000", "open": "100000", "close": "100000", "volume": "100.00", "time": "2024-10-31T08:29:59.999Z", "start_time": "2024-10-31T08:00:00.000Z" }, { "last_sequence": 1730330727170770700, "instrument_code": "BTC_EUR", "granularity": { "unit": "MINUTES", "period": 30 }, "high": "100000", "low": "100000", "open": "100000", "close": "100000", "volume": "200.00", "time": "2024-10-30T23:29:59.999Z", "start_time": "2024-10-30T23:00:00.000Z" }, { "last_sequence": 1730328614342880500, "instrument_code": "BTC_EUR", "granularity": { "unit": "MINUTES", "period": 30 }, "high": "100000", "low": "100000", "open": "100000", "close": "100000", "volume": "100.00", "time": "2024-10-30T22:59:59.999Z", "start_time": "2024-10-30T22:30:00.000Z" } ] ```