Skip to content

feat: Path payment support for multi-asset claims #549

Description

@joelpeace48-cell

Background & current state

The payout reserve (NEW-010) holds one asset (say USDC), but some users want to receive a different asset (e.g., XLM or a local-currency anchor token). Stellar path payments can convert at claim time when DEX liquidity exists.

Goal

Let a user claim into their preferred asset via a strict-receive path payment from the reserve asset, when a viable path exists; otherwise fail clearly.

Technical design

  • Backend builds a PathPaymentStrictReceive (or strict-send) from the reserve asset to the user's chosen asset, using /paths (Horizon path finding) to select a route + max slippage.
  • Slippage guard (destMin/sendMax); reject if no path or slippage exceeds tolerance.

Edge cases

  • No path / illiquid market → clear NO_PATH error; user can fall back to the reserve asset.
  • Slippage beyond tolerance → reject (don't execute a bad swap).
  • Partial liquidity → strict-receive guarantees amount or fails.
  • Trustline missing for the destination asset → detect + instruct the user to add a trustline.

Task breakdown

  • Path-finding integration (Horizon /paths).
  • Build + submit path payment with slippage guard.
  • Trustline pre-check + guidance.
  • Frontend asset selector at claim.
  • Integration tests against a seeded testnet path.

Acceptance criteria

  • Claiming in asset B succeeds when a path from reserve asset A exists within slippage.
  • Clear error when no path / missing trustline / excessive slippage.

Testing & verification

  • Integration test against testnet DEX with a seeded path + a no-path case.

Out of scope

  • AMM-specific routing beyond Horizon path finding.

Dependencies / related

  • Builds on NEW-010 payout reserve.

References

  • Path payments; Horizon path finding.

Difficulty: medium · Effort: M · stellar

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programarea: backendBackend API (Node/Express)difficulty: mediumModerate complexityenhancementNew feature or requeststellarStellar/Soroban integration

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions