This endpoint performs a multi-hop swap through a sequence of liquidity pools, allowing users to exchange assets that may not have direct trading pairs. Each hop in the route represents a swap through a different pool.
The route is executed atomically:
Before execution, the system validates:
Fees are applied at each hop:
Two levels of slippage protection:
Requires a valid JWT bearer token. The token’s public key must match the user_public_key in the request. The request must be signed with the user’s private key.
user_public_key
- Public key of the user executing the swaphops
- Ordered list of pools and assets for the routeinitial_spark_transfer_id
- Spark transfer proof for input assetinput_amount
- Amount of initial asset to swapmax_route_slippage_bps
- Maximum slippage for entire routenonce
- Unique value for replay protectionsignature
- Request signature for verificationintegrator_fee_rate_bps
- Optional default integrator feeintegrator_public_key
- Optional integrator identifier200 OK
with route swap details if successful400 Bad Request
if validation fails or route cannot be executed401 Unauthorized
if authentication or signature verification fails500 Internal Server Error
if route execution failsBearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Route swap execution details including hop sequence and authentication
Defines the request to execute a swap across a defined route of liquidity pools.
Route swap execution successful
Represents the response after a route swap execution attempt.