dexter.newFetchRequest()
...
Omitting the forTokens()
& forTokenPairs()
when constructing your request will result in all possible pools.
Omitting the forDexs()
& forAllDexs()
when constructing your request will result in all available DEXs to be used
when fetching pools.
onDexs(string | string[]): FetchRequest
Set which DEXs to grab information for.
dexter.newFetchRequest()
.onDexs(WingRiders.identifier)
...
or
dexter.newFetchRequest()
.onDexs([WingRiders.identifier, SundaeSwap.identifier])
...
onAllDexs(): FetchRequest
Grab information from all available DEXs.
dexter.newFetchRequest()
.onAllDexs()
...
setDataProviderForDex(string, BaseDataProvider): FetchRequest
Force a data provider for a DEX.
dexter.newFetchRequest()
.onAllDexs()
...
forTokens(Token[]): FetchRequest
Set filtering tokens when fetching liquidity pools
const indyAsset: Asset = new Asset('533bb94a8850ee3ccbe483106489399112b74c905342cb1792a797a0', '494e4459', 6);
// Will only fetch pools containing the INDY token
dexter.newFetchRequest()
.forTokens([indyAsset])
...
forTokenPairs(Token[][]): FetchRequest
Set filtering token pairs when fetching liquidity pools
const indyAsset: Asset = new Asset('533bb94a8850ee3ccbe483106489399112b74c905342cb1792a797a0', '494e4459', 6);
// Will only fetch pools containing ADA & INDY assets
dexter.newFetchRequest()
.forTokenPairs([
['lovelace', indyAsset],
])
...
getLiquidityPools(): Promise<LiquidityPool[]>
Fetch liquidity pools from your set DEXs
Providing the first or first & second parameters will filter the returned pools by the assets you provide.
dexter.newFetchRequest()
.onAllDexs()
.getLiquidityPools()
.then((pools: LiquidityPool[]) => {
console.log(pools);
});