Skip to content

feat(swap): add curated asset picker and custom slippage#325

Open
Babigdk wants to merge 1 commit into
Dgetsylver:mainfrom
Babigdk:feat/318-curated-swap-assets
Open

feat(swap): add curated asset picker and custom slippage#325
Babigdk wants to merge 1 commit into
Dgetsylver:mainfrom
Babigdk:feat/318-curated-swap-assets

Conversation

@Babigdk

@Babigdk Babigdk commented Jun 27, 2026

Copy link
Copy Markdown

Summary

Replace the hardcoded swap asset universe with the LOBSTR curated assets feed and add support for custom slippage values.

Changes Made

  • Added frontend/src/views/swapAssets.ts to load, cache, and normalize assets from the LOBSTR curated assets feed.
  • Added synthetic XLM support so native XLM remains available alongside curated assets.
  • Replaced hardcoded SWAP_ASSETS and BROKER_TO_CONTRACT mappings with dynamically loaded asset metadata.
  • Updated swap initialization to load assets asynchronously with loading and error states.
  • Switched balance lookups and Aquarius rate comparisons to use dynamically resolved contract IDs from the curated asset list.
  • Added custom slippage support alongside the existing 0.1%, 0.5%, and 1.0% presets.
  • Added validation for custom slippage values (0 < value <= 50).
  • Added a high-slippage warning for values above 5%.
  • Preserved existing quote generation, DEX comparison, and execution gating behavior.

Related Issue

Closes #318

Checks

  • I read the contribution guide.
  • I kept this pull request scoped to the linked issue.
  • I ran the relevant local checks or explained why they were skipped.
  • For Drips wave issues, I claimed the issue before opening this pull request.

Notes for Reviewers

Verification Performed

  • Verified curated asset loading and fallback behavior.
  • Verified dynamic contract resolution for balance checks and Aquarius rate lookups.
  • Verified custom slippage validation and warning behavior.
  • Verified quote generation continues to function with dynamically loaded assets.

Remaining Follow-up

This PR implements the curated asset data layer and custom slippage support. The searchable asset picker with token logos may be completed in a follow-up change if additional UI work is required beyond the scope of the current implementation.

Suggested Validation

npm run lint
npm run build

Manual Testing

  1. Open the Swap screen and confirm curated assets load successfully.
  2. Verify XLM and USDC are selected by default.
  3. Generate quotes across multiple asset pairs.
  4. Confirm balance lookup still works for connected wallets.
  5. Test custom slippage values:
    • Accept: 0.4, 2.4, 10
    • Reject: 0, negative values, values greater than 50
    • Show warning when value exceeds 5%

@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@Babigdk 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! 🚀

Learn more about application limits

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.

Swap: curated asset list (lobstr API) with search + logos, and custom slippage

1 participant