Skip to content

refund exact amounts on order cancellation#335

Open
Tomoya0k wants to merge 3 commits into
SO4-Markets:mainfrom
Tomoya0k:fix/order-cancellation-exact-refund
Open

refund exact amounts on order cancellation#335
Tomoya0k wants to merge 3 commits into
SO4-Markets:mainfrom
Tomoya0k:fix/order-cancellation-exact-refund

Conversation

@Tomoya0k

Copy link
Copy Markdown

Closes #268.

Summary

  • add regression coverage for exact order-cancellation refunds in tests/order_cancellation.rs
  • verify user-initiated cancellation returns the exact collateral amount and restores the execution fee
  • verify keeper-initiated cancellation after failed execution returns exact collateral to the user and pays the execution fee to the keeper
  • verify partial collateral cancellation refunds the exact deposited amount with no rounding loss
  • fix order_handler::cancel_order so execution_fee is paid out on cancellation instead of remaining stuck in the vault

Tests

  • cargo test -p gmx-integration-tests --test order_cancellation
  • cargo test -p order-handler cancel_order

Notes

  • The test environment uses mocked auth and does not charge native transaction fees, so XLM refund assertions expect exact restoration with no fee offset.
  • cargo test -p gmx-integration-tests still has unrelated pre-existing failures in other integration tests and was not fully green before this change.

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.

test: order cancellation — user receives exact token refund with no slippage loss

1 participant