User Data Streams
Connect
- The base API endpoint is: https://eapi.binance.com
- A User Data Stream
listenKeyis valid for 60 minutes after creation. - Doing a
PUTon alistenKeywill extend its validity for 60 minutes. - Doing a
DELETEon alistenKeywill close the stream and invalidate thelistenKey. - Doing a
POSTon an account with an activelistenKeywill return the currently activelistenKeyand extend its validity for 60 minutes. - Connection method for Websocket:
- Base Url: wss://fstream.binance.com/private/
- User Data Streams are accessed at /ws/<listenKey>
- Example:
wss://fstream.binance.com/private/ws/XaEAKTsQSRLZAGH9tuIu37plSRsdjmlAVBoNYPUITlTAko1WI22PgmBMpI1rS8Yh
- A single connection is only valid for 24 hours; expect to be disconnected at the 24 hour mark
Event: Account Data
Description
- Update under the following conditions:
- Account deposit or withdrawal
- Position info change
- Periodic update every 10s when having position
URL Path
/private
Event Name
ACCOUNT_UPDATE
Update Speed
50ms
Payload
Schema:
accountUpdate
Note: The event payload is wrapped in a
stream/dataenvelope on the WebSocket connection.
Event: Balance and Position Update
Description
Event type is BALANCE_POSITION_UPDATE.
-
When balance or position get updated, this event will be pushed.
BALANCE_POSITION_UPDATEwill be pushed only when update happens on user's account, including changes on balances, positions.- Unfilled orders or cancelled orders will not make the event pushed, since there's no change on positions.
- "position" in
BALANCE_POSITION_UPDATE: Only symbols of changed positions will be pushed.
-
The field "m" represents the reason type for the event and may shows the following possible types:
- DEPOSIT
- WITHDRAW
- ORDER
-
The field "bc" represents the balance change except for PnL and commission.
Event Name
BALANCE_POSITION_UPDATE
Payload
Schema:
balancePositionUpdate
Event: Order Update
Description
When new order created, order status changed will push such event. Event type is
ORDER_TRADE_UPDATE.
Side
- BUY
- SELL
Order Type
- LIMIT
Execution Type
- NEW
- CANCELED
- EXPIRED
- TRADE
Order Status
- NEW
- PARTIALLY_FILLED
- FILLED
- CANCELED
- EXPIRED
Time in force
- GTC
- IOC
- FOK
- GTX
URL Path
/private
Event Name
ORDER_TRADE_UPDATE
Update Speed
50ms
Payload
Schema:
orderTradeUpdate
Event: Greek Update
Description
GREEK_UPDATE will be triggered when a position changes or periodically every 10 seconds when
having position.
URL Path
/private
Event Name
GREEK_UPDATE
Payload
Schema:
greekUpdate
Event: Risk Level Change
Description
- Updates whenever there is an account risk level change. The following are possibly values:
- NORMAL
- REDUCE_ONLY
- Note: Risk level changes are only applicable to VIP and Market Makers user accounts. VIP and
certain Market Maker accounts will be automatically placed into REDUCE_ONLY mode if their margin
balance is insufficient to meet their maintenance margin obligations. Once in REDUCE_ONLY mode,
the system will re-evaluate the risk level only upon the following events:
- Funds transfer
- Trade fill
- Option expiry
URL Path
/private
Event Name
RISK_LEVEL_CHANGE
Update Speed
50ms
Payload
Schema:
riskLevelChange
Event: User Data Stream Expired
Description
When the listenKey used for the user data stream turns expired, this event will be pushed.
Notice:
- This event is not related to the websocket disconnection.
- This event will be received only when a valid
listenKeyin connection got expired. - No more user data event will be updated after this event received until a new valid
listenKeyused.
Event Name
listenKeyExpired
Payload
Schema:
listenKeyExpired