here is my scenario, 2 steps:
- Transfer some money from MAIN to PORTFOLIO_MARGIN through
userUniversalTransfer
- Make a margin order through papi
Then encounter an error in step2, says: “{ code: -2019, msg: “Margin is insufficient.”}” .
I did a little change to my codes. Sleep for 200ms - 500ms after step 1 then the error gone.
Does the ‘userUniversalTransfer’ API immediately take effect? Am I doing something wrong?