Skip to content

feat: Payment Path Simulator - route finding, hop visualization, slippage estimation#31

Open
devboluwatife53 wants to merge 1 commit into
Savitura:mainfrom
devboluwatife53:feat/payment-simulator
Open

feat: Payment Path Simulator - route finding, hop visualization, slippage estimation#31
devboluwatife53 wants to merge 1 commit into
Savitura:mainfrom
devboluwatife53:feat/payment-simulator

Conversation

@devboluwatife53

@devboluwatife53 devboluwatife53 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

closes #20

Full implementation of the Payment Path Simulator feature for the Stellar developer workstation.

Changes

Backend (apps/api/src/modules/simulator/)

  • GET /simulator/paths — wraps Horizon /paths/strict-send and /paths/strict-receive with per-hop asset breakdown, effective exchange rate, estimated fee, and recommended slippage based on order book depth
  • POST /simulator/estimate — given a selected path and slippage tolerance %, returns computed destination_min (strict send) or send_max (strict receive)
  • DTOs with class-validator validation for both endpoints
  • SimulatorModule registered in app.module.ts

Frontend (apps/web/src/components/tools/simulator-tool.tsx)

  • Asset pickers — XLM toggle + token code/issuer inputs for source and destination
  • Direction toggle — "Send exactly" (strict_send) vs "Receive exactly" (strict_receive)
  • Hop chain visualization — asset bubbles connected by arrows (up to 6 hops)
  • Results panel — effective rate, hop count, recommended slippage badge per path
  • Slippage tolerance input (%) — instant client-side recalculation of destination_min/send_max (no API call)
  • "Use in Composer" button — navigates to /composer pre-filled with all path payment fields
  • Empty state — explains why no paths were found (illiquid pair, wrong issuer, etc.)
  • Network toggle — works on both testnet and mainnet

Acceptance Criteria

  • Paths returned match Horizon's response for the same query
  • Hop chain renders correctly for paths up to 6 hops
  • Slippage recalculation is instant — purely client-side
  • "Use in Composer" correctly pre-populates all path payment fields including intermediate assets
  • Empty state clearly explains why no paths were found
  • Works on both testnet and mainnet via the global network toggle

… hop visualization, and slippage estimation

- Add GET /simulator/paths wrapping Horizon strict-send/strict-receive with per-hop breakdown, effective rate, and recommended slippage
- Add POST /simulator/estimate computing destination_min/send_max from slippage tolerance
- Add validation DTOs (find-paths.dto.ts, estimate.dto.ts) with class-validator
- Rewrite simulator-tool.tsx with asset pickers, direction toggle, hop chain visualization, live slippage recalc, and composer linking
- Register SimulatorModule in app.module.ts
- Add simulator types to frontend api.ts
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.

Payment Path Simulator, Route Finder, Hop Visualiser & Slippage Estimator

2 participants