Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perp positions delay in API call to /v2/positions #104

Open
pfeiler opened this issue Jan 30, 2025 · 3 comments
Open

Perp positions delay in API call to /v2/positions #104

pfeiler opened this issue Jan 30, 2025 · 3 comments

Comments

@pfeiler
Copy link

pfeiler commented Jan 30, 2025

I send an order for SOL-PERP via API call /v2/orders and in the GUI (https://app.drift.trade/overview/positions) I see it popping up first as "Open Orders" and then after seconds in "Open Positions". Great!

But when I query /v2/positions I dont see any perp data for quite a while in the reponse.
Even after 5 minutes still no data in json key "perp".

Also */v2/positionInfo/0 * gives me an error "{"code": 400,"reason": "no position"}, allthough I see the position in the GUI in "Open Positions".
Can you reproduce this?

Is there another way to do a "Close all positions" API call, instead of creating a order with the data from /v2/positions?

Thanks in advance!

@jordy25519
Copy link
Collaborator

hi, thanks for the report.

But when I query /v2/positions I dont see any perp data for quite a while in the reponse.
Even after 5 minutes still no data in json key "perp".

It should be patched in the latest release/commit.

Is there another way to do a "Close all positions" API call, instead of creating a order with the data from /v2/positions?

can you describe your usecase more? would they all market close?

@pfeiler
Copy link
Author

pfeiler commented Feb 6, 2025

Fixed it straight away!
With the positions data I can do "Close all position" call now.
Thanks a lot.

@pfeiler pfeiler closed this as completed Feb 6, 2025
@pfeiler
Copy link
Author

pfeiler commented Feb 6, 2025

I am very sorry, I have to reopen. I just had a brief look this morning.

It does work fine for the first order via gateway. But for all (successful) consecutive orders, /v2/positions does not show the correct perp data. It only returns the data from the first order. You have this as well?

@pfeiler pfeiler reopened this Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants