sammchardy / python-binance

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

Add isolated margin account and order #612

Closed xulngx closed 3 years ago

xulngx commented 3 years ago

Describe the bug I want to add isolated margin account_info and order functions myself but I don’t know how to do that. Can anyone help me please!!!

Expected behavior Add isolated margin account info and order functions.

Environment (please complete the following information): Ubuntu 16 Python 3.7 Python-binance

mfiro commented 3 years ago

For this you should find the endpoint address from the official API documentation. For Query Isolated Margin Account Info (USER_DATA) it is:

GET /sapi/v1/margin/isolated/account (HMAC SHA256)

Then try to add it to client.py. See other functions to know which prefix/variable represents /sapi/. Also a PR is nice if everything works.

xulngx commented 3 years ago

Thanks a lot!!! It works fine for me, just add a function in client.py file.

kimchirichie commented 3 years ago

mind creating a PR for the community?

xulngx commented 3 years ago

Yes sure! I’m really glad that I can help, I’ll work on that😁

ttamg commented 3 years ago

I see that the new get isolated account endpoint has just been merged into master. Great stuff thanks!

There are a few other issues that mean python-binance doesn't yet have what is needed to trade on isolated margin. I'm proposing creating a PR for the following over the coming days. ...

@kimchirichie Do you want a PR for this?

ttamg commented 3 years ago

I've now added the Binance isolated margin endpoints I need.
And I have updated the docs for isolated margin.

I'll post a PR now and you can review if you want to include @kimchirichie

It's PR #622

kimchirichie commented 3 years ago

merged!

ttamg commented 3 years ago

Great. Thanks @kimchirichie Do you have a plan for when to do the next Pypi release? For now I will import from master branch.

kimchirichie commented 3 years ago

@ttamg 0.7.7 was released 4 days ago. thanks for waiting