sammchardy / python-binance

Binance Exchange API python implementation for automated trading
https://python-binance.readthedocs.io/en/latest/
MIT License
6.06k stars 2.21k forks source link

outboundAccountPosition doesn't include "borrowed" or "interest" in websocket stream #1145

Open ddeanto opened 2 years ago

ddeanto commented 2 years ago

I've noticed, even when subscribing to the margin user socket stream, that outboundAccountPosition events only include 'a' 'f' and 'l' fields (for asset, free, and locked respectively). However, I need to know how much was borrowed, and how much interest is owed on each asset too in order for the bot to pay back the entire loan. The get_margin_account() request however does return these fields ({'asset': 'LINK', 'free': '0', 'locked': '0', 'borrowed': '0', 'interest': '0', 'netAsset': '0'}), but this is a one time get request (not a websocket). Thanks!

tuncel3 commented 1 year ago

I think you have to check borrowed amount from API. Websocket data is minimized to have only changed data. When borrowed amount changes, a response comes only once.