get_swap_route
Route a swap intent across ICPSwap: prices the direct pool and every two-hop path through ICP, ckUSDC, ckUSDT, ckBTC, and ckETH live on-chain, chains each leg's quoted output into the next leg's input, and returns the best route leg-by-leg. Read-only — no tokens move. Use this instead of get_swap_quote when a direct pool may be thin or missing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fee | No | Optional pool fee tier in hundredths of a bps (3000 = 0.3%), applied to every leg. Defaults to trying 3000, then 10000, then 500 per leg. | |
| max_hops | No | 1 = direct path only, 2 = also try two-hop routes via intermediate tokens (default 2). | |
| pay_token | Yes | Token to sell: symbol or ledger principal. | |
| pay_amount | Yes | Amount to sell, in base units as a decimal string (e.g. "100000000" = 1 ICP). | |
| receive_token | Yes | Token to buy: symbol or ledger principal. |