Skip to main content

Module paths

Module paths 

Source
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 Token for an address.
read_market
A read view of the market, under label when one is given and of the live state otherwise.
simulate_pool_path
Swaps amount_in along 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.