Old qty when fetching future positions after an order is filled

Dear Binance,

I’m running trading bot for futures and I’d like to ask one question.
The bot is using both user_data_stream websocket and the rest api((fapi/v1/positionRisk) for the position update. The user_data_stream is mainly used for managing the current position and the rest api is used as a fallback in case where position update notification is lost due to connectivity issue, e.g. connection hiccup.

The issue is that I’m getting old position size via the rest api after receiving the position update from user_data_stream. It seems that there’s some delay for the position update when calling the rest api.

If so,

  1. can you tell me how long the delay may be?
  2. what’s the best way to get the current position size in case where the position update is lost?

Thanks

FYI, here’s the logs:

/fapi/v1/positionRisk is deprecated, I suggest using /fapi/v2/positionRisk instead and report back if the issue is still present.

1 Like

Thanks for the follow-up.

I’ll let you know whether it works.
Thanks,
Yumi

Hey Alex,

I got the same position size after changing the rest api to v2.

Thanks for the help!