LUCIT-Systems-and-Development / unicorn-fy

A Python SDK by LUCIT to convert received raw data from crypto exchange API endpoints into well-formed python dictionaries.
https://unicorn-fy.docs.lucit.tech
MIT License
54 stars 20 forks source link

Binance API Updates #18

Closed oliver-zehentleitner closed 3 years ago

oliver-zehentleitner commented 3 years ago

Is your feature request related to a problem? Please describe. https://binance-docs.github.io/apidocs/futures/en/#change-log

Describe the solution you'd like Test the changes and make changes to the lib if needed:

2020-11-09

WEB SOCKET USER DATA STREAM

Please notice: new streamlined and optimized push rules on event ACCOUNT_UPDATE in USER-DATA-STREAM

When an asset of a user is changed:
    Only this asset and its balance information will be pushed
    Other assets and information will no longer be pushed even the balances may not be 0
    If none of the open positions change, the position "P" will only return an empty []

When a position or the margin type of a symbol is changed:
    "P" will push the details in the "BOTH" position of this symbol
    If the change happens in "LONG" or "SHORT" position, the changed "LONG" or "SHORT" position of this symbol will be pushed
    Initialized "LONG" or "SHORT" isolated position of this symbol will also be pushed
    Position information of other symbols will no longer be pushed, even their positions may not be 0

In short, the full information of assets and positions should be obtained via the related RESTful endpoints(GET /fapi/v2/account and GET /fapi/v2/positionRisk), and the locally cached asset or position data can be updated via the event ACCOUNT_UPDATE in Websocket USER-DATA-STREAM with the information of changed asset or position.

Please visit here to get examples for helping to understand the upgrade.