JKorf / Binance.Net

A C# .netstandard client library for the Binance REST and Websocket Spot and Futures API focusing on clear usage and models
https://jkorf.github.io/Binance.Net/
MIT License
1.04k stars 428 forks source link

Binance Futures PositionInfo/AccountInfo missing "isolatedWallet" field #1314

Closed ItsXor closed 10 months ago

ItsXor commented 1 year ago

Hi.

Seems like classes with position information are missing a critical field that is used for isolated futures positions: "isolatedWallet"

My tests show that it returns exact margin amount allocated to isolated position (same as shown in binance app/web interfaces).

There are two functions for getting position info:

  1. BinanceRestClient.UsdFuturesApi.Account.GetPositionInformationAsync() Returns BinancePositionDetailsUsdt and it lacks "isolatedWallet" Docs: https://binance-docs.github.io/apidocs/futures/en/#position-information-v2-user_data

  2. BinanceRestClient.UsdFuturesApi.Account.GetAccountInfoAsync() Returns BinanceFuturesAccountInfo and Positions Field of type BinancePositionInfoUsdt lacks "isolatedWallet" too Docs: https://binance-docs.github.io/apidocs/futures/en/#account-information-v2-user_data Strangely docs don't show that AccountInfo will return positions with "isolatedWallet", but if you look at actual JSON data returned by server, this field is present.

I am not sure if it is appropriate to include undocumented field that is returned for positions in AccountInfo, but PositionsInfo documentation includes it and I see it as the only option to get currently allocated margin for isolated position.

Also resolving this issue will solve Issue https://github.com/JKorf/Binance.Net/issues/1312

Big thanks.

JKorf commented 10 months ago

Added it in the latest version