pair_sync
A simple library to get all pairs from any supported Dex and sync reserves.
Filename: examples/sync-pairs.rs
async
Supported Dexes
| Dex | Status |
|---|---|
| UniswapV2 variants | ✅ |
| UniswapV3 | ✅ |
Running Examples
To run any of the examples, supply your node endpoint to the endpoint variable in each example file. For example in sync-pairs.rs:
//Add rpc endpoint here:
let rpc_endpoint = "";
Once you have supplied a node endpoint, you can simply run cargo run --example <example_name>.
Filters
filter_blacklisted_tokens
- Removes any pair from a
Vec<Pair>where eithertoken_aortoken_bmatches a blacklisted address.
filter_blacklisted_pools
- Removes any pair from a
Vec<Pair>where thepair_addressmatches a blacklisted address.
filter_blacklisted_addresses
- Removes any pair from a
Vec<Pair>where eithertoken_a,token_bor thepair_addressmatches a blacklisted address.
filter_pools_below_usd_threshold
- Removes any pair where the USD value of the pool is below the specified USD threshold.
filter_pools_below_weth_threshold
- Removes any pair where the USD value of the pool is below the specified WETH threshold.
Upcoming Filters
filter_fee_tokens
- Removes any pair where where either
token_aortoken_bis a token with fee on transfer.