Tradegen
Search…
Fetcher
This class contains static methods for constructing instances of pairs and tokens from on-chain data. It cannot be constructed.

Static Methods

fetchTokenData

Initializes a Token class instance from a token address, if the decimals of the token are unknown and cannot be fetched externally.
1
fetchTokenData(
2
address: string,
3
symbol?: string,
4
name?: string
5
): Promise<Token>
Copied!

fetchPoolData

Initializes a Pool class instance from a pool address, if the performance fee of the pool is unknown and cannot be fetched externally.
1
fetchPoolData(
2
address: string,
3
managerAddress?: string,
4
name?: string
5
): Promise<Pool>
Copied!

getPoolAvailableFunds

Given a pool address, returns the amount of cUSD in the pool.
1
getPoolAvailableFunds(
2
address: string,
3
): Promise<string>
Copied!

getUserUSDBalance

Given a pool address and a user address, returns the USD value of the user's investment in the pool.
1
getUserUSDBalance(
2
address: string,
3
user: string,
4
): Promise<string>
Copied!

getPoolPositionsAndTotal

Returns the address of each position, the balance of each position, and the total USD value for the given pool.
1
getPoolPositionsAndTotal(
2
address: string,
3
): Promise<[string[], string[], string]>
Copied!

getSupportedCurrencies

Returns the address of each currency supported on the Tradegen platform.
1
getSupportedCurrencies(
2
): Promise<string[]>
Copied!

getAvailablePools

Returns the address of each available pool on the Tradegen platform.
1
getAvailablePools(
2
): Promise<string[]>
Copied!

fetchTokensFromAddresses

Given an array of token addresses, returns a Token instance for each address.
1
fetchTokensFromAddresses(
2
addresses: string[],
3
): Promise<Token[]>
Copied!

fetchPoolsFromAddresses

Given an array of pool addresses, returns a Pool instance for each address.
1
fetchPoolsFromAddresses(
2
addresses: string[]
3
): Promise<Pool[]>
Copied!
Last modified 5mo ago
Copy link