RathRath Finance
API Reference

Build Best Path

Builds executable calldata for the best-ranked route directly from quote inputs.

GET
/build-best-path

Query Parameters

fromChain*integer

Source chain ID for the input token. Required. Use the numeric chain ID configured in xPath for the chain that holds fromToken.

Formatint64
Range0 <= value
toChain*integer

Destination chain ID for the output token. Required. Use the numeric chain ID configured in xPath for the chain that holds toToken.

Formatint64
Range0 <= value
fromToken*string

Input token identifier on fromChain. Required. Pass the chain-specific token address or mint address exactly as xPath stores it.

toToken*string

Output token identifier on toChain. Required. Pass the chain-specific token address or mint address exactly as xPath stores it.

amount*string

Input amount to evaluate, encoded as a base-10 integer string in the token's smallest unit.

sender*string

Wallet address that will fund the route and receive any route-specific approvals or calldata bindings.

slippage?|

Maximum slippage tolerance for the returned route, expressed as a percentage. Example: 1 means 1%.

Formatdouble
feeBps?|

Integrator fee in basis points, where 100 = 1%. Optional. Must be a non-negative integer.

Formatint32
Range0 <= value
includeProvider?array<>

Restricts planning to the listed provider keys. Optional. Accepts repeated values or a comma-separated list.

excludeProvider?array<>

Excludes the listed provider keys from route planning. Optional. Accepts repeated values or a comma-separated list.

priorityProvider?|

Preferred provider hint for route planning. Optional. Use a provider key to bias route selection toward a specific integration.

routeMode?|

Route ranking strategy. Optional. Use values such as fastest, max_value, or suggested to influence route ordering.

Integrator?|

Integrator identifier associated with the request. Optional. xPath can echo this identifier in downstream route metadata.

Referrer?|

Referrer identifier for partner attribution. Optional.

destinationCallData?|

Optional destination-chain calldata to associate with the generated route when the downstream integration supports it.

destinationGasLimit?|

Optional destination-chain gas limit hint, encoded as a string integer.

allowedPriceImpact?|

Maximum acceptable price impact for route selection. Optional. Expressed as a percentage value.

Formatdouble
allowMultiBridge?|

Enables multi-bridge route candidates during planning. Optional. If true, xPath may return routes that use more than one bridge hop.

acquisitionMode?|

Input token acquisition mode. Optional. Typical values are 0 for direct transfer, 1 for native token, and Permit2-based modes for signed execution flows.

Formatint32
Range0 <= value
minOutputAmount?|

Optional minimum acceptable output amount, encoded as a base-10 integer string in the output token's smallest unit.

includeRoute?|

If true, includes detailed route composition data in the response payload when available.

simulation?|

If true, requests simulation-aware planning metadata when supported by the route builder.

Header Parameters

api-key*string

Required API key used for authenticated access and account-based rate limits. Missing or invalid keys return 401.

Response Body

application/json

curl -X GET "https://api.xpath.rath.fi/build-best-path?fromChain=0&toChain=0&fromToken=string&toToken=string&amount=string&sender=string" \  -H "api-key: YOUR_API_KEY"
{
  "code": 0,
  "data": {
    "Tx": {
      "allowanceTarget": "string",
      "chain": 0,
      "data": "string",
      "expiry": 0,
      "gasLimit": "string",
      "simulation": true,
      "to": "string"
    },
    "route": {}
  },
  "message": "string"
}
Empty