-
Notifications
You must be signed in to change notification settings - Fork 58
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
[TS] [CLOB-895] v0.38.2
: Cancel order examples
#44
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: add typescript client version in PR so it's easy for people to find changes made in this version
@@ -37,7 +37,7 @@ async function test(): Promise<void> { | |||
side, | |||
price, | |||
0.01, | |||
randomInt(100_000_000), | |||
randomInt(MAX_CLIENT_ID), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: can we abstract this into a function? Maybe call it getRandomClientId
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gonna ignore this for now.
console.log(error.message); | ||
} | ||
|
||
await sleep(5000); // wait for placeOrder to complete |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this sleep necessary for Short-Term orders?
console.log(error.message); | ||
} | ||
|
||
await sleep(5000); // wait for placeOrder to complete |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you note that for stateful orders, it can only be canceled after it's added to a block (which i'm assuming is why there's a sleep here)
Maybe also add a log statement "waiting for long-term order placement to included in a block"?
subaccount, | ||
shortTermOrderClientId, | ||
OrderFlags.SHORT_TERM, | ||
'ETH-USD', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metapoint not addressable in this PR: I think the V4 client should expose the concept of an order ID to programmatic traders
It's confusing that if any of these params change the order ID is diff and that's all under the hood
8d85635
to
a8e785c
Compare
v0.38.2
: Cancel order examples
No description provided.