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

How can we retrieve just one specific open order? #230

Open
Danilo-Araujo-Silva opened this issue Apr 29, 2022 · 1 comment
Open

How can we retrieve just one specific open order? #230

Danilo-Araujo-Silva opened this issue Apr 29, 2022 · 1 comment

Comments

@Danilo-Araujo-Silva
Copy link

Danilo-Araujo-Silva commented Apr 29, 2022

How can we retrieve the information of just only one specific open order instead of loading all of them?

For example, we have this documentation here:
https://github.com/project-serum/serum-ts/tree/master/packages/serum

But we only have an example to be retrieving the info for all open orders, so if we are working with several markets this would be very time-consuming.

Maybe we could have something like:

await market.loadOrdersForOwner({ connection: connection, onwer: owner.publicKey, clientId: clientId });
await market.loadOrdersForOwner({ connection: connection, onwer: owner.publicKey, exchangeId: exchangeId });

or

await market.loadOrdersForOwner(connection, owner.publicKey, clientId);
await market.loadOrdersForOwner(connection, owner.publicKey, undefined, exchangeId);
@GiveMeSomething
Copy link

GiveMeSomething commented May 30, 2022

Maybe you can rewrite this function in OpenOrder class to get all orders without filtering them by market. And then find your order using clientId or orderId. But hopefully they will provide us a way to actually filter it like you said 😄

static async findForMarketAndOwner()

p/s: For loadOrdersForOwner(), they ensured that your orders actually get into the Orderbook by filter orders in the OpenOrders with those in bids and asks. I think you can skip those in your custom function if you just need the order info

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