Expand description
Enumerating and simulating routes between two tokens. Finding, ranking and simulating routes that name a pool for every leg.
A Path is a route with its pools already chosen, as opposed to the
token sequences TopologyGraph searches over. Enumerating one
per pool combination is what an algorithm does when it wants to compare whole routes rather
than choose a pool per leg.
Functions§
- fetch_
gas_ price - The view’s effective gas price, for algorithms that cannot price a route without one.
- find_
paths - Every route between two tokens, one per combination of the pools serving its legs.
- find_
token_ paths - Every route as a sequence of tokens, before any pool is chosen for its legs.
- get_
token - The market’s
Tokenfor an address. - read_
market - A read view of the market, under
labelwhen one is given and of the live state otherwise. - simulate_
pool_ path - Swaps
amount_inalong a path, one pool at a time, and reports what comes out. - try_
score_ path - Ranks a path by the rate it quotes and the liquidity behind it.