Turbos
  • 📖About Turbos
    • Getting Started
    • About Turbos Finance
    • Why Sui Network
  • 📽️Products
    • Concentrated Liquidity AMM
      • Fee Tier for Token Pairs
      • Oracle
    • Automated Rebalance Vault
      • Step-by-Step Guide
      • Referral Program
    • TurboStar
    • TurbosBoost
  • 💡Protocol Concepts
    • About Concentrated Liquidity
    • Fee Tiers
    • Glossary
  • 🪙Tokenomics
    • TURBOS
    • Token Utility
    • Emission Distribution
  • ⚙️Others
    • Roadmap
    • Audits
    • Brand kit
    • Risks
    • Token Address
  • Developer Docs
    • Dev Overview
    • via SDK
      • Get Started
      • Initialize SDK
      • Clmm
        • getConfig
        • getFeesConfig
        • getPools
        • getPool
        • createPool
        • createAndAddLiquidity
        • increaseLiquidity
        • decreaseLiquidity
        • removeLiquidityAndBurn
        • preSwap
        • swap
        • collect Fees
        • collect Rewards
        • Fee
        • Liquidity and coin amounts calculation
        • APR calculation
      • Vault
        • createAndDepositVault
        • depositVault
        • withdrawVault
        • withdrawAllVault
        • collectClmmRewardDirectReturnVault
        • closeVault
        • computeTokenWithdrawVaultSwapResult
        • getVaultBalanceAmount
        • getMyVaults
  • Turbos Fun
    • Base
    • Create Pool
    • Calculate Token Amount
    • Buy
    • Sell
  • 📱Socials
    • Official website
    • Twitter
    • Discord
    • Medium
    • Zealy
  • Tutorials
    • Supported Wallets
      • SafePal Wallet
    • Move tutorial
    • Sui tutorial
Powered by GitBook
On this page
  • Pool APR
  • Position APR
  1. Developer Docs
  2. via SDK
  3. Clmm

APR calculation

Pool APR

The pool's Annual Percentage Rate (APR) is influenced by both the trading volume and the pool's rewards. The calculation is based on the average trading volume over the past 24 hours.

apr = ((feeUsd * 365) / tvlUsd) * 100 + rewardAPR

Position APR

We use the getPositionAPR method in the SDK to calculate the position apr

Examples

const poolId = '0xb32fb8ec0b447a833066496bd7251d3a2ee57a0a97c54bf4cc945a986235582a';
const pool = await turbosSdk.pool.getPool(poolId);
const positionId =
  '0xb7efa54832e000dcb8879e586f74cec55623105920c96f5f1ebe78a60f9cbd3b';
const position = await turbosSdk.nft.getPositionFields(positionId);
turbosSdk.nft.getPositionAPR({
  poolId,
  tickLower: turbosSdk.math.bitsToNumber(position.tick_lower_index.fields.bits),
  tickUpper: turbosSdk.math.bitsToNumber(position.tick_upper_index.fields.bits),
  fees24h: '100000000',
  getPrice: async (coinType) => {
    return await getPriceFromApi(coinType);
  },
})
PreviousLiquidity and coin amounts calculationNextVault

Last updated 2 days ago

24h fee and pool apr can get from our api:

https://api.turbos.finance/pools/v2?page=1&pageSize=40&orderBy=&category=&coinTypes=&includeRisk=false&symbol=