This endpoint allows users to preview the results of a multi-hop swap through a sequence of liquidity pools without executing the transaction. It calculates expected outputs, fees, and price impacts across the entire route.
The simulation executes virtually through each pool:
Before simulation, the system validates:
The simulation provides detailed impact metrics:
Simulation calculates all fees separately:
The execution price represents:
output_amount / input_amountRoute simulation is useful for:
Simulations are read-only operations that don’t modify pool state or require authentication. Anyone can simulate routes.
hops - Ordered sequence of pools and assets defining the routeamount_in - Initial amount to swap through the routemax_route_slippage_bps - Maximum acceptable slippage in basis points200 OK with detailed simulation results and per-hop breakdown400 Bad Request if route validation fails or pools don’t exist500 Internal Server Error if simulation calculation failsRoute simulation details including hop sequence and input amount
Defines the request for simulating a swap across a defined route of liquidity pools.
An ordered sequence of pools and assets that defines the swap route. Must contain at least 2 hops and no more than 4 hops.
[
{
"assetInAddress": "03bitcoinassetpubkey0000000000000000000000000000000000000000000000",
"assetOutAddress": "03ethereumassetpubkey1111111111111111111111111111111111111111111111",
"poolId": "03pool1aabbccddeeff00112233445566778899aabbccddeeff00112233445566778"
},
{
"assetInAddress": "03ethereumassetpubkey1111111111111111111111111111111111111111111111",
"assetOutAddress": "03usdstablecoinpubkey2222222222222222222222222222222222222222222222",
"poolId": "03pool2bbccddeeffffaabbccddeeff00112233445566778899aabbccddeeff0011"
}
]The total amount of the input asset to be swapped, in its smallest unit.
x >= 0100000000
The maximum acceptable slippage for the entire route, in basis points (0-10000).
x >= 0100
Route simulation successful
Represents the complete simulation result for the requested route swap.
The estimated final amount of the output asset to be received, in its smallest unit.
x >= 0The estimated effective price of the swap, calculated as output_amount / input_amount.
The total estimated fees paid to liquidity providers across all hops.
x >= 0The total estimated fees paid to pool hosts across all hops.
x >= 0The total estimated price impact for the entire route as a percentage string.
A detailed breakdown of the simulation results for each hop in the route.
An optional warning message, e.g., if the calculated slippage exceeds the user's maximum setting.