fix(vault): add slippage protection for deposit and withdraw#277
Merged
0xDeon merged 1 commit intoSuncrest-Labs:mainfrom Apr 23, 2026
Merged
fix(vault): add slippage protection for deposit and withdraw#2770xDeon merged 1 commit intoSuncrest-Labs:mainfrom
0xDeon merged 1 commit intoSuncrest-Labs:mainfrom
Conversation
|
@wheval Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
@wheval Fix conflicts please |
Add min output parameters to vault deposit/withdraw flows and revert when execution would return worse-than-expected terms. Also expose preview methods and update tests/callers to enforce slippage-safe behavior. Closes Suncrest-Labs#248 Made-with: Cursor
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
min_shares_outfordepositandmin_assets_outforwithdrawContractError::SlippageExceededwhen output falls below caller-specified minimumspreview_deposit/preview_withdrawviews and update vault + integration tests to pass explicit slippage paramsTest plan
cargo test -p vault-contractin CI environment withvault_token.wasmartifact availableCloses #248