Meteora
  • Meteora: The most dynamic and sustainable liquidity layer on Solana
  • PRODUCT OVERVIEW
    • Meteora Liquidity Pools
      • DLMM Overview
        • What is DLMM?
        • DLMM Program
        • Dynamic Fees
        • Strategies & Use Cases
        • DLMM Farming Rewards
      • DLMM Launch Pool Overview
      • Dynamic AMM Overview
        • What is a Dynamic AMM Pool?
        • Dynamic AMM LP Fee and APY Calculation
        • Creating a Dynamic AMM Pool via the UI
        • Claiming Fees from Permanently Locked Liquidity
        • Dynamic AMM Stable Pools
        • Dynamic LST Pools
        • Additional yield from Dynamic Vaults
        • Dynamic AMM Farm Overview
      • DAMM v2 Overview
      • Memecoin Pool Overview
        • Memecoin Pool v2
          • What is Memecoin Pool v2?
        • Memecoin Pool v1
          • What is Memecoin Pool v1?
          • Permanently Locking Liquidity
      • Stake2Earn Pool Overview
        • What is a Stake2Earn Pool?
        • Stake2Earn for Launchpads
      • Multi-Token Stable Pool Overview
    • Alpha Vault Overview
    • Dynamic Vault Overview
      • What is a Dynamic Vault?
      • Dynamic Vault Program
      • Hermes - Meteora's Keeper
        • Algorithm to find optimal yield allocations
        • Rebalance crank
        • Operation fee calculation
      • Design Goals
      • Security
      • Dynamic Vaults Whitepaper
      • Dynamic Vaults Community Explainers
      • Affiliate Program for Dynamic Vault
        • Become an Affiliate Partner (Dynamic Vaults)
    • Dynamic Bonding Curve (DBC) Overview
      • What is the Dynamic Bonding Curve?
      • Customizable Pool Configuration
      • Bonding Curve Formula
      • DBC Migrator Keeper
  • Meteora's Anti-Sniper Suite (A.S.S.)
    • Meteora’s Anti-Sniper Suite
      • Dynamic Fees
      • Fee Scheduler
      • Alpha Vault
  • INTEGRATION
    • DLMM Integration
      • DLMM SDK
        • DLMM TypeScript SDK
        • CPI Examples
      • DLMM API
      • Fetching information on locked liquidity in a DLMM
    • Dynamic AMM Pool Integration
      • Dynamic AMM SDK
        • Dynamic AMM TypeScript SDK
        • CPI Examples
      • Dynamic AMM API
        • Pool Info
        • Pool State
      • Setting Pool and Fee Config for Dynamic AMM Pools
      • Create Dynamic Pool with Timestamp/Slot Activation
      • Dynamic AMM - Farm Integration
    • DAMM v2 Integration
      • DAMM v2 SDK
        • DAMM v2 TypeScript SDK
        • DAMM v2 Rust SDK
      • Setting Pool and Fee Config for DAMM v2
      • Technical FAQ
    • Memecoin Pool Integration
      • Memecoin Pool v2 Integration
        • Setting Pool and Fee Config for Memecoin Pool v2
      • Memecoin Pool v1 Integration
        • TypeScript Code Examples
        • CPI Examples
        • Setting Pool and Fee Config for Memecoin Pool v1
        • Track permanently-locked liquidity in Memecoin Pool v1
        • Track Protocol Fee from swaps in Memecoin Pool v1
    • Stake2Earn Pool Integration
    • Dynamic Vault Integration
      • Using TypeScript-Client
      • Using Rust-Client
      • Using CPI
      • Vault API
        • Vault Info
        • Vault State
      • Vault Developer Resources
    • Alpha Vault Integration
      • Alpha Vault TypeScript SDK
      • Alpha Vault without Whitelist Setup
      • Alpha Vault with Whitelist Setup
    • Dynamic Bonding Curve (DBC) Integration
      • DBC SDK
        • DBC TypeScript SDK
        • DBC Rust SDK
      • DBC Fee Scheduler Formula
      • DBC Scripts
      • Program Repo
      • Launchpad Template
      • Technical FAQ
  • TOKEN LAUNCH POOLS
    • Steps to Create a Pool for a Token Launch
      • Create: DLMM Launch Pool
      • Create: Dynamic AMM Pool
      • Create: Memecoin Pool v1
      • Create: Stake2Earn Pool
      • Create: Pools with Alpha Vault
        • Create: DLMM Launch Pool with Alpha Vault
        • Create: Dynamic AMM Pool with Alpha Vault
        • Create: Memecoin Pool with Alpha Vault
        • Create: Stake2Earn Pool with Alpha Vault
    • Anti-Sniper Fee Suite for a Token Launch
  • Resources
    • Audits
    • Meteora Program IDs
    • Meteora APIs
    • Devnet Testing
    • Community Data Dashboards & Tools
    • Meteora Brand Assets
    • THE MASSIVE METEORA STIMULUS PACKAGE
      • Overview
      • 1. Dynamic Liquidity Market Maker (DLMM)
      • 2. Formation Of An LP Army DAO
      • 3. The 10% Stimulus Proposal
  • USER FAQ
    • Getting Started LPing
      • Supported Wallets
      • Prepare SOL
      • SOL required for Rent
      • What is Wrapped SOL?
      • What is an AMM?
      • What does it mean to provide liquidity?
      • How to swap to the tokens required for adding liquidity to a pool
      • How to quickly check if a token has any risks
      • Viewing your transaction history
      • My wallet has been compromised. What should I do?
    • Differences between DLMM and Dynamic Pools
    • DLMM FAQ
    • Dynamic AMM FAQ
      • How is the pool price of the token calculated in a Dynamic AMM?
      • What is a Meteora LP token?
      • How do I see fees earned on a Dynamic AMM Pool?
      • How to track your earnings for a Dynamic Pool?
      • What is Virtual Price in a Dynamic Pool?
      • How do LP tokens, fees, and virtual price work for Dynamic Pools?
      • Why must I add liquidity in non-stable Dynamic Pools using a 50:50 value ratio?
      • What is AMP in a Dynamic Pool with stable coins?
      • Why is the USDT-USDC pool not 1:1 in ratio of assets?
      • Can I create an LST, FX, or Multi-token pool using the Dynamic Pool creation tool?
    • Alpha Vault FAQ
    • Why is the token sometimes not picked up and tradable on Jupiter?
    • How do I create a new farm?
    • Video Tutorials to Get Started
      • LP Army Boot Camp
      • DLMM Strategy Sessions / Jam Sessions
  • Security and Risks
    • Risk of Impermanent Loss (IL)
    • Risk of depositing into an imbalanced pool / pool with price out of sync
    • Smart contract risk
    • Risk of a stablecoin depeg
    • Operational risk for dynamic vaults and pools
    • Lending risk for dynamic vaults and pools
  • legal
    • Terms of Service
    • Stake2Earn Terms of Service
Powered by GitBook
On this page
  • Pools State
  • Pool Fees
  • Padding
  • Curve Type
  • Token Multiplier
  • Depeg
  • Depeg Type
  • User Functions
  • Admin Functions
  1. INTEGRATION
  2. Dynamic AMM Pool Integration
  3. Dynamic AMM API

Pool State

PreviousPool InfoNextSetting Pool and Fee Config for Dynamic AMM Pools

Last updated 9 months ago

:

Pools State

Key Data retrieved:

Data
Description

lp_mint

LP mint of the pool

token_a_mint

Pool token A mint. Eg: USDC mint

token_b_mint

Pool token B mint. Eg: USDT mint

a_vault

The vault to store pool token A

b_vault

The vault to store pool token B

a_vault_lp

The LP of the vault to store pool token A

b_vault_lp

The LP of the vault to store pool token B

a_vault_lp_bump

The nonce used to create signer seed

enabled

Flag to determine the pool is enabled or disabled. If disabled, user couldn’t add liquidity, remove liquidity in imbalance ratio or swap at the given pool

admin_token_a_fee

Used to collect swap fee

admin_token_b_fee

Used to collect swap fee

admin

The admin of the pool

fees

The fee parameter of the pool. It will affect the fee charged during the swap process

padding

Reserved space for future use

curve_type

The curve of the pool. Example: Constant product, stable.

Pool Fees

Data
Description

trade_fee_numerator

Numerator for trading fee

trade_fee_denominator

Denominator for trading fee

owner_trade_fee_numerator

Numerator for owner trading fee

owner_trade_fee_denominator

Denominator for owner trading fee

Padding

Data
Description

padding

512 bytes reserved for future use

Curve Type

Data
Description

ConstantProduct

Indicate the pool is constant product pool

Stable

Indicate the pool is stable swap pool

Token Multiplier

Because there are tokens with different decimals, the precision factor has been added to normalize the value to support tokens with different decimals in stable swap calculation.

Data
Description

token_a_multiplier

Multiplier for token A. Used to make sure that token A will have the same precision as token B.

token_b_multiplier

Multiplier for token B. Used to make sure that token A will have the same precision as token A.

precision_factor

The precision of token A and B of the pool.

Depeg

Store the information about the depeg stable swap pool.

Data
Description

base_virtual_price

Store the virtual price of the staking/interest-bearing token. Used to calculate the native token amount.

base_cache_updated

Store the last timestamp the base_virtual_price was updated.

depeg_type

Indicate the type of the depeg pool supported. If the pool is a depeg pool, token_b of the pool will always be to depeg token.

Depeg Type

Data
Description

None

Indicate that the pool does not support staking / interest bearing token

Marinade

The pool supports marinade token (mSOL)

Lido

The pool supports solido token (stSOL)

spl-stake

The pool supports more LSTs like jitoSOL, bSOL, and more.

User Functions

Data
Description

add_balance_liquidity

  • User have to deposit a balanced ratio into the pool.

  • The amount of token A/B to deposit will be calculated based on the number of lp token user wish to receive.

  • The pool itself does not hold token A/B. The pool will deposit the user deposited token A, and B to the vault, and hold the minted vault LP.

  • Supported by stable swap, and constant product.

add_imbalance_liquidity

  • User can deposit both tokens, or only single token into the token without any ratio restrictions.

  • The amount of lp token to be minted will be calculated based on the token A/B user is depositing.

  • The pool itself does not hold token A/B. The pool will deposit the user deposited token A, and B to the vault, and hold the minted vault LP.

  • Trading fee will be charged.

  • Supported only by stable swap.

remove_balance_liquidity

  • User will get token A and token B based on the current pool ratio by burning the lp token.

  • The process will fail when the vault does not have enough liquidity.

remove_liquidity_single_side

  • User can choose to withdraw only token A, or token B by burning the lp token.

  • Trading fee will be charged.

  • The process will fail when the vault does not have enough liquidity.

swap

  • User can exchange token B by deposit token A or vice versa.

  • Swap fee will be charged based on the PoolFee parameter stored in the pool account.

  • If the host fee account was passed as the remaining account during the swap, 20% of the admin trading fee will be taken by the host.

  • Admin trading fee will be transferred to admin_token_a_fee or admin_token_b_fee based on the deposit mint token.

  • The pool will deposit the user deposited token to the respective vault, and hold the minted vault LP.

  • Meanwhile, the pool will burn the correct amount of vault LP by using vault SDK and transfer the token to the user.

  • The process will fail when the vault does not have enough liquidity.

get_pool_info

  • User can query the pool metric information, such as total token A amount, total token B amount, virtual price, and pool APY.

initialize_permissionless_pool

Creates a new permissionless pool by depositing tokens A and B as bootstrap liquidity.

Admin Functions

Data
Description

initialize_permissioned_pool

Admin creates a new permissioned pool by depositing tokens A and B as bootstrap liquidity.

transfer_admin

Transfer the admin of the pool to the new admin for permissioned pools.

set_pool_fees

Set a new fee parameter for permissioned pools.

set_admin_fee_account

Set a new admin token fee account to receive the swap fee for permissioned pools.

override_curve_param

Update curve parameters. For example, amplification coefficient of stable swap for permissioned pools.

enable_or_disable_pool

Enable or disable permissioned pools. A disabled pool will allow only remove balanced liquidity.

Typescript SDK
https://github.com/mercurial-finance/mercurial-dynamic-amm-sdk/tree/master/ts-client