Wallet guide: explain the slippage limit on swap and path payment - #2803
Merged
Conversation
The Swap and Path Pay examples called the wallet SDKs without a minimum-received or maximum-spent bound, and the prose never said what those parameters are for. Add a short explanation of the slippage limit to both sections, pass an explicit bound in every TypeScript, Dart and Swift snippet, and add a strict-receive example showing destAmount paired with sendMax. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds slippage-bound explanations and examples for wallet SDK swaps and path payments.
Recommendation: NEEDS-CHANGES — the Swift swap example uses an invalid argument label.
Changes:
- Adds explicit slippage bounds across TypeScript, Dart, and Swift.
- Adds strict-receive path payment examples.
- Explains
destMinandsendMax.
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Preview is available here: |
CassioMG
marked this pull request as draft
August 28, 2026 23:25
The Swift wallet SDK's swap takes destMin, not destinationMinAmount (that label belongs to strictSend). Also reword the sendMax bullet to 'the maximum amount of the send asset' for clarity and parallelism. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Preview is available here: |
Contributor
Author
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code |
ElliotFriend
approved these changes
Sep 1, 2026
Contributor
|
PR Preview: torn down |
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.
TL;DR
The wallet guide's Swap and Path Pay examples called the wallet SDKs without a minimum-received or maximum-spent bound, and never explained what those parameters are for. This adds a short explanation of the slippage limit to both sections — a swap or path payment is filled at whatever rate the network finds when the transaction is applied, and the bound is what makes it fail rather than fill at a worse rate — and passes an explicit bound in every TypeScript, Dart, and Swift snippet. It also adds a strict-receive example (fix the amount delivered, cap the amount spent), which the page did not show before.
Companion change: stellar/typescript-wallet-sdk#252 makes the bound a required argument in the TypeScript wallet SDK. The updated snippets here are valid on the current SDK releases too, since the parameters already exist, so this PR does not need to wait on that one.
Implementation details (for agents)
What changed (single file,
docs/build/apps/wallet/stellar.mdx):destMinas the slippage limit and how to derive it (current quote minus tolerance). All three snippets now pass a minimum: TypeScriptswap(..., ".1", ".025"), DartdestMin: "0.025", SwiftdestMin: 0.025. Parameter names verified against each SDK's current source.sendAmount→destMin,destAmount→sendMax). The existing strict-send snippets gaindestMin: "1.25"in all three languages. A second<WalletCodeExample>block shows the strict-receive form withdestAmount: "5"/sendMax: "21"in all three languages.Verification:
prettier --config .prettierrc.js --no-editorconfig -c docs/build/apps/wallet/stellar.mdxwith prettier 3.9.6 and@stellar/prettier-config: passes (this is whatci:mdxruns).<WalletCodeExample>open/close tags balance (36/36) after the edit.check:linksis unaffected. No frontmatter or heading changes.Follow-ups / out of scope:
🤖 Generated with Claude Code