-
Notifications
You must be signed in to change notification settings - Fork 5.6k
feat(perps): add configurable slippage controls #43357
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
Merged
+2,173
−55
Merged
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
2ade60e
feat(perps): add slippage estimate display and persisted max slippage…
abretonc7s c9cdb9b
fix(perps): address self-review feedback for slippage config (TAT-1043)
abretonc7s 9bcc630
fix(perps): address self-review feedback (TAT-1043)
abretonc7s 0ede7e8
fix(perps): address external review for slippage config (TAT-1043)
abretonc7s cf01625
fix(perps): use camelCase remote flag key and rollout shape for slipp…
abretonc7s 8261ab0
fix(perps): address self-review feedback (TAT-1043)
abretonc7s fcba0eb
Merge remote-tracking branch 'origin/main' into TAT-1043-feat-add-per…
abretonc7s 033330b
fix: address review comments on PR #43357
abretonc7s 4bf3d00
Merge remote-tracking branch 'origin/main' into TAT-1043-feat-add-per…
abretonc7s 6d1ff88
fix: prevent slippage hook from deactivating shared order book
abretonc7s eaffaf0
Merge remote-tracking branch 'origin/main' into TAT-1043-feat-add-per…
abretonc7s f6a5ff2
fix: gate perps slippage UI on max-slippage loading state
abretonc7s 7b62737
fix: address review comments on PR #43357
abretonc7s d67b6d9
Merge remote-tracking branch 'origin/main' into TAT-1043-feat-add-per…
abretonc7s 7b84f82
fix: address review comments on PR #43357
abretonc7s e7f5f8c
Merge remote-tracking branch 'origin/main' into TAT-1043-feat-add-per…
abretonc7s 33037de
fix(perps): clear stale slippage error after max save
abretonc7s 3db46a4
fix(perps): request slippage book depth on order entry stream
abretonc7s 2242007
fix: address CI feedback
abretonc7s 6702b6e
Merge remote-tracking branch 'origin/main' into TAT-1043-feat-add-per…
abretonc7s 766493b
fix: address review comments on PR #43357
abretonc7s 35b7ff7
fix(perps): show max slippage while estimate loads
abretonc7s 8b41663
fix(messenger): delegate SnapController state to MultichainAccountSer…
abretonc7s b844316
fix(perps): align slippage estimate direction with form state
abretonc7s 66107e8
fix(test): restore perps-controller mocks for slippage constants
abretonc7s 3299258
fix(perps): recap prefill on balance and gate submit on estimate
abretonc7s 7772e1b
fix(messenger): align MultichainAccountService delegate types
abretonc7s 7b9c17e
fix(messenger): align delegates with multichain-account-service 10.0.2
abretonc7s 267b6d6
fix(perps): block slippage modal until preference loads
abretonc7s e56953f
fix(perps): recap default amount with current form leverage
abretonc7s 50af04c
fix(perps): format usePerpsOrderForm for oxfmt CI gate
abretonc7s 2e7bd1c
Merge branch 'main' into TAT-1043-feat-add-perps-slippage-config
abretonc7s 93f1ff5
Merge remote-tracking branch 'origin/main' into TAT-1043-feat-add-per…
abretonc7s eef4891
fix: register perpsSlippageConfig2 feature flag
abretonc7s 7f23ad1
fix(perps): disable perpsSlippageConfig2 in e2e perps fixture
abretonc7s 2477325
Merge remote-tracking branch 'origin/main' into TAT-1043-feat-add-per…
abretonc7s 7720371
fix: address review comments on PR #43357
abretonc7s 9ca75f2
Merge remote-tracking branch 'origin/main' into TAT-1043-feat-add-per…
abretonc7s 5981254
fix: address review comments on PR #43357
abretonc7s File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import { | ||
| PERPS_SLIPPAGE_DEFAULT_BPS, | ||
| PERPS_SLIPPAGE_MAX_BPS, | ||
| PERPS_SLIPPAGE_MIN_BPS, | ||
| PERPS_SLIPPAGE_STEP_BPS, | ||
| bpsToPercent, | ||
| percentToBps, | ||
| } from './slippageConfig'; | ||
|
|
||
| describe('slippageConfig constants', () => { | ||
| it('uses controller default of 3%', () => { | ||
| expect(PERPS_SLIPPAGE_DEFAULT_BPS).toBe(300); | ||
| expect(bpsToPercent(PERPS_SLIPPAGE_DEFAULT_BPS)).toBe(3); | ||
| }); | ||
|
|
||
| it('exposes 0.1% to 10% bounds in 0.1% steps', () => { | ||
| expect(bpsToPercent(PERPS_SLIPPAGE_MIN_BPS)).toBe(0.1); | ||
| expect(bpsToPercent(PERPS_SLIPPAGE_MAX_BPS)).toBe(10); | ||
| expect(bpsToPercent(PERPS_SLIPPAGE_STEP_BPS)).toBe(0.1); | ||
| }); | ||
|
|
||
| it('converts percent and bps', () => { | ||
| expect(percentToBps(3)).toBe(300); | ||
| expect(bpsToPercent(300)).toBe(3); | ||
| }); | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.