evx-sdk
Version:
The Evx SDK is a developer toolkit designed to simplify interaction with the Evx decentralized liquidity protocol. It provides an abstraction layer over the smart contracts, allowing developers to easily build applications, integrate liquidity pools, fetc
23 lines (22 loc) • 1.07 kB
TypeScript
/**
* @title Path Finding Utilities
* @notice Utilities for finding the shortest path between tokens through pools
* @dev Implements breadth-first search algorithm to find optimal trading paths
*/
import { Pool, TradingPath, EncodedPath } from '../interfaces/utils';
/**
* @notice Finds the shortest path between two tokens through available pools
* @param pools Array of available pools
* @param inputToken Address of the input token
* @param outputToken Address of the output token
* @returns The shortest trading path or null if no path exists
*/
export declare function findShortestPath(pools: Pool[], inputToken: string, outputToken: string): TradingPath | null;
/**
* @notice Encodes a trading path for use with SwapRouter
* @param path Trading path to encode
* @param pools Array of available pools
* @param isExactOutput Whether this is for exact output (reverses the path)
* @returns Encoded path with all necessary data for SwapRouter
*/
export declare function encodePath(path: TradingPath, pools: Pool[], isExactOutput?: boolean): EncodedPath;