zhouaini528 / binance-php

Binance API Like the official document interface, Support for arbitrary extension.
MIT License
106 stars 43 forks source link

liquidationPrice Stream #17

Open mohammad-rj opened 3 years ago

mohammad-rj commented 3 years ago

with Position Information V2 (USER_DATA) " GET /fapi/v2/positionRisk (HMAC SHA256) " https://binance-docs.github.io/apidocs/futures/en/#position-information-v2-user_data

function positionRisk "$binance->trade()->getPositionRisk();"

we can get liquidationPrice of current open position on all symbols

but how we can get liquidationPrice on websocket streaming ?

there is a Stream Name: !forceOrder@arr on binnace doc https://binance-docs.github.io/apidocs/futures/en/#all-market-liquidation-order-streams

It gives us // Original Quantity - // Price - // Average Price but does not give a liquidation price!

so how we can stream the liquidationPrice ? is it possible ?

zhouaini528 commented 3 years ago

I found that the Chinese document of binance is updated more slowly than the English document. I'll go to experiment first and then give you feedback.

zhouaini528 commented 3 years ago

Sorry to reply to you now, you can do this

$binance->subscribe([
      '!forceOrder@arr'
]);

$data=$binance->getSubscribes();
print_r($data);
mohammad-rj commented 3 years ago

tanks for answering

but there is not "liquidationPrice" in "!forceOrder@arr"

zhouaini528 commented 3 years ago

I haven't used this data. After testing, I found that there is no such data "liquidationPrice". It can be combined with HTTP REST and websocket as an auxiliary method