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 to place several orders in just one single transaction? #229

Open
Danilo-Araujo-Silva opened this issue Apr 29, 2022 · 0 comments
Open

Comments

@Danilo-Araujo-Silva
Copy link

How can we place several orders in just one transaction?
Guaranteeing this way that it returns success only if all of them succeeded?

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 placing a single order at a time, how can we achieve the proposed above?
This is very needed for some cases.

Maybe we could have something like:

await market.placeOrder(connection,
[
  {
    owner,
    payer,
    side: 'buy', // 'buy' or 'sell'
    price: 123.45,
    size: 17.0,
    orderType: 'limit', // 'limit', 'ioc', 'postOnly'
  },
  {
    owner,
    payer,
    side: 'buy', // 'buy' or 'sell'
    price: 123.45,
    size: 17.0,
    orderType: 'limit', // 'limit', 'ioc', 'postOnly'
  },
  ...
]);
@Danilo-Araujo-Silva Danilo-Araujo-Silva changed the title How to place several orders in one single transaction? How to place several orders in just one single transaction? Apr 29, 2022
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

1 participant