Fetcher
This class contains static methods for constructing instances of pairs and tokens from on-chain data. It cannot be constructed.
Initializes a Token class instance from a token address, if the decimals of the token are unknown and cannot be fetched externally.
fetchTokenData(
address: string,
symbol?: string,
name?: string
): Promise<Token>
Initializes a Pool class instance from a pool address, if the performance fee of the pool is unknown and cannot be fetched externally.
fetchPoolData(
address: string,
managerAddress?: string,
name?: string
): Promise<Pool>
Given a pool address, returns the amount of cUSD in the pool.
getPoolAvailableFunds(
address: string,
): Promise<string>
Given a pool address and a user address, returns the USD value of the user's investment in the pool.
getUserUSDBalance(
address: string,
user: string,
): Promise<string>
Returns the address of each position, the balance of each position, and the total USD value for the given pool.
getPoolPositionsAndTotal(
address: string,
): Promise<[string[], string[], string]>
Returns the address of each currency supported on the Tradegen platform.
getSupportedCurrencies(
): Promise<string[]>
Returns the address of each available pool on the Tradegen platform.
getAvailablePools(
): Promise<string[]>
Given an array of token addresses, returns a Token instance for each address.
fetchTokensFromAddresses(
addresses: string[],
): Promise<Token[]>
Given an array of pool addresses, returns a Pool instance for each address.
fetchPoolsFromAddresses(
addresses: string[]
): Promise<Pool[]>
Last modified 2yr ago