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
  • Pools
  • NFT Pool Token Distribution
  • Asset Prices

Was this helpful?

  1. Resources

Equations

Pools

poolAssetValue=(assetTokenBalance∗tokenPrice)/(10∗∗decimals)poolAssetValue= (assetTokenBalance*tokenPrice)/ (10 ** decimals)poolAssetValue=(assetTokenBalance∗tokenPrice)/(10∗∗decimals)
poolValue=∑positionValue(i)poolValue = ∑positionValue(i)poolValue=∑positionValue(i)

A pool's USD value is calculated by taking the sum of position values for each position the pool has. The position can be either an ERC20 token or an LP token.

userPoolValue=userTokenBalance∗poolTokenPriceuserPoolValue = userTokenBalance * poolTokenPriceuserPoolValue=userTokenBalance∗poolTokenPrice
poolTokenPrice=poolValue/totalSupplypoolTokenPrice = poolValue/totalSupplypoolTokenPrice=poolValue/totalSupply

A pool manager's available performance fee is calculated as follows:

profit=max(0,currentTokenPrice−tokenPriceAtLastFeeMint)profit=max(0, currentTokenPrice-tokenPriceAtLastFeeMint)profit=max(0,currentTokenPrice−tokenPriceAtLastFeeMint)
feeRatio=performanceFee/10000feeRatio = performanceFee/10000feeRatio=performanceFee/10000
availableManagerFee=profit∗totalSupply∗feeRatio/currentTokenPriceavailableManagerFee = profit*totalSupply*feeRatio/currentTokenPriceavailableManagerFee=profit∗totalSupply∗feeRatio/currentTokenPrice

Note that the performance fee is a percentage of the pool's profits, not the pool value.

NFT Pool Token Distribution

availableC1=max(supplyCap∗0.05,1)availableC1 = max(supplyCap * 0.05, 1)availableC1=max(supplyCap∗0.05,1)
availableC2=max(supplyCap∗0.1,2)availableC2 = max(supplyCap * 0.1, 2)availableC2=max(supplyCap∗0.1,2)
availableC3=max(supplyCap∗0.2,3)availableC3 = max(supplyCap * 0.2, 3)availableC3=max(supplyCap∗0.2,3)
availableC4=supplyCap−availableC1−availableC2−availableC3availableC4 = supplyCap - availableC1 - availableC2 - availableC3availableC4=supplyCap−availableC1−availableC2−availableC3

An NFT pool's supply cap is determined by the pool manager when the pool is created, and can't be changed.

Asset Prices

ERC20 asset price is calculated by getting the pre-determined optimal path for the asset and calling getAmountsOut() in Ubeswap's router.

The LP token price for a pair(token0, token1) is calculated as follows:

r=sqrt(reserve0,reserve1)r=sqrt(reserve0, reserve1)r=sqrt(reserve0,reserve1)
p=sqrt(assetPrice0,assetPrice1)p=sqrt(assetPrice0, assetPrice1)p=sqrt(assetPrice0,assetPrice1)
price=2∗r∗p/totalSupplyprice=2*r*p/totalSupplyprice=2∗r∗p/totalSupply

The reserves for an LP pair are retrieved from the Ubeswap Factory contract.

PreviousRoadmapNextProtocol Settings

Last updated 3 years ago

Was this helpful?