XChange icon indicating copy to clipboard operation
XChange copied to clipboard

Support binance futures and margin trading

Open m1dnightc0der opened this issue 3 years ago • 7 comments

It does not see that the existing binanace (xchange-binance) only support the spot api's (api/v3) rather than the margin (/sapi/v1/margin) and futures (/fapi/v1/). I would like to implement the additional margin and futures support, and wondered if there was any guidence on how to do this, i.e. as a new exhcange within xchange-binance or via some flag using the exsitng exchange.

m1dnightc0der avatar Nov 15 '22 14:11 m1dnightc0der

If you don't know, please don't start because i will implement it in this month

Στις Τρί 15 Νοε 2022 στις 5:00 μ.μ., ο/η m1dnightc0der < @.***> έγραψε:

It does not see that the existing binanace (xchange-binance) only support the spot api's (api/v3) rather than the margin (/sapi/v1/margin) and futures (/fapi/v1/). I would like to implement the additional margin and futures support, and wondered if there was any guidence on how to do this, i.e. as a new exhcange within xchange-binance or via some flag using the exsitng exchange.

— Reply to this email directly, view it on GitHub https://github.com/knowm/XChange/issues/4612, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHIWQ756X7NS2TQWLHDWIBDWIOQPFANCNFSM6AAAAAASBBDAHU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

makarid avatar Nov 15 '22 16:11 makarid

@makarid great news, want to collobrate on a branch? i will probably need the margin part next week, so happy to work on that. Think doing it with all the same exchange settings and adding the methods to the existing org.knowm.xchange.binance.BinanceAuthenticated and then routing to them using a combination of order flags and instrument type (i.e. perp/futs)

m1dnightc0der avatar Nov 16 '22 08:11 m1dnightc0der

Great idea. I was thinking to create a separate exchange for futures but the way Binance has built their API doesn't help that approach. I like your idea better, I am starting with futures endpoints first and then I will go to the coin margined. So I guess we will create orderFlags in order to distinguish which endpoints to call when trading, WalletFeature when we call account endpoints. What about the market data endpoints?

On Wed, Nov 16, 2022, 10:58 AM m1dnightc0der @.***> wrote:

@makarid https://github.com/makarid great news, want to collobrate on a branch, i will probably need the margin part next week, so happy to work on that. Think doing it with all the same exchange settings and adding the methods to the existing org.knowm.xchange.binance.BinanceAuthenticated and then routing to them using a combination of order flags and instrument type (i.e. perp/futs)

— Reply to this email directly, view it on GitHub https://github.com/knowm/XChange/issues/4612#issuecomment-1316630995, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHIWQ77ZU6TQPNB6MIHZZO3WISO2DANCNFSM6AAAAAASBBDAHU . You are receiving this because you were mentioned.Message ID: @.***>

makarid avatar Nov 16 '22 09:11 makarid

I guess we can use the Instrument class and check if the Instrument is CurrencyPair or FutureContract.

makarid avatar Nov 16 '22 09:11 makarid

@m1dnightc0der will you do the margin part and i will do the futures part (USDT and CoinMargined one)? What do you think?

makarid avatar Nov 16 '22 09:11 makarid

sorry totally missed, this, will work on margin this week. let me know if you have a branch, will work from that

m1dnightc0der avatar Nov 26 '22 21:11 m1dnightc0der

Hello @m1dnightc0der , the Binance Futures support has already been added to develop branch so, you can start from there.

makarid avatar Jan 09 '23 21:01 makarid