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

Support order ID linking after order placement in a public entry context #395

Open
alnoki opened this issue Jul 31, 2023 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@alnoki
Copy link
Member

alnoki commented Jul 31, 2023

Currently, if someone places a limit order from the Python SDK in a public entry context there is no immediate feedback providing them with the order ID of the order they just submitted. For them to get this info:

  • Before placing a trade call the view function to get active market order IDs, then place trade, then call the view function again and get the diff (but note this only works for orders that post)
  • Alternatively just call the relevant event handle and check the order ID described in the last emitted event (the events endpoint accepts an int saying how many events to return, it would be ideal if passing “1” just returned the most recent one)

This does mean that orders need to be serialized, for example submit three orders then get the last 3 events emitted

Some alternative solutions

  • Allow client to provide a client order ID, and if the transaction succeeds, they will know the assigned order ID
  • Store data on user account with a list of order IDs, for example, in the order that they were submitted, to be queried by a view function
@alnoki alnoki added the enhancement New feature or request label Jul 31, 2023
@alnoki
Copy link
Member Author

alnoki commented Aug 28, 2023

Noting here that txn events can be used to link txn hash with order ID

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant