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 427 forks source link

Missing property in UsdFuturesApi.Account.GetPositionInformationAsync result #1315

Closed alaky2 closed 10 months ago

alaky2 commented 10 months ago

The BinanceRestClient.UsdFuturesApi.Account.GetPositionInformationAsync does not return the "breakEvenPrice" on result. According to this page: https://binance-docs.github.io/apidocs/futures/en/#position-information-v2-user_data the response has an item called "breakEvenPrice".

ItsXor commented 10 months ago

I may be wrong, but according to tests I made "breakEvenPrice" == "entryPrice", so this field does not give any new information. And it does not account any fees. IMHO, better to calculate break even price based on your strategy and not rely on this field.

If there are any other uses for this field or if I am missing a point then please correct me.

alaky2 commented 10 months ago

Hi, I set the ClientOptions.OutputOriginalData = True and did a test. Here is the raw response:

[{"symbol":"BTCUSDT","positionAmt":"0.003","entryPrice":"37140.0","breakEvenPrice":"37147.428","markPrice":"37113.25148824","unRealizedProfit":"-0.08024553","liquidationPrice":"36549.03942102","leverage":"50","maxNotionalValue":"3000000","marginType":"isolated","isolatedMargin":"2.13122468","isAutoAddMargin":"false","positionSide":"LONG","notional":"111.33975446","isolatedWallet":"2.21147021","updateTime":1699810265319,"isolated":true,"adlQuantile":2},{"symbol":"BTCUSDT","positionAmt":"0.000","entryPrice":"0.0","breakEvenPrice":"0.0","markPrice":"37113.25148824","unRealizedProfit":"0.00000000","liquidationPrice":"0","leverage":"50","maxNotionalValue":"3000000","marginType":"isolated","isolatedMargin":"0.00000000","isAutoAddMargin":"false","positionSide":"SHORT","notional":"0","isolatedWallet":"0","updateTime":1699761002711,"isolated":true,"adlQuantile":0}]

As you can see the "breakEvenPrice" is 37147.428, different from "entryPrice"=37140.0. It is the price at which there would be neither loss and nor profit.

JKorf commented 10 months ago

I've added it in the latest version