delta-exchange / python-rest-client

https://pypi.org/project/delta-rest-client/
13 stars 19 forks source link

liquidation price, bankruptcy price, margin missing from "get positions" api call. #32

Open chatterjeesd opened 3 years ago

chatterjeesd commented 3 years ago
  1. First of all the API doc states that "get positions" API returns info about all open positions and that product_id is not a query required. However the python client requires product id. Clearly a mismatch. Please update the API doc.

  2. When I used the api using python requests (not the python client) for getting positions using the new (v2) API following the API doc, I got "invalid signature" or "type error".

Capture

  1. When I passed product_id to the above as a query, then I got a successful response but with only the entry price and size. Important information about liquidation price, bankruptcy price, margin are missing. Please include the information ASAP or if there is another API call that can provide us with these info, then please mention it in the API doc.

Thanks !!

``

bbc4468 commented 3 years ago

Hi, Certain things have changed in v2. Please go through the changelog to understand the details https://docs.delta.exchange/#changelog

For supporting trading strategies which require latest positions, Now we have two different Apis to query position.

/v2/positions - returns only size and entry price. This should be used when you want to get the latest position, but dont need the margin dependent fields like liquidation price, bankruptcy price etc

/v2/positions/margined - returns all fields including margin dependent fields. When the position is updated due to a fill, changes might take some time to reflect in this Api.