Dear API users:
To: OKX API Users
From: OKX API Product Team
Issue Date: 23-Jul-2021
Contact us: https://t.me/OKExAPI (Telegram)
In order to improve user experience of V5 API service, we have released lots of updates during the past Q2 2021. We summarize the following updates as a review of V5 API changes in Q2 2021.
Thank you for your continued support and we assure you our best services at all times.
Detailed change logs please see our API docs:
Change summary:
-
Trade Module
Id
|
Endpoint
|
Change Summary
|
Date
|
1
|
REST - Place order
|
Add new order type: optimal_limit_ioc
|
25-May-2021
|
REST - Place multiple orders
|
|||
WebSocket - Place order
|
|||
WebSocket - Place multiple orders
|
-
Funding Module
Id
|
Endpoint
|
Change Summary
|
Date
|
1
|
Get deposit address
|
Add a new response parameter ctAddr: Last 6 digits of contract address.
|
15-Jun-2021
|
2
|
Withdrawal
|
Add a new response parameter chain name.
|
15-Jun-2021
|
Get deposit address
|
|||
Get withdrawal history
|
|||
Get deposit history
|
|||
3
|
Withdrawal
|
Add a new request parameter chain name.
|
15-Jun-2021
|
-
Account Module
Id
|
Endpoint
|
Change Summary
|
Date
|
1
|
Get maximum buy/sell amount or open amount
|
Support multiple instrument IDs (no more than 5), separated with comma.
|
11-Jun-2021
|
2
|
Get positions
|
Support multiple instrument IDs (no more than 10), separated with comma.
|
8-Jun-2021
|
3
|
REST - Get balance
|
Add new response parameters: notionalUsd, notionalLever, eqUsd and maxLoan.
|
18-May-2021
|
WebSocket -
Account channel
|
|||
4
|
REST - Get positions
|
Add new response parameters of greeks metrics.
|
21-Apr-2021
|
WebSocket - Positions
channel
|
|||
5
|
Get account
configuration
|
Add new response parameters: level and levelTmp.
|
21-Apr-2021
|
6
|
Get bills details
|
Delete the enum “109” of subType parameter
|
21-Apr-2021
|
7
|
REST - Get balance
|
Add new response parameters: cashBal and uTime.
|
16-Apr-2021
|
WebSocket - Account
channel
|
|||
8
|
Get account and
position risk
|
Add this new REST endpoint
|
16-Apr-2021
|
9
|
Get interest rate
|
Add this new REST endpoint
|
16-Apr-2021
|
-
SubAccount Module
Id
|
Endpoint
|
Change Summary
|
Date
|
1
|
Get sub-account balance
|
Add new response parameters: notionalUsd, notionalLever and eqUsd.
|
18-May-2021
|
2
|
Get sub-account balance
|
Add new response parameters: cashBal and uTime.
|
16-Apr-2021
|
-
Market Data Module
Id
|
Endpoint
|
Change Summary
|
Date
|
1
|
Get oracle
|
Add this new REST endpoint.
|
21-Apr-2021
|
2
|
Get total volume
|
Add this new REST endpoint.
|
16-Apr-2021
|
-
Public Data Module
Id
|
Endpoint
|
Change Summary
|
Date
|
1
|
Get discount rate and interest-free quota
|
Add new response parameters for detailed discount information of a currency.
|
25-May-2021
|
2
|
Get underlying
|
Add this new REST endpoint.
|
25-May-2021
|
3
|
Get interest rate and
loan quota
|
Add this new REST endpoint.
|
25-May-2021
|
4
|
Get position tiers
|
Add this new REST endpoint.
|
21-Apr-2021
|
-
WebSocket Module
Id
|
Endpoint
|
Change Summary
|
Date
|
1
|
Orders channel
|
Add 2 new response parameters: fillNotionalUsd and notionalUsd.
|
8-Jun-2021
|
2
|
Algo orders channel
|
Add new response parameter: notionalUsd.
|
8-Jun-2021
|
3
|
Orders channel
|
Add new response parameters: fillFee, fillFeeCcy and execType.
|
21-Apr-2021
|
4
|
books50-l2-tbt channel
|
Add this new order book channel.
|
21-Apr-2021
|
5
|
Balance and position channel
|
Add new enum “interest_deduction” of eventType.
|
21-Apr-2021
|
-
Error Code
Id
|
Change Summary
|
Date
|
1
|
Add new error code 55000, message is “Cannot be transferred out within 30 minutes after delivery.”
|
11-Jun-2021
|
Change details:
-
Trade Module
-
Change 1
-
Date: 25-May-2021
-
REST Endpoints: Place order, place multiple orders
-
REST URLs: POST /api/v5/trade/order
POST /api/v5/trade/batch-orders
-
WebSocket Operations: Place order, place multiple orders
-
WebSocket Operation Keys: Order, batch-orders
-
Description: Add new order type: optimal_limit_ioc, which is applicable to futures and perpetual swap trading.
-
Benefit: This newly added order type allows user to place market order with “immediate or cancel” for futures and perpetual swap trading.
-
Funding Module
-
Change 1
-
Date: 15-Jun-2021
-
Endpoint: Get deposit address
-
URL: GET /api/v5/asset/deposit-address
-
Description: Add a new response parameter ctAddr: Last 6 digits of contract address.
-
Benefit: Keeps user posted on the accurate contract address of the currency to avoid depositing to wrong contract.
-
Change 2
-
Date: 15-Jun-2021
-
Endpoints: Get deposit address, withdrawal, get withdrawal history, get deposit history
-
URLs: GET /api/v5/asset/deposit-address
POST /api/v5/asset/withdrawal
GET /api/v5/asset/withdrawal-history
GET /api/v5/asset/deposit-history
-
Description: Add a new response parameter chain (chain name).
-
Benefit: Split the chain info from the currency parameter to make the currency response parameter more regular.
-
Change 3
-
Date: 15-Jun-2021
-
Endpoint: Withdrawal
-
URL: POST /api/v5/asset/withdrawal
-
Description: Add a new request parameter chain (chain name).
-
Benefit: Split the chain info from the currency parameter to make the currency request parameter more regular.
-
Account Module
-
Change 1
-
Date: 15-Jun-2021
-
Endpoint: Get maximum buy/sell amount or open amount
-
URL: GET /api/v5/account/max-size
-
Description: Allows user to specify multiple instrument IDs (no more than 5), separated with comma.
-
Benefit: Makes the query more flexible.
-
Change 2
-
Date: 8-Jun-2021
-
Endpoint: Get positions
-
URL: POST /api/v5/asset/withdrawal
-
Description: Allows user to specify multiple instrument IDs (no more than 10), separated with comma.
-
Benefit: Makes the query more flexible.
-
Change 3
-
Date: 18-May-2021
-
REST Endpoint: Get balance
-
REST URL: GET /api/v5/account/balance
-
WebSocket Channel: Account channel
-
WebSocket Subscription Name: account
-
Description: Add new response parameters: notionalUsd (quantity of positions of the whole account in USD), notionalLever (leverage of the currency), eqUsd (equity of the currency in USD) and maxLoan (maximum loan of the currency).
-
Benefit: Users can calculate the overall account risk metrics based on these parameters via user-defined ways more conveniently.
-
Change 4
-
Date: 21-Apr-2021
-
REST Endpoint: Get positions
-
REST URL: GET /api/v5/account/positions
-
WebSocket Channel: Positions channel
-
WebSocket Subscription Name: positions
-
Description: Add new response parameters of greeks risk metrics.
-
Benefit: User can review the greeks risk metrics for options position more conveniently.
-
Change 5
-
Date: 21-Apr-2021
-
Endpoint: Get account configuration
-
URL: GET /api/v5/account/config
-
Description: Add new response parameters: level and levelTmp.
-
Benefit: User can review the actual level based on real trading volume and the temporary experience level more conveniently.
-
Change 6
-
Date: 21-Apr-2021
-
Endpoint: Get bills details
-
URLs: GET /api/v5/account/bills
GET /api/v5/account/bills-archive
-
Description: Delete the enum “109” of subType
-
Benefit: Remove this type to math latest business model.
-
Change 7
-
Date: 16-Apr-2021
-
REST Endpoint: Get balance
-
REST URL: GET /api/v5/account/balance
-
WebSocket Channel: Account channel
-
WebSocket Subscription Name: account
-
Description: Add new response parameters: cashBal (cash balance of the currency) and uTime (update time of the cash balance).
-
Benefit: Offers the cash balance and update time of currency.
-
Change 8
-
Date: 16-Apr-2021
-
Endpoint: Get account and position risk
-
URL: GET /api/v5/account/account-position-risk
-
Description: Add this new REST endpoint
-
Benefit: User can fetch the key balance of account and positions on the same time slice to calculate some risk metrics via user-defined ways more conveniently.
-
Change 9
-
Date: 16-Apr-2021
-
Endpoint: Get interest rate
-
URL: GET /api/v5/account/interest-rate
-
Description: Add this new REST endpoint.
-
Benefit: User can fetch the leveraged currency borrowing interest rate based on user’s account level.
-
SubAccount Module
-
Change 1
-
Date: 18-May-2021
-
Endpoint: Get sub-account balance
-
URL: GET /api/v5/account/subaccount/balances
-
Description: Add new response parameters: notionalUsd (quantity of positions of the whole account in USD), notionalLever (leverage of the currency) and eqUsd (equity of the currency in USD).
-
Benefit: Users can calculate the overall account risk based on these parameters via user-defined ways more conveniently.
-
Change 2
-
Date: 16-Apr-2021
-
Endpoint: Get sub-account balance
-
URL: GET /api/v5/account/subaccount/balances
-
Description: Add new response parameters: cashBal (cash balance of the currency) and uTime (update time of the cash balance).
-
Benefit: Offers the basic balance and update time information.
-
Market Data Module
-
Change 1
-
Date: 21-Apr-2021
-
Endpoint: Get oracle
-
URL: GET /api/v5/market/open-oracle
-
Description: Add this new REST endpoint
-
Benefit: User can fetch the cryptographically signed prices posted on-chain by Open Oracle standard.
-
Change 2
-
Date: 16-Apr-2021
-
Endpoint: Get total volume
-
URL: GET /api/v5/market/platform-24-volume
-
Description: Add this new REST endpoint.
-
Benefit: User can fetch the 24-hour trading volume calculated on a rolling basis, using USD as the pricing unit. It is especially helpful for some third party platforms.
-
Public Data Module
-
Change 1
-
Date: 25-May-2021
-
Endpoint: Get discount rate and interest-free quota
-
URL: GET /api/v5/public/discount-rate-interest-free-quota
-
Description: Add new response parameters for discount information, which are discountRate (discount rate), minAmt (tier-lower bound) and maxAmt (tier-upper bound).
-
Benefit: Offers user the detailed discount tiers information.
-
Change 2
-
Date: 25-May-2021
-
Endpoint: Get underlying
-
URL: GET /api/v5/public/underlying
-
Description: Add this new REST endpoint.
-
Benefit: User can fetch the underlying indexes for derivatives.
-
Change 3
-
Date: 25-May-2021
-
Endpoint: Get interest rate and loan quota
-
URL: GET /api/v5/public/interest-rate-loan-quota
-
Description: Add this new REST endpoint.
-
Benefit: User can fetch the margin interest rate and loan quota.
-
Change 4
-
Date: 21-Apr-2021
-
Endpoint: Get position tiers
-
URL: GET /api/v5/public/position-tiers
-
Description: Add this new REST endpoint
-
Benefit: User can fetch the public data of position tiers for derivatives.
-
WebSocket Module
-
Change 1
-
Date: 8-Jun-2021
-
Channel: Orders channel
-
Subscription Name: orders
-
Description: Add 2 new response parameters: fillNotionalUsd (filled notional value) and notionalUsd (estimated national value), both are in USD.
-
Benefit: User can review the notional value of order in USD more conveniently.
-
Change 2
-
Date: 8-Jun-2021
-
Channel: Algo orders channel
-
Subscription Name: orders-algo
-
Description: Add new response parameter: notionalUsd (estimated national value in USD).
-
Benefit: User can review the notional value of order in USD more conveniently.
-
Change 3
-
Date: 21-Apr-2021
-
Channel: Orders channel
-
Subscription Name: orders
-
Description: Add new response parameters: fillFee (last filled fee), fillFeeCcy (last filled fee currency) and execType (Order flow type, T: taker M: maker).
-
Benefit: Makes the WebSocket order messages more friendly for users’ real-time reconciliation.
-
Change 4
-
Date: 21-Apr-2021
-
Channel: Order book channel
-
Subscription Name: books50-l2-tbt
-
Description: Add this new order book channel
-
Benefit: Offers a 50 depth levels tick-by-tick order book channel, to match users’ needs for tick-by-tick data while consuming fewer resources.
-
Change 5
-
Date: 21-Apr-2021
-
Channel: Balance and position channel
-
Subscription Name: balance_and_position
-
Description: Add new enum “interest_deduction” of eventType
-
Benefit: This channel will push message when interest deduction happens.
-
Error Code
-
Change 1
-
Date: 11-Jun-2021
-
Description: Add new error code 55000, of which the message is “Cannot be transferred out within 30 minutes after delivery.”
-
Benefit: Makes user more clear about the error situation.
OKX,
April 14, 2022