User Data Streams for Binance Spot TESTNET
General information
- Subscribe via the WebSocket API using an API Key.
- Both SBE and JSON output are supported.
- Account events are pushed in real-time.
- All timestamps in JSON payloads are in milliseconds by default.
- Events may contain non-ASCII characters encoded in UTF-8 if you own or trade any assets or symbols whose names contain non-ASCII characters.
User Data Stream Events
Account Update
outboundAccountPosition is sent any time an account balance has changed and contains the assets
that were possibly changed by the event that generated the balance change.
Code
Balance Update
Balance Update occurs during the following:
- Deposits or withdrawals from the account
- Transfer of funds between accounts (e.g. Spot to Margin)
Payload
Code
Order Update
Orders are updated with the executionReport event.
Payload:
Code
Note: Average price can be found by doing Z divided by z.
Conditional Fields in Execution Report
These are fields that appear in the payload only if certain conditions are met.
For additional information on these parameters, please refer to the Spot Glossary.
Order Reject Reason
For additional details, look up the Error Message in the Errors documentation.
Rejection Reason (r) | Error Message |
|---|---|
NONE | N/A (i.e. The order was not rejected.) |
INSUFFICIENT_BALANCES | "Account has insufficient balance for requested action." |
STOP_PRICE_WOULD_TRIGGER_IMMEDIATELY | "Order would trigger immediately." |
WOULD_MATCH_IMMEDIATELY | "Order would immediately match and take." |
OCO_BAD_PRICES | "The relationship of the prices for the orders is not correct." |
If the order is an order list, an event named ListStatus will be sent in addition to the
executionReport event.
Payload
Code
Execution types
NEW- The order has been accepted into the engine.CANCELED- The order has been canceled by the user.REPLACED- The order has been amended.REJECTED- The order has been rejected and was not processed. (e.g. Cancel Replace orders where the new order placement was rejected even if the cancel request succeeded.)TRADE- Part of the order or all of the order's quantity has filled.EXPIRED- The order was canceled according to the order type's rules (e.g. LIMIT FOK orders with no fill, LIMIT IOC or MARKET orders that partially fill) or by the exchange, (e.g. orders canceled during liquidation, orders canceled during maintenance).TRADE_PREVENTION- The order has expired due to STP.
Check the Enums Documentation for more relevant enum definitions.
Event Stream Terminated
eventStreamTerminated is sent when:
- A listen token subscription expires due to token expiration.
- A logon subscription ends
after sending
session.logoutmethod. - The subscription is stopped via the
userDataStream.unsubscribemethod.
Payload:
Code
External Lock Update
externalLockUpdate is sent when part of your spot wallet balance is locked/unlocked by an external
system, for example when used as margin collateral.
Payload:
Code