Skip to main content
The getBestRoute function finds the optimal trading route for a token swap through Fibrous’s liquidity pools.

Function Signature

getBestRouteParams Type

IntegrationData Type

Parameters

RouteOverrides Type

  • excludeProtocols: This is where you list the IDs of the AMMs you don’t want to include. For example, if there are certain AMMs you prefer not to use due to high fees or other reasons, you simply put their unique IDs (numbers) in this list.
  • Use supportedProtocols(chainId) to get a list of supported AMMs and their IDs.

RouteResponse Type

Example Usage