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

FEAT: Allow cancel inactive limit orders #711

Merged
merged 7 commits into from
Oct 8, 2024
Merged

Conversation

jcompagni10
Copy link
Contributor

@jcompagni10 jcompagni10 commented Sep 5, 2024

Allow inactive limit orders to be canceled instead of withdrawn.
This new behavior has 2 benefits.

  1. Right now it takes at least 1 extra query to figure out if a tranche is inactive. If it's inactive you can currently only call withdraw. If we allow cancel you can always safely call cancel to completely remove your position.
  2. This is very nice for astroport. Their goal is to get the value of a position at any given time. If they can always call SimulateCancel they can reduce this down to a single query instead of 2.

related PRs
neutron-org/neutron-integration-tests#355

@jcompagni10
Copy link
Contributor Author

@joldie777
Copy link
Contributor

Please attach a succesfull testrun

Copy link
Contributor

@sotnikov-s sotnikov-s left a comment

Choose a reason for hiding this comment

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

the rest LGTM

x/dex/keeper/cancel_limit_order.go Outdated Show resolved Hide resolved
@jcompagni10
Copy link
Contributor Author

quasisamurai
quasisamurai previously approved these changes Sep 20, 2024
sotnikov-s
sotnikov-s previously approved these changes Sep 23, 2024
@jcompagni10 jcompagni10 dismissed stale reviews from sotnikov-s and quasisamurai via 18c5e3e September 24, 2024 15:45
Copy link
Contributor

@NicholasDotSol NicholasDotSol left a comment

Choose a reason for hiding this comment

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

really good change

@jcompagni10
Copy link
Contributor Author

jcompagni10 commented Sep 25, 2024

@pr0n00gler pr0n00gler merged commit fa19fc5 into main Oct 8, 2024
9 checks passed
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.

6 participants