gateio/gateapi-go

no liquidation type in futures account book

Opened this issue · 2 comments

In the API Query account book the liquidation records are count as "pnl" type, is it possible to add a type named "liquidation"?

We have listFuturesLiquidates API to retrieve liquidation history. Don't know if this works for you.

It should work, but not so straightforward. Here is my solution:

  1. fetch user account book
  2. fetch liquidation history
  3. traverse the account book, if the order ID is in liquidation history and the type is "pnl", then change the type to "liquidation"

Another problem is that it's hard to get all of the liquidations since there is no paging mechanism in Retrieve liquidation history API. In the case that we don't get all liquidations, some records in the user account book won't be converted to "liquidation".