Skip to content

Wallet guide: explain the slippage limit on swap and path payment - #2803

Merged
ElliotFriend merged 2 commits into
mainfrom
wallet-guide-path-payment-slippage
Sep 1, 2026
Merged

Wallet guide: explain the slippage limit on swap and path payment#2803
ElliotFriend merged 2 commits into
mainfrom
wallet-guide-path-payment-slippage

Conversation

@CassioMG

@CassioMG CassioMG commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

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):

  • Swap section — new paragraph describing destMin as the slippage limit and how to derive it (current quote minus tolerance). All three snippets now pass a minimum: TypeScript swap(..., ".1", ".025"), Dart destMin: "0.025", Swift destMin: 0.025. Parameter names verified against each SDK's current source.
  • Path Pay section — new paragraph explaining which bound applies to which mode (sendAmountdestMin, destAmountsendMax). The existing strict-send snippets gain destMin: "1.25" in all three languages. A second <WalletCodeExample> block shows the strict-receive form with destAmount: "5" / sendMax: "21" in all three languages.
  • Each snippet carries a one-line comment stating the intent of the numbers, which are illustrative.

Verification:

  • prettier --config .prettierrc.js --no-editorconfig -c docs/build/apps/wallet/stellar.mdx with prettier 3.9.6 and @stellar/prettier-config: passes (this is what ci:mdx runs).
  • <WalletCodeExample> open/close tags balance (36/36) after the edit.
  • No links added, so check:links is unaffected. No frontmatter or heading changes.

Follow-ups / out of scope:

  • The page still does not show how to obtain a quote (Horizon strict-send/strict-receive paths); a short pointer there would let readers derive the bound rather than hard-code it.

🤖 Generated with Claude Code

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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 destMin and sendMax.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/build/apps/wallet/stellar.mdx Outdated
Comment thread docs/build/apps/wallet/stellar.mdx Outdated
@stellar-jenkins-ci

Copy link
Copy Markdown

@CassioMG
CassioMG marked this pull request as draft August 28, 2026 23:25
@CassioMG CassioMG self-assigned this Aug 31, 2026
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>
@stellar-jenkins-ci

Copy link
Copy Markdown

@CassioMG
CassioMG marked this pull request as ready for review August 31, 2026 23:50
Copilot AI review requested due to automatic review settings August 31, 2026 23:50
@CassioMG

Copy link
Copy Markdown
Contributor Author

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@ElliotFriend
ElliotFriend merged commit 83c68f2 into main Sep 1, 2026
10 checks passed
@ElliotFriend
ElliotFriend deleted the wallet-guide-path-payment-slippage branch September 1, 2026 14:59
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

PR Preview: torn down

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.

3 participants