Introduction
Learn what xPath is, how the routing flow works, and which endpoints to use first.
Introduction
xPath is Rath's unified routing API for swaps, bridges, and gasless execution.
Instead of stitching together separate quote engines, bridge providers, token catalogs, and execution builders, you integrate one API surface that plans the route and returns the data needed to execute it.
What You Can Build
Use xPath when you need to:
- quote same-chain and cross-chain swaps
- discover supported chains and token metadata
- search tokens across supported networks
- build transaction-ready calldata for selected routes
- support Permit2-based gasless swap execution
How xPath Works
At a high level, xPath follows a simple flow:
- Discover the route with
GET /quote - Select the route that matches your UX or execution policy
- Build executable transaction data with
POST /build-pathorPOST /build-path-by-id - Track route and bridge health with
GET /status
If you need a relayed flow, use the gasless endpoints:
- Request a Permit2 quote with
GET /gasless/quote - Have the user sign the returned payload
- Submit the signed swap with
POST /gasless/submit-swap - Poll final state with
GET /gasless/status