Skip to content
All library documents

OKX API v5 Account Setup, Order Handling, and Position Reconciliation

Article OKX Learn

Summary

This guide explains how OKX API v5 unifies trading requests across product types and describes account configuration, leverage settings, and order handling. It covers REST and WebSocket access, public and private channels, authentication, trade modes, and subscription options for order updates. The examples show how leverage settings can apply at different scopes, such as currencies or derivative instruments, and explain that an order acknowledgement does not by itself confirm the order is live.

A key operational topic is reconciling order fills with position updates. The guide uses trade identifiers and position timestamps to compare events, while noting that position messages can aggregate changes and that liquidation or auto-deleveraging may change positions without a matching order update. This is a practical integration guide, not a trading strategy or performance study. API specifications can change, and the document itself advises checking current documentation before implementation.

Key ideas

  • API v5 uses common request and response models across product types.
  • REST and WebSocket can both support order placement, while WebSocket order updates require a private channel.
  • Account mode, position mode, trade mode, and leverage settings affect how orders and positions are managed.
  • An order acknowledgement indicates receipt and assignment of an order identifier, not necessarily that the order is live.
  • Position reconciliation should account for trade identifiers, timestamps, aggregated updates, liquidation, and auto-deleveraging.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.