Tradegen
  • Introduction
  • Tradegen Platform
    • Use Cases
    • Supported Assets
    • Supported Projects
    • Pools
    • NFT Pools
    • Marketplace
  • Tutorial
    • Investing in a Pool
    • Withdrawing From a Pool
    • Creating a Pool
    • Managing a Pool
    • Investing in an NFT Pool
    • Withdrawing From an NFT Pool
    • Creating an NFT Pool
  • Token Info
    • Introduction
    • Allocation
  • SDK
    • Getting Started
    • Entities
      • Price
      • TokenAmount
      • Percent
      • Fraction
      • Token
      • Pool
    • Fetcher
    • Other Exports
  • Technical
    • Implementation
    • Synthetic Trading Bots
    • Mining System
    • Trading Strategies
  • Contracts
    • Asset Management V1
    • Data Feeds
      • Protocol
      • Candlestick Data Feeds
        • 1-Minute Timeframe
        • 5-Minute Timeframe
        • 1-Hour Timeframe
        • 1-Day Timeframe
    • Tradegen Token
    • Algo Trading
      • Core Contracts
      • Indicators
      • Comparators
      • Component IDs
      • Initial Instances and Keepers
    • Asset Management V2
      • Core Contracts
      • Price Calculators
      • Adapters
      • Asset Verifiers
      • Contract Verifiers
    • Virtual Trading Environments
    • Farming System
    • Synthetic Trading Bots
  • Resources
    • Roadmap
    • Equations
    • Protocol Settings
    • Changelog
      • Pre-launch
      • Phase 1
      • Phase 2
    • Links
    • Github
    • Analytics
    • Whitepaper
  • Deprecated
    • Pools
      • Investing in Pools
      • Farming
      • Creating a Pool
      • Managing a Pool
      • System Architecture
    • Strategies
      • Investing in Strategies
      • Claiming Yield
      • Running Backtests
      • Strategy Approval
        • Voting for a Strategy
        • Submitting a Strategy
      • Trading LP Tokens
      • Building a Strategy
      • System Architecture
    • Components
      • Components Marketplace
      • Building Custom Components
      • Submitting Custom Components
Powered by GitBook
On this page

Was this helpful?

  1. SDK

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.

fetchTokenData(
    address: string,
    symbol?: string,
    name?: string
  ): Promise<Token>

fetchPoolData

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>

getPoolAvailableFunds

Given a pool address, returns the amount of cUSD in the pool.

getPoolAvailableFunds(
    address: string,
  ): Promise<string>

getUserUSDBalance

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>

getPoolPositionsAndTotal

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]>

getSupportedCurrencies

Returns the address of each currency supported on the Tradegen platform.

getSupportedCurrencies(
  ): Promise<string[]>

getAvailablePools

Returns the address of each available pool on the Tradegen platform.

getAvailablePools(
  ): Promise<string[]>

fetchTokensFromAddresses

Given an array of token addresses, returns a Token instance for each address.

fetchTokensFromAddresses(
    addresses: string[],
  ): Promise<Token[]>

fetchPoolsFromAddresses

Given an array of pool addresses, returns a Pool instance for each address.

fetchPoolsFromAddresses(
    addresses: string[]
  ): Promise<Pool[]>
PreviousPoolNextOther Exports

Last updated 3 years ago

Was this helpful?