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

Neg Risk Support #100

Merged
merged 10 commits into from
Nov 29, 2023
Merged

Neg Risk Support #100

merged 10 commits into from
Nov 29, 2023

Conversation

mshrieve
Copy link
Contributor

@mshrieve mshrieve commented Oct 25, 2023

Modifies the Clob Client in anticipation of the future Neg Risk market type.
Adds a new OrderOptions object:

type OrderOptions = {
  tickSize: TickSize;
  negRisk?: boolean;
}

These modifications do not require extra calls to the CLOB, e.g., to get the exchange address to be used when signing.
Contract addresses are now hard-coded in this repo, as opposed to retrieved from the clob-order-utils.

@mshrieve mshrieve changed the title Neg Risk Proposal 1 [WIP] Neg Risk Proposal 1 Oct 25, 2023
@mshrieve mshrieve changed the title [WIP] Neg Risk Proposal 1 [WIP] Neg Risk Nov 15, 2023
@mshrieve mshrieve changed the title [WIP] Neg Risk Neg Risk Support Nov 29, 2023

return this.orderBuilder.buildOrder(userOrder, tickSize);
const tickSize = await this._resolveTickSize(tokenID, options?.tickSize);
const negRisk = options?.negRisk ?? false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the negRisk flag is a param of this function, the frontend (or any other client) has to know in advance if the market is neg risk or not, is that information available in this context or should we add a new CLOB request to resolve that?

cc: @mttwlkr @L-Kov

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the frontend will known at the time of calling whether the market is neg-risk or not. We considered adding an extra call to the CLOB to determine locally (to this package) whether the market is neg-risk but opted to make these calls as light-weight as possible.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it makes sense, thanks!

@mshrieve mshrieve merged commit 0a69c12 into main Nov 29, 2023
2 checks passed
@mshrieve mshrieve deleted the feat/neg-risk-1 branch November 29, 2023 21:22
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

Successfully merging this pull request may close these issues.

3 participants