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

program: new modify order ix #422

Merged
merged 6 commits into from
Apr 11, 2023
Merged

Conversation

crispheaney
Copy link
Member

No description provided.

let post_only = modify_order_params
.post_only
.unwrap_or(if existing_order.post_only {
PostOnlyParam::MustPostOnly
Copy link
Member

@0xbigz 0xbigz Apr 11, 2023

Choose a reason for hiding this comment

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

good to have stricter assumption here 👍

} else {
PostOnlyParam::None
});
let immediate_or_cancel = modify_order_params
Copy link
Member

@0xbigz 0xbigz Apr 11, 2023

Choose a reason for hiding this comment

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

technically, params.immediate_or_cancel should not be allowed here, right? looking at handle_place_perp_order

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah it should only be false

let user_order_id = existing_order.user_order_id;
let base_asset_amount = modify_order_params
.base_asset_amount
.unwrap_or(existing_order.base_asset_amount);
Copy link
Member

@0xbigz 0xbigz Apr 11, 2023

Choose a reason for hiding this comment

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

should this enforce that a partially filled order (base_asset_amount_filled!=0) must have the base asset amount replaced?

might be nice not to and havent thought it completely thru, but just wondering if this is going to lead to confusing states (quoteAssetAmountFilled estimating prices etc)

@crispheaney crispheaney merged commit b1abf5f into master Apr 11, 2023
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.

2 participants