Complexity: High — 200 pts
Summary
Stellar's DEX supports multi-hop path payments through intermediate assets. StellarFlow's swap picks the first Horizon result automatically. This issue builds a dedicated Path Explorer that shows all available routes between two assets, ranked by output, so users can pick the best one.
Files to Create/Modify
- Create:
src/pages/PathExplorerPage.tsx
- Modify:
src/lib/stellar.ts — add findAllPaths and PathOption
- Modify:
src/pages/SwapPage.tsx — add "Explore routes" link, read path URL param
- Modify:
src/App.tsx — add /paths route
- Modify:
src/types/index.ts — add PathOption type
Implementation Notes
findAllPaths in stellar.ts
export interface PathOption {
rank: number;
pathLabels: string[];
pathAssets: StellarSdk.Asset[];
destinationAmount: string;
rate: string;
isBest: boolean;
}
export async function findAllPaths(fromAssetCode, toAssetCode, amount, fromIssuer?, toIssuer?): Promise<PathOption[]>
Call server.strictSendPaths(sendAsset, amount, [destAsset]).call(), map each record to a PathOption with the full asset chain as pathLabels, sort descending by destinationAmount, mark index 0 as isBest.
PathExplorerPage layout
From: [XLM ▾] To: [USDC ▾] Amount: [100] [Find Routes]
★ Best XLM → USDC You get: 41.23 USDC [Use this route]
#2 XLM → yXLM → USDC You get: 41.18 USDC [Use this route]
"Use this route" navigates to /swap?from=XLM&to=USDC&amount=100&path=.... Empty state: "No routes found. Try a smaller amount."
SwapPage update
Read a path URL param and pre-select it, skipping the quote fetch and using the provided pathAssets directly. Add an "Explore routes" link below the quote details card.
Acceptance Criteria
Screen Recording Requirements
- From the Swap page, click "Explore routes"
- Path Explorer opens pre-filled with current swap params
- Multiple route options appear sorted by output amount
- Best route has ★ badge
- Click "Use this route" on the second-best route → navigated to Swap pre-filled with that exact route
- Execute the swap → confirm the route used on Stellar Expert matches what was selected
Complexity: High — 200 pts
Summary
Stellar's DEX supports multi-hop path payments through intermediate assets. StellarFlow's swap picks the first Horizon result automatically. This issue builds a dedicated Path Explorer that shows all available routes between two assets, ranked by output, so users can pick the best one.
Files to Create/Modify
src/pages/PathExplorerPage.tsxsrc/lib/stellar.ts— addfindAllPathsandPathOptionsrc/pages/SwapPage.tsx— add "Explore routes" link, read path URL paramsrc/App.tsx— add/pathsroutesrc/types/index.ts— addPathOptiontypeImplementation Notes
findAllPathsinstellar.tsCall
server.strictSendPaths(sendAsset, amount, [destAsset]).call(), map each record to aPathOptionwith the full asset chain aspathLabels, sort descending bydestinationAmount, mark index 0 asisBest.PathExplorerPagelayout"Use this route" navigates to
/swap?from=XLM&to=USDC&amount=100&path=.... Empty state: "No routes found. Try a smaller amount."SwapPageupdateRead a
pathURL param and pre-select it, skipping the quote fetch and using the providedpathAssetsdirectly. Add an "Explore routes" link below the quote details card.Acceptance Criteria
Screen Recording Requirements