Skip to Content
Cogwheel DocsCogwheel Docs
ApiV1V1.pathfinderservice

FindPath

FindPath finds and validates a route between two chains Supports human-readable denoms (e.g., "uatone") or IBC denoms

POST/v1.PathfinderService/FindPath

Header Parameters

Connect-Protocol-Version*1

Define the version of the Connect protocol

Value in1
Connect-Timeout-Ms?Connect-Timeout-Ms

Define the timeout, in ms

Request Body

  1. body

FindPathRequest - Find a route between chains

For token_from_denom and token_to_denom, you can use:

  • Human-readable/native denom (e.g., "uatone", "uosmo", "ustars")
  • Full IBC denom (e.g., "ibc/ABC123...")
  • "symbol@origin_chain" convenience syntax (e.g., "uatone@atomone-1"), which disambiguates a base denom by naming the chain it's native to - useful when the same base denom could otherwise resolve ambiguously.

The pathfinder will automatically resolve human-readable denoms. If token_to_denom is empty, the pathfinder assumes you want the same token on the destination chain (useful for bridging without swapping).

chainFrom*chain_from

Source chain ID (e.g., "osmosis-1", "atomone-1")

tokenFromDenom*token_from_denom

Token denom on source chain. Accepts a native denom (e.g., "uatone"), an IBC denom (e.g., "ibc/..."), or "symbol@origin_chain" (e.g., "uatone@atomone-1") to disambiguate by origin chain.

Length1 <= length <= 128
amountIn*amount_in

Amount to transfer/swap (in base units)

chainTo*chain_to

Destination chain ID

tokenToDenom?token_to_denom

Token denom you want to receive on destination chain. Accepts the same forms as token_from_denom (native, IBC, or "symbol@origin_chain"). If empty, assumes same token as token_from (bridging without swap)

Lengthlength <= 128
senderAddress*sender_address

Sender address on source chain

Length38 <= length <= 68
receiverAddress*receiver_address

Receiver address on destination chain

Length38 <= length <= 68
smartRoute?smart_route

If true, return a smart route, if false, return a normal route

slippageBps?slippage_bps

Slippage in basis points (e.g., 100 = 1%, 1000 = 10%) Must be less than 10000

Range0 <= value <= 10000

Response Body

Success

  1. response
success?success
error_message?error_message
broker_swap*

BrokerSwapRoute represents a route involving a swap on a broker chain. Supports various scenarios:

  • Same-chain swap: inbound_leg absent, outbound_legs=[] (e.g., osmosis ATOM -> osmosis OSMO)
  • Swap from broker: inbound_leg absent (e.g., osmosis USDC -> juno JUNO)
  • Standard 3-chain: inbound_leg set, len(outbound_legs)=1
  • Multi-hop outbound: inbound_leg set, len(outbound_legs)>1 (e.g., cosmos ATOM -> swap -> noble -> juno)
Example Request
curl -X POST 'https://example.com/v1.PathfinderService/FindPath' \  -H 'Connect-Protocol-Version: 1' \  -H 'Content-Type: application/json' \  -d '{  "chainFrom": "string",  "tokenFromDenom": "string",  "amountIn": "string",  "chainTo": "string",  "senderAddress": "stringstringstringstringstringstringst",  "receiverAddress": "stringstringstringstringstringstringst"}'
Example Response
{  "success": true,  "error_message": "string",  "broker_swap": {    "path": [      "string"    ],    "inbound_legs": [      {        "from_chain": "string",        "to_chain": "string",        "channel": "string",        "port": "string",        "token": {          "chain_denom": "string",          "base_denom": "string",          "origin_chain": "string",          "is_native": true        },        "amount": "string"      }    ],    "swap": {      "broker": "string",      "token_in": {        "chain_denom": "string",        "base_denom": "string",        "origin_chain": "string",        "is_native": true      },      "token_out": {        "chain_denom": "string",        "base_denom": "string",        "origin_chain": "string",        "is_native": true      },      "amount_in": "string",      "amount_out": "string",      "price_impact": "string",      "effective_fee": "string",      "osmosis_route_data": {        "routes": [          {            "pools": [              {                "id": 0,                "type": 0,                "spread_factor": "string",                "token_out_denom": "string",                "taker_fee": "string",                "liquidity_cap": "string"              }            ],            "has_cw_pool": true,            "out_amount": "string",            "in_amount": "string"          }        ],        "liquidity_cap": "string",        "liquidity_cap_overflow": true      }    },    "outbound_legs": [      {        "from_chain": "string",        "to_chain": "string",        "channel": "string",        "port": "string",        "token": {          "chain_denom": "string",          "base_denom": "string",          "origin_chain": "string",          "is_native": true        },        "amount": "string"      }    ],    "outbound_supports_pfm": true,    "execution": {      "memo": "string",      "smart_contract_data": {        "contract": "string",        "msg": {          "swap_and_action": {            "user_swap": {              "swap_exact_asset_in": {                "swap_venue_name": "string",                "operations": [                  {                    "pool": "string",                    "denom_in": "string",                    "denom_out": "string",                    "interface": "string"                  }                ]              }            },            "min_asset": {              "native": {                "amount": "string",                "denom": "string"              }            },            "timeout_timestamp": 0,            "post_swap_action": {              "ibc_transfer": {                "ibc_info": {                  "memo": "string",                  "receiver": "string",                  "recover_address": "string",                  "source_channel": "string"                }              }            },            "affiliates": [              "string"            ]          }        }      },      "ibc_receiver": "string",      "recover_address": "string",      "min_output_amount": "string",      "uses_wasm": true,      "description": "string"    }  }}