Skip to content

program: modify order trigger limit to limit#2077

Open
0xbigz wants to merge 2 commits intomasterfrom
modify-order-trigger-limit-to-limit
Open

program: modify order trigger limit to limit#2077
0xbigz wants to merge 2 commits intomasterfrom
modify-order-trigger-limit-to-limit

Conversation

@0xbigz
Copy link
Member

@0xbigz 0xbigz commented Jan 19, 2026

feat: convert triggered TriggerLimit orders to Limit orders in modify_order

When modifying an order, if the existing order is a TriggerLimit that has already been triggered, it will now be automatically converted to a Limit order. This ensures that once a trigger limit order is triggered, it behaves as a regular limit order with the limit price instead of maintaining trigger-related fields.

However, if the user is explicitly trying to modify the trigger price (modify_order_params.trigger_price is Some), the conversion is skipped to handle race conditions where the user updates the trigger price while the order gets triggered.

…_order

When modifying an order, if the existing order is a TriggerLimit that has
already been triggered, it will now be automatically converted to a Limit
order. This ensures that once a trigger limit order is triggered, it
behaves as a regular limit order with the limit price instead of
maintaining trigger-related fields.

However, if the user is explicitly trying to modify the trigger price
(modify_order_params.trigger_price is Some), the conversion is skipped
to handle race conditions where the user updates the trigger price while
the order gets triggered.
@0xbigz 0xbigz force-pushed the modify-order-trigger-limit-to-limit branch from 374324a to 65a9aad Compare January 19, 2026 18:32
…_order

When modifying an order, if the existing order is a TriggerLimit that has
already been triggered, it will now be automatically converted to a Limit
order. This ensures that once a trigger limit order is triggered, it
behaves as a regular limit order with the limit price instead of
maintaining trigger-related fields.

However, if the user is explicitly trying to modify the trigger price
(modify_order_params.trigger_price is Some), the conversion is skipped
to handle race conditions where the user updates the trigger price while
the order gets triggered.
@0xbigz 0xbigz force-pushed the modify-order-trigger-limit-to-limit branch from 65a9aad to 995059d Compare January 19, 2026 18:32
modify_order_params
.trigger_price
.or(Some(existing_order.trigger_price)),
modify_order_params
Copy link
Member

Choose a reason for hiding this comment

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

if it's already been triggered you have to reset the trigger condition as the previous code did?

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