There is barely any reliable way at the moment to identify when a position in isolated mode has seen his margin adjusted when receiving such event in the websocket API:
-
/fapi/v1/positionMargin/history
shows adjusted margins, but it shows also funding fees as well as limit orders getting filled. - It would be possible to cross-check with
/fapi/v1/income?incomeType=FUNDING_FEE
for the funding fees and/fapi/v1/allOrders
for filled (limit) orders. Then a comparison on the quantity and approximate timestamps could help too, but it’s obviously complicated, very error prone and doesn’t even guarantee a correct identification.
Long story short, it would be really great if the Websocket API would return more information what fired the ACCOUNT_UPDATE
event: is it a funding fee, is it a limit order closed, or is it the margin adjusted?