# Table of Contents - [Introduction - Meteora Documentation](#introduction-meteora-documentation) - [Alpha Vault Modes - Meteora Documentation](#alpha-vault-modes-meteora-documentation) - [What's Rate Limiter? - Meteora Documentation](#what-s-rate-limiter-meteora-documentation) - [What's Alpha Vault? - Meteora Documentation](#what-s-alpha-vault-meteora-documentation) - [What's Fee Scheduler? - Meteora Documentation](#what-s-fee-scheduler-meteora-documentation) - [Fee Scheduler Math - Meteora Documentation](#fee-scheduler-math-meteora-documentation) - [Alpha Vault Formulas - Meteora Documentation](#alpha-vault-formulas-meteora-documentation) - [Overview - Meteora Documentation](#overview-meteora-documentation) - [Rate Limiter Math - Meteora Documentation](#rate-limiter-math-meteora-documentation) - [Getting Started - Meteora Documentation](#getting-started-meteora-documentation) - [We Build Liquidity Pools - Meteora Documentation](#we-build-liquidity-pools-meteora-documentation) - [Anti Sniper Suite Toolkit - Meteora Documentation](#anti-sniper-suite-toolkit-meteora-documentation) - [Introduction - Meteora Documentation](#introduction-meteora-documentation) - [Pool Fee Configs - Meteora Documentation](#pool-fee-configs-meteora-documentation) - [Dynamic Pool Configs - Meteora Documentation](#dynamic-pool-configs-meteora-documentation) - [DAMM v1 Formulas - Meteora Documentation](#damm-v1-formulas-meteora-documentation) - [Pool State - Meteora Documentation](#pool-state-meteora-documentation) - [DAMM v1 CPI Examples - Meteora Documentation](#damm-v1-cpi-examples-meteora-documentation) - [Pool Info - Meteora Documentation](#pool-info-meteora-documentation) - [Getting Started - Meteora Documentation](#getting-started-meteora-documentation) - [Alpha Vault Without Whitelist - Meteora Documentation](#alpha-vault-without-whitelist-meteora-documentation) - [DAMM v1 SDK Functions - Meteora Documentation](#damm-v1-sdk-functions-meteora-documentation) - [Alpha Vault With Whitelist - Meteora Documentation](#alpha-vault-with-whitelist-meteora-documentation) - [Farm Integration - Meteora Documentation](#farm-integration-meteora-documentation) - [Introduction - Meteora Documentation](#introduction-meteora-documentation) - [DAMM v2 Formulas - Meteora Documentation](#damm-v2-formulas-meteora-documentation) - [Pool Fee Configs - Meteora Documentation](#pool-fee-configs-meteora-documentation) - [Swagger UI - Meteora Documentation](#swagger-ui-meteora-documentation) - [Getting Started - Meteora Documentation](#getting-started-meteora-documentation) - [Rust Integration - Meteora Documentation](#rust-integration-meteora-documentation) - [Launchpad Scaffold - Meteora Documentation](#launchpad-scaffold-meteora-documentation) - [Introduction - Meteora Documentation](#introduction-meteora-documentation) - [Rust Integration - Meteora Documentation](#rust-integration-meteora-documentation) - [Swagger UI - Meteora Documentation](#swagger-ui-meteora-documentation) - [Getting Started - Meteora Documentation](#getting-started-meteora-documentation) - [Introduction - Meteora Documentation](#introduction-meteora-documentation) - [Introduction - Meteora Documentation](#introduction-meteora-documentation) - [Getting Started - Meteora Documentation](#getting-started-meteora-documentation) - [Introduction - Meteora Documentation](#introduction-meteora-documentation) - [DLMM CPI Examples - Meteora Documentation](#dlmm-cpi-examples-meteora-documentation) - [Getting Started - Meteora Documentation](#getting-started-meteora-documentation) - [Introduction - Meteora Documentation](#introduction-meteora-documentation) - [Introduction - Meteora Documentation](#introduction-meteora-documentation) - [Bonding Curve Formulas - Meteora Documentation](#bonding-curve-formulas-meteora-documentation) - [Trading Terminal Integration - Meteora Documentation](#trading-terminal-integration-meteora-documentation) - [DLMM Formulas - Meteora Documentation](#dlmm-formulas-meteora-documentation) - [Getting Started - Meteora Documentation](#getting-started-meteora-documentation) - [Getting Started - Meteora Documentation](#getting-started-meteora-documentation) - [What's a DLMM Launch Pool? - Meteora Documentation](#what-s-a-dlmm-launch-pool-meteora-documentation) - [Swagger UI - Meteora Documentation](#swagger-ui-meteora-documentation) - [What's Dynamic Fee Sharing? - Meteora Documentation](#what-s-dynamic-fee-sharing-meteora-documentation) - [Create a DAMM v1 Launch Pool - Meteora Documentation](#create-a-damm-v1-launch-pool-meteora-documentation) - [Getting Started - Meteora Documentation](#getting-started-meteora-documentation) - [Dynamic Vault CPI Examples - Meteora Documentation](#dynamic-vault-cpi-examples-meteora-documentation) - [Dynamic Fee Sharing SDK Functions - Meteora Documentation](#dynamic-fee-sharing-sdk-functions-meteora-documentation) - [What's Stake2Earn? - Meteora Documentation](#what-s-stake2earn-meteora-documentation) - [Create a DLMM Launch Pool - Meteora Documentation](#create-a-dlmm-launch-pool-meteora-documentation) - [What's Meteora Lock? - Meteora Documentation](#what-s-meteora-lock-meteora-documentation) - [Design Goals - Meteora Documentation](#design-goals-meteora-documentation) - [What's DAMM v2? - Meteora Documentation](#what-s-damm-v2-meteora-documentation) - [Risk Management - Meteora Documentation](#risk-management-meteora-documentation) - [DBC Config Key - Meteora Documentation](#dbc-config-key-meteora-documentation) - [What's Dynamic Vault? - Meteora Documentation](#what-s-dynamic-vault-meteora-documentation) - [Create a Stake2Earn v1 Pool with Alpha Vault - Meteora Documentation](#create-a-stake2earn-v1-pool-with-alpha-vault-meteora-documentation) - [Terms of Service - Meteora Documentation](#terms-of-service-meteora-documentation) - [Rust Integration - Meteora Documentation](#rust-integration-meteora-documentation) - [Stake2Earn Terms of Service - Meteora Documentation](#stake2earn-terms-of-service-meteora-documentation) - [Create a DLMM Launch Pool with Alpha Vault - Meteora Documentation](#create-a-dlmm-launch-pool-with-alpha-vault-meteora-documentation) - [What's Hermes? - Meteora Documentation](#what-s-hermes-meteora-documentation) - [What's DLMM? - Meteora Documentation](#what-s-dlmm-meteora-documentation) - [Algorithm to Find Optimal Yield Allocations - Meteora Documentation](#algorithm-to-find-optimal-yield-allocations-meteora-documentation) - [Strategies and Use Cases - Meteora Documentation](#strategies-and-use-cases-meteora-documentation) - [What's DBC? - Meteora Documentation](#what-s-dbc-meteora-documentation) - [What's DAMM v1? - Meteora Documentation](#what-s-damm-v1-meteora-documentation) - [Stable Pools - Meteora Documentation](#stable-pools-meteora-documentation) - [LST Pools - Meteora Documentation](#lst-pools-meteora-documentation) - [Pools with Farms - Meteora Documentation](#pools-with-farms-meteora-documentation) - [DLMM Concepts - Meteora Documentation](#dlmm-concepts-meteora-documentation) - [DLMM Farming Rewards - Meteora Documentation](#dlmm-farming-rewards-meteora-documentation) - [Create a DAMM v1 Launch Pool with Alpha Vault - Meteora Documentation](#create-a-damm-v1-launch-pool-with-alpha-vault-meteora-documentation) - [LP Fee and APY Calculation - Meteora Documentation](#lp-fee-and-apy-calculation-meteora-documentation) - [Vault Quickstart - Meteora Documentation](#vault-quickstart-meteora-documentation) - [Meteora Lock SDK Functions - Meteora Documentation](#meteora-lock-sdk-functions-meteora-documentation) - [Additional Yield From Dynamic Vaults - Meteora Documentation](#additional-yield-from-dynamic-vaults-meteora-documentation) - [DAMM v1 - Meteora Documentation](#damm-v1-meteora-documentation) - [DLMM - Meteora Documentation](#dlmm-meteora-documentation) - [DAMM v2 - Meteora Documentation](#damm-v2-meteora-documentation) - [Pool Fees Calculation - Meteora Documentation](#pool-fees-calculation-meteora-documentation) - [DBC - Meteora Documentation](#dbc-meteora-documentation) - [Alpha Vault - Meteora Documentation](#alpha-vault-meteora-documentation) - [Rebalance Crank - Meteora Documentation](#rebalance-crank-meteora-documentation) - [Trading Fees Calculation - Meteora Documentation](#trading-fees-calculation-meteora-documentation) - [Meteora Lock - Meteora Documentation](#meteora-lock-meteora-documentation) - [Stake2Earn - Meteora Documentation](#stake2earn-meteora-documentation) - [Dynamic Vault - Meteora Documentation](#dynamic-vault-meteora-documentation) - [Brand Kit - Meteora Documentation](#brand-kit-meteora-documentation) - [Dashboards - Meteora Documentation](#dashboards-meteora-documentation) - [Tools - Meteora Documentation](#tools-meteora-documentation) - [Operation Fee Calculation - Meteora Documentation](#operation-fee-calculation-meteora-documentation) - [Create a Stake2Earn v1 Launch Pool - Meteora Documentation](#create-a-stake2earn-v1-launch-pool-meteora-documentation) - [Create a DAMM v2 Launch Pool - Meteora Documentation](#create-a-damm-v2-launch-pool-meteora-documentation) - [Stake2Earn Integration - Meteora Documentation](#stake2earn-integration-meteora-documentation) - [Dynamic Vault SDK Functions - Meteora Documentation](#dynamic-vault-sdk-functions-meteora-documentation) - [DBC Scripts - Meteora Documentation](#dbc-scripts-meteora-documentation) - [DLMM Fee Calculation - Meteora Documentation](#dlmm-fee-calculation-meteora-documentation) --- # Introduction - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Alpha Vault Introduction [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Alpha Vault is a complementary anti-bot mechanism used together with a Launch Pool that provides early access for genuine supporters to deposit and purchase tokens before the pool starts trading. [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/1-introduction#program-address) Program Address ======================================================================================================================= * Mainnet-beta: `vaU6kP7iNEGkbmPkLmZfGwiGxd4Mob24QQCie5R9kd2` * Devnet: `vaU6kP7iNEGkbmPkLmZfGwiGxd4Mob24QQCie5R9kd2` [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/1-introduction#resources) Resources =========================================================================================================== * [Alpha Vault Typescript SDK](https://github.com/MeteoraAg/alpha-vault-sdk) * [Interface Definition Language (IDL)](https://github.com/MeteoraAg/alpha-vault-sdk/blob/main/idls/alpha_vault.json) [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/1-introduction#features) Features ========================================================================================================= Vault System ------------ **Prorata Vault**: Users can deposit over the max buying cap, with proportional distribution**FCFS Vault**: First-Come-First-Serve with deposit caps, no withdrawal once deposited**Vault Modes**: Permissionless, Permissioned with Merkle Proof, or Authority-based access control AMM Integration --------------- **DLMM Support**: Supports Meteora’s Dynamic Liquidity Market Maker pools**DAMM v1 Support**: Supports Meteora’s Dynamic AMM V1 pools**DAMM v2 Support**: Supports Meteora’s Dynamic AMM V2 pools User Management --------------- **Escrow System**: Create escrow accounts with individual deposit caps**Deposit/Withdraw**: Flexible deposit limits with conditional withdrawal**Escrow Fees**: Configurable fee structure**Account Closure**: Automatic escrow closure after vesting completion Token Distribution & Vesting ---------------------------- **Linear Vesting**: Time-based token claiming with configurable periods**Activation Types**: Slot-based or Timestamp-based activation**Timing Controls**: Depositing, Start Vesting, End Vesting, and Activation points**Vesting Duration**: Up to 1 year vesting periods Security & Permissions ---------------------- **Merkle Tree Whitelisting**: Cryptographic proof-based access control**Authority Management**: Admin-based permissions with transfer capabilities**Multi-signature Support**: Enhanced security for administrative operations**Proof Metadata**: Comprehensive whitelist management system Highly Configurable ------------------- **Vault Configurations**: Prorata and FCFS config with customizable parameters**Fee Management**: Escrow fees, crank fee whitelist, treasury collection**Parameter Updates**: Dynamic caps, timing, and configuration adjustments**Merkle Root Config**: Cryptographic proof configurations**Multi-token Support**: SPL Token & Token-2022 compatibility Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/dbc/rust-sdk/1-rust-integration) [Alpha Vault Formulas\ \ Next](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/2-alpha-vault-formulas) On this page * [Program Address](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/1-introduction#program-address) * [Resources](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/1-introduction#resources) * [Features](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/1-introduction#features) Assistant Responses are generated using AI and may contain mistakes. --- # Alpha Vault Modes - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Alpha Vault Alpha Vault Modes [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) There are 2 modes for the Alpha Vault: * Pro Rata Mode * FCFS Mode (First Come First Serve) [​](https://docs.meteora.ag/anti-sniper-suite/alpha-vault/2-alpha-vault-modes#pro-rata-mode) Pro Rata Mode ============================================================================================================= In Pro Rata mode, the Alpha Vault is able to accept unlimited deposits of SOL or USDC, even exceeding the Alpha Vault Max Buy Cap. After depositing SOL or USDC, depositors can choose to withdraw anytime before the end of the deposit period if they change their mind. Once the deposit period ends, users can no longer deposit more SOL or USDC or withdraw their earlier deposit. The vault becomes active and after a short buffer period, will begin using the funds collected to buy tokens from the pool. However, the Alpha Vault would only buy tokens up to the max buy cap. As such, if the deposits by users into the Alpha Vault had exceeded the max buy cap, there will be unused funds, and they can be withdrawn by depositors. For example, you deposited 100 USDC and TVL in the vault (total deposited) is 10M USDC, but the vault max cap is 1M USDC. Only 1/10th of your USDC deposit will be used to purchase tokens. 90 USDC from your 100 USDC deposit will be unused and returned to you. All vault users get their tokens at the same price and the amount of tokens received is proportional to your share of the total amount of SOL or USDC deposited. [​](https://docs.meteora.ag/anti-sniper-suite/alpha-vault/2-alpha-vault-modes#fcfs-mode) FCFS Mode ===================================================================================================== FCFS (First Come First Serve) follows a similar process to Pro Rata mode, but with the following differences: Unlike Pro rata mode, in FCFS mode, during the deposit period, Alpha Vault max buying cap = max amount of deposits the Alpha Vault accepts. Users can deposit as much as they want initially, but as soon as the vault’s reserve reaches the deposit/buy cap, then no one can deposit more (TVL cannot exceed Vault Max Cap). In other words, deposits are first come first served, up to the Alpha Vault max deposit/buy cap. For example: If Vault Max Cap is 1M USDC, and a single user is the first to deposit 1M USDC right when deposits open, the vault gets fully filled and no longer accepts further deposits. By default, each user has no individual deposit cap, which means a single user can technically fill up the entire Alpha Vault deposit/buy cap. However, if required, the project can specify an individual user cap and/or submit a whitelist to allow only certain wallets to deposit. Once a user deposits funds, the user cannot withdraw them, even during the deposit period. In FCFS mode, there won’t be any unused USDC or SOL. All deposits would be used to buy the token. After the Alpha Vault buys the tokens, all depositors will also get tokens at the same average price. Was this page helpful? YesNo [Previous\ \ What's Alpha Vault?](https://docs.meteora.ag/anti-sniper-suite/alpha-vault/1-what-is-alpha-vault) On this page * [Pro Rata Mode](https://docs.meteora.ag/anti-sniper-suite/alpha-vault/2-alpha-vault-modes#pro-rata-mode) * [FCFS Mode](https://docs.meteora.ag/anti-sniper-suite/alpha-vault/2-alpha-vault-modes#fcfs-mode) Assistant Responses are generated using AI and may contain mistakes. --- # What's Rate Limiter? - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Rate Limiter What's Rate Limiter? [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Available on **DBC** Rate Limiter is a configurable fee slope designed to deter sniper bots by increasing the fee depending on the trade size. For example, if a user swaps 100 SOL, then the first SOL will be charged as 1%, the next SOL will be charged as 5%… until it fulfils the full input amount. Similar to how tax brackets work in the real world, the fee slope increases when the trade size increases. ![Rate Limiter](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/anti-sniper-suite/rate-limiter.png) [​](https://docs.meteora.ag/anti-sniper-suite/rate-limiter/1-what-is-rate-limiter#how-does-it-work%3F) How does it work? =========================================================================================================================== Rate Limiter requires the following parameters to be configured: * **Cliff Fee Numerator**: The base fee of the rate limiter. * **Reference Amount**: The amount of tokens that will be charged at the base fee. * **Fee Increment Bps**: The amount of basis points to increase the fee by. * **Max Limiter Duration**: The maximum duration of the rate limiter. With these parameters, the fee slope will increase by the **Fee Increment Bps** for each increment of **Reference Amount** of tokens swapped. This rate limiter will last for the duration of **Max Limiter Duration**. Any swap amount below the **Reference Amount** will be charged the **Cliff Fee Numerator**. [​](https://docs.meteora.ag/anti-sniper-suite/rate-limiter/1-what-is-rate-limiter#requirements-for-rate-limiter) Requirements for Rate Limiter ================================================================================================================================================= Quote Token Only ---------------- The rate limiter mode is only available if collect fee mode is in quote token only, and when the user buys the token (not sell). Single Swap Per Transaction --------------------------- Rate limiter doesn’t allow user to send multiple swap instructions (or CPI) to the same pool in 1 transaction. Mutually Exclusive with Fee Scheduler ------------------------------------- Developers have to choose between using Fee Scheduler or Rate Limiter for their pool. Max Limiter Duration ≤ 12 Hours ------------------------------- Max limiter duration must be less than or equal to 12 hours. Example: If you have: * `reference_amount` = 1 SOL * `cliff_fee_numerator` = 1% (100 bps) * `fee_increment_bps` = 100 bps (1%) Then: * Trading 1 SOL: 1% fee * Trading 2 SOL: 1.5% average fee * Trading 3 SOL: 2% average fee * And so on… [​](https://docs.meteora.ag/anti-sniper-suite/rate-limiter/1-what-is-rate-limiter#which-launch-pools-support-rate-limiter%3F) Which Launch Pools support Rate Limiter? ========================================================================================================================================================================= Rate Limiter is available as an option for Dynamic Bonding Curve (DBC). Rate Limiter for DAMM v2 is coming soon. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/anti-sniper-suite/fee-scheduler/2-fee-scheduler-math) [Rate Limiter Math\ \ Next](https://docs.meteora.ag/anti-sniper-suite/rate-limiter/2-rate-limiter-math) On this page * [How does it work?](https://docs.meteora.ag/anti-sniper-suite/rate-limiter/1-what-is-rate-limiter#how-does-it-work%3F) * [Requirements for Rate Limiter](https://docs.meteora.ag/anti-sniper-suite/rate-limiter/1-what-is-rate-limiter#requirements-for-rate-limiter) * [Which Launch Pools support Rate Limiter?](https://docs.meteora.ag/anti-sniper-suite/rate-limiter/1-what-is-rate-limiter#which-launch-pools-support-rate-limiter%3F) Assistant Responses are generated using AI and may contain mistakes. --- # What's Alpha Vault? - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Alpha Vault What's Alpha Vault? [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Available on **DAMM v1**, **DLMM** and **DAMM v2** The Alpha Vault is a complementary anti-bot mechanism used together with a Launch Pool that provides early access for genuine supporters to deposit and purchase tokens before the pool starts trading, thereby getting tokens at the earliest price and helping to safeguard the token launch against sniper bots. Projects who use the Alpha Vault have the flexibility to tailor vault parameters to suit their specific token launch requirements, such as setting maximum purchase limits and defining the lock-up and vesting periods for users. [​](https://docs.meteora.ag/anti-sniper-suite/alpha-vault/1-what-is-alpha-vault#key-features-and-benefits) Key Features and Benefits ======================================================================================================================================= First-to-Purchase Ability ------------------------- The Alpha Vault is whitelisted to buy tokens from the liquidity pool before the launch activation slot, enabling users to purchase tokens at the earliest (and likely lowest) price before sniper bots can access the pool. Fair Distribution ----------------- All vault users receive tokens at the same average price, with the amount of tokens distributed proportionally to their share of the total SOL or USDC deposited in the vault. Configurable Launch Parameters ------------------------------ Projects can configure vault parameters such as lock-up periods (1+ days) and vesting schedules (several days) to encourage purchases by genuine project supporters. [​](https://docs.meteora.ag/anti-sniper-suite/alpha-vault/1-what-is-alpha-vault#how-does-it-work%3F) How does it work? ========================================================================================================================= The Alpha Vault for the Launch Pool is first created together with the Launch Pool, using the project’s preferred configurations for the Alpha Vault and pool, including: * Alpha Vault mode: Pro rata or FCFS * To accept SOL or USDC deposits * Alpha Vault Max Buy Cap * Pool activation slot/time * Token lock-up period * Vesting Period for token claims * To whitelist addresses for deposits or not * Individual address purchase cap [​](https://docs.meteora.ag/anti-sniper-suite/alpha-vault/1-what-is-alpha-vault#deposit-period) Deposit Period ----------------------------------------------------------------------------------------------------------------- The Alpha Vault doesn’t hold any tokens at the start. During the deposit period, the Alpha Vault will accept either SOL or USDC from depositors. There needs to be a buffer period of at least roughly ~1 hour 5 min between the end of the Alpha Vault deposit period and the pool activation time. [​](https://docs.meteora.ag/anti-sniper-suite/alpha-vault/1-what-is-alpha-vault#buying-period) Buying Period --------------------------------------------------------------------------------------------------------------- The Alpha Vault is whitelisted to buy tokens from the pool BEFORE the pool is activated to start trading. After the deposit period ends (and before the pool starts trading), the SOL or USDC collected in the Alpha Vault is used to purchase tokens from the pool. This is essentially a token swap, which means SOL or USDC from the Alpha Vault goes into the pool, while tokens purchased from the pool go into the Alpha Vault. The token pool price would increase from the initial price, based on the token amount purchased by the Alpha Vault. If the Alpha Vault is using the Pro rata mode (which accepts unlimited deposits), depositors are able to withdraw any unused SOL or USDC that exceeded the Alpha Vault max buy cap. [​](https://docs.meteora.ag/anti-sniper-suite/alpha-vault/1-what-is-alpha-vault#token-claiming) Token Claiming ----------------------------------------------------------------------------------------------------------------- When the token unlocks for claiming, the Alpha Vault then distributes the tokens to depositors. Depositors get tokens at the same price, and the amount of tokens received is based on their share of the total deposits. Creators can configure the Alpha Vault to their preference; whether token claiming is unlocked immediately when the pool starts trading or at a later time/date, and whether there is a vesting period for token claims. This vesting solution has the dual benefit of mitigating against sniper bots as well as encouraging purchase from the strongest and most genuine supporters of the project, since they would be more willing to hold their tokens for a longer period. This helps ensure greater alignment between projects and token holders. [​](https://docs.meteora.ag/anti-sniper-suite/alpha-vault/1-what-is-alpha-vault#example-flow-of-pro-rata-mode) Example Flow of Pro Rata Mode ----------------------------------------------------------------------------------------------------------------------------------------------- ![Alpha Vault Pro Rata Mode](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/anti-sniper-suite/alpha-vault-pro-rata.png) [​](https://docs.meteora.ag/anti-sniper-suite/alpha-vault/1-what-is-alpha-vault#alpha-vault-with-whitelist) Alpha Vault with Whitelist ========================================================================================================================================= For some launches, the project may want to restrict which wallet addresses are allowed to deposit funds into the Alpha Vault, so in the config file used in the script to create the Alpha Vault, the `whitelistMode` needs to be specified. 1. `permissionless`: No whitelist, anyone can deposit into the Alpha Vault 2. `permission_with_authority`: In this mode, only the Alpha Vault creator can create escrow account with max\_cap. This allows the creator to use a permissioned (with whitelist) setup without having to use the merkle tree. * Creator needs to pay SOL rent for each escrow account for the whitelisted wallets, so this Alpha Vault whitelist mode is suitable for scenarios where there are very few whitelisted addresses (e.g. ≤ 100). * If they need to support a lot more whitelisted addresses, they should still use the merkle tree (PermissionWithMerkleProof whitelist mode). 3. `permission_with_merkle_proof`: In this mode, only wallets that are whitelisted can deposit into the Alpha Vault. * [CSV file](https://github.com/MeteoraAg/meteora-pool-setup/blob/main/config/whitelist_wallet.csv) containing the list of whitelisted wallets needs to be provided by the project to Meteora, for the Merkle proof to be hosted by Meteora and shown on the UI. * Alpha Vault deposits should not open until the Merkle proof is hosted by Meteora. [​](https://docs.meteora.ag/anti-sniper-suite/alpha-vault/1-what-is-alpha-vault#past-alpha-vault-launches) Past Alpha Vault Launches ======================================================================================================================================= Projects that have used Alpha Vault for their token launches include **UpRock** (UPT), **Sanctum** (CLOUD), **dVin Labs** (VIN), **deBridge** (DBR), **Streamflow** (STREAM), **SonicVM** (SONIC), and **Sendcoin** (SEND). Read the CLOUD Launch Case Study [here](https://meteoraag.medium.com/dlmm-case-study-the-cloud-launch-08eaa5ab3b9c) . [​](https://docs.meteora.ag/anti-sniper-suite/alpha-vault/1-what-is-alpha-vault#which-launch-pools-support-alpha-vault%3F) Which Launch Pools support Alpha Vault? ===================================================================================================================================================================== Available on DLMM, DAMM v1, and DAMM v2. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/anti-sniper-suite/rate-limiter/2-rate-limiter-math) [Alpha Vault Modes\ \ Next](https://docs.meteora.ag/anti-sniper-suite/alpha-vault/2-alpha-vault-modes) On this page * [Key Features and Benefits](https://docs.meteora.ag/anti-sniper-suite/alpha-vault/1-what-is-alpha-vault#key-features-and-benefits) * [How does it work?](https://docs.meteora.ag/anti-sniper-suite/alpha-vault/1-what-is-alpha-vault#how-does-it-work%3F) * [Deposit Period](https://docs.meteora.ag/anti-sniper-suite/alpha-vault/1-what-is-alpha-vault#deposit-period) * [Buying Period](https://docs.meteora.ag/anti-sniper-suite/alpha-vault/1-what-is-alpha-vault#buying-period) * [Token Claiming](https://docs.meteora.ag/anti-sniper-suite/alpha-vault/1-what-is-alpha-vault#token-claiming) * [Example Flow of Pro Rata Mode](https://docs.meteora.ag/anti-sniper-suite/alpha-vault/1-what-is-alpha-vault#example-flow-of-pro-rata-mode) * [Alpha Vault with Whitelist](https://docs.meteora.ag/anti-sniper-suite/alpha-vault/1-what-is-alpha-vault#alpha-vault-with-whitelist) * [Past Alpha Vault Launches](https://docs.meteora.ag/anti-sniper-suite/alpha-vault/1-what-is-alpha-vault#past-alpha-vault-launches) * [Which Launch Pools support Alpha Vault?](https://docs.meteora.ag/anti-sniper-suite/alpha-vault/1-what-is-alpha-vault#which-launch-pools-support-alpha-vault%3F) Assistant Responses are generated using AI and may contain mistakes. --- # What's Fee Scheduler? - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Fee Scheduler What's Fee Scheduler? [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Available on **DAMM v1**, **DAMM v2** and **DBC** Fee scheduler is a configurable fee decay over time. Creators have the option to use a pool with a configurable fee schedule (time-based) where the base fee starts high and drops over time (linearly or exponentially). This is designed to deter sniper bots by imposing higher fees during the start of the launch and initial launch phase. [​](https://docs.meteora.ag/anti-sniper-suite/fee-scheduler/1-what-is-fee-scheduler#how-does-it-work%3F) How does it work? ============================================================================================================================= Fee Scheduler requires the following parameters to be configured: * **Cliff Fee Numerator**: The starting fee of the fee scheduler. * **Number Of Periods**: The number of time periods to reduce the fee by. * **Period Frequency**: The frequency of the number of periods. * **Fee Reduction Factor**: The amount of basis points to reduce the fee by. With these parameters, the starting fee will be **Cliff Fee Numerator** and the fee will be reduced by **Fee Reduction Factor** for the total duration of **Number Of Periods** multiplied by **Period Frequency**. The change in fee can be based on a **linear** or **exponential** fee curve. [​](https://docs.meteora.ag/anti-sniper-suite/fee-scheduler/1-what-is-fee-scheduler#damm-v1-fee-scheduler) DAMM v1 Fee Scheduler =================================================================================================================================== DAMM v1 uses an off-chain fee scheduler. For a DAMM v1 pool using the fee scheduler, the default global fee schedule config used on the Meteora frontend is based on a **Linear** curve, with the following schedule: 1 15% - when pool trading starts Initial fee rate when the pool begins trading 2 7% - 10 min after pool trading starts 10 minutes after the initial 15% rate begins 3 5% - 130 min after pool trading starts 120 minutes after the 7% rate starts 4 2% - 250 min after pool trading starts 120 minutes after the 5% rate starts 5 1% - 370 min after pool trading starts 120 minutes after the 2% rate starts 6 0.5% - 490 min after pool trading starts 120 minutes after the 1% rate starts 7 0.25% - 24 hours after pool trading starts 950 minutes after the 0.5% rate starts [​](https://docs.meteora.ag/anti-sniper-suite/fee-scheduler/1-what-is-fee-scheduler#damm-v2-fee-scheduler) DAMM v2 Fee Scheduler =================================================================================================================================== DAMM v2 uses an on-chain fee scheduler. For a DAMM v2 pool using the fee scheduler, the default fee schedule config used on the Meteora frontend is based on an **Exponential** curve, 50% when pool trading starts, and dropping every second for 120 min, ending at 0.25%. DAMM v2 also offers creators and integrators the option of a Linear curve if required. Read about how [Pump.Science](https://meteoraag.medium.com/damm-v2-case-study-pump-science-d18501c5ef4b) uses DAMM v2’s Fee Scheduler for its token launchpad. [​](https://docs.meteora.ag/anti-sniper-suite/fee-scheduler/1-what-is-fee-scheduler#example-of-an-exponential-fee-scheduler) Example of an Exponential Fee Scheduler ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- The exponential fee scheduler reduces fees by a percentage of the current rate over time. ![Exponential Fee Scheduler](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/anti-sniper-suite/exponential-fee-scheduler.png) 1 50% - when pool trading starts Initial fee rate when the pool begins trading 2 32.15% - 10 min after pool trading starts 10 minutes after the initial 50% rate begins 3 20.67% - 20 min after pool trading starts 10 minutes after the 32.15% rate starts 4 13.29% - 30 min after pool trading starts 10 minutes after the 20.67% rate starts 5 8.55% - 40 min after pool trading starts 10 minutes after the 13.29% rate starts 6 5.50% - 50 min after pool trading starts 10 minutes after the 8.55% rate starts 7 3.53% - 60 min after pool trading starts 10 minutes after the 5.50% rate starts 8 2.27% - 70 min after pool trading starts 10 minutes after the 3.53% rate starts 9 1.46% - 80 min after pool trading starts 10 minutes after the 2.27% rate starts 10 0.94% - 90 min after pool trading starts 10 minutes after the 1.46% rate starts 11 0.60% - 100 min after pool trading starts 10 minutes after the 0.94% rate starts 12 0.39% - 110 min after pool trading starts 10 minutes after the 0.60% rate starts 13 0.25% - 120 min after pool trading starts 10 minutes after the 0.39% rate starts [​](https://docs.meteora.ag/anti-sniper-suite/fee-scheduler/1-what-is-fee-scheduler#example-of-a-linear-fee-scheduler) Example of a Linear Fee Scheduler ----------------------------------------------------------------------------------------------------------------------------------------------------------- ![Linear Fee Scheduler](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/anti-sniper-suite/linear-fee-scheduler.png) Unlike the exponential fee scheduler which reduces fees by a percentage of the current rate, a linear scheduler reduces fees by a constant rate at each time interval. [​](https://docs.meteora.ag/anti-sniper-suite/fee-scheduler/1-what-is-fee-scheduler#dbc-fee-scheduler) DBC Fee Scheduler =========================================================================================================================== Partners (e.g. launchpads) that integrate DBC to create and launch tokens on their platform, can also configure a fee scheduler as part of the virtual bonding curve. This way, even before the token is migrated to an actual liquidity pool, snipers that are the first to buy tokens on the virtual bonding curve are subjected to higher swap fees. [​](https://docs.meteora.ag/anti-sniper-suite/fee-scheduler/1-what-is-fee-scheduler#which-launch-pools-supports-fee-scheduler%3F) Which Launch Pools supports Fee Scheduler? =============================================================================================================================================================================== Fee Scheduler is available as an option for DAMM v1 Launch Pools, DAMM v2 Launch Pools, as well as Dynamic Bonding Curve (DBC). In addition, Fee Scheduler can be used together with Dynamic Fee to bolster the defence against sniper bots at launch. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/anti-sniper-suite/home) [Fee Scheduler Math\ \ Next](https://docs.meteora.ag/anti-sniper-suite/fee-scheduler/2-fee-scheduler-math) On this page * [How does it work?](https://docs.meteora.ag/anti-sniper-suite/fee-scheduler/1-what-is-fee-scheduler#how-does-it-work%3F) * [DAMM v1 Fee Scheduler](https://docs.meteora.ag/anti-sniper-suite/fee-scheduler/1-what-is-fee-scheduler#damm-v1-fee-scheduler) * [DAMM v2 Fee Scheduler](https://docs.meteora.ag/anti-sniper-suite/fee-scheduler/1-what-is-fee-scheduler#damm-v2-fee-scheduler) * [Example of an Exponential Fee Scheduler](https://docs.meteora.ag/anti-sniper-suite/fee-scheduler/1-what-is-fee-scheduler#example-of-an-exponential-fee-scheduler) * [Example of a Linear Fee Scheduler](https://docs.meteora.ag/anti-sniper-suite/fee-scheduler/1-what-is-fee-scheduler#example-of-a-linear-fee-scheduler) * [DBC Fee Scheduler](https://docs.meteora.ag/anti-sniper-suite/fee-scheduler/1-what-is-fee-scheduler#dbc-fee-scheduler) * [Which Launch Pools supports Fee Scheduler?](https://docs.meteora.ag/anti-sniper-suite/fee-scheduler/1-what-is-fee-scheduler#which-launch-pools-supports-fee-scheduler%3F) Assistant Responses are generated using AI and may contain mistakes. --- # Fee Scheduler Math - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Fee Scheduler Fee Scheduler Math [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) There are two types of fee schedulers: 1. **Linear** 2. **Exponential** [​](https://docs.meteora.ag/anti-sniper-suite/fee-scheduler/2-fee-scheduler-math#linear-fee-scheduler-formula) Linear Fee Scheduler Formula ============================================================================================================================================== A linear fee scheduler is a fee reduction mechanism that decreases trading fees at a constant rate over time. For Linear \[0\]: Ending Fee\=Cliff Fee Numerator−(Number Of Periods×Reduction Factor)\\text{Ending Fee} = \\text{Cliff Fee Numerator} - (\\text{Number Of Periods} \\times \\text{Reduction Factor}) Ending Fee\=Cliff Fee Numerator−(Number Of Periods×Reduction Factor) Where: * `cliff_fee_numerator`: The initial fee amount at the start * `number_of_periods`: The number of time periods * `reduction_factor`: The constant amount by which the fee decreases each period (expressed in basis points) [​](https://docs.meteora.ag/anti-sniper-suite/fee-scheduler/2-fee-scheduler-math#exponential-fee-scheduler-formula) Exponential Fee Scheduler Formula ======================================================================================================================================================== An exponential fee scheduler is a fee reduction mechanism that decreases trading fees by a percentage of the current rate over time. For Exponential \[1\]: Ending Fee\=Cliff Fee Numerator×(1−Reduction Factor10000)Number Of Periods\\text{Ending Fee} = \\text{Cliff Fee Numerator} \\times \\left(1 - \\frac{\\text{Reduction Factor}}{10000}\\right)^{\\text{Number Of Periods}} Ending Fee\=Cliff Fee Numerator×(1−10000Reduction Factor​)Number Of Periods Where: * `cliff_fee_numerator`: The initial fee amount at the start * `reduction_factor`: The reduction factor (expressed in basis points) * `number_of_periods`: The number of time period Was this page helpful? YesNo [Previous](https://docs.meteora.ag/anti-sniper-suite/fee-scheduler/1-what-is-fee-scheduler) [What's Rate Limiter?\ \ Next](https://docs.meteora.ag/anti-sniper-suite/rate-limiter/1-what-is-rate-limiter) On this page * [Linear Fee Scheduler Formula](https://docs.meteora.ag/anti-sniper-suite/fee-scheduler/2-fee-scheduler-math#linear-fee-scheduler-formula) * [Exponential Fee Scheduler Formula](https://docs.meteora.ag/anti-sniper-suite/fee-scheduler/2-fee-scheduler-math#exponential-fee-scheduler-formula) Assistant Responses are generated using AI and may contain mistakes. --- # Alpha Vault Formulas - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Alpha Vault Alpha Vault Formulas [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Alpha Vault implements a sophisticated vesting and token distribution mechanism with support for both pro-rata and first-come-first-served (FCFS) allocation modes. [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/2-alpha-vault-formulas#linear-vesting-formula) Linear Vesting Formula ============================================================================================================================================= The core vesting mechanism follows a linear time-based release schedule: claimable\_tokens\=elapsed\_time×total\_bought\_tokenstotal\_vesting\_duration\\text{claimable\\\_tokens} = \\frac{\\text{elapsed\\\_time} \\times \\text{total\\\_bought\\\_tokens}}{\\text{total\\\_vesting\\\_duration}} claimable\_tokens\=total\_vesting\_durationelapsed\_time×total\_bought\_tokens​ **Where:** * `elapsed_time` = time since vesting start * `total_bought_tokens` = total tokens purchased by all users * `total_vesting_duration` = total duration of vesting period * * * [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/2-alpha-vault-formulas#individual-token-claim-formula) Individual Token Claim Formula ============================================================================================================================================================= user\_claimable\=total\_claimable×user\_deposittotal\_vault\_deposit−already\_claimed\\text{user\\\_claimable} = \\frac{\\text{total\\\_claimable} \\times \\text{user\\\_deposit}}{\\text{total\\\_vault\\\_deposit}} - \\text{already\\\_claimed} user\_claimable\=total\_vault\_deposittotal\_claimable×user\_deposit​−already\_claimed **Where:** * `total_claimable` = total tokens available for claiming at current time * `user_deposit` = individual user’s deposit amount * `total_vault_deposit` = sum of all user deposits in the vault * `already_claimed` = tokens already claimed by the user * * * [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/2-alpha-vault-formulas#refund-calculation-formulas) Refund Calculation Formulas ======================================================================================================================================================= [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/2-alpha-vault-formulas#base-refund-calculation) Base Refund Calculation ----------------------------------------------------------------------------------------------------------------------------------------------- refund\=unswapped\_amount×user\_deposittotal\_deposit\\text{refund} = \\frac{\\text{unswapped\\\_amount} \\times \\text{user\\\_deposit}}{\\text{total\\\_deposit}} refund\=total\_depositunswapped\_amount×user\_deposit​ [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/2-alpha-vault-formulas#deposit-overflow-refund-pro-rata-vaults) Deposit Overflow Refund (Pro-rata Vaults) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- overflow\_refund\=excess\_deposit×user\_deposittotal\_deposit\\text{overflow\\\_refund} = \\frac{\\text{excess\\\_deposit} \\times \\text{user\\\_deposit}}{\\text{total\\\_deposit}} overflow\_refund\=total\_depositexcess\_deposit×user\_deposit​ **Where:** * `excess_deposit` = total deposits exceeding the maximum buying cap * `unswapped_amount` = tokens that weren’t successfully swapped * * * [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/2-alpha-vault-formulas#swappable-amount-calculation) Swappable Amount Calculation ========================================================================================================================================================= [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/2-alpha-vault-formulas#pro-rata-mode) Pro-rata Mode --------------------------------------------------------------------------------------------------------------------------- max\_swappable\=min⁡(total\_deposit,max\_buying\_cap)\\text{max\\\_swappable} = \\min(\\text{total\\\_deposit}, \\text{max\\\_buying\\\_cap}) max\_swappable\=min(total\_deposit,max\_buying\_cap) [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/2-alpha-vault-formulas#fcfs-mode) FCFS Mode ------------------------------------------------------------------------------------------------------------------- max\_swappable\=total\_deposit\\text{max\\\_swappable} = \\text{total\\\_deposit} max\_swappable\=total\_deposit **Where:** * `max_buying_cap` = maximum tokens that can be purchased (for pro-rata mode only) * `total_deposit` = sum of all user deposits * * * [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/2-alpha-vault-formulas#vault-mode-specifications) Vault Mode Specifications =================================================================================================================================================== [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/2-alpha-vault-formulas#pro-rata-mode-2) Pro-rata Mode ----------------------------------------------------------------------------------------------------------------------------- * No maximum buying cap restriction * Distributes tokens proportionally among all participants * Provides refunds for excess deposits * Suitable for unlimited token sales [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/2-alpha-vault-formulas#fcfs-mode-2) FCFS Mode --------------------------------------------------------------------------------------------------------------------- * Enforces maximum buying cap * Tokens distributed on first-come-first-served basis * No overflow refunds (all deposits are valid) * Suitable for fair distribution with limited token supply Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/1-introduction) [Getting StartedAlpha Vault\ \ Next](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/1-getting-started) On this page * [Linear Vesting Formula](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/2-alpha-vault-formulas#linear-vesting-formula) * [Individual Token Claim Formula](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/2-alpha-vault-formulas#individual-token-claim-formula) * [Refund Calculation Formulas](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/2-alpha-vault-formulas#refund-calculation-formulas) * [Base Refund Calculation](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/2-alpha-vault-formulas#base-refund-calculation) * [Deposit Overflow Refund (Pro-rata Vaults)](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/2-alpha-vault-formulas#deposit-overflow-refund-pro-rata-vaults) * [Swappable Amount Calculation](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/2-alpha-vault-formulas#swappable-amount-calculation) * [Pro-rata Mode](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/2-alpha-vault-formulas#pro-rata-mode) * [FCFS Mode](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/2-alpha-vault-formulas#fcfs-mode) * [Vault Mode Specifications](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/2-alpha-vault-formulas#vault-mode-specifications) * [Pro-rata Mode](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/2-alpha-vault-formulas#pro-rata-mode-2) * [FCFS Mode](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/2-alpha-vault-formulas#fcfs-mode-2) Assistant Responses are generated using AI and may contain mistakes. --- # Overview - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Integration Overview [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) ![Meteora Banner](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/developer-guide/meteoraic-banner-2.png) We write innovative programs that powers the future of DeFi. With novel products like **DLMM**, **DAMM v1 & v2**, **DBC** and more, we are pushing the boundaries of what is possible on Solana. [​](https://docs.meteora.ag/developer-guide/home#program-ids) Program IDs ============================================================================ | Program Type | Program ID | | --- | --- | | DLMM Program | LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo | | DAMM v1 Program | Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB | | DAMM v2 Program | cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG | | DBC Program | dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN | | Alpha Vault Program | vaU6kP7iNEGkbmPkLmZfGwiGxd4Mob24QQCie5R9kd2 | | Stake2Earn Program | FEESngU3neckdwib9X3KWqdL7Mjmqk9XNp3uh5JbP4KP | | Vault Program | 24Uqj9JCLxUeoC3hGfh5W3s9FM9uCHDS2SG3LYwBpyTi | | Lock Program | LocpQgucEQHbqNABEYvBvwoxCPsSbG91A1QaQhQQqjn | | Dynamic Fee Sharing Program | dfsdo2UqvwfN8DuUVrMRNfQe11VaiNoKcMqLHVvDPzh | | Farm Program | FarmuwXPWXvefWUeqFAa5w6rifLkq5X6E8bimYvrhCB1 | | Mercurial Stable Swap Program | MERLuDFBMmsHnsBPZw2sDQZHvXFMwp8EdjudcU2HKky | [​](https://docs.meteora.ag/developer-guide/home#devnet) Devnet ================================================================== Our programs are deployed on devnet as well. We also provide a devnet version of Meteora at [https://devnet.meteora.ag](https://devnet.meteora.ag/) . ![Devnet Meteora](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/developer-guide/devnet-meteora.png) [​](https://docs.meteora.ag/developer-guide/home#integrations) Integrations ============================================================================== [DLMM\ ----\ \ DLMM (Dynamic Liquidity Market Maker) implements a bin-based liquidity distribution model with algorithmic fee adjustment mechanisms based on market volatility metrics. Liquidity providers can deploy capital across discrete price bins with configurable spreads, enabling concentrated liquidity positioning with real-time fee optimization through volatility-sensitive pricing algorithms.](https://docs.meteora.ag/developer-guide/integrations/dlmm/1-introduction) [DAMM v1\ -------\ \ DAMM v1 (Dynamic Automatic Market Maker v1) utilizes a constant-product formula with infinite price range support (0 < P < ∞) and integrated yield aggregation through external lending protocol interfaces. The architecture enables composite yield generation via swap fee accrual and external DeFi protocol interaction, with automated capital efficiency optimization.](https://docs.meteora.ag/developer-guide/integrations/damm-v1/1-introduction) [DAMM v2\ -------\ \ DAMM v2 (Dynamic Automatic Market Maker v2) implements a constant-product invariant (x\*y=k) with enhanced features including SPL/Token-2022 compatibility, optional concentrated liquidity ranges, position NFTs, algorithmic onchain fee scheduling, programmable fee distribution mechanisms, and native yield farming integration.](https://docs.meteora.ag/developer-guide/integrations/damm-v2/1-introduction) [Dynamic Bonding Curve\ ---------------------\ \ Dynamic Bonding Curve (DBC) implements customizable mathematical pricing functions with configurable curve parameters for token launch mechanisms. The protocol supports arbitrary curve geometries with programmable price discovery algorithms, featuring virtual AMM states that migrate to dynamic AMM pools upon reaching predetermined liquidity thresholds through automated graduation logic.](https://docs.meteora.ag/developer-guide/integrations/dbc/1-introduction) [Alpha Vault\ -----------\ \ Dynamic Vaults implement algorithmic yield optimization through multi-protocol asset allocation strategies, utilizing the Hermes yield aggregation engine for automated capital deployment across lending markets. The system employs mathematical optimization algorithms to maximize risk-adjusted returns for DAMM v1 and memecoin pool liquidity providers through dynamic rebalancing mechanisms.](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/1-introduction) [Stake2Earn\ ----------\ \ Stake2Earn is a mechanism where top memecoin stakers compete to earn fee rewards from permanently-locked liquidity in the memecoin pool, transforming memecoins from a race to dump to a race to stake. Whether as a memecoin holder right from launch or a new holder just entering the game, Stake2Earn offers a unique opportunity to earn fee rewards through staking.](https://docs.meteora.ag/developer-guide/integrations/stake2earn/1-introduction) [Dynamic Vault\ -------------\ \ Dynamic Vaults implement algorithmic yield optimization through multi-protocol asset allocation strategies, utilizing the Hermes yield aggregation engine for automated capital deployment across lending markets. The system employs mathematical optimization algorithms to maximize risk-adjusted returns for DAMM v1 and memecoin pool liquidity providers through dynamic rebalancing mechanisms.](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/1-introduction) [Meteora Lock\ ------------\ \ Meteora Lock is an open-source, permissionless, free and audited alternative to release your project’s tokens over time. Meteora Lock is **free — zero fees**, allowing any project to release their tokens over-time for free.](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/1-introduction) [Dynamic Fee Sharing\ -------------------\ \ Dynamic Fee Sharing program allows for the creation of fee vaults where collected fees can be automatically distributed among multiple recipients based on predetermined share allocations.](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/1-introduction) Was this page helpful? YesNo [Introduction\ \ Next](https://docs.meteora.ag/developer-guide/integrations/dlmm/1-introduction) On this page * [Program IDs](https://docs.meteora.ag/developer-guide/home#program-ids) * [Devnet](https://docs.meteora.ag/developer-guide/home#devnet) * [Integrations](https://docs.meteora.ag/developer-guide/home#integrations) Assistant Responses are generated using AI and may contain mistakes. --- # Rate Limiter Math - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Rate Limiter Rate Limiter Math [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Rate Limiter is a configurable fee slope that can charge fees ranging from the configured `base_fee` up to 99% fee (`MAX_FEE`). [​](https://docs.meteora.ag/anti-sniper-suite/rate-limiter/2-rate-limiter-math#rate-limiter-formula) Rate Limiter Formula ============================================================================================================================ The rate limiter uses a progressive fee calculation with the following key components: Parameters: * `reference_amount` (x₀): The base reference amount * `cliff_fee_numerator` (c): The base fee rate * `fee_increment_bps` (i): The fee increment in basis points * `max_limiter_duration`: Duration for which the rate limiter is active The formula depends on the relationship between input\_amount and reference\_amount: **Case 1: `input_amount ≤ reference_amount`** Fee\=Input Amount×c\\text{Fee} = \\text{Input Amount} \\times \\text{c} Fee\=Input Amount×c **Case 2: `input_amount > reference_amount`** First, decompose the excess amount: Input Amount\=x0+(a×x0+b)\\text{Input Amount} = x\_0 + (a \\times x\_0 + b) Input Amount\=x0​+(a×x0​+b) where: * `a`: floor division of `(Input Amount - x₀) / x₀` * `b`: remainder of `(Input Amount - x₀) mod x₀` Then calculate fees based on whether we exceed the maximum index: Max Index can be calculated as: Max Index\=MAX\_FEE\_NUMERATOR−cfee\_increment\_numerator\\text{Max Index} = \\frac{\\text{MAX\\\_FEE\\\_NUMERATOR} - c}{\\text{fee\\\_increment\\\_numerator}} Max Index\=fee\_increment\_numeratorMAX\_FEE\_NUMERATOR−c​ where: * `fee_increment_numerator = (fee_increment_bps * FEE_DENOMINATOR) / 10_000` **If `a < max_index`** Fee\=x0×(c+c×a+i×a×(a+1)/2)+b×(c+i×(a+1))\\text{Fee} = x\_0 \\times (c + c \\times a + i \\times a \\times (a+1) / 2) + b \\times (c + i \\times (a+1)) Fee\=x0​×(c+c×a+i×a×(a+1)/2)+b×(c+i×(a+1)) **If `a ≥ max_index`** d\=a−Max Indexd = a - \\text{Max Index} d\=a−Max Index Fee\=x0×(c+c×Max Index+i×Max Index×(Max Index+1)/2)+(d×x0+b)×Max Fee\\text{Fee} = x\_0 \\times (c + c \\times \\text{Max Index} + i \\times \\text{Max Index} \\times (\\text{Max Index}+1) / 2) + (d \\times x\_0 + b) \\times \\text{Max Fee} Fee\=x0​×(c+c×Max Index+i×Max Index×(Max Index+1)/2)+(d×x0​+b)×Max Fee Was this page helpful? YesNo [Previous](https://docs.meteora.ag/anti-sniper-suite/rate-limiter/1-what-is-rate-limiter) [What's Alpha Vault?\ \ Next](https://docs.meteora.ag/anti-sniper-suite/alpha-vault/1-what-is-alpha-vault) On this page * [Rate Limiter Formula](https://docs.meteora.ag/anti-sniper-suite/rate-limiter/2-rate-limiter-math#rate-limiter-formula) Assistant Responses are generated using AI and may contain mistakes. --- # Getting Started - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Typescript SDK Getting Started [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) This guide provides instructions on how to get started with the Alpha Vault TypeScript SDK. Before you begin, here are some important resources: * **Program ID (Mainnet & Devnet):** `vaU6kP7iNEGkbmPkLmZfGwiGxd4Mob24QQCie5R9kd2` * **TypeScript SDK Repository:** [@meteora-ag/alpha-vault-sdk](https://github.com/MeteoraAg/alpha-vault-sdk) [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/1-getting-started#installation) Installation =================================================================================================================================== To use the SDK in your project, install it using your preferred package manager: Copy Ask AI npm install @meteora-ag/alpha-vault @solana/web3.js # or pnpm install @meteora-ag/alpha-vault @solana/web3.js # or yarn add @meteora-ag/alpha-vault @solana/web3.js [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/1-getting-started#initialization) Initialization ======================================================================================================================================= Once installed, you can initialize the SDK in your TypeScript/JavaScript project like this: Copy Ask AI import { Connection } from "@solana/web3.js"; import { AlphaVault } from "@meteora-ag/alpha-vault"; // Initialize a connection to the Solana network (e.g., Mainnet) const connection = new Connection("https://api.mainnet-beta.solana.com"); // Intialize the Alpha Vault address const vault = Keypair.generate(); // Create a new instance of the AlphaVault const alphaVault = await AlphaVault.create(connection, vault.publicKey); [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/1-getting-started#testing-the-sdk-for-contributors) Testing the SDK (for contributors) ============================================================================================================================================================================= If you have cloned the SDK repository and want to run the built-in tests: Copy Ask AI # Install dependencies cd ts-client bun install # Run tests bun test [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/1-getting-started#development-resources) Development Resources ===================================================================================================================================================== [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/1-getting-started#faucets) Faucets ------------------------------------------------------------------------------------------------------------------------- [Devnet Faucet\ -------------\ \ When working on devnet, you might need test tokens. Here is a helpful faucet.](https://faucet.raccoons.dev/) Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/2-alpha-vault-formulas) [Alpha Vault Without Whitelist\ \ Next](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist) On this page * [Installation](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/1-getting-started#installation) * [Initialization](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/1-getting-started#initialization) * [Testing the SDK (for contributors)](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/1-getting-started#testing-the-sdk-for-contributors) * [Development Resources](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/1-getting-started#development-resources) * [Faucets](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/1-getting-started#faucets) Assistant Responses are generated using AI and may contain mistakes. --- # We Build Liquidity Pools - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation We Build Liquidity Pools [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) ![Meteora Banner](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/overview/meteoraic-banner-1.png) Our mission at Meteora is to build the most dynamic liquidity pools for **liquidity providers**, **launchpads**, and **token launches**. We build **the best liquidity pools** for: [Liquidity Providers\ -------------------\ \ Join the LP Army and earn the best fees and yield on your capital with Meteora’s innovative liquidity solutions.](https://lparmy.meteora.ag/) [Launchpads\ ----------\ \ Launch your project with confidence using Meteora’s comprehensive launchpad infrastructure and tools.](https://launch.meteora.ag/) [Launches\ --------\ \ Discover and participate in exciting new token launches on Meteora.](https://v2.meteora.ag/) By using Meteora’s DAMM v1/v2, DLMM, and DBC Pools, liquidity providers can earn the best fees and yield on their capital, driving sustainable, long-term liquidity to the platform. Follow our [developer updates on Telegram](https://t.me/meteora_dev) ! [​](https://docs.meteora.ag/overview/home#product-overview) Product Overview =============================================================================== [​](https://docs.meteora.ag/overview/home#core-products) Core products ------------------------------------------------------------------------- [DLMM\ ----\ \ DLMM (Dynamic Liquidity Market Maker) gives LPs access to dynamic fees to capitalize on volatility, and precise liquidity concentration all in real-time, with the flexibility to select their preferred volatility strategy.](https://docs.meteora.ag/overview/products/dlmm/1-what-is-dlmm) [DAMM v1\ -------\ \ DAMM v1 (Dynamic Automatic Market Maker v1) is a constant-product AMM that supports token prices from 0 to infinity. LPs can earn additional yield by utilizing lending sources alongside traditional swap fees, enhancing their returns.](https://docs.meteora.ag/overview/products/damm-v1/1-what-is-damm-v1) [DAMM v2\ -------\ \ DAMM v2 (Dynamic Automatic Market Maker v2) is a constant-product AMM, with features that optimize transaction fees and provide greater flexibility for liquidity providing such as optional concentrated liquidity and usage of position NFTs. DAMM v2 is a new program, and not an upgrade of the Dynamic AMM v1 program.](https://docs.meteora.ag/overview/products/damm-v2/1-what-is-damm-v2) [Dynamic Bonding Curve\ ---------------------\ \ Dynamic Bonding Curve (DBC) is a fully customisable pricing curve that allows you to create and launch tokens with unique price dynamics. Tokens trade in a virtual bonding curve and graduate to a Meteora DAMM v1 or v2 pool when they hit the minimum quote threshold.](https://docs.meteora.ag/overview/products/dbc/1-what-is-dbc) By implementing these liquidity solutions, Meteora aims to foster a thriving ecosystem on Solana and establish Solana as the ultimate trading hub in DeFi. [​](https://docs.meteora.ag/overview/home#other-products) Other products --------------------------------------------------------------------------- [Alpha Vault\ -----------\ \ Alpha Vaults are complimentary anti-bot mechanisms used together with a Launch Pool to deposit and purchase tokens before the pool starts trading.](https://docs.meteora.ag/anti-sniper-suite/alpha-vault/1-what-is-alpha-vault) [Stake2Earn\ ----------\ \ Stake2Earn Vaults allows you to fee share trading fees generated from DAMM v1/v2 pools with top token stakers.](https://docs.meteora.ag/overview/other-products/stake2earn/1-what-is-stake2earn) [Dynamic Vault\ -------------\ \ Dynamic Vaults optimize capital utilization by dynamically distributing assets to lending pools, generating yields for liquidity providers (LPs) on DAMM v1 and Memecoin Pools.](https://docs.meteora.ag/overview/other-products/dynamic-vault/1-what-is-dynamic-vault) [Meteora Lock\ ------------\ \ Meteora Lock is an open source program that allows users to lock tokens based on a vesting plan.](https://docs.meteora.ag/overview/other-products/meteora-lock/1-what-is-meteora-lock) [Dynamic Fee Sharing \[Beta\]\ ----------------------------\ \ Dynamic Fee Sharing is a program that allows you to dynamically configure sharing of fees to a handful of users.](https://docs.meteora.ag/overview/other-products/dynamic-fee-sharing/1-what-is-dynamic-fee-sharing) [​](https://docs.meteora.ag/overview/home#why-liquidity-and-liquidity-providers-on-solana-are-important) Why Liquidity and Liquidity Providers on Solana are Important ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/overview/home#liquidity-pools%3A-the-foundation-of-defi) **Liquidity Pools: The Foundation of DeFi** Liquidity pools are the backbone of decentralized finance. No matter what you’re building—whether it’s a new token, a DApp, or a DeFi service—it all starts with liquidity. For example, if you’re launching a new token, you begin with nothing. You need to create a liquidity pool to enable swaps between your token and others. Moreover, deep liquidity for key tokens like SOL enables smooth liquidation and minimizes bad debt risks within the ecosystem. And deep liquidity for wrapped tokens (e.g., BTC, ETH) on Solana allows users to bridge assets across chains, attracting more users from other blockchain networks. Most users tend to focus only on the DeFi app experience, overlooking the liquidity that powers it. It’s important to remember that behind every trade is a liquidity pool making it possible. ### [​](https://docs.meteora.ag/overview/home#endless-ways-to-provide-liquidity) **Endless Ways to Provide Liquidity** There are countless approaches to being a liquidity provider (LP). You can LP for: * New token launches * Memecoins or non-hyped assets * Market-making strategies * Major DeFi protocols or smaller experiments Being an LP isn’t one-size-fits-all—it’s a spectrum with endless possibilities. ### [​](https://docs.meteora.ag/overview/home#a-diverse-range-of-lps) **A Diverse Range of LPs** Being an LP can mean very different things depending on who you are and what your goals are. Liquidity provision comes from a wide array of contributors, such as: * Professional Market Makers * Developers who integrate liquidity pools into DApps * Creators who aunch and bootstrap liquidity for new tokens * Launchpads that help migrate and establish liquidity for new projects * Everyday DeFi users who provide liquidity directly to earn yield or support projects they believe in ### [​](https://docs.meteora.ag/overview/home#liquidity-is-the-fuel-for-crypto%E2%80%99s-future) **Liquidity Is the Fuel for Crypto’s Future** As DeFi continues to evolve, liquidity will become even more critical. The future of crypto doesn’t revolve around centralized exchanges—it lies in decentralized systems. We’re heading toward a world where millions of people are launching billions of new tokens. **Liquidity Pools** will be central to that future. We’ll need new mechanisms for **creating, launching, distributing**, and **maintaining** these tokens—and all of them will depend on liquidity pools. For example **Liquidity Providers (LPs)** will be the people driving this ecosystem. They’re the ones who create, fund, and maintain the markets that make DeFi possible. **Launchpads** will play a vital role in this shift, offering platforms for new tokens to be created and launched. The launchpad ecosystem is just getting started—what we have today is only the beginning. Was this page helpful? YesNo [What's DLMM?Meteora's Dynamic Liquidity Market Maker (DLMM) gives liquidity providers access to dynamic fees and precise liquidity concentration all in real-time.\ \ Next](https://docs.meteora.ag/overview/products/dlmm/1-what-is-dlmm) On this page * [Product Overview](https://docs.meteora.ag/overview/home#product-overview) * [Core products](https://docs.meteora.ag/overview/home#core-products) * [Other products](https://docs.meteora.ag/overview/home#other-products) * [Why Liquidity and Liquidity Providers on Solana are Important](https://docs.meteora.ag/overview/home#why-liquidity-and-liquidity-providers-on-solana-are-important) * [Liquidity Pools: The Foundation of DeFi](https://docs.meteora.ag/overview/home#liquidity-pools%3A-the-foundation-of-defi) * [Endless Ways to Provide Liquidity](https://docs.meteora.ag/overview/home#endless-ways-to-provide-liquidity) * [A Diverse Range of LPs](https://docs.meteora.ag/overview/home#a-diverse-range-of-lps) * [Liquidity Is the Fuel for Crypto’s Future](https://docs.meteora.ag/overview/home#liquidity-is-the-fuel-for-crypto%E2%80%99s-future) Assistant Responses are generated using AI and may contain mistakes. --- # Anti Sniper Suite Toolkit - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Anti Sniper Suite Toolkit [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) For any token launch, sniper bots have an incredibly unfair advantage as they can buy up a substantial portion of the initial token supply right at the activation slot, at the earliest/lowest prices, in order to sell for a quick profit. This prevents tokens from being widely distributed and severely disadvantages genuine users and supporters of the token project. Meteora has developed an advanced Anti-Sniper Suite (A.S.S.) to counter the threat of mercenary sniper bots during token launches, helping to provide a fairer experience for the community. [​](https://docs.meteora.ag/anti-sniper-suite/home#as-s-core-components) A.S.S. Core Components ================================================================================================== ![A.S.S. Core Components](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/anti-sniper-suite/ass-core-components.png) [Fee Scheduler\ -------------\ \ Configurable fee decay over time designed to deter sniper bots by imposing higher fees during the initial launch phase.](https://docs.meteora.ag/anti-sniper-suite/fee-scheduler) [Rate Limiter\ ------------\ \ Configurable fee slope designed to deter sniper bots by increasing the fee depending on the trade size. If a user buys with an amount more than the reference amount, the fee will increase.](https://docs.meteora.ag/anti-sniper-suite/rate-limiter) [Alpha Vault\ -----------\ \ A complementary anti-bot mechanism used together with a Launch Pool that provides early access for genuine supporters to deposit and purchase tokens before the pool starts trading, thereby safeguarding the token launch against sniper bots.](https://docs.meteora.ag/anti-sniper-suite/alpha-vault) [​](https://docs.meteora.ag/anti-sniper-suite/home#as-s-progress) A.S.S. Progress ==================================================================================== ![A.S.S. Progress](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/anti-sniper-suite/ass-progress.png) Was this page helpful? YesNo [What's Fee Scheduler?\ \ Next](https://docs.meteora.ag/anti-sniper-suite/fee-scheduler/1-what-is-fee-scheduler) On this page * [A.S.S. Core Components](https://docs.meteora.ag/anti-sniper-suite/home#as-s-core-components) * [A.S.S. Progress](https://docs.meteora.ag/anti-sniper-suite/home#as-s-progress) Assistant Responses are generated using AI and may contain mistakes. --- # Introduction - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DAMM v1 Introduction [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Initialize your own constant product liquidity pool with DAMM v1. DAMM v1 allows you to earn fees from both swap fees and yield rewards from lending platforms. [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/1-introduction#program-address) Program Address =================================================================================================================== * Mainnet-beta: `Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB` * Devnet: `Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB` [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/1-introduction#resources) Resources ======================================================================================================= * [DAMM v1 Typescript SDK](https://github.com/MeteoraAg/damm-v1-sdk) * [Interface Definition Language Types (IDL Types)](https://github.com/MeteoraAg/damm-v1-sdk/blob/main/ts-client/src/amm/idl.ts) [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/1-introduction#features) Features ===================================================================================================== Constant Product Curve ---------------------- Traditional Uniswap-style `x * y = k` model for general token pairs Stable Swap Curve ----------------- Curve-style stable swap with customizable amplification coefficient (`A`) for stable/correlated assets, providing tighter spreads around 1:1 ratio Permissioned Pools ------------------ Admin-controlled pools with custom parameters Permissionless Pools -------------------- Anyone can create pools with default or custom fee tiers Customizable Pools ------------------ Permissionless pools with flexible parameters Add Balanced Liquidity ---------------------- Deposit tokens in pool ratio Remove Balanced Liquidity ------------------------- Withdraw tokens proportionally Add Imbalanced Liquidity ------------------------ Deposit in custom ratios (stable pools only) Remove Single-Side Liquidity ---------------------------- Withdraw only one token type (stable pools only) Automatic Yield Generation -------------------------- Deposited assets earn yield automatically LP Token Benefits ----------------- Tokens represent claims on both trading fees and vault yields Dynamic Pricing --------------- LP token pricing based on pool performance Fee Distribution ---------------- Proportional to locked amounts and duration LST Pool -------- mSOL/SOL pools, stSOL/SOL pools with virtual price tracking SPL Stake Pool -------------- Generic stake pool token support Virtual Price Updates --------------------- Automatic price adjustments based on staking rewards Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/dlmm/apis/1-api-endpoints) [Pool Fee Configs\ \ Next](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs) On this page * [Program Address](https://docs.meteora.ag/developer-guide/integrations/damm-v1/1-introduction#program-address) * [Resources](https://docs.meteora.ag/developer-guide/integrations/damm-v1/1-introduction#resources) * [Features](https://docs.meteora.ag/developer-guide/integrations/damm-v1/1-introduction#features) Assistant Responses are generated using AI and may contain mistakes. --- # Pool Fee Configs - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DAMM v1 Pool Fee Configs [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs#how-to-choose-a-suitable-pool-config) How to Choose a Suitable Pool Config ================================================================================================================================================================= What fee parameters to choose depends on your project’s needs. You will need to look at the pool [config list](https://damm-api.meteora.ag/swagger-ui/#/pools/get_all_pool_configs) and choose a suitable `pool_config_key` with your preferred fee parameters. If you want to create an Alpha Vault along with your new pool, you also need to find a `pool_config_key` that is mapped to a `vault_config_key` that meets your requirements. You can find the list of alpha vault configs [here](https://damm-api.meteora.ag/swagger-ui/#/alpha_vault_config/get_all) . [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs#public-pool-config-list) Public Pool Config List ======================================================================================================================================= [Mainnet Pool Config List API\ ----------------------------\ \ Access the complete list of pool configurations available on Mainnet for DAMM v1 pools.](https://damm-api.meteora.ag/swagger-ui/#/pools/get_all_pool_configs) [Devnet Pool Config List API\ ---------------------------\ \ Access the complete list of pool configurations available on Devnet for testing and development.](https://damm-api.devnet.meteora.ag/swagger-ui/#/pools/get_all_pool_configs) * Using these endpoint, pool creators can input the config pubkey, and it will return an array of fee update timings for the config. * Pool creators may choose a `pool_config_key` with a fee curve that suits your integration. If there is no existing config in the list that fits your project’s requirement, a new config needs to be created. Only the Meteora team can create a new config to add it to the preset pool config list. [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs#default-pool-config-used-by-meteora-frontend) Default Pool Config Used by Meteora Frontend ================================================================================================================================================================================= By default, Meteora’s frontend is currently using this pool config key for Memecoin Pool creation: Copy Ask AI FiENCCbPi3rFh5pW2AJ59HC53yM32eLaCjMKxRqanKFJ For the `FiENCCbPi3rFh5pW2AJ59HC53yM32eLaCjMKxRqanKFJ` pool config, it doesn’t allow creation of any Alpha Vault, therefore its field `vault_config_key` is `1111111...` [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs#new-custom-pool-config-and-fee-curve-for-pool-creators) New Custom Pool Config and Fee Curve for Pool Creators ===================================================================================================================================================================================================== [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs#custom-pool-config-key) Custom Pool Config Key ------------------------------------------------------------------------------------------------------------------------------------- Pool creators may need to use their own unique custom pool config key, if they want custom `pool_creator_authority` to prevent front-running of the token launch pool. New dedicated config keys can only be created by Meteora. Please reach out to us if this is required. The `pool_creator_authority` doesn’t work with program address. It’s not a program whitelist, it needs to be a PDA (program derived address) or normal account. [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs#custom-fee-curve) Custom Fee Curve ------------------------------------------------------------------------------------------------------------------------- Meteora can also apply a custom fee curve/schedule for your pools, but we will need to create a dedicated config key for your team, where `pool_creator_authority` is linked to your signer wallet for pool creation. You would need to send us your **signer wallet** that would be using to deploy the pools. Even with a dedicated config key for your team, Meteora would need to customize the fee curve/schedule for you. You can’t do it on your own. [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs#custom-fee-curve-for-a-specific-pool) Custom Fee Curve for a Specific Pool ================================================================================================================================================================= If required, Meteora can set a custom fee curve for a single, specific pool which would override the fee curve used by the pool’s config key regardless of which config key is used. [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs#api-to-track-associated-fee-curve-for-each-config) API to Track Associated Fee Curve for Each Config =========================================================================================================================================================================================== [Fee Curve Configuration API\ ---------------------------\ \ Get the associated fee curve configurations for each existing pool config.](https://damm-api.meteora.ag/swagger-ui/#/fee_config/get_config_associated_fee_configs) Using this endpoint, pool creators can input the config pubkey, and it will return an array of fee update timings for the config. Pool creators may then choose a config with a fee curve that suits their integration. [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs#steps-to-check-fee-curves) Steps to Check Fee Curves ------------------------------------------------------------------------------------------------------------------------------------------- 1 View All Pool Configs Navigate to [Swagger UI](https://damm-api.meteora.ag/swagger-ui/#/pools/get_all_pool_configs) 2 Select Config Press **“Execute”** and find and select the config you want to view 3 Check Dynamic Fee Curve [Check](https://damm-api.meteora.ag/swagger-ui/#/fee_config/get_config_associated_fee_configs) for any Dynamic Fee curve for that specific config [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs#understanding-pool-config-fields) Understanding Pool Config Fields ========================================================================================================================================================= | Field | Description | | --- | --- | | `config_address` | The pool config key | | `trade_fee_bps` | Pool trading fee | | `protocol_fee_bps` | Protocol fee charged from pool trading fee | | `activation_duration` | Used to determine when exactly the pool will start trading | | `vault_config_key` | Alpha vault config key. If it is `11111111111111111111111111111111`, means no alpha vault. If not, the pool can create an alpha vault. **Note:** This is NOT the same as the vault address. | | `pool_creator_authority` | Address which can use the pool config key to create a pool. If it is `11111111111111111111111111111111`, it’s public and available for everyone to use | | `activation_type` | Pool activation type. `0` = slot, `1` = time | **Start trade time calculation** * `current_time + activation_duration` OR * `current_slot + activation_duration` (depends on the `activation_type`) [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs#pool-config-example) Pool Config Example =============================================================================================================================== Copy Ask AI { "config_address": "FiENCCbPi3rFh5pW2AJ59HC53yM32eLaCjMKxRqanKFJ", "trade_fee_bps": 1500, "protocol_fee_bps": 2000, "activation_duration": 0, "vault_config_key": "11111111111111111111111111111111", "pool_creator_authority": "11111111111111111111111111111111", "activation_type": 0 } [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs#user-flow-example) User Flow Example =========================================================================================================================== A pool config may or may not have an associated vault config. There’s no vault config associated when the `vault_config_key` is `11111111111111111111111111111111`. When the pool config has a vault config, user can create the pool + Alpha Vault that is binded (auto-whitelisted) by the pool. The Alpha Vault created will inherit the parameters (Pro Rata / FCFS + buying\_cap, vesting duration, etc.) from the vault config. [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs#creating-pool-abc%2Fsol-with-an-alpha-vault) Creating Pool ABC/SOL with an Alpha Vault ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Let’s say a user wants to create the pool ABC/SOL with an Alpha Vault, the user will need to: 1. **Check for pool config** that have `vault_config_key` not = `1111...`, and `pool_creator_authority` is the user or `1111...` (accessible by the public) 2. **Based on the vault requirement** the user wants, the user will need to: * a) Check all the pool configs from step 1, which are each mapped to a `vault_config_key`, as well as * b) Check for vault config and look for one that fits the requirement 3. **If the user finds a requirement** that suits their needs, they can use that `pool_config_key` to create the pool, then use the pool config-mapped `vault_config_key` to create the vault. As long as `vault_config_key` is used, the vault is automatically whitelisted upon pool creation. All the settings are already predefined by `pool_config` + its mapped `vault_config_key`. The permutations for pool config + Alpha Vault are created by Meteora. [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs#pool-config-example-2) Pool Config Example --------------------------------------------------------------------------------------------------------------------------------- Copy Ask AI { "config_address": "8aPHoLN8ke6PhWeYA7ELi19fppptVYUCQvqKWR5yP1sn", "trade_fee_bps": 150, "protocol_fee_bps": 2000, "activation_duration": 1512000, "vault_config_key": "7ixojP8Zuu4csfTycHi8ywQymHm9zxAhu1TjnFuJaq2R", "pool_creator_authority": "5unTfT2kssBuNvHPY6LbJfJpLqEcdMxGYLWHwShaeTLi", "activation_type": 0 } ### [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs#alpha-vault-config-example) Alpha Vault Config Example Copy Ask AI { "address": "7ixojP8Zuu4csfTycHi8ywQymHm9zxAhu1TjnFuJaq2R", "max_depositing_cap": 10, "start_vesting_duration": 1, "end_vesting_duration": 24107, "depositing_duration_until_last_join_point": 24107, "individual_depositing_cap": 1, "escrow_fee": 0, "activation_type": 0 } In this example above, only the `pool_creator_authority` => `5unTfT2kssBuNvHPY6LbJfJpLqEcdMxGYLWHwShaeTLi` can use the pool config `8aPHoLN8ke6PhWeYA7ELi19fppptVYUCQvqKWR5yP1sn` to create a pool with the below settings: * **1.5% fee** * **20% protocol fee** (this is fixed Meteora fee) * Pool starts trading after **1512000 slot** upon creation * **Slot based activation** You can also create a binded Alpha Vault with **FCFS config** as shown below: * Max deposit cap = **10 token** * Vested over **24106 slot** after pool activate * Deposit opens at **24107 slot** before vault crank * Every escrow maximum can only deposit **1 token** Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/damm-v1/1-introduction) [Dynamic Pool Configs\ \ Next](https://docs.meteora.ag/developer-guide/integrations/damm-v1/3-dynamic-pool-configs) On this page * [How to Choose a Suitable Pool Config](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs#how-to-choose-a-suitable-pool-config) * [Public Pool Config List](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs#public-pool-config-list) * [Default Pool Config Used by Meteora Frontend](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs#default-pool-config-used-by-meteora-frontend) * [New Custom Pool Config and Fee Curve for Pool Creators](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs#new-custom-pool-config-and-fee-curve-for-pool-creators) * [Custom Pool Config Key](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs#custom-pool-config-key) * [Custom Fee Curve](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs#custom-fee-curve) * [Custom Fee Curve for a Specific Pool](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs#custom-fee-curve-for-a-specific-pool) * [API to Track Associated Fee Curve for Each Config](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs#api-to-track-associated-fee-curve-for-each-config) * [Steps to Check Fee Curves](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs#steps-to-check-fee-curves) * [Understanding Pool Config Fields](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs#understanding-pool-config-fields) * [Pool Config Example](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs#pool-config-example) * [User Flow Example](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs#user-flow-example) * [Creating Pool ABC/SOL with an Alpha Vault](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs#creating-pool-abc%2Fsol-with-an-alpha-vault) * [Pool Config Example](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs#pool-config-example-2) * [Alpha Vault Config Example](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs#alpha-vault-config-example) Assistant Responses are generated using AI and may contain mistakes. --- # Dynamic Pool Configs - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DAMM v1 Dynamic Pool Configs [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) DAMM v1 Pool can be set up to start trading at a specific activation slot on the blockchain, or at a specific time based on sysvar clock. [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/3-dynamic-pool-configs#activation-fields) Activation Fields =============================================================================================================================== There are 2 fields involved: * `pool.activation_type` * `pool.activation_point` Pool creator has the option to choose between using slot or time for activation. * If `Pool.activation_type == 0`, Pool starts trading when `current_slot >= pool.activation_point` * If `Pool.activation_type == 1`, Pool starts trading when `current_time >= pool.activation_point` [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/3-dynamic-pool-configs#pool-activation-by-slot) Pool Activation by Slot =========================================================================================================================================== Pool starts trading when `current_slot >= pool.activation_slot` [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/3-dynamic-pool-configs#pool-activation-by-time-clock) Pool Activation by Time (Clock) ========================================================================================================================================================= You can create a pool with timestamp (clock or slot) by using this endpoint: Copy Ask AI initialize_permissionless_constant_product_pool_with_config2 In the new endpoint, pool creator is able to specify an `activation_point` for a pool, that allows token team to set a precise launch time for the pool. In the config account, there will be a max duration. This max duration (to be determined by Meteora) determines the furthest point in time after pool creation where the `pool.activation_point` can be adjusted to. For example, if the max duration is 7 days, `Pool.activation_point` must be <= 7 days from pool creation. For time, we are using sysvar clock. [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/3-dynamic-pool-configs#important-reminders) Important Reminders =================================================================================================================================== [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/3-dynamic-pool-configs#claim-start-time-should-not-be-earlier-than-pool-activation-time) Claim start time should NOT be earlier than Pool activation time ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- For a new token launch, the project should ensure that token claiming from the Alpha Vault is NOT possible before the launch pool trading activation or before the token starts trading anywhere, whether on a Dynamic AMM or DLMM Pool. If users are able to claim tokens before the launch pool/token starts trading, they may create a separate market with a price that deviates from the project’s preferred launch price. Read how to configure Alpha Vault timings here. [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/3-dynamic-pool-configs#for-memecoins-that-want-to-permanently-lock-liquidity%2C-lock-it-before-pool-activation-time) For Memecoins that want to permanently lock liquidity, lock it before Pool activation time ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- If the project wants to permanently lock liquidity in the DAMM v1 Pool, they should ideally lock the liquidity BEFORE the pool starts trading, so that swap fees from locked liquidity are captured the second trading starts. In a scenario where: 1. **The pool started trading** - t0 2. **Liquidity gets deposited to the pool by the project, but not locked** - t1 3. **Subsequently, that liquidity is permanently locked by the project** - t2 The project will not be able to claim swap fees earned from t1 to t2, since fees from t1 to t2 are assigned to the LP token before the LP token gets permanently locked. When the LP token gets locked, the earlier fees are locked along with it. The project will only be able to claim swap fees from locked liquidity starting from t2. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/damm-v1/2-pool-fee-configs) [DAMM v1 Formulas\ \ Next](https://docs.meteora.ag/developer-guide/integrations/damm-v1/4-damm-v1-formulas) On this page * [Activation Fields](https://docs.meteora.ag/developer-guide/integrations/damm-v1/3-dynamic-pool-configs#activation-fields) * [Pool Activation by Slot](https://docs.meteora.ag/developer-guide/integrations/damm-v1/3-dynamic-pool-configs#pool-activation-by-slot) * [Pool Activation by Time (Clock)](https://docs.meteora.ag/developer-guide/integrations/damm-v1/3-dynamic-pool-configs#pool-activation-by-time-clock) * [Important Reminders](https://docs.meteora.ag/developer-guide/integrations/damm-v1/3-dynamic-pool-configs#important-reminders) * [Claim start time should NOT be earlier than Pool activation time](https://docs.meteora.ag/developer-guide/integrations/damm-v1/3-dynamic-pool-configs#claim-start-time-should-not-be-earlier-than-pool-activation-time) * [For Memecoins that want to permanently lock liquidity, lock it before Pool activation time](https://docs.meteora.ag/developer-guide/integrations/damm-v1/3-dynamic-pool-configs#for-memecoins-that-want-to-permanently-lock-liquidity%2C-lock-it-before-pool-activation-time) Assistant Responses are generated using AI and may contain mistakes. --- # DAMM v1 Formulas - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DAMM v1 DAMM v1 Formulas [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) DAMM v1 is a traditional full-range liquidity AMM with multiple curve support. [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/4-damm-v1-formulas#constant-product-curve-xy-%3D-k) Constant Product Curve (xy = k) ======================================================================================================================================================= The constant product formula maintains liquidity invariance through the following relationships: [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/4-damm-v1-formulas#invariant-formula) Invariant Formula --------------------------------------------------------------------------------------------------------------------------- k\=tokena×tokenbk = \\text{token}\_a \\times \\text{token}\_b k\=tokena​×tokenb​ [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/4-damm-v1-formulas#liquidity-invariant-d) Liquidity Invariant (D) ------------------------------------------------------------------------------------------------------------------------------------- D\=tokena×tokenbD = \\sqrt{\\text{token}\_a \\times \\text{token}\_b} D\=tokena​×tokenb​​ [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/4-damm-v1-formulas#stable-swap-curve-stableswap) Stable Swap Curve (StableSwap) --------------------------------------------------------------------------------------------------------------------------------------------------- Implements Curve Finance’s StableSwap algorithm via Saber StableSwap. [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/4-damm-v1-formulas#core-stableswap-invariant) Core StableSwap Invariant ------------------------------------------------------------------------------------------------------------------------------------------- A⋅nn⋅∑ixi+D\=A⋅nn⋅D+Dn+1nn⋅∏ixiA \\cdot n^n \\cdot \\sum\_{i} x\_i + D = A \\cdot n^n \\cdot D + \\frac{D^{n+1}}{n^n \\cdot \\prod\_{i} x\_i} A⋅nn⋅i∑​xi​+D\=A⋅nn⋅D+nn⋅∏i​xi​Dn+1​ **Where:** * `A` = amplification coefficient * `n` = number of tokens (2 for pairs) * `x_i` = token amounts * `D` = invariant * * * [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/4-damm-v1-formulas#fee-calculation-formulas) Fee Calculation Formulas ========================================================================================================================================= [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/4-damm-v1-formulas#trading-fees) Trading Fees ----------------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/4-damm-v1-formulas#base-trading-fee) Base Trading Fee fee\=token\_amount×fee\_numeratorfee\_denominator\\text{fee} = \\frac{\\text{token\\\_amount} \\times \\text{fee\\\_numerator}}{\\text{fee\\\_denominator}} fee\=fee\_denominatortoken\_amount×fee\_numerator​ **Where:** * `fee_denominator` = 100,000 Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/damm-v1/3-dynamic-pool-configs) [Getting StartedDAMM v1\ \ Next](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/1-getting-started) On this page * [Constant Product Curve (xy = k)](https://docs.meteora.ag/developer-guide/integrations/damm-v1/4-damm-v1-formulas#constant-product-curve-xy-%3D-k) * [Invariant Formula](https://docs.meteora.ag/developer-guide/integrations/damm-v1/4-damm-v1-formulas#invariant-formula) * [Liquidity Invariant (D)](https://docs.meteora.ag/developer-guide/integrations/damm-v1/4-damm-v1-formulas#liquidity-invariant-d) * [Stable Swap Curve (StableSwap)](https://docs.meteora.ag/developer-guide/integrations/damm-v1/4-damm-v1-formulas#stable-swap-curve-stableswap) * [Core StableSwap Invariant](https://docs.meteora.ag/developer-guide/integrations/damm-v1/4-damm-v1-formulas#core-stableswap-invariant) * [Fee Calculation Formulas](https://docs.meteora.ag/developer-guide/integrations/damm-v1/4-damm-v1-formulas#fee-calculation-formulas) * [Trading Fees](https://docs.meteora.ag/developer-guide/integrations/damm-v1/4-damm-v1-formulas#trading-fees) * [Base Trading Fee](https://docs.meteora.ag/developer-guide/integrations/damm-v1/4-damm-v1-formulas#base-trading-fee) Assistant Responses are generated using AI and may contain mistakes. --- # Pool State - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation API Pool State [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/apis/2-pool-state#key-data-retrieved-from-the-pool-state) Key data retrieved from the pool state ==================================================================================================================================================================== | 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 whether 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 | [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/apis/2-pool-state#pool-fees) 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 | [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/apis/2-pool-state#padding) Padding ====================================================================================================== | Data | Description | | --- | --- | | `padding` | 512 bytes reserved for future use | [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/apis/2-pool-state#curve-type) Curve Type ============================================================================================================ | Data | Description | | --- | --- | | `ConstantProduct` | Indicate the pool is constant product pool | | `Stable` | Indicate the pool is stable swap pool | [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/apis/2-pool-state#token-multiplier) 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 | [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/apis/2-pool-state#depeg) 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 | [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/apis/2-pool-state#depeg-type) 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 | [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/apis/2-pool-state#user-functions) User Functions ==================================================================================================================== | Function | 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. | Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/damm-v1/apis/1-pool-info) [Introduction\ \ Next](https://docs.meteora.ag/developer-guide/integrations/damm-v2/1-introduction) On this page * [Key data retrieved from the pool state](https://docs.meteora.ag/developer-guide/integrations/damm-v1/apis/2-pool-state#key-data-retrieved-from-the-pool-state) * [Pool Fees](https://docs.meteora.ag/developer-guide/integrations/damm-v1/apis/2-pool-state#pool-fees) * [Padding](https://docs.meteora.ag/developer-guide/integrations/damm-v1/apis/2-pool-state#padding) * [Curve Type](https://docs.meteora.ag/developer-guide/integrations/damm-v1/apis/2-pool-state#curve-type) * [Token Multiplier](https://docs.meteora.ag/developer-guide/integrations/damm-v1/apis/2-pool-state#token-multiplier) * [Depeg](https://docs.meteora.ag/developer-guide/integrations/damm-v1/apis/2-pool-state#depeg) * [Depeg Type](https://docs.meteora.ag/developer-guide/integrations/damm-v1/apis/2-pool-state#depeg-type) * [User Functions](https://docs.meteora.ag/developer-guide/integrations/damm-v1/apis/2-pool-state#user-functions) Assistant Responses are generated using AI and may contain mistakes. --- # DAMM v1 CPI Examples - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation CPI DAMM v1 CPI Examples [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) This [repository](https://github.com/MeteoraAg/cpi-examples) contains examples for Cross-Program Invocation (CPI) to swap using DAMM v1 program. [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/cpi/1-cpi-examples#dependencies) Dependencies ================================================================================================================= * **Anchor:** `0.28.0` * **Solana:** `1.16.1` * **Rust:** `1.68.0` [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/cpi/1-cpi-examples#available-examples) Available Examples ============================================================================================================================= [CPI to Dynamic AMM swap example\ -------------------------------\ \ Example of swapping using Dynamic AMM via CPI.](https://github.com/MeteoraAg/cpi-examples/blob/main/programs/cpi-example/src/instructions/dynamic_amm_cpi/swap.rs) [CPI to Dynamic AMM initialize pool example\ ------------------------------------------\ \ Example of initializing a pool using Dynamic AMM via CPI.](https://github.com/MeteoraAg/cpi-examples/blob/main/programs/cpi-example/src/instructions/dynamic_amm_cpi/initialize_customizable_permissionless_pool.rs) [CPI to Dynamic AMM initialize pool with config example\ ------------------------------------------------------\ \ Example of initializing a pool with configuration using Dynamic AMM via CPI.](https://github.com/MeteoraAg/cpi-examples/blob/main/programs/cpi-example/src/instructions/dynamic_amm_cpi/initialize_permissionless_pool_with_config.rs) [CPI to Dynamic AMM lock liquidity example\ -----------------------------------------\ \ Example of locking liquidity using Dynamic AMM via CPI.](https://github.com/MeteoraAg/cpi-examples/blob/main/programs/cpi-example/src/instructions/dynamic_amm_cpi/lock_liquidity.rs) [CPI to Dynamic AMM claim fee example\ ------------------------------------\ \ Example of claiming fees using Dynamic AMM via CPI.](https://github.com/MeteoraAg/cpi-examples/blob/main/programs/cpi-example/src/instructions/dynamic_amm_cpi/claim_fee.rs) [CPI to M3m3 initialize vault example\ ------------------------------------\ \ Example of initializing a vault using M3m3 via CPI.](https://github.com/MeteoraAg/cpi-examples/blob/main/programs/cpi-example/src/instructions/m3m3_cpi/initialize_vault.rs) [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/cpi/1-cpi-examples#testing) Testing ======================================================================================================= The [repository](https://github.com/MeteoraAg/cpi-examples/blob/main/programs/cpi-example/tests) includes comprehensive tests for all the CPI examples. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/4-farm-integration) [Pool Info\ \ Next](https://docs.meteora.ag/developer-guide/integrations/damm-v1/apis/1-pool-info) On this page * [Dependencies](https://docs.meteora.ag/developer-guide/integrations/damm-v1/cpi/1-cpi-examples#dependencies) * [Available Examples](https://docs.meteora.ag/developer-guide/integrations/damm-v1/cpi/1-cpi-examples#available-examples) * [Testing](https://docs.meteora.ag/developer-guide/integrations/damm-v1/cpi/1-cpi-examples#testing) Assistant Responses are generated using AI and may contain mistakes. --- # Pool Info - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation API Pool Info [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/apis/1-pool-info#swagger-ui) Swagger UI =========================================================================================================== [Mainnet (Latest)\ ----------------\ \ Access the latest Swagger UI documentation for DAMM v1 APIs](https://damm-api.meteora.ag/swagger-ui/) [Mainnet (Legacy)\ ----------------\ \ Legacy Swagger UI documentation (mainnet)](https://amm-v2.meteora.ag/swagger-ui/) [Devnet (Latest)\ ---------------\ \ Swagger UI for development and testing environment](https://damm-api.devnet.meteora.ag/swagger-ui/) [Devnet (Legacy)\ ---------------\ \ Legacy Swagger UI documentation (devnet)](https://damm-api.devnet.meteora.ag/swagger-ui/) Use the latest API endpoints for new integrations. Legacy endpoints are maintained for backward compatibility. [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/apis/1-pool-info#key-information-fields) Key Information Fields =================================================================================================================================== The following table describes the key information that can be retrieved: | Field | Description | | --- | --- | | `pool_address` | Token mint address of the token in the pool (e.g. USDC-USDT) | | `pool_token_mints` | Pool token mints for the pool, for both tokens | | `pool_token_amounts` | Pool token amounts for both tokens | | `pool_token_usd_amounts` | Pool tokens amounts in USD value | | `lp_mint` | Liquidity Pool (LP) Token mint address | | `pool_tvl` | Pool Total Value Locked | | `farm_tvl` | Farm Total Value Locked | | `farming_pool` | Farming pool address that is linked with the AMM pool (Note: not all AMM pools have the farming pool) | | `farming_apy` | Farm APY data | | `is_monitoring` | N/A | | `pool_order` | N/A | | `farm_order` | N/A | | `pool_version` | Indicate whether the pool is Multi-token Stable Pool (1) or Dynamic AMM Pools (2) | | `pool_name` | Pool name | | `lp_decimal` | LP token decimals place | | `farm_reward_duration_end` | Farm reward duration end timestamp | | `farm_expire` | Farm expiration | | `pool_lp_price_in_usd` | LP Token price in USD | | `trading_volume` | Trading Volume | | `fee_volume` | Fee Volume | | `weekly_trading_volume` | Weekly Trading Volume | | `weekly_fee_volume` | Weekly Fee Volume | | `yield_volume` | 24h Yield | | `accumulated_trading_volume` | Accumulated Trading Volume | | `accumulated_fee_volume` | Accumulated Fee Volume | | `accumulated_yield_volume` | Accumulated Yield Volume | | `trade_apy` | Trading fees APY | | `weekly_trade_apy` | Weekly trading fees APY | | `virtual_price_apy` | Virtual Price APY | | `daily_base_apy` | Daily Base APY (Including lending yield from vault) | | `weekly_base_apy` | Weekly Base APY (Including lending yield from vault) | | `farm_new` | New farm tag | | `permissioned` | Permission / Permissionless pool | | `unknown` | Unknown / new token | | `total_fee_pct` | Swap fee of the pool | | `is_lst` | LST pool tag indicate whether the pool is LST or not | [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/apis/1-pool-info#example-response) Example Response ======================================================================================================================= Copy Ask AI { "pool_address": "32D4zRxNc1EssbJieVHfPhZM3rH6CzfUPrWUuWxD9prG", "pool_token_mints": [\ "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",\ "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"\ ], "pool_token_amounts": [\ "147848.134080",\ "319838.170088"\ ], "pool_token_usd_amounts": [\ "147848.134080",\ "319794.991935"\ ], "lp_mint": "xLebAypjbaQ9tmxUKHV6DZU4mY8ATAAP2sfkNNQLXjf", "pool_tvl": "467643.126015", "farm_tvl": "0", "farming_pool": null, "farming_apy": "0", "is_monitoring": false, "pool_order": 21, "farm_order": 0, "pool_version": 2, "pool_name": "USDT-USDC", "lp_decimal": 6, "farm_reward_duration_end": 0, "farm_expire": false, "pool_lp_price_in_usd": "1.033891", "trading_volume": 192226.124643, "fee_volume": 14.416761, "weekly_trading_volume": 707133.354544, "weekly_fee_volume": 53.033889, "yield_volume": "21.232559", "accumulated_trading_volume": "27982256.437910", "accumulated_fee_volume": "1359.906515", "accumulated_yield_volume": "3571.774818", "trade_apy": "1.131579", "weekly_trade_apy": "0.591424", "virtual_price_apy": "2.878042", "daily_base_apy": "2.878042", "weekly_base_apy": "2.572358", "farm_new": false, "permissioned": true, "unknown": false, "total_fee_pct": "0.01", "is_lst": false } Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/damm-v1/cpi/1-cpi-examples) [Pool State\ \ Next](https://docs.meteora.ag/developer-guide/integrations/damm-v1/apis/2-pool-state) On this page * [Swagger UI](https://docs.meteora.ag/developer-guide/integrations/damm-v1/apis/1-pool-info#swagger-ui) * [Key Information Fields](https://docs.meteora.ag/developer-guide/integrations/damm-v1/apis/1-pool-info#key-information-fields) * [Example Response](https://docs.meteora.ag/developer-guide/integrations/damm-v1/apis/1-pool-info#example-response) Assistant Responses are generated using AI and may contain mistakes. --- # Getting Started - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Typescript SDK Getting Started [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) This guide provides instructions on how to get started with the DAMM v1 TypeScript SDK. Before you begin, here are some important resources: * **Program ID (Mainnet & Devnet):** `Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB` * **TypeScript SDK Repository:** [@meteora-ag/dynamic-amm-sdk](https://github.com/MeteoraAg/damm-v1-sdk) [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/1-getting-started#installation) Installation =============================================================================================================================== To use the SDK in your project, install it using your preferred package manager: Copy Ask AI npm install @meteora-ag/dynamic-amm-sdk @solana/web3.js # or pnpm install @meteora-ag/dynamic-amm-sdk @solana/web3.js # or yarn add @meteora-ag/dynamic-amm-sdk @solana/web3.js [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/1-getting-started#initialization) Initialization =================================================================================================================================== Once installed, you can initialize the SDK in your TypeScript/JavaScript project like this: Copy Ask AI import AmmImpl, { MAINNET_POOL } from '@meteora-ag/dynamic-amm-sdk'; import { Connection, PublicKey } from '@solana/web3.js'; const mainnetConnection = new Connection('https://api.mainnet-beta.solana.com'); // Create pool instances // e.g. creating a constant product pool const constantProductPool = await AmmImpl.create(mainnetConnection, MAINNET_POOL.USDC_SOL); // e.g. creating a stable pool const stablePool = await AmmImpl.create(mainnetConnection, MAINNET_POOL.USDT_USDC); // e.g. creating a pool with an existing pool address const pool = await AmmImpl.create(mainnetConnection, new PublicKey('...')); // e.g. creating multiple pools const pools = [MAINNET_POOL.USDC_SOL, MAINNET_POOL.USDT_USDC]; const [constantProductPool, stablePool] = await AmmImpl.createMultiple(mainnetConnection, pools); [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/1-getting-started#testing-the-sdk-for-contributors) Testing the SDK (for contributors) ========================================================================================================================================================================= If you have cloned the SDK repository and want to run the built-in tests: Copy Ask AI # Install dependencies cd ts-client bun install # Run tests bun test [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/1-getting-started#development-resources) Development Resources ================================================================================================================================================= [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/1-getting-started#faucets) Faucets --------------------------------------------------------------------------------------------------------------------- [Devnet Faucet\ -------------\ \ When working on devnet, you might need test tokens. Here is a helpful faucet.](https://faucet.raccoons.dev/) Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/damm-v1/4-damm-v1-formulas) [DAMM v1 SDK Functions\ \ Next](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions) On this page * [Installation](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/1-getting-started#installation) * [Initialization](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/1-getting-started#initialization) * [Testing the SDK (for contributors)](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/1-getting-started#testing-the-sdk-for-contributors) * [Development Resources](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/1-getting-started#development-resources) * [Faucets](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/1-getting-started#faucets) Assistant Responses are generated using AI and may contain mistakes. --- # Alpha Vault Without Whitelist - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Typescript SDK Alpha Vault Without Whitelist [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Below we provide the steps to use the Alpha Vault Typescript SDK to create an Alpha Vault without Whitelist. Permissionless Alpha Vault has no whitelist or individual deposit cap. “Permissionless” in this case means anyone can deposit assets into the Alpha Vault after creation. [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#example-timeline-pro-rata-mode) Example Timeline (Pro-rata Mode) ======================================================================================================================================================================================= ![Alpha Vault Without Whitelist](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/developer-guide/alpha-vault/alpha-vault-without-whitelist.png) [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#code-examples) Code Examples --------------------------------------------------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#create-dynamic-pool-with-permissionless-alpha-vault) Create Dynamic Pool With Permissionless Alpha Vault This example shows how to create a new DAMM v1 Pool that also adds a permissionless Alpha Vault. Please contact the Meteora team if the existing pool and vault config do not meet your requirements. Currently only DAMM v1 Pools support the addition of a permissionless Alpha Vault. Currently, only SOL or USDC is accepted as the quote token when initializing a DAMM v1 Pool with Alpha Vault in a permissionless setup. Copy Ask AI import { clusterApiUrl, Connection, Keypair, PublicKey, sendAndConfirmTransaction, SYSVAR_CLOCK_PUBKEY, } from "@solana/web3.js"; import AlphaVault, { DYNAMIC_AMM_PROGRAM_ID, PoolType, VaultMode } from ".."; import DynamicAmm from "@meteora-ag/dynamic-amm-sdk"; import { ActivationType, Clock, ClockLayout, createTokenAndMint, loadKeypairFromFile, } from "./utils"; import dotenv from "dotenv"; import { BN } from "bn.js"; import { derivePoolAddressWithConfig } from "@meteora-ag/dynamic-amm-sdk/dist/cjs/src/amm/utils"; dotenv.config(); async function createDummyMints(connection: Connection, payer: Keypair) { console.log("Creating mint A"); const mintAInfo = await createTokenAndMint( connection, payer, 6, 100_000_000_000 ); console.log("Creating mint B"); const mintBInfo = await createTokenAndMint( connection, payer, 6, 100_000_000_000 ); return { mintAInfo, mintBInfo, }; } /** * @param connection * @param creator * @param activationType Pool activation based on time or slot * @param maximumActivationDuration Maximum duration for pool to be activation after creation * @param minimumLockDuration Minimum duration for bought token be locked * @param maximumLockDuration Maximum duration for bought token to be locked * @param minimumVestingDuration Minimum duration for bought token to be vested * @param maximumVestingDuration Maximum duration for bought token be vested * @param vaultMode Vault mode: fcfs or prorata */ async function getPoolConfigByRequirement( connection: Connection, creator: PublicKey, activationType: ActivationType, maximumActivationDuration: number, minimumLockDuration: number, maximumLockDuration: number, minimumVestingDuration: number, maximumVestingDuration: number, vaultMode: VaultMode ) { // 1. Pool configs that can be used by anyone to create pool const publicPoolConfigs = await DynamicAmm.getPoolConfigsWithPoolCreatorAuthority( connection, PublicKey.default ); // 2. Pool configs that can only be used by specific pubkey to create pool const creatorPoolConfigs = await DynamicAmm.getPoolConfigsWithPoolCreatorAuthority( connection, creator ); // 3. Look for pool configs that have vault support const poolConfigsWithVaultSupport = [\ ...publicPoolConfigs,\ ...creatorPoolConfigs,\ ].filter((config) => config.account.vaultConfigKey != PublicKey.default); console.log( `Gotten ${poolConfigsWithVaultSupport.length} usable pool configs with vault support` ); const configFuture = vaultMode === VaultMode.FCFS ? AlphaVault.getFcfsConfigs(connection) : AlphaVault.getProrataConfigs(connection); const configs = await configFuture; for (const programAccount of poolConfigsWithVaultSupport) { const { account } = programAccount; // 3.1 Pool activation type and duration matches if ( account.activationType == activationType && account.activationDuration.toNumber() >= maximumActivationDuration ) { const vaultConfig = configs.find((c) => c.publicKey.equals(account.vaultConfigKey) ); if (!vaultConfig) { continue; } const startVestingDuration = vaultConfig.account.startVestingDuration.toNumber(); const endVestingDuration = vaultConfig.account.endVestingDuration.toNumber(); const vestingDuration = endVestingDuration - startVestingDuration; // 3.2 Vault activation type, lock and vesting duration matches if ( startVestingDuration >= minimumLockDuration && startVestingDuration <= maximumLockDuration && vestingDuration >= minimumVestingDuration && vestingDuration <= maximumVestingDuration && vaultConfig.account.activationType == activationType ) { return programAccount; } } } return null; } async function createDynamicPoolWithPermissionlessVault( connection: Connection, payer: Keypair ) { const { mintAInfo, mintBInfo } = await createDummyMints(connection, payer); // Pool and vault requirement const maximumActivationDuration = 86400; // 1 day const minimumLockDuration = 60 * 30; // 30 minutes const maximumLockDuration = 86400; // 1 day const minimumVestingDuration = 60 * 60; // 1 hour const maximumVestingDuration = 60 * 60 * 24 * 7; // 1 week const vaultMode = VaultMode.PRORATA; // 1. Find pool config where it allow user to create pool with customizable start trading time which start from NOW -> NOW + 24H // With lock duration fall between 30 minutes -> 1 days (non customizable) // And vesting duration fall between 1 hour -> 1 week (non customizable) // And prorata vault const poolConfig = await getPoolConfigByRequirement( connection, payer.publicKey, ActivationType.Timestamp, maximumActivationDuration, minimumLockDuration, maximumLockDuration, minimumVestingDuration, maximumVestingDuration, vaultMode ); console.log("Got pool config"); console.log(poolConfig); const clockAccount = await connection.getAccountInfo(SYSVAR_CLOCK_PUBKEY); const clock: Clock = ClockLayout.decode(clockAccount.data); // Pool start trade after created for 5 hour const activationPoint = clock.unixTimestamp.add(new BN(3600 * 5)); // 2. Create the pool const transactions = await DynamicAmm.createPermissionlessConstantProductPoolWithConfig2( connection, payer.publicKey, mintAInfo.mint, mintBInfo.mint, new BN(100_000_000), new BN(100_000_000), poolConfig.publicKey, { activationPoint, } ); console.log("Creating pool"); for (const tx of transactions) { const txHash = await sendAndConfirmTransaction(connection, tx, [payer]); console.log(txHash); } const poolPubkey = derivePoolAddressWithConfig( mintAInfo.mint, mintBInfo.mint, poolConfig.publicKey, DYNAMIC_AMM_PROGRAM_ID ); console.log("Pool created", poolPubkey.toBase58()); // 3. Create the alpha vault const initPermissionlessVaultTx = await AlphaVault.createPermissionlessVault( connection, { baseMint: mintAInfo.mint, quoteMint: mintBInfo.mint, poolType: PoolType.DYNAMIC, vaultMode: VaultMode.PRORATA, poolAddress: poolPubkey, config: poolConfig.account.vaultConfigKey, }, payer.publicKey ); console.log("Creating vault"); const txHash = await sendAndConfirmTransaction( connection, initPermissionlessVaultTx, [payer] ); console.log(txHash); } const connection = new Connection(clusterApiUrl("devnet")); const payer = loadKeypairFromFile(process.env.KEYPAIR_PATH); /** * This example shows how to create dynamic pool with permissionless vault * Please contact meteora team if the existing pool and vault config doesn't meet the requirement * Currently only dynamic pool support permissionless vault */ createDynamicPoolWithPermissionlessVault(connection, payer) .then(() => { console.log("Done"); }) .catch(console.error); **Note for token vesting period:** * `startVestingSlot = poolState.activationSlot + startVestingDuration` * `endVestingSlot = poolState.activationSlot + endVestingDuration` * `startVestingPoint`: Absolute value, the slot or timestamp that start vesting depend on the pool activation type. If no vesting is required, you should put this as 1 sec after the pool’s activationPoint * `endVestingPoint`: Absolute value, the slot or timestamp that end vesting depend on the pool activation type. If no vesting is required, this should be the same as startVestingPoint ### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#deposit-sol-or-usdc-into-alpha-vault) Deposit SOL or USDC into Alpha Vault This example shows how to deposit SOL or USDC into an Alpha Vault. Deposit can only happen before the end of the deposit period. Copy Ask AI import { clusterApiUrl, Connection, Keypair, PublicKey, sendAndConfirmTransaction, } from "@solana/web3.js"; import { loadKeypairFromFile } from "./utils"; import { AlphaVault } from "../alpha-vault"; import BN from "bn.js"; import dotenv from "dotenv"; dotenv.config(); async function depositToAlphaVault( vault: PublicKey, depositAmount: BN, payer: Keypair ) { const connection = new Connection(clusterApiUrl("devnet"), "confirmed"); const alphaVault = await AlphaVault.create(connection, vault); const depositTx = await alphaVault.deposit(depositAmount, payer.publicKey); console.log(`Depositing ${depositAmount.toString()}`); const txHash = await sendAndConfirmTransaction(connection, depositTx, [\ payer,\ ]); console.log(txHash); const escrow = await alphaVault.getEscrow(payer.publicKey); console.log("Escrow info"); console.log(escrow); } // Alpha vault to be deposited to const vault = new PublicKey("AxRoXRwQgxyaQBMwQsTRrtQ9i9Hd59BKNZBycTcYru5Z"); const depositAmount = new BN(100_000); const payer = loadKeypairFromFile(process.env.KEYPAIR_PATH); /** * This example shows how to deposit to alpha vault. Deposit can only happen before the deposit close. */ depositToAlphaVault(vault, depositAmount, payer) .then(() => { console.log("Done"); }) .catch(console.error); ### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#withdraw-sol-or-usdc-from-alpha-vault-during-deposit-period-only-for-pro-rata-mode) Withdraw SOL or USDC from Alpha Vault during deposit period (only for Pro rata mode) This example shows how to withdraw SOL or USDC from an Alpha Vault. Withdraw function only available before the end of the deposit period, and the function is applicable only when the Alpha Vault is using Pro rata mode. Copy Ask AI import { clusterApiUrl, Connection, Keypair, PublicKey, sendAndConfirmTransaction, } from "@solana/web3.js"; import { loadKeypairFromFile } from "./utils"; import { AlphaVault } from "../alpha-vault"; import BN from "bn.js"; import dotenv from "dotenv"; dotenv.config(); async function withdrawFromAlphaVault( vault: PublicKey, withdrawAmount: BN, payer: Keypair ) { const connection = new Connection(clusterApiUrl("devnet"), "confirmed"); const alphaVault = await AlphaVault.create(connection, vault); const withdrawTx = await alphaVault.withdraw(withdrawAmount, payer.publicKey); console.log(`Withdrawing ${withdrawAmount.toString()}`); const txHash = await sendAndConfirmTransaction(connection, withdrawTx, [\ payer,\ ]); console.log(txHash); const escrow = await alphaVault.getEscrow(payer.publicKey); console.log("Escrow info"); console.log(escrow); } // Alpha vault to be withdraw from const vault = new PublicKey("AxRoXRwQgxyaQBMwQsTRrtQ9i9Hd59BKNZBycTcYru5Z"); const withdrawAmount = new BN(100_000); const payer = loadKeypairFromFile(process.env.KEYPAIR_PATH); /** * This example shows how to withdraw from an alpha vault. Withdraw can only happen before the deposit close, * and it applicable only when the vault is in Prorata mode. */ withdrawFromAlphaVault(vault, withdrawAmount, payer) .then(() => { console.log("Done"); }) .catch(console.error); ### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#crank-alpha-vault-to-buy-tokens-from-a-dynamic-amm%2Fmemecoin-pool) Crank Alpha Vault to buy tokens from a Dynamic AMM/Memecoin pool This example shows how to crank an Alpha Vault to purchase the base token from the liquidity pool during the crank period. Alpha Vault would purchase tokens using the SOL or USDC deposited into the Alpha Vault earlier. Copy Ask AI import { clusterApiUrl, Connection, Keypair, PublicKey, sendAndConfirmTransaction, } from "@solana/web3.js"; import { loadKeypairFromFile } from "./utils"; import { AlphaVault } from "../alpha-vault"; import dotenv from "dotenv"; import { PoolType } from "../alpha-vault/type"; dotenv.config(); async function fillVaultWithDynamicAmm(vault: PublicKey, payer: Keypair) { const connection = new Connection(clusterApiUrl("devnet"), "confirmed"); const alphaVault = await AlphaVault.create(connection, vault); console.log( "Pool type: ", alphaVault.vault.poolType == PoolType.DYNAMIC ? "Dynamic AMM" : "DLMM" ); // Dynamic AMM require only single fill transaction const fillVaultWithDynamicAmmTransaction = await alphaVault.fillVault( payer.publicKey ); console.log("Fill vault with dynamic AMM"); const txHash = await sendAndConfirmTransaction( connection, fillVaultWithDynamicAmmTransaction, [payer] ); console.log(txHash); } // Alpha vault to be cranked const vault = new PublicKey("AxRoXRwQgxyaQBMwQsTRrtQ9i9Hd59BKNZBycTcYru5Z"); const payer = loadKeypairFromFile(process.env.KEYPAIR_PATH); /** * This example shows how to crank the vault to purchase base token from the pool, with deposited token from the vault. */ fillVaultWithDynamicAmm(vault, payer) .then(() => { console.log("Done"); }) .catch(console.error); ### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#crank-alpha-vault-to-buy-tokens-from-a-dlmm-pool) Crank Alpha Vault to buy tokens from a DLMM pool This example shows how to crank an Alpha Vault to purchase the base token from the liquidity pool during the crank period. Alpha Vault would purchase tokens using the SOL or USDC deposited into the Alpha Vault earlier. Typically, we have a keeper that cranks the Alpha Vault to automatically purchase tokens from the pool. However, if the auto-crank fails, you can visit this [fillVaultDlmm.ts](https://github.com/MeteoraAg/alpha-vault-sdk/blob/main/ts-client/src/examples/fillVaultDlmm.ts) and input your PublicKey. Copy Ask AI import { clusterApiUrl, Connection, Keypair, PublicKey, sendAndConfirmTransaction, } from "@solana/web3.js"; import { loadKeypairFromFile } from "./utils"; import { AlphaVault } from "../alpha-vault"; import dotenv from "dotenv"; import { PoolType, VaultMode } from "../alpha-vault/type"; dotenv.config(); async function fillVaultWithDlmm(vault: PublicKey, payer: Keypair) { const connection = new Connection(clusterApiUrl("devnet"), "confirmed"); const alphaVault = await AlphaVault.create(connection, vault); console.log( "Pool type: ", alphaVault.vault.poolType == PoolType.DYNAMIC ? "Dynamic AMM" : "DLMM" ); // DLMM require require one to many transactions while (true) { const fillVaultWithDLMMTransaction = await alphaVault.fillVault( payer.publicKey ); if (!fillVaultWithDLMMTransaction) { // Vault bought out the whole pool and still have remaining break; } console.log("Fill vault with DLMM"); const txHash = await sendAndConfirmTransaction( connection, fillVaultWithDLMMTransaction, [payer] ); console.log(txHash); await alphaVault.refreshState(); const inAmountCap = alphaVault.vault.vaultMode == VaultMode.FCFS ? alphaVault.vault.totalDeposit : alphaVault.vault.totalDeposit.lt(alphaVault.vault.maxBuyingCap) ? alphaVault.vault.totalDeposit : alphaVault.vault.maxBuyingCap; if (inAmountCap.eq(alphaVault.vault.swappedAmount)) { break; } } } // Alpha vault to be cranked const vault = new PublicKey("AxRoXRwQgxyaQBMwQsTRrtQ9i9Hd59BKNZBycTcYru5Z"); const payer = loadKeypairFromFile(process.env.KEYPAIR_PATH); /** * This example shows how to crank the vault to purchase base token from the pool, with deposited token from the vault. */ fillVaultWithDlmm(vault, payer) .then(() => { console.log("Done"); }) .catch(console.error); ### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#withdraw-unused-sol-or-usdc-from-alpha-vault-only-for-pro-rata-mode) Withdraw unused SOL or USDC from Alpha Vault (only for Pro rata mode) This example shows how to withdraw unused SOL or USDC deposit from an Alpha Vault after the Alpha Vault has completed the purchase of tokens from the liquidity pool. This is applicable only for Alpha Vault using Pro rata mode. Copy Ask AI import { clusterApiUrl, Connection, Keypair, PublicKey, sendAndConfirmTransaction, } from "@solana/web3.js"; import { loadKeypairFromFile } from "./utils"; import { AlphaVault } from "../alpha-vault"; import BN from "bn.js"; import dotenv from "dotenv"; dotenv.config(); async function withdrawRemainingFromAlphaVault( vault: PublicKey, payer: Keypair ) { const connection = new Connection(clusterApiUrl("devnet"), "confirmed"); const alphaVault = await AlphaVault.create(connection, vault); const withdrawRemainingTx = await alphaVault.withdrawRemainingQuote( payer.publicKey ); console.log(`Withdrawing unused fund`); const txHash = await sendAndConfirmTransaction( connection, withdrawRemainingTx, [payer] ); console.log(txHash); const escrow = await alphaVault.getEscrow(payer.publicKey); console.log("Escrow info"); console.log(escrow); } // Alpha vault to be withdraw / refund from const vault = new PublicKey("AxRoXRwQgxyaQBMwQsTRrtQ9i9Hd59BKNZBycTcYru5Z"); const payer = loadKeypairFromFile(process.env.KEYPAIR_PATH); /** * This example shows how to withdraw remaining unused deposit from an alpha vault after the vault done buying. */ withdrawRemainingFromAlphaVault(vault, payer) .then(() => { console.log("Done"); }) .catch(console.error); ### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#claim-tokens-from-alpha-vault) Claim Tokens from Alpha Vault This example shows how to claim tokens from an Alpha Vault after it has purchased those tokens from the liquidity pool. Claiming can only happen after the start of the vesting period. **Important Reminder**: Claim start time should NOT be earlier than Pool activation time For a new token launch, the project should ensure that token claiming from the Alpha Vault is NOT possible before the launch pool trading activation or before the token starts trading anywhere, whether on a Dynamic AMM or DLMM Pool. If users are able to claim tokens before the launch pool/token starts trading, they may create a separate market with a price that deviates from the project’s preferred launch price. Copy Ask AI import { clusterApiUrl, Connection, Keypair, PublicKey, sendAndConfirmTransaction, } from "@solana/web3.js"; import { loadKeypairFromFile } from "./utils"; import { AlphaVault } from "../alpha-vault"; import dotenv from "dotenv"; dotenv.config(); async function claimBoughtTokenFromAlphaVault( vault: PublicKey, payer: Keypair ) { const connection = new Connection(clusterApiUrl("devnet"), "confirmed"); const alphaVault = await AlphaVault.create(connection, vault); const claimTx = await alphaVault.claimToken(payer.publicKey); console.log("Claiming bought token"); const txHash = await sendAndConfirmTransaction(connection, claimTx, [payer]); console.log(txHash); const escrow = await alphaVault.getEscrow(payer.publicKey); console.log("Escrow info"); console.log(escrow); } // Alpha vault to be deposited to const vault = new PublicKey("AxRoXRwQgxyaQBMwQsTRrtQ9i9Hd59BKNZBycTcYru5Z"); const payer = loadKeypairFromFile(process.env.KEYPAIR_PATH); /** * This example shows how to claim bought token from an alpha vault. Claim can only happen when the vesting start. */ claimBoughtTokenFromAlphaVault(vault, payer) .then(() => { console.log("Done"); }) .catch(console.error); ### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#close-escrow-account) Close Escrow Account When a user deposits to the vault, it will create an escrow account, which stores the user info, such as deposit, claimed token, etc. Once user fully claims all tokens, they can close the escrow account. Close escrow can only happen after vesting of tokens is complete, and the escrow has claimed all the bought token. This example shows how to close an escrow account and get rental back. Copy Ask AI import { clusterApiUrl, Connection, Keypair, PublicKey, sendAndConfirmTransaction, } from "@solana/web3.js"; import { loadKeypairFromFile } from "./utils"; import { AlphaVault } from "../alpha-vault"; import dotenv from "dotenv"; dotenv.config(); async function closeEscrow(vault: PublicKey, payer: Keypair) { const connection = new Connection(clusterApiUrl("devnet"), "confirmed"); const alphaVault = await AlphaVault.create(connection, vault); const claimTx = await alphaVault.closeEscrow(payer.publicKey); console.log("Close escrow"); const txHash = await sendAndConfirmTransaction(connection, claimTx, [payer]); console.log(txHash); } // Alpha vault to be deposited to const vault = new PublicKey("AxRoXRwQgxyaQBMwQsTRrtQ9i9Hd59BKNZBycTcYru5Z"); const payer = loadKeypairFromFile(process.env.KEYPAIR_PATH); /** * This example shows how to close an escrow account and get rental back. Close escrow can only happen after vesting is complete, and escrow have claimed all the bought token. */ closeEscrow(vault, payer) .then(() => { console.log("Done"); }) .catch(console.error); [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#configure-alpha-vault-timings) Configure Alpha Vault Timings ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- If you are integrating the Alpha Vault program and need to view and select the predefined timings for the various phases, such as: * Deposit open time (only for FCFS mode currently) * Deposit close time * Vault crank/buy start time * Vault crank/buy end time * Withdraw unused USDC or SOL after crank is successful * Pool Activation time * Token claim start time * Vesting start time * Vesting end time There must be a ~1 hour 5 minutes period between the deposit close time and the pool activation time. You can use this config endpoint that has predefined timings created by Meteora. [DAMM v1 Pool Config List\ ------------------------\ \ View all available pool configurations for DAMM v1 Pools with Alpha Vault.](https://damm-api.meteora.ag/swagger-ui/#/pools/get_all_pool_configs) [DAMM v1 Vault Config List\ -------------------------\ \ Browse all vault configurations for DAMM v1 Pools with Alpha Vault.](https://damm-api.meteora.ag/swagger-ui/#/alpha_vault_config/get_all) [Launch Pools Config List\ ------------------------\ \ View all available pool configurations for Launch Pools.](https://github.com/MeteoraAg/meteora-pool-setup/tree/main/config) If your preferred configs are not available in the predefined config lists above, and you want more customization, please contact the Meteora team. ### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#config-endpoint-based-on-pool-activation-timing) Config endpoint based on Pool Activation Timing This config endpoint is tied to the pool activation timing, so all timings for the different Alpha Vault phases is derived from the pool activation timing. In this example below, the claim process will start 3600 seconds (1 hour) after pool activation, and it will end 7200 seconds (2 hours) after pool activation. In other words, after the pool starts trading, tokens are locked first and released for claiming 3600 seconds (1 hour) later. Copy Ask AI { maxBuyingCap: new BN(10000000), index, startVestingDuration: new BN(3600), endVestingDuration: new BN(7200), escrowFee: new BN(0), individualDepositingCap: new BN(50000), activationType: ActivationType.TIMESTAMP, depositingPoint: new BN(1028979080), } [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#considerations-for-slot-parameters) Considerations for Slot Parameters --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#slot-timeline-sequence) Slot Timeline Sequence #### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#alpha-vault-slot-progression) Alpha Vault Slot Progression d→j→p→a→s→ed \\rightarrow j \\rightarrow p \\rightarrow a \\rightarrow s \\rightarrow e d→j→p→a→s→e #### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#current-slot-condition) Current Slot Condition current\_slotcurrent\_slotj > \\text{current\\\_slot} j\>current\_slot j+750\=pj + 750 = p j+750\=p p+9000\=ap + 9000 = a p+9000\=a aae \\geq s > a e≥s\>a ### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#slot-to-timestamp-conversion) Slot-to-Timestamp Conversion 3000\=20minutes3000 = 20 minutes 3000\=20minutes 750\=5minutes750 = 5 minutes 750\=5minutes 9000\=1hour9000 = 1 hour 9000\=1hour **Note for Quote mint:** New endpoint only supports wSOL or USDC as Quote mint on mainnet. Devnet has more flexibility regarding the Quote mint; please reach out to the team. ### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#variable-definitions) Variable Definitions Where: * ddd = depositing\_slot * jjj = last\_join\_slot * ppp = pre\_activation\_slot * aaa = activation\_slot * sss = start\_vesting\_slot * eee = end\_vesting\_slot [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#important-reminders) Important Reminders --------------------------------------------------------------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#a-claim-start-time-should-not-be-earlier-than-pool-activation-time) A) Claim start time should NOT be earlier than Pool activation time For a new token launch, the project should ensure that token claiming from the Alpha Vault is NOT possible before the launch pool trading activation or before the token starts trading anywhere, whether on a Dynamic AMM or DLMM Pool. If users are able to claim tokens before the launch pool/token starts trading, they may create a separate market with a price that deviates from the project’s preferred launch price. ### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#b-for-memecoins-that-want-to-permanently-lock-liquidity%2C-lock-it-before-pool-activation-time) B) For Memecoins that want to permanently lock liquidity, lock it before Pool activation time If the Alpha Vault is used for a Memecoin launch pool, and the project wants to permanently lock liquidity in the Memecoin pool, they should ideally lock the liquidity BEFORE the pool starts trading, so that swap fees from locked liquidity are captured the second trading starts. In a scenario where: * The pool started trading - t0 * Liquidity gets deposited to the pool by the project, but not locked - t1 * Subsequently, that liquidity is permanently locked by the project - t2 The project will not be able to claim swap fees earned from t1 to t2, since fees from t1 to t2 are assigned to the LP token before the LP token gets permanently locked. When the LP token gets locked, the earlier fees are locked along with it. The project will only be able to claim swap fees from locked liquidity starting from t2. ### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#c-quote-token-must-be-sol-or-usdc) C) Quote token must be SOL or USDC Only SOL or USDC is accepted as the quote token when initializing a Dynamic AMM or DLMM Pool with Alpha Vault. ### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#d-for-permissionless-alpha-vault-any-wallet-can-deposit-%2C-is-there-a-way-to-set-an-individual-user-cap%3F) D) For permissionless Alpha Vault (any wallet can deposit), is there a way to set an individual user cap? Permissionless FCFS Alpha Vault allows you to set an individual cap, but this will be the same individual cap for everyone. ### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#e-if-no-vesting-is-required%2C-what-should-the-startvestingpoint-and-endvestingpoint-be%3F) E) If no vesting is required, what should the startVestingPoint and endVestingPoint be? * `startVestingPoint`: Absolute value, the slot or timestamp that start vesting depend on the pool activation type. If no vesting is required, you should put this as 1 sec after the pool’s `activationPoint` * `endVestingPoint`: Absolute value, the slot or timestamp that end vesting depend on the pool activation type. If no vesting is required, this should be the same as startVestingPoint ### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#f-how-do-you-determine-the-alpha-vault-deposit-close-time%3F) F) How do you determine the Alpha Vault deposit close time? **Crank start point (time when vault buys tokens from the pool):** * Timestamp-based: `Crank start point = activationPoint - 3600` * Slot-based: `Crank start point = activationPoint - 9000` **Vault deposit close point (time when vault deposits close):** * Timestamp-based Vault: `Deposit close point = Crank start point - 5 min` * Slot-based Vault: `Deposit close point = Crank start point - 750` Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/1-getting-started) [Alpha Vault With Whitelist\ \ Next](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist) On this page * [Example Timeline (Pro-rata Mode)](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#example-timeline-pro-rata-mode) * [Code Examples](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#code-examples) * [Create Dynamic Pool With Permissionless Alpha Vault](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#create-dynamic-pool-with-permissionless-alpha-vault) * [Deposit SOL or USDC into Alpha Vault](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#deposit-sol-or-usdc-into-alpha-vault) * [Withdraw SOL or USDC from Alpha Vault during deposit period (only for Pro rata mode)](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#withdraw-sol-or-usdc-from-alpha-vault-during-deposit-period-only-for-pro-rata-mode) * [Crank Alpha Vault to buy tokens from a Dynamic AMM/Memecoin pool](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#crank-alpha-vault-to-buy-tokens-from-a-dynamic-amm%2Fmemecoin-pool) * [Crank Alpha Vault to buy tokens from a DLMM pool](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#crank-alpha-vault-to-buy-tokens-from-a-dlmm-pool) * [Withdraw unused SOL or USDC from Alpha Vault (only for Pro rata mode)](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#withdraw-unused-sol-or-usdc-from-alpha-vault-only-for-pro-rata-mode) * [Claim Tokens from Alpha Vault](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#claim-tokens-from-alpha-vault) * [Close Escrow Account](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#close-escrow-account) * [Configure Alpha Vault Timings](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#configure-alpha-vault-timings) * [Config endpoint based on Pool Activation Timing](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#config-endpoint-based-on-pool-activation-timing) * [Considerations for Slot Parameters](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#considerations-for-slot-parameters) * [Slot Timeline Sequence](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#slot-timeline-sequence) * [Alpha Vault Slot Progression](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#alpha-vault-slot-progression) * [Current Slot Condition](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#current-slot-condition) * [Slot Constraints](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#slot-constraints) * [Required Program Parameters](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#required-program-parameters) * [User Submission Requirements](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#user-submission-requirements) * [Slot Calculation Guidelines](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#slot-calculation-guidelines) * [Recommended Calculation Sequence](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#recommended-calculation-sequence) * [Slot-to-Timestamp Conversion](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#slot-to-timestamp-conversion) * [Variable Definitions](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#variable-definitions) * [Important Reminders](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#important-reminders) * [A) Claim start time should NOT be earlier than Pool activation time](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#a-claim-start-time-should-not-be-earlier-than-pool-activation-time) * [B) For Memecoins that want to permanently lock liquidity, lock it before Pool activation time](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#b-for-memecoins-that-want-to-permanently-lock-liquidity%2C-lock-it-before-pool-activation-time) * [C) Quote token must be SOL or USDC](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#c-quote-token-must-be-sol-or-usdc) * [D) For permissionless Alpha Vault (any wallet can deposit), is there a way to set an individual user cap?](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#d-for-permissionless-alpha-vault-any-wallet-can-deposit-%2C-is-there-a-way-to-set-an-individual-user-cap%3F) * [E) If no vesting is required, what should the startVestingPoint and endVestingPoint be?](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#e-if-no-vesting-is-required%2C-what-should-the-startvestingpoint-and-endvestingpoint-be%3F) * [F) How do you determine the Alpha Vault deposit close time?](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist#f-how-do-you-determine-the-alpha-vault-deposit-close-time%3F) Assistant Responses are generated using AI and may contain mistakes. --- # DAMM v1 SDK Functions - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Typescript SDK DAMM v1 SDK Functions [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#create-pool-functions) Create Pool Functions ------------------------------------------------------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#createpermissionlessconstantproductpoolwithconfig) createPermissionlessConstantProductPoolWithConfig Creates a new permissionless constant product pool with a predefined configuration. **Function** Copy Ask AI async createPermissionlessConstantProductPoolWithConfig( connection: Connection, payer: PublicKey, tokenAMint: PublicKey, tokenBMint: PublicKey, tokenAAmount: BN, tokenBAmount: BN, config: PublicKey, opt?: { cluster?: Cluster; programId?: string; lockLiquidity?: boolean; swapLiquidity?: { inAmount: BN; minAmountOut: BN; }; skipAAta?: boolean; skipBAta?: boolean; } ): Promise **Parameters** Copy Ask AI connection: Connection // Solana connection instance payer: PublicKey // Wallet paying for the transaction tokenAMint: PublicKey // Mint address for token A tokenBMint: PublicKey // Mint address for token B tokenAAmount: BN // Initial amount of token A to deposit tokenBAmount: BN // Initial amount of token B to deposit config: PublicKey // The configuration account for the pool opt?: { // Optional parameters cluster?: Cluster; // The Solana cluster (mainnet, devnet, etc.) programId?: string; // Custom program ID if different from default lockLiquidity?: boolean; // Whether to permanently lock the initial liquidity swapLiquidity?: { // Optional swap parameters for initial liquidity inAmount: BN; // Amount to swap in minAmountOut: BN; // Minimum amount to receive from swap }; skipAAta?: boolean; // Skip creating associated token account for token A skipBAta?: boolean; // Skip creating associated token account for token B } **Returns** An array of transactions that can be signed and sent to the network. **Example** Copy Ask AI // Token A/B address of the pool. const tokenAMint = new PublicKey('...'); const tokenBMint = new PublicKey('...'); // Configuration address for the pool. It will decide the fees of the pool. const config = new PublicKey('...'); // Amount of token A and B to be deposited to the pool. const tokenAAmount = new BN(100_000); const tokenBAmount = new BN(500_000); const transactions = await AmmImpl.createPermissionlessConstantProductPoolWithConfig( provider.connection, wallet.publicKey, tokenAMint, tokenBMint, tokenAAmount, tokenBAmount, config, ); for (const transaction of transactions) { transaction.sign(wallet.payer); const txHash = await provider.connection.sendRawTransaction(transaction.serialize()); await provider.connection.confirmTransaction(txHash, 'finalized'); console.log('transaction %s', txHash); } **Notes** * Both token amounts must be greater than zero * If using native SOL, it will be automatically wrapped to wSOL * The `config` parameter should be a valid configuration account * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#createpermissionlessconstantproductpoolwithconfig2) createPermissionlessConstantProductPoolWithConfig2 Creates a new permissionless constant product pool with a predefined configuration. This function is similar to `createPermissionlessConstantProductPoolWithConfig` but only if you need to set the activation point earlier than the default derived from the config. **Function** Copy Ask AI async createPermissionlessConstantProductPoolWithConfig2( connection: Connection, payer: PublicKey, tokenAMint: PublicKey, tokenBMint: PublicKey, tokenAAmount: BN, tokenBAmount: BN, config: PublicKey, opt?: { cluster?: Cluster; programId?: string; lockLiquidity?: boolean; swapLiquidity?: { // always swap B to A inAmount: BN; minAmountOut: BN; }; stakeLiquidity?: { ratio?: Decimal; param: Omit; }; activationPoint?: BN; } ): Promise **Parameters** Copy Ask AI connection: Connection // Solana connection instance payer: PublicKey // Wallet paying for the transaction tokenAMint: PublicKey // Mint address for token A tokenBMint: PublicKey // Mint address for token B tokenAAmount: BN // Initial amount of token A to deposit tokenBAmount: BN // Initial amount of token B to deposit config: PublicKey // The configuration account for the pool opt?: { // Optional parameters cluster?: Cluster; // The Solana cluster (mainnet, devnet, etc.) programId?: string; // Custom program ID if different from default lockLiquidity?: boolean; // Whether to permanently lock the initial liquidity swapLiquidity?: { // Optional swap parameters for initial liquidity inAmount: BN; // Amount to swap in minAmountOut: BN; // Minimum amount to receive from swap }; stakeLiquidity?: { // Optional stake parameters for initial liquidity ratio?: Decimal; // Stake ratio param: Omit; // Stake parameters }; activationPoint?: BN; // Activation point for the pool } **Returns** An array of transactions that can be signed and sent to the network. **Example** Copy Ask AI // Token A/B address of the pool. const tokenAMint = new PublicKey('...'); const tokenBMint = new PublicKey('...'); // Configuration address for the pool. It will decide the fees of the pool. const config = new PublicKey('...'); // Amount of token A and B to be deposited to the pool. const tokenAAmount = new BN(100_000); const tokenBAmount = new BN(500_000); const startTime = 'now' // const startTime = new Date('2024-12-20T15:30:00Z').toISOString(); const transactions = await AmmImpl.createPermissionlessConstantProductPoolWithConfig2( provider.connection, wallet.publicKey, // payer tokenAMint, tokenBMint, tokenAAmount, tokenBAmount, config, { activationPoint: startTime !== 'now' ? new BN(Math.floor(new UTCDate(startTime).getTime() / 1000)) : undefined, }, ); for (const transaction of transactions) { transaction.sign(wallet.payer); const txHash = await provider.connection.sendRawTransaction(transaction.serialize()); await provider.connection.confirmTransaction(txHash, 'finalized'); console.log('transaction %s', txHash); } **Notes** * Both token amounts must be greater than zero * If using native SOL, it will be automatically wrapped to wSOL * The `config` parameter should be a valid configuration account * The `activationPoint` parameter is the timestamp in seconds since the Unix epoch. If you want to set it to the current time, you can use `'now'`. * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#createpermissionlesspool) createPermissionlessPool Creates a new permissionless constant product pool. **Function** Copy Ask AI async createPermissionlessPool( connection: Connection, payer: PublicKey, mintA: PublicKey, mintB: PublicKey, tokenAAmount: BN, tokenBAmount: BN, isStable: boolean, tradeFeeBps: BN, opt?: { programId?: string; skipAta?: boolean; } ): Promise **Parameters** Copy Ask AI connection: Connection // The Solana connection instance payer: PublicKey // The wallet paying for the transaction mintA: PublicKey // The mint address for token A mintB: PublicKey // The mint address for token B tokenAAmount: BN // Initial amount of token A to deposit tokenBAmount: BN // Initial amount of token B to deposit isStable: boolean // Whether the pool is stable tradeFeeBps: BN // Trade fee in basis points opt?: { // Optional parameters programId?: string; // Custom program ID if different from default skipAta?: boolean; // Skip creating associated token account for token A } **Returns** A transaction that can be signed and sent to the network. **Example** Copy Ask AI // Token A/B address of the pool. const tokenAMint = new PublicKey('...'); const tokenBMint = new PublicKey('...'); const tokenADecimal = 6; const tokenBDecimal = 6; const feeBps = new BN(1); // 0.01% // Get pool address const poolPubkey = derivePoolAddress( provider.connection, tokenAMint, tokenBMint, tokenADecimal, tokenBDecimal, true, // stable feeBps, ); // Create pool const transactions = await AmmImpl.createPermissionlessPool( provider.connection, wallet.publicKey, // payer tokenAMint, tokenBMint, tokenAAmount, tokenBAmount, true, // stable, feeBps, ); for (const transaction of transactions) { transaction.sign(wallet.payer); const txHash = await provider.connection.sendRawTransaction(transaction.serialize()); await provider.connection.confirmTransaction(txHash, 'finalized'); console.log('transaction %s', txHash); } **Notes** * Both token amounts must be greater than zero * If using native SOL, it will be automatically wrapped to wSOL * The `tradeFeeBps` parameter is the trade fee in basis points. * The `isStable` parameter is whether the pool is stable. * The `skipAta` parameter is whether to skip creating associated token account for token A. * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#createpermissionlessconstantproductmemecoinpoolwithconfig) createPermissionlessConstantProductMemecoinPoolWithConfig Creates a new permissionless constant product memecoin pool with a predefined configuration. **Function** Copy Ask AI async createPermissionlessConstantProductMemecoinPoolWithConfig( connection: Connection, payer: PublicKey, tokenAMint: PublicKey, tokenBMint: PublicKey, tokenAAmount: BN, tokenBAmount: BN, config: PublicKey, memecoinInfo: { isMinted?: boolean; keypair?: Keypair; payer?: PublicKey; assetData?: DataV2; mintAuthority?: PublicKey; freezeAuthority?: PublicKey | null; decimals?: number; mintAmount?: BN; }, opt?: { cluster?: Cluster; programId?: string; lockLiquidity?: boolean; swapLiquidity?: { inAmount: BN; minAmountOut: BN; }; stakeLiquidity?: { ratio?: Decimal; }; skipAAta?: boolean; skipBAta?: boolean; feeVault?: { secondsToFullUnlock: BN; topListLength: number; startFeeDistributeTimestamp: BN | null; unstakeLockDuration: BN; }; } ): Promise **Parameters** Copy Ask AI connection: Connection // Solana connection instance payer: PublicKey // Wallet paying for the transaction tokenAMint: PublicKey // Mint address for token A tokenBMint: PublicKey // Mint address for token B tokenAAmount: BN // Initial amount of token A to deposit tokenBAmount: BN // Initial amount of token B to deposit config: PublicKey // The configuration account for the pool memecoinInfo: { isMinted?: boolean; // Whether the memecoin is minted keypair?: Keypair; // Keypair for the memecoin payer?: PublicKey; // Payer for the memecoin assetData?: DataV2; // Asset data for the memecoin mintAuthority?: PublicKey; // Mint authority for the memecoin freezeAuthority?: PublicKey | null; // Freeze authority for the memecoin decimals?: number; // Decimals for the memecoin mintAmount?: BN; // Mint amount } opt?: { // Optional parameters cluster?: Cluster; // The Solana cluster (mainnet, devnet, etc.) programId?: string; // Custom program ID if different from default lockLiquidity?: boolean; // Whether to permanently lock the initial liquidity swapLiquidity?: { // Optional swap parameters for initial liquidity inAmount: BN; // Amount to swap in minAmountOut: BN; // Minimum amount to receive from swap }; stakeLiquidity?: { // Optional stake parameters for initial liquidity ratio?: Decimal; // Stake ratio }; skipAAta?: boolean; // Skip creating associated token account for token A skipBAta?: boolean; // Skip creating associated token account for token B feeVault?: { secondsToFullUnlock: BN; // Seconds to full unlock topListLength: number; // Top list length startFeeDistributeTimestamp: BN | null; // Start fee distribute timestamp unstakeLockDuration: BN; // Unstake lock duration }; } **Returns** An array of transactions that can be signed and sent to the network. **Example** Copy Ask AI // Token A/B address of the pool. const memecoinMint = new PublicKey('...'); const tokenBMint = new PublicKey('...'); const memecoinAmount = new BN(100_000); const tokenBAmount = new BN(500_000); // Create pool const programId = new PublicKey(PROGRAM_ID); const CONFIG_KEY = new PublicKey('...'); const feeConfigurations = await AmmImpl.getFeeConfigurations(provider.connection, { programId, }); const feeConfig = feeConfigurations.find(({ publicKey }) => publicKey.equals(CONFIG_KEY)); // Create pool const transactions = await AmmImpl.createPermissionlessConstantProductMemecoinPoolWithConfig( provider.connection, wallet.publicKey, // payer memecoinMint, tokenBMint, memecoinAmount, tokenBAmount, feeConfig.publicKey, { isMinted: true }, ); for (const transaction of transactions) { transaction.sign(wallet.payer); const txHash = await provider.connection.sendRawTransaction(transaction.serialize()); await provider.connection.confirmTransaction(txHash, 'finalized'); console.log('transaction %s', txHash); } **Notes** * Both token amounts must be greater than zero * If using native SOL, it will be automatically wrapped to wSOL * The `memecoinInfo` parameter is the information for the memecoin. * The `feeVault` parameter is the information for the fee vault. * * * [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#state-functions) State Functions ------------------------------------------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#getlpsupply) getLpSupply Get the total supply of the pool. **Function** Copy Ask AI async getLpSupply(): Promise **Returns** The total supply of the pool. **Example** Copy Ask AI const lpSupply = await pool.getLpSupply(); **Notes** * The `pool` parameter is the instance of the pool. * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#getuserbalance) getUserBalance Get the balance of a user in the pool. **Function** Copy Ask AI async getUserBalance(owner: PublicKey): Promise **Parameters** Copy Ask AI owner: PublicKey // The owner of the pool **Returns** The balance of the user in the pool. **Example** Copy Ask AI const userLpBalance = await pool.getUserBalance(wallet.publicKey); **Notes** * The `pool` parameter is the instance of the pool. * The `owner` parameter is the address of the user. * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#getswapquote) getSwapQuote Get the swap quote for a given amount of token. **Function** Copy Ask AI getSwapQuote( inTokenMint: PublicKey, inAmountLamport: BN, slippage: number, swapInitiator?: PublicKey ): Promise<{ swapInAmount: BN; swapOutAmount: BN; minSwapOutAmount: BN; fee: BN; priceImpact: Decimal; }> **Parameters** Copy Ask AI inTokenMint: PublicKey, // Mint address for the input token inAmountLamport: BN, // Amount of input token to swap slippage: number, // Slippage tolerance swapInitiator?: PublicKey // Optional swap initiator **Returns** The swap quote containing the following parameters: Copy Ask AI { swapInAmount: BN; swapOutAmount: BN; minSwapOutAmount: BN; fee: BN; priceImpact: Decimal; } **Example** Copy Ask AI const slippage = 0.1; // Max to 2 decimal place const inAmountLamport = new BN(0.1 * 10 ** pool.tokenB.decimals); const { swapInAmount, swapOutAmount, minSwapOutAmount, fee, priceImpact } = await pool.getSwapQuote( new PublicKey(pool.tokenB.address), inAmountLamport, slippage, // 0.01 ); **Notes** * The `inTokenMint` parameter is the mint address of the input token. * The `inAmountLamport` parameter is the amount of input token to swap. * The `slippage` parameter is the slippage tolerance. * The `swapInitiator` parameter is the address of the swap initiator. * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#getdepositquote) getDepositQuote Get the deposit quote for a given amount of token. **Function** Copy Ask AI getDepositQuote( tokenAInAmount: BN, tokenBInAmount: BN, balance: boolean, slippage: number ): Promise **Parameters** Copy Ask AI tokenAInAmount: BN, // Amount of token A to deposit tokenBInAmount: BN, // Amount of token B to deposit balance: boolean, // Whether to use the balance of the user slippage: number // Slippage tolerance **Returns** The deposit quote containing the following parameters: Copy Ask AI { poolTokenAmountOut: BN; minPoolTokenAmountOut: BN; tokenAInAmount: BN; tokenBInAmount: BN; } **Example** Copy Ask AI const balance = true; const slippage = 0.1; // Max to 2 decimal place const inAmountALamport = new BN(1 * 10 ** pool.tokenAMint.decimals); const { poolTokenAmountOut, minPoolTokenAmountOut, tokenAInAmount, tokenBInAmount } = pool.getDepositQuote( inAmountALamport, new BN(0), balance, slippage, ); **Notes** * The `tokenAInAmount` parameter is the amount of token A to deposit. * The `tokenBInAmount` parameter is the amount of token B to deposit. * The `balance` parameter is whether to use the balance of the user. * The `slippage` parameter is the slippage tolerance. * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#getwithdrawquote) getWithdrawQuote Get the withdraw quote for a given amount of pool token. **Function** Copy Ask AI getWithdrawQuote( withdrawTokenAmount: BN, slippage: number, tokenMint?: PublicKey ): Promise **Parameters** Copy Ask AI withdrawTokenAmount: BN, // Amount of pool token to withdraw slippage: number, // Slippage tolerance tokenMint?: PublicKey // Optional mint address for the token **Returns** The withdraw quote containing the following parameters: Copy Ask AI { poolTokenAmountIn: BN; minTokenAOutAmount: BN; minTokenBOutAmount: BN; tokenAOutAmount: BN; tokenBOutAmount: BN; } **Example** Copy Ask AI const slippage = 0.1; // Max to 2 decimal place const outTokenAmountLamport = new BN(0.1 * 10 ** pool.decimals); const { poolTokenAmountIn, minTokenAOutAmount, minTokenBOutAmount, tokenAOutAmount, tokenBOutAmount } = pool.getWithdrawQuote( outTokenAmountLamport, slippage, ); **Notes** * The `withdrawTokenAmount` parameter is the amount of pool token to withdraw. * The `slippage` parameter is the slippage tolerance. * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#updatestate) updateState Update the state of the pool. **Function** Copy Ask AI updateState() **Returns** No return value. **Example** Copy Ask AI await pool.updateState(); **Notes** * The `pool` parameter is the instance of the pool. * * * [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#pool-functions) Pool Functions ----------------------------------------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#deposit) deposit Deposit tokens into the pool. **Function** Copy Ask AI async deposit( owner: PublicKey, tokenAInAmount: BN, tokenBInAmount: BN, poolTokenAmount: BN, ): Promise **Parameters** Copy Ask AI owner: PublicKey, // The owner of the pool tokenAInAmount: BN, // Amount of token A to deposit tokenBInAmount: BN, // Amount of token B to deposit poolTokenAmount: BN, // Amount of pool token to deposit **Returns** The transaction that can be signed and sent to the network. **Example** Copy Ask AI const balance = true; const slippage = 0.1; // Max to 2 decimal place const inAmountALamport = new BN(1 * 10 ** constantProductPool.tokenAMint.decimals); // Get deposit quote const { poolTokenAmountOut, tokenAInAmount, tokenBInAmount } = pool.getDepositQuote( inAmountALamport, new BN(0), balance, slippage, ); const depositTx = await pool.deposit( wallet.publicKey, tokenAInAmount, tokenBInAmount, poolTokenAmountOut, ); const depositResult = await provider.sendAndConfirm(depositTx); **Notes** * The `owner` parameter is the address of the owner. * The `tokenAInAmount` parameter is the amount of token A to deposit. * The `tokenBInAmount` parameter is the amount of token B to deposit. * The `poolTokenAmount` parameter is the amount of pool token to deposit. * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#withdraw) withdraw Withdraw tokens from the pool. **Function** Copy Ask AI async withdraw( owner: PublicKey, lpTokenAmount: BN, tokenAOutAmount: BN, tokenBOutAmount: BN, ): Promise **Parameters** Copy Ask AI owner: PublicKey, // The owner of the pool lpTokenAmount: BN, // Amount of pool token to withdraw tokenAOutAmount: BN, // Amount of token A to withdraw tokenBOutAmount: BN, // Amount of token B to withdraw **Returns** The transaction that can be signed and sent to the network. **Example** Copy Ask AI const slippage = 0.1; const outTokenAmountLamport = new BN(0.1 * 10 ** pool.decimals); const { poolTokenAmountIn, tokenAOutAmount, tokenBOutAmount } = pool.getWithdrawQuote( outTokenAmountLamport, slippage, ); const withdrawTx = await pool.withdraw( wallet.publicKey, poolTokenAmountIn, tokenAOutAmount, tokenBOutAmount, ); const withdrawResult = await provider.sendAndConfirm(withdrawTx); **Notes** * The `owner` parameter is the address of the owner. * The `lpTokenAmount` parameter is the amount of pool token to withdraw. * The `tokenAOutAmount` parameter is the amount of token A to withdraw. * The `tokenBOutAmount` parameter is the amount of token B to withdraw. * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#swap) swap Swap tokens in the pool. **Function** Copy Ask AI async swap( owner: PublicKey, inTokenMint: PublicKey, inAmountLamport: BN, outAmountLamport: BN, referralOwner?: PublicKey, ): Promise **Parameters** Copy Ask AI owner: PublicKey, // The owner of the pool inTokenMint: PublicKey, // Mint address for the input token inAmountLamport: BN, // Amount of input token to swap outAmountLamport: BN, // Amount of output token to receive referralOwner?: PublicKey // Optional referral owner **Returns** The transaction that can be signed and sent to the network. **Example** Copy Ask AI const slippage = 0.1; const inAmountLamport = new BN(0.1 * 10 ** pool.tokenB.decimals); const { minSwapOutAmount } = pool.getSwapQuote( new PublicKey(pool.tokenB.address), inAmountLamport, slippage, ); const swapTx = await pool.swap( mockWallet.publicKey, new PublicKey(pool.tokenB.address), inAmountLamport, minSwapOutAmount, ); const swapResult = await provider.sendAndConfirm(swapTx); **Notes** * The `owner` parameter is the address of the owner. * The `inTokenMint` parameter is the mint address of the input token. * The `inAmountLamport` parameter is the amount of input token to swap. * The `outAmountLamport` parameter is the amount of output token to receive. * The `referralOwner` parameter is the address of the referral owner. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/1-getting-started) [DAMM v1 Scripts\ \ Next](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/3-damm-v1-scripts) On this page * [Create Pool Functions](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#create-pool-functions) * [createPermissionlessConstantProductPoolWithConfig](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#createpermissionlessconstantproductpoolwithconfig) * [createPermissionlessConstantProductPoolWithConfig2](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#createpermissionlessconstantproductpoolwithconfig2) * [createPermissionlessPool](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#createpermissionlesspool) * [createPermissionlessConstantProductMemecoinPoolWithConfig](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#createpermissionlessconstantproductmemecoinpoolwithconfig) * [State Functions](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#state-functions) * [getLpSupply](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#getlpsupply) * [getUserBalance](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#getuserbalance) * [getSwapQuote](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#getswapquote) * [getDepositQuote](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#getdepositquote) * [getWithdrawQuote](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#getwithdrawquote) * [updateState](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#updatestate) * [Pool Functions](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#pool-functions) * [deposit](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#deposit) * [withdraw](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#withdraw) * [swap](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/2-damm-v1-sdk-functions#swap) Assistant Responses are generated using AI and may contain mistakes. --- # Alpha Vault With Whitelist - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Typescript SDK Alpha Vault With Whitelist [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Below we provide the steps to use the Alpha Vault Typescript SDK to create an Alpha Vault with Whitelist. Permissioned Alpha Vault has whitelist and individual deposit cap, so only whitelisted addresses can deposit into the vault, up to the deposit cap defined for the wallet. [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#example-timeline-pro-rata-mode) Example Timeline (Pro rata mode) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ![Alpha Vault With Whitelist](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/developer-guide/alpha-vault/alpha-vault-with-whitelist.png) [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#code-examples) Code Examples ------------------------------------------------------------------------------------------------------------------------------------------------ ### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#main-steps) Main Steps This example demonstrates how to use the permissioned Alpha Vault to achieve authorization of user deposit with whitelisted wallet and deposit cap. 1. Update address and deposit cap. Check `whitelist_wallet.csv`. 2. Create a pool with permissioned vault. Check `createDynamicPoolWithPermissionedVault.ts` for more details. 3. Generate merkle tree, and create merkle root config. Check `createMerkleRootConfig.ts` for more details. 4. Deposit with merkle proof. Check `depositWithProof.ts` for more details. ### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#create-permissioned-alpha-vault-with-whitelist-and-individual-deposit-cap) Create Permissioned Alpha Vault with Whitelist and Individual Deposit Cap This example shows how to create a Dynamic AMM Pool with permissioned Alpha Vault (that has a whitelist and deposit cap). Currently only Dynamic AMM Pool support permissioned Alpha Vault with whitelist and deposit cap. Please contact the Meteora team if the existing pool and Alpha Vault config don’t meet your requirements. Copy Ask AI import { clusterApiUrl, Connection, Keypair, PublicKey, sendAndConfirmTransaction, SYSVAR_CLOCK_PUBKEY, } from "@solana/web3.js"; import AlphaVault, { DYNAMIC_AMM_PROGRAM_ID, PoolType, VaultMode } from "../.."; import DynamicAmm from "@meteora-ag/dynamic-amm-sdk"; import { ActivationType, Clock, ClockLayout, createTokenAndMint, loadKeypairFromFile, } from "../utils"; import dotenv from "dotenv"; import { BN } from "bn.js"; import { derivePoolAddressWithConfig } from "@meteora-ag/dynamic-amm-sdk/dist/cjs/src/amm/utils"; dotenv.config(); async function createDummyMints(connection: Connection, payer: Keypair) { console.log("Creating mint A"); const mintAInfo = await createTokenAndMint( connection, payer, 6, 100_000_000_000 ); console.log("Creating mint B"); const mintBInfo = await createTokenAndMint( connection, payer, 6, 100_000_000_000 ); return { mintAInfo, mintBInfo, }; } /** * @param connection * @param creator * @param activationType Pool activation based on time or slot * @param maximumActivationDuration Maximum duration for pool to be activation after creation * @param minimumLockDuration Minimum duration for bought token be locked * @param maximumLockDuration Maximum duration for bought token to be locked * @param minimumVestingDuration Minimum duration for bought token to be vested * @param maximumVestingDuration Maximum duration for bought token be vested * @param vaultMode Vault mode: fcfs or prorata */ async function getPoolConfigByRequirement( connection: Connection, creator: PublicKey, activationType: ActivationType, maximumActivationDuration: number, minimumLockDuration: number, maximumLockDuration: number, minimumVestingDuration: number, maximumVestingDuration: number, vaultMode: VaultMode ) { // 1. Pool configs that can be used by anyone to create pool const publicPoolConfigs = await DynamicAmm.getPoolConfigsWithPoolCreatorAuthority( connection, PublicKey.default ); // 2. Pool configs that can only be used by specific pubkey to create pool const creatorPoolConfigs = await DynamicAmm.getPoolConfigsWithPoolCreatorAuthority( connection, creator ); // 3. Look for pool configs that have vault support const poolConfigsWithVaultSupport = [\ ...publicPoolConfigs,\ ...creatorPoolConfigs,\ ].filter((config) => config.account.vaultConfigKey != PublicKey.default); console.log( `Gotten ${poolConfigsWithVaultSupport.length} usable pool configs with vault support` ); const configFuture = vaultMode === VaultMode.FCFS ? AlphaVault.getFcfsConfigs(connection) : AlphaVault.getProrataConfigs(connection); const configs = await configFuture; for (const programAccount of poolConfigsWithVaultSupport) { const { account } = programAccount; // 3.1 Pool activation type and duration matches if ( account.activationType == activationType && account.activationDuration.toNumber() >= maximumActivationDuration ) { const vaultConfig = configs.find((c) => c.publicKey.equals(account.vaultConfigKey) ); if (!vaultConfig) { continue; } const startVestingDuration = vaultConfig.account.startVestingDuration.toNumber(); const endVestingDuration = vaultConfig.account.endVestingDuration.toNumber(); const vestingDuration = endVestingDuration - startVestingDuration; // 3.2 Vault activation type, lock and vesting duration matches if ( startVestingDuration >= minimumLockDuration && startVestingDuration <= maximumLockDuration && vestingDuration >= minimumVestingDuration && vestingDuration <= maximumVestingDuration && vaultConfig.account.activationType == activationType ) { return programAccount; } } } return null; } async function createDynamicPoolWithPermissionedVault( connection: Connection, payer: Keypair ) { const { mintAInfo, mintBInfo } = await createDummyMints(connection, payer); // Pool and vault requirement const maximumActivationDuration = 86400; // 1 day const minimumLockDuration = 60 * 30; // 30 minutes const maximumLockDuration = 86400; // 1 day const minimumVestingDuration = 60 * 60; // 1 hour const maximumVestingDuration = 60 * 60 * 24 * 7; // 1 week const vaultMode = VaultMode.PRORATA; // 1.Find pool config where it allow user to create pool with customizable start trading time which start from NOW -> NOW + 24H // With lock duration fall between 30 minutes -> 1 days (non customizable) // And vesting duration fall between 1 hour -> 1 week (non customizable) // And prorata vault const poolConfig = await getPoolConfigByRequirement( connection, payer.publicKey, ActivationType.Timestamp, maximumActivationDuration, minimumLockDuration, maximumLockDuration, minimumVestingDuration, maximumVestingDuration, vaultMode ); console.log("Got pool config"); console.log(poolConfig); const clockAccount = await connection.getAccountInfo(SYSVAR_CLOCK_PUBKEY); const clock: Clock = ClockLayout.decode(clockAccount.data); // Pool start trade after created for 5 hour const activationPoint = clock.unixTimestamp.add(new BN(3600 * 5)); // 2. Create the pool const transactions = await DynamicAmm.createPermissionlessConstantProductPoolWithConfig2( connection, payer.publicKey, mintAInfo.mint, mintBInfo.mint, new BN(100_000_000), new BN(100_000_000), poolConfig.publicKey, { activationPoint, } ); console.log("Creating pool"); for (const tx of transactions) { const txHash = await sendAndConfirmTransaction(connection, tx, [payer]); console.log(txHash); } const poolPubkey = derivePoolAddressWithConfig( mintAInfo.mint, mintBInfo.mint, poolConfig.publicKey, DYNAMIC_AMM_PROGRAM_ID ); console.log("Pool created", poolPubkey.toBase58()); // 3. Create the alpha vault const initPermissionlessVaultTx = await AlphaVault.createPermissionedVault( connection, { baseMint: mintAInfo.mint, quoteMint: mintBInfo.mint, poolType: PoolType.DYNAMIC, vaultMode: VaultMode.PRORATA, poolAddress: poolPubkey, config: poolConfig.account.vaultConfigKey, }, payer.publicKey ); console.log("Creating vault"); const txHash = await sendAndConfirmTransaction( connection, initPermissionlessVaultTx, [payer] ); console.log(txHash); } const connection = new Connection(clusterApiUrl("devnet")); const payer = loadKeypairFromFile(process.env.KEYPAIR_PATH); /** * This example shows how to create dynamic pool with permissioned vault * Please contact meteora team if the existing pool and vault config doesn't meet the requirement * Currently only dynamic pool support permissioned vault */ createDynamicPoolWithPermissionedVault(connection, payer) .then(() => { console.log("Done"); }) .catch(console.error); ### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#whitelisted-wallet-csv-file-example) Whitelisted Wallet CSV File Example Reference: [whitelist\_wallet.csv](https://github.com/MeteoraAg/meteora-pool-setup/blob/main/config/whitelist_wallet.csv) ### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#whitelist-modes) Whitelist Modes #### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#without-whitelist) Without Whitelist * **Permissionless:** No whitelist, anyone can deposit into the Alpha Vault #### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#with-whitelist) With Whitelist * **`PermissionWithAuthority`** - In this mode, only the Alpha Vault creator can create escrow account with max\_cap. This allows the creator to easily use a permissioned (with whitelist) setup without having to use the merkle tree. Creator needs to pay SOL rent for each escrow account for the whitelisted wallets, so this Alpha Vault whitelist mode is suitable for scenarios where there are very few whitelisted addresses `(e.g. <=100)`. If they need to support a lot more whitelisted addresses, they should still use the merkle tree (PermissionWithMerkleProof whitelist mode). * **`PermissionWithMerkleProof`** - In this mode, only wallets that are whitelisted can deposit into the Alpha Vault. CSV file containing the list of whitelisted wallets needs to be provided by the project to Meteora, for the Merkle proof to be hosted by Meteora and shown on the UI. Alpha Vault deposits should not open until the Merkle proof is hosted by Meteora. ### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#create-merkle-root-config) Create Merkle Root Config This example shows how to create a merkle root config after generating a merkle tree, which is required to verify the whitelisted wallet address data, and enable deposits by whitelisted wallets. Copy Ask AI import { clusterApiUrl, Connection, Keypair, PublicKey, sendAndConfirmTransaction, } from "@solana/web3.js"; import { loadKeypairFromFile } from "../utils"; import { AlphaVault } from "../../alpha-vault"; import dotenv from "dotenv"; import { createMerkleTree, loadWhitelistWalletCsv } from "./utils"; import { BN } from "bn.js"; dotenv.config(); async function createMerkleRootConfig( vault: PublicKey, csvPath: string, payer: Keypair ) { const connection = new Connection(clusterApiUrl("devnet"), "confirmed"); const alphaVault = await AlphaVault.create(connection, vault); // 1. Load whitelist wallet from csv file const whitelistWallets = await loadWhitelistWalletCsv(csvPath); console.log("Loaded whitelist wallets"); console.log(whitelistWallets); // 2. Create merkle tree const tree = await createMerkleTree(connection, alphaVault, whitelistWallets); // 3. Create merkle root config // If the tree grew too large, one can partition it into multiple tree by setting different version const version = new BN(0); const createMerkleRootConfigTx = await alphaVault.createMerkleRootConfig( tree.getRoot(), version, payer.publicKey ); // 4. Send transaction console.log("Sending transaction"); const txHash = await sendAndConfirmTransaction( connection, createMerkleRootConfigTx, [payer] ); console.log(txHash); } // Permissioned alpha vault const vault = new PublicKey("ARGqVVUPPqtqH9UeBHvYsv7AtZv623YdEaEziZ1pdDUs"); const payer = loadKeypairFromFile(process.env.KEYPAIR_PATH); const whitelistWalletCsvFilepath = "src/examples/permissioned/whitelist_wallet.csv"; /** * This example shows how to create merkle root config for permissioned alpha vault */ createMerkleRootConfig(vault, whitelistWalletCsvFilepath, payer) .then(() => { console.log("Done"); }) .catch(console.error); ### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#deposit-sol-or-usdc-with-proof) Deposit SOL or USDC with Proof This example shows how to deposit into a permissioned alpha vault using a whitelisted wallet. Deposit can only happen before the end of the deposit period. Copy Ask AI import { clusterApiUrl, Connection, Keypair, PublicKey, sendAndConfirmTransaction, } from "@solana/web3.js"; import { loadKeypairFromFile } from "../utils"; import { AlphaVault } from "../../alpha-vault"; import BN from "bn.js"; import dotenv from "dotenv"; import Decimal from "decimal.js"; import { deriveMerkleRootConfig } from "../../alpha-vault/helper"; import { createMerkleTree, loadWhitelistWalletCsv } from "./utils"; import { PROGRAM_ID } from "../../alpha-vault/constant"; dotenv.config(); async function depositToPermissionedAlphaVault( vault: PublicKey, depositAmount: BN, csvPath: string, payer: Keypair ) { const connection = new Connection(clusterApiUrl("devnet"), "confirmed"); const alphaVault = await AlphaVault.create(connection, vault); // 1. Load whitelisted wallet const whitelistedWallets = await loadWhitelistWalletCsv(csvPath); // 2. Create merkle tree const tree = await createMerkleTree( connection, alphaVault, whitelistedWallets ); // 3. Get wallet proof info const depositorWhitelistInfo = whitelistedWallets.find((w) => w.wallet.equals(payer.publicKey) ); const quoteMint = await connection.getTokenSupply(alphaVault.vault.quoteMint); const toNativeAmountMultiplier = new Decimal(10 ** quoteMint.value.decimals); const nativeDepositCap = new BN( depositorWhitelistInfo.depositCap.mul(toNativeAmountMultiplier).toString() ); const depositorProof = tree .getProof(payer.publicKey, nativeDepositCap) .map((buffer) => { return Array.from(new Uint8Array(buffer)); }); const [merkleRootConfig] = deriveMerkleRootConfig( alphaVault.pubkey, new BN(0), new PublicKey(PROGRAM_ID["mainnet-beta"]) ); // 4. Deposit const depositTx = await alphaVault.deposit(depositAmount, payer.publicKey, { merkleRootConfig, maxCap: nativeDepositCap, proof: depositorProof, }); console.log(`Depositing ${depositAmount.toString()}`); const txHash = await sendAndConfirmTransaction(connection, depositTx, [\ payer,\ ]); console.log(txHash); const escrow = await alphaVault.getEscrow(payer.publicKey); console.log("Escrow info"); console.log(escrow); } // Alpha vault to be deposited to const vault = new PublicKey("ARGqVVUPPqtqH9UeBHvYsv7AtZv623YdEaEziZ1pdDUs"); const depositAmount = new BN(100_000); const payer = loadKeypairFromFile(process.env.KEYPAIR_PATH); const whitelistWalletCsvFilepath = "src/examples/permissioned/whitelist_wallet.csv"; /** * This example shows how to deposit to permissioned alpha vault. Deposit can only happen before the deposit close. */ depositToPermissionedAlphaVault( vault, depositAmount, whitelistWalletCsvFilepath, payer ) .then(() => { console.log("Done"); }) .catch(console.error); [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#configure-alpha-vault-timings) Configure Alpha Vault Timings -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- If you are integrating the Alpha Vault program and need to view and select the predefined timings for the various phases, such as: * Deposit open time (only for FCFS mode currently) * Deposit close time * Vault crank/buy start time * Vault crank/buy end time * Withdraw unused USDC or SOL after crank is successful * Pool Activation time * Token claim start time * Vesting start time * Vesting end time There must be a ~1 hour 5 minutes period between the deposit close time and the pool activation time. You can use this config endpoint that has predefined timings created by Meteora. [DAMM v1 Pool Config List\ ------------------------\ \ View all available pool configurations for DAMM v1 Pools with Alpha Vault.](https://damm-api.meteora.ag/swagger-ui/#/pools/get_all_pool_configs) [DAMM v1 Vault Config List\ -------------------------\ \ Browse all vault configurations for DAMM v1 Pools with Alpha Vault.](https://damm-api.meteora.ag/swagger-ui/#/alpha_vault_config/get_all) [Launch Pools Config List\ ------------------------\ \ View all available pool configurations for Launch Pools.](https://github.com/MeteoraAg/meteora-pool-setup/tree/main/config) If your preferred configs are not available in the predefined config lists above, and you want more customization, please contact the Meteora team. ### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#config-endpoint-based-on-pool-activation-timing) Config Endpoint Based on Pool Activation Timing The above config endpoint is tied to the pool activation timing, so all timings for the different Alpha Vault phases is derived from the pool activation timing. In this example below, the claim process will start 3600 seconds (1 hour) after pool activation, and it will end 7200 seconds (2 hours) after pool activation. In other words, after the pool starts trading, tokens are locked first and released for claiming 3600 seconds (1 hour) later. Copy Ask AI { maxBuyingCap: new BN(10000000), index: 0, startVestingDuration: new BN(3600), endVestingDuration: new BN(7200), escrowFee: new BN(0), individualDepositingCap: new BN(50000), activationType: ActivationType.TIMESTAMP, depositingPoint: new BN(1028979080), } [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#important-reminders) Important Reminders ------------------------------------------------------------------------------------------------------------------------------------------------------------ ### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#a-claim-start-time-should-not-be-earlier-than-pool-activation-time) A) Claim start time should NOT be earlier than Pool activation time For a new token launch, the project should ensure that token claiming from the Alpha Vault is NOT possible before the launch pool trading activation or before the token starts trading anywhere, whether on a Dynamic AMM or DLMM Pool. If users are able to claim tokens before the launch pool/token starts trading, they may create a separate market with a price that deviates from the project’s preferred launch price. ### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#b-for-memecoins-that-want-to-permanently-lock-liquidity%2C-lock-it-before-pool-activation-time) B) For Memecoins that want to permanently lock liquidity, lock it before Pool activation time If the Alpha Vault is used for a Memecoin launch pool, and the project wants to permanently lock liquidity in the Memecoin pool, they should ideally lock the liquidity BEFORE the pool starts trading, so that swap fees from locked liquidity are captured the second trading starts. In a scenario where: * The pool started trading - t0 * Liquidity gets deposited to the pool by the project, but not locked - t1 * Subsequently, that liquidity is permanently locked by the project - t2 The project will not be able to claim swap fees earned from t1 to t2, since fees from t1 to t2 are assigned to the LP token before the LP token gets permanently locked. When the LP token gets locked, the earlier fees are locked along with it. The project will only be able to claim swap fees from locked liquidity starting from t2. ### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#c-quote-token-must-be-sol-or-usdc) C) Quote token must be SOL or USDC Only SOL or USDC is accepted as the quote token when initializing a Dynamic AMM or DLMM Pool with Alpha Vault. ### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#d-if-no-vesting-is-required%2C-what-should-the-startvestingpoint-and-endvestingpoint-be%3F) D) If no vesting is required, what should the startVestingPoint and endVestingPoint be? * `startVestingPoint`: Absolute value, the slot or timestamp that start vesting depend on the pool activation type. If no vesting is required, you should put this as 1 sec after the pool’s activationPoint * `endVestingPoint`: Absolute value, the slot or timestamp that end vesting depend on the pool activation type. If no vesting is required, this should be the same as `startVestingPoint` ### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#e-how-to-crank-the-alpha-vault-so-that-it-purchases-the-token-from-the-pool%3F) E) How to crank the Alpha Vault so that it purchases the token from the pool? Typically, we have a keeper that cranks the Alpha Vault to automatically purchase tokens from the pool. However, if the auto-crank fails, you can visit this [fillVaultDlmm.ts](https://github.com/MeteoraAg/alpha-vault-sdk/blob/main/ts-client/src/examples/fillVaultDlmm.ts) repo and input your PublicKey. ### [​](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#f-how-do-you-determine-the-alpha-vault-deposit-close-time%3F) F) How do you determine the Alpha Vault deposit close time? **Crank start point (time when vault buys tokens from the pool):** * Timestamp-based: `Crank start point = activationPoint - 3600` * Slot-based: `Crank start point = activationPoint - 9000` **Vault deposit close point (time when vault deposits close):** * Timestamp-based Vault: `Deposit close point = Crank start point - 5 min` * Slot-based Vault: `Deposit close point = Crank start point - 750` Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/2-alpha-vault-without-whitelist) [Introduction\ \ Next](https://docs.meteora.ag/developer-guide/integrations/stake2earn/1-introduction) On this page * [Example Timeline (Pro rata mode)](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#example-timeline-pro-rata-mode) * [Code Examples](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#code-examples) * [Main Steps](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#main-steps) * [Create Permissioned Alpha Vault with Whitelist and Individual Deposit Cap](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#create-permissioned-alpha-vault-with-whitelist-and-individual-deposit-cap) * [Whitelisted Wallet CSV File Example](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#whitelisted-wallet-csv-file-example) * [Whitelist Modes](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#whitelist-modes) * [Without Whitelist](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#without-whitelist) * [With Whitelist](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#with-whitelist) * [Create Merkle Root Config](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#create-merkle-root-config) * [Deposit SOL or USDC with Proof](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#deposit-sol-or-usdc-with-proof) * [Configure Alpha Vault Timings](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#configure-alpha-vault-timings) * [Config Endpoint Based on Pool Activation Timing](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#config-endpoint-based-on-pool-activation-timing) * [Important Reminders](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#important-reminders) * [A) Claim start time should NOT be earlier than Pool activation time](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#a-claim-start-time-should-not-be-earlier-than-pool-activation-time) * [B) For Memecoins that want to permanently lock liquidity, lock it before Pool activation time](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#b-for-memecoins-that-want-to-permanently-lock-liquidity%2C-lock-it-before-pool-activation-time) * [C) Quote token must be SOL or USDC](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#c-quote-token-must-be-sol-or-usdc) * [D) If no vesting is required, what should the startVestingPoint and endVestingPoint be?](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#d-if-no-vesting-is-required%2C-what-should-the-startvestingpoint-and-endvestingpoint-be%3F) * [E) How to crank the Alpha Vault so that it purchases the token from the pool?](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#e-how-to-crank-the-alpha-vault-so-that-it-purchases-the-token-from-the-pool%3F) * [F) How do you determine the Alpha Vault deposit close time?](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist#f-how-do-you-determine-the-alpha-vault-deposit-close-time%3F) Assistant Responses are generated using AI and may contain mistakes. --- # Farm Integration - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Typescript SDK Farm Integration [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) This guide provides instructions on how to integrate DAMM v1 pools with farms. Before you begin, here are some important resources: * **Program ID (Mainnet & Devnet):** `FarmuwXPWXvefWUeqFAa5w6rifLkq5X6E8bimYvrhCB1` * **TypeScript SDK Repository:** [@meteora-ag/farming-sdk](https://github.com/MeteoraAg/reward-pool) [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/4-farm-integration#install-dependencies) Install Dependencies ================================================================================================================================================ Copy Ask AI npm install @meteora-ag/farming-sdk @solana/web3.js # or pnpm install @meteora-ag/farming-sdk @solana/web3.js # or yarn add @meteora-ag/farming-sdk @solana/web3.js [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/4-farm-integration#initialize-poolfarmimpl-instance) Initialize PoolFarmImpl Instance ======================================================================================================================================================================== Copy Ask AI import { PoolFarmImpl } from "@meteora-ag/farming-sdk"; import { Connection, PublicKey, Keypair } from "@solana/web3.js"; // Connection, Wallet, and AnchorProvider to interact with the network const mainnetConnection = new Connection("https://api.mainnet-beta.solana.com"); const USDC_acUSDC_POOL = new PublicKey( "6ZLKLjMd2KzH7PPHCXUPgbMAtdTT37VgTtdeXWLoJppr" ); // Pool Address can get from https://docs.meteora.ag/dynamic-pools-integration/dynamic-pool-api/pool-info const farmingPools = await PoolFarmImpl.getFarmAddressesByPoolAddress( USDC_acUSDC_POOL ); // farmingPools is an array (A pool can have multiple farms) const farmingPool = farmingPools[0]; const farm = await PoolFarmImpl.create( mainnetConnection, farmingPool.farmAddress ); [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/4-farm-integration#code-examples) Code Examples ================================================================================================================================== [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/4-farm-integration#stake) Stake ------------------------------------------------------------------------------------------------------------------ Copy Ask AI // https://station.jup.ag/blog/jupiter-token-list-api#endpoints const tokenList = await fetch('https://token.jup.ag/all').then(res => res.json()); const USDC = tokenList.find(token => token.address === ); const USDT = tokenList.find(token => token.address === ); // Get pool lp balance from `@meteora-ag/dynamic-amm-sdk` package const pool = await AmmImpl.create(connection, MAINNET_POOL.USDC_USDT, USDC, USDT); const lpBalance = await pool.getUserBalance(mockWallet.publicKey); const stakeTx = await farm.deposit(mockWallet.publicKey, lpBalance); // Web3 Transaction Object const stakeResult = await provider.sendAndConfirm(stakeTx); // Transaction hash [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/4-farm-integration#claim) Claim ------------------------------------------------------------------------------------------------------------------ Copy Ask AI const claimTx = await farm.claim(mockWallet.publicKey); const claimResult = await provider.sendAndConfirm(claimTx); // Transaction hash [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/4-farm-integration#unstake) Unstake ---------------------------------------------------------------------------------------------------------------------- Copy Ask AI const unStakeTx = await farm.withdraw(mockWallet.publicKey, farmBalance); // Web3 Transaction Object const unstakeResult = await provider.sendAndConfirm(unStakeTx); // Transaction hash [​](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/4-farm-integration#check-stake-balance) Check Stake Balance ---------------------------------------------------------------------------------------------------------------------------------------------- Copy Ask AI const farmBalance = await farm.getUserBalance(mockWallet.publicKey); Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/3-damm-v1-scripts) [DAMM v1 CPI Examples\ \ Next](https://docs.meteora.ag/developer-guide/integrations/damm-v1/cpi/1-cpi-examples) On this page * [Install Dependencies](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/4-farm-integration#install-dependencies) * [Initialize PoolFarmImpl Instance](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/4-farm-integration#initialize-poolfarmimpl-instance) * [Code Examples](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/4-farm-integration#code-examples) * [Stake](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/4-farm-integration#stake) * [Claim](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/4-farm-integration#claim) * [Unstake](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/4-farm-integration#unstake) * [Check Stake Balance](https://docs.meteora.ag/developer-guide/integrations/damm-v1/typescript-sdk/4-farm-integration#check-stake-balance) Assistant Responses are generated using AI and may contain mistakes. --- # Introduction - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DAMM v2 Introduction [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Initialize your own constant product liquidity pool with DAMM v2. DAMM v2 allows you to optimize transaction fees, an option to set single-side liquidity, the flexibility of concentrating liquidty providing etc. [​](https://docs.meteora.ag/developer-guide/integrations/damm-v2/1-introduction#program-address) Program Address =================================================================================================================== * Mainnet-beta: `cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG` * Devnet: `cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG` [​](https://docs.meteora.ag/developer-guide/integrations/damm-v2/1-introduction#resources) Resources ======================================================================================================= * [DAMM v2 Program](https://github.com/MeteoraAg/damm-v2) * [DAMM v2 Typescript SDK](https://github.com/MeteoraAg/damm-v2-sdk) * [Interface Definition Language (IDL)](https://github.com/MeteoraAg/damm-v2-sdk/blob/main/src/idl/cp_amm.json) * Pool Authority: [HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC](https://solscan.io/account/HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC) [​](https://docs.meteora.ag/developer-guide/integrations/damm-v2/1-introduction#features) Features ===================================================================================================== [​](https://docs.meteora.ag/developer-guide/integrations/damm-v2/1-introduction#position-nft) Position NFT ------------------------------------------------------------------------------------------------------------- The position state manages `unlocked_liquidity` + `locked_liquidity` + `vested liquidity`. User can interact with the following flows in the same, single position: * Permanently lock part of the liquidity * Create multiple vesting schedules * Add more liquidity (unlocked liquidity) The Position NFT is also a transferrable NFT that can be sent to other wallets. [​](https://docs.meteora.ag/developer-guide/integrations/damm-v2/1-introduction#farming) Farming --------------------------------------------------------------------------------------------------- For DAMM v2, there is an in-built farming mechanism within the program. This is unlike DAMM v1, where there is a separate farming program. Each specific pool in DAMM v2 can create farming rewards and the pool has its own unique reward vault. Each reward vault can have a maximum of 2 types of reward tokens. When the `initialize_reward` program endpoint is used, a `reward_vault` for the specific pool is created, and the initiator can specify the reward token (max 2 types) for the `reward_vault` Rewards will be shared with all liquidity providers over the farming duration. Currently, in this beta stage: 1. The `initialize_reward` program endpoint can only be initialized by Meteora’s admin 2. Only a whitelisted funder address can fund rewards into this `reward_vault` So for now, projects have to reach out to the Meteora team to create a farm and add rewards. We’re exploring ways to make this process permissionless at a later stage. [​](https://docs.meteora.ag/developer-guide/integrations/damm-v2/1-introduction#fee-collection) Fee Collection ----------------------------------------------------------------------------------------------------------------- DAMM v2 pools can collect fees in quote token or output token. ### [​](https://docs.meteora.ag/developer-guide/integrations/damm-v2/1-introduction#quote-token) Quote Token * Swap Quote Token to Base Token, then fees are taken from Quote Token before swap. * Swap Base Token to Quote Token, then fees are taken from Quote Token after swap. ### [​](https://docs.meteora.ag/developer-guide/integrations/damm-v2/1-introduction#output-token) Output Token * Swap Quote Token to Base Token, then fees are taken from Base Token after swap. * Swap Base Token to Quote Token, then fees are taken from Quote Token after swap. [​](https://docs.meteora.ag/developer-guide/integrations/damm-v2/1-introduction#min-max-price) Min-Max Price --------------------------------------------------------------------------------------------------------------- In general, you can set a min-max price range for a balanced pool as DAMM v2 is a constant product AMM that follows a balanced ratio deposit. If you need to set a min-max price range, as well as implement imbalanced deposits for the pool, you need to use [DLMM](https://docs.meteora.ag/overview/products/dlmm/1-what-is-dlmm.mdx) instead. [​](https://docs.meteora.ag/developer-guide/integrations/damm-v2/1-introduction#config-key-parameters) Config Key Parameters =============================================================================================================================== vault\_config\_key ------------------ **Type:** `address` Alpha-vault address that is able to buy from the pool before `activation_point`. pool\_creator\_authority ------------------------ **Type:** `address` If this address is non-default, then only this address can create a pool with that config key (useful for launchpad scenarios). pool\_fees ---------- **Type:** `object` Includes base fee scheduler, dynamic fee, protocol fee percent, partner fee percent, and referral fee percent configuration. activation\_type ---------------- **Type:** `0 | 1` Determines whether pools are run in **slot** (`0`) or **timestamp** (`1`). collect\_fee\_mode ------------------ **Type:** `0 | 1` Determines whether the pool should collect fees in both tokens (`1`) or only one token (`0`). sqrt\_min\_price ---------------- **Type:** `number` Square root of the minimum price for pools. sqrt\_max\_price ---------------- **Type:** `number` Square root of the maximum price for pools. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/damm-v1/apis/2-pool-state) [Pool Fee Configs\ \ Next](https://docs.meteora.ag/developer-guide/integrations/damm-v2/2-pool-fee-configs) On this page * [Program Address](https://docs.meteora.ag/developer-guide/integrations/damm-v2/1-introduction#program-address) * [Resources](https://docs.meteora.ag/developer-guide/integrations/damm-v2/1-introduction#resources) * [Features](https://docs.meteora.ag/developer-guide/integrations/damm-v2/1-introduction#features) * [Position NFT](https://docs.meteora.ag/developer-guide/integrations/damm-v2/1-introduction#position-nft) * [Farming](https://docs.meteora.ag/developer-guide/integrations/damm-v2/1-introduction#farming) * [Fee Collection](https://docs.meteora.ag/developer-guide/integrations/damm-v2/1-introduction#fee-collection) * [Quote Token](https://docs.meteora.ag/developer-guide/integrations/damm-v2/1-introduction#quote-token) * [Output Token](https://docs.meteora.ag/developer-guide/integrations/damm-v2/1-introduction#output-token) * [Min-Max Price](https://docs.meteora.ag/developer-guide/integrations/damm-v2/1-introduction#min-max-price) * [Config Key Parameters](https://docs.meteora.ag/developer-guide/integrations/damm-v2/1-introduction#config-key-parameters) Assistant Responses are generated using AI and may contain mistakes. --- # DAMM v2 Formulas - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DAMM v2 DAMM v2 Formulas [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) DAMM v2 is a constant product AMM that operates between a `sqrt_min_price` and a `sqrt_max_price`. [​](https://docs.meteora.ag/developer-guide/integrations/damm-v2/3-damm-v2-formulas#liquidity-addition-%2F-removal) Liquidity Addition / Removal =================================================================================================================================================== When adding or removing liquidity, for a given liquidity delta `ΔL`, the required token amounts are calculated as: Δa\=ΔL×(1P−1Pmax)\\Delta a = \\Delta L \\times \\left(\\frac{1}{\\sqrt{P}} - \\frac{1}{\\sqrt{P\_{\\text{max}}}}\\right) Δa\=ΔL×(P​1​−Pmax​​1​) Δb\=ΔL×(P−Pmin)\\Delta b = \\Delta L \\times (\\sqrt{P} - \\sqrt{P\_{\\text{min}}}) Δb\=ΔL×(P​−Pmin​​) [​](https://docs.meteora.ag/developer-guide/integrations/damm-v2/3-damm-v2-formulas#lp-token-amount) LP Token Amount ======================================================================================================================= Example from token B: Token B Amount\=LP Token×(currentSqrtPrice−minSqrtPrice)2128\\text{Token B Amount} = \\frac{\\text{LP Token} × (\\text{currentSqrtPrice} - \\text{minSqrtPrice})}{2^{128}} Token B Amount\=2128LP Token×(currentSqrtPrice−minSqrtPrice)​ so you can reverse: LP Token\=Token B Amount×2128currentSqrtPrice−minSqrtPrice\\text{LP Token} = \\frac{\\text{Token B Amount} × 2^{128}}{\\text{currentSqrtPrice} - \\text{minSqrtPrice}} LP Token\=currentSqrtPrice−minSqrtPriceToken B Amount×2128​ [​](https://docs.meteora.ag/developer-guide/integrations/damm-v2/3-damm-v2-formulas#farming-rewards) Farming Rewards ======================================================================================================================= The farming rewards are calculated as: Reward per token\=Elapsed Time×Reward Rate×264Total Liquidity\\text{Reward per token} = \\frac{\\text{Elapsed Time} \\times \\text{Reward Rate} \\times 2^{64}}{\\text{Total Liquidity}} Reward per token\=Total LiquidityElapsed Time×Reward Rate×264​ User reward\=Position Liquidity×(Current Reward per Token−User Last Reward per Token)≫64\\text{User reward} = \\text{Position Liquidity} \\times (\\text{Current Reward per Token} - \\text{User Last Reward per Token}) \\gg 64 User reward\=Position Liquidity×(Current Reward per Token−User Last Reward per Token)≫64 [​](https://docs.meteora.ag/developer-guide/integrations/damm-v2/3-damm-v2-formulas#price-impact) Price Impact ================================================================================================================= The price impact for a swap can be calculated as: Price Impact\=∣New Sqrt Price−Old Sqrt Price∣Old Sqrt Price\\text{Price Impact} = \\frac{|\\text{New Sqrt Price} - \\text{Old Sqrt Price}|}{\\text{Old Sqrt Price}} Price Impact\=Old Sqrt Price∣New Sqrt Price−Old Sqrt Price∣​ Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/damm-v2/2-pool-fee-configs) [Getting StartedDAMM v2\ \ Next](https://docs.meteora.ag/developer-guide/integrations/damm-v2/typescript-sdk/1-getting-started) On this page * [Liquidity Addition / Removal](https://docs.meteora.ag/developer-guide/integrations/damm-v2/3-damm-v2-formulas#liquidity-addition-%2F-removal) * [LP Token Amount](https://docs.meteora.ag/developer-guide/integrations/damm-v2/3-damm-v2-formulas#lp-token-amount) * [Farming Rewards](https://docs.meteora.ag/developer-guide/integrations/damm-v2/3-damm-v2-formulas#farming-rewards) * [Price Impact](https://docs.meteora.ag/developer-guide/integrations/damm-v2/3-damm-v2-formulas#price-impact) Assistant Responses are generated using AI and may contain mistakes. --- # Pool Fee Configs - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DAMM v2 Pool Fee Configs [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Each DAMM v2 pool is a PDA of token mints + config. There are 2 types of config: 1. Public config - can be used by anyone to create a pool. 2. Private config - can only be used by the `pool_creator_authority` to create a pool. [​](https://docs.meteora.ag/developer-guide/integrations/damm-v2/2-pool-fee-configs#public-config) Public Config =================================================================================================================== In a public config, anyone can use one of the public config keys to create a pool. Currently, we have 72 config keys created for devnet and mainnet. Integrators can consider using a public config if tokens cannot be bought (leaked) before the token launch time. But launchpads typically use a private config. To fetch all public config key addresses, you can use the `getAllConfigs` function in the [Typescript SDK](https://github.com/MeteoraAg/damm-v2-sdk/blob/cdd71c0282e3555989fc255c5fba335ade5a443b/src/CpAmm.ts#L712) . Integrators cannot change the fee schedule for that particular public config key. View all public config key addresses (JSON) Copy Ask AI [\ {\ "index": 0,\ "baseFeeValue": 2500000,\ "baseFee": {\ "cliffFeeNumerator": 2500000,\ "numberOfPeriod": 0,\ "reductionFactor": 0,\ "periodFrequency": 0,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 0,\ "dynamicFee": true,\ "configAccount": "8CNy9goNQNLM4wtgRw528tUQGMKD3vSuFRZY2gLGLLvF"\ },\ {\ "index": 1,\ "baseFeeValue": 2500000,\ "baseFee": {\ "cliffFeeNumerator": 2500000,\ "numberOfPeriod": 0,\ "reductionFactor": 0,\ "periodFrequency": 0,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 1,\ "dynamicFee": true,\ "configAccount": "82p7sVzQWZfCrmStPhsG8BYKwheQkUiXSs2wiqdhwNxr"\ },\ {\ "index": 2,\ "baseFeeValue": 2500000,\ "baseFee": {\ "cliffFeeNumerator": 2500000,\ "numberOfPeriod": 0,\ "reductionFactor": 0,\ "periodFrequency": 0,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 0,\ "dynamicFee": false,\ "configAccount": "FzvMYBQ29z2J21QPsABpJYYxQBEKGsxA6w6J2HYceFj8"\ },\ {\ "index": 3,\ "baseFeeValue": 2500000,\ "baseFee": {\ "cliffFeeNumerator": 2500000,\ "numberOfPeriod": 0,\ "reductionFactor": 0,\ "periodFrequency": 0,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 1,\ "dynamicFee": false,\ "configAccount": "EQbqYxecZuJsVt6g5QbKTWpNWa3QyWQE5NWz5AZBAiNv"\ },\ {\ "index": 4,\ "baseFeeValue": 3000000,\ "baseFee": {\ "cliffFeeNumerator": 3000000,\ "numberOfPeriod": 0,\ "reductionFactor": 0,\ "periodFrequency": 0,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 0,\ "dynamicFee": true,\ "configAccount": "9RuAyDH81GB9dhks6MzHva2objQJxHvqRRfyKKdfmkxk"\ },\ {\ "index": 5,\ "baseFeeValue": 3000000,\ "baseFee": {\ "cliffFeeNumerator": 3000000,\ "numberOfPeriod": 0,\ "reductionFactor": 0,\ "periodFrequency": 0,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 1,\ "dynamicFee": true,\ "configAccount": "GqRo1PG5KZc4QqZn1RCcnEGC8E7yRscHaW1fQp9St9Lz"\ },\ {\ "index": 6,\ "baseFeeValue": 3000000,\ "baseFee": {\ "cliffFeeNumerator": 3000000,\ "numberOfPeriod": 0,\ "reductionFactor": 0,\ "periodFrequency": 0,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 0,\ "dynamicFee": false,\ "configAccount": "3KLdspUofc75aaEAJdBo1o6D6cyzXJVtGB8PgpWJEiaR"\ },\ {\ "index": 7,\ "baseFeeValue": 3000000,\ "baseFee": {\ "cliffFeeNumerator": 3000000,\ "numberOfPeriod": 0,\ "reductionFactor": 0,\ "periodFrequency": 0,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 1,\ "dynamicFee": false,\ "configAccount": "9xKsCsiv8eeBohobb8Z1snLZzVKKATGqmY69vJHyCzvu"\ },\ {\ "index": 8,\ "baseFeeValue": 10000000,\ "baseFee": {\ "cliffFeeNumerator": 10000000,\ "numberOfPeriod": 0,\ "reductionFactor": 0,\ "periodFrequency": 0,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 0,\ "dynamicFee": true,\ "configAccount": "EVRn9bAekgZsVVAHt25AUjA7qpKh4ac7uUMpoSGqgS5U"\ },\ {\ "index": 9,\ "baseFeeValue": 10000000,\ "baseFee": {\ "cliffFeeNumerator": 10000000,\ "numberOfPeriod": 0,\ "reductionFactor": 0,\ "periodFrequency": 0,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 1,\ "dynamicFee": true,\ "configAccount": "7BJfgt3ahTtCfXkPMRbS6YneR92JuwsU1dyayhmNBL11"\ },\ {\ "index": 10,\ "baseFeeValue": 10000000,\ "baseFee": {\ "cliffFeeNumerator": 10000000,\ "numberOfPeriod": 0,\ "reductionFactor": 0,\ "periodFrequency": 0,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 0,\ "dynamicFee": false,\ "configAccount": "GXZLjqmebpsy74vqTD6DqSTugTKVwoTi8fZwLAXBsMNN"\ },\ {\ "index": 11,\ "baseFeeValue": 10000000,\ "baseFee": {\ "cliffFeeNumerator": 10000000,\ "numberOfPeriod": 0,\ "reductionFactor": 0,\ "periodFrequency": 0,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 1,\ "dynamicFee": false,\ "configAccount": "AeLtDKgw3XnXbr3Kgfbcb7KiZULVCQ5mXaFDiG9n7EgW"\ },\ {\ "index": 12,\ "baseFeeValue": 20000000,\ "baseFee": {\ "cliffFeeNumerator": 20000000,\ "numberOfPeriod": 0,\ "reductionFactor": 0,\ "periodFrequency": 0,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 0,\ "dynamicFee": true,\ "configAccount": "G8pJy5Hsxeko5srUxDUF6cpuPJ3r53MbMucbpLhNC8NU"\ },\ {\ "index": 13,\ "baseFeeValue": 20000000,\ "baseFee": {\ "cliffFeeNumerator": 20000000,\ "numberOfPeriod": 0,\ "reductionFactor": 0,\ "periodFrequency": 0,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 1,\ "dynamicFee": true,\ "configAccount": "BcgnWGkrvEQm4hChY6R4wDuwshsvmnnh1Hmzvrm7M8FQ"\ },\ {\ "index": 14,\ "baseFeeValue": 20000000,\ "baseFee": {\ "cliffFeeNumerator": 20000000,\ "numberOfPeriod": 0,\ "reductionFactor": 0,\ "periodFrequency": 0,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 0,\ "dynamicFee": false,\ "configAccount": "HdqGCsprdhmgqaCXjJzGnKib2SGQvmT9XKYmR7ZjMqmi"\ },\ {\ "index": 15,\ "baseFeeValue": 20000000,\ "baseFee": {\ "cliffFeeNumerator": 20000000,\ "numberOfPeriod": 0,\ "reductionFactor": 0,\ "periodFrequency": 0,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 1,\ "dynamicFee": false,\ "configAccount": "HQ6vW45Kug23h2A4LkyUqB4UFfGx4LqY1uZLLfQemEjU"\ },\ {\ "index": 16,\ "baseFeeValue": 40000000,\ "baseFee": {\ "cliffFeeNumerator": 40000000,\ "numberOfPeriod": 0,\ "reductionFactor": 0,\ "periodFrequency": 0,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 0,\ "dynamicFee": true,\ "configAccount": "Gjsr13rp68pMXrpwekfygphynT1hjRzbLLQLHTeQNfQq"\ },\ {\ "index": 17,\ "baseFeeValue": 40000000,\ "baseFee": {\ "cliffFeeNumerator": 40000000,\ "numberOfPeriod": 0,\ "reductionFactor": 0,\ "periodFrequency": 0,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 1,\ "dynamicFee": true,\ "configAccount": "BjJKkSVvDiMt6qM9vc5MAtFHTxpaYTbgrD6KuwUQhj7u"\ },\ {\ "index": 18,\ "baseFeeValue": 40000000,\ "baseFee": {\ "cliffFeeNumerator": 40000000,\ "numberOfPeriod": 0,\ "reductionFactor": 0,\ "periodFrequency": 0,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 0,\ "dynamicFee": false,\ "configAccount": "FivzJShpkDj7tdLv6hYSyLcZEAF2FsqNfw8W8mPc8op2"\ },\ {\ "index": 19,\ "baseFeeValue": 40000000,\ "baseFee": {\ "cliffFeeNumerator": 40000000,\ "numberOfPeriod": 0,\ "reductionFactor": 0,\ "periodFrequency": 0,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 1,\ "dynamicFee": false,\ "configAccount": "DT1PBa3RRvd2GDjKuMJHrcyrus7cM5oqL3eY6tR63uUk"\ },\ {\ "index": 20,\ "baseFeeValue": 60000000,\ "baseFee": {\ "cliffFeeNumerator": 60000000,\ "numberOfPeriod": 0,\ "reductionFactor": 0,\ "periodFrequency": 0,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 0,\ "dynamicFee": true,\ "configAccount": "5UMffQ4jEJgjS2rFoyTWNyh3Xf3ek3LFPyr89RfYQRbu"\ },\ {\ "index": 21,\ "baseFeeValue": 60000000,\ "baseFee": {\ "cliffFeeNumerator": 60000000,\ "numberOfPeriod": 0,\ "reductionFactor": 0,\ "periodFrequency": 0,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 1,\ "dynamicFee": true,\ "configAccount": "7y8Y3kuKphxBoyesTaKV2WQLtu884zhVCDtxqrCP4HWv"\ },\ {\ "index": 22,\ "baseFeeValue": 60000000,\ "baseFee": {\ "cliffFeeNumerator": 60000000,\ "numberOfPeriod": 0,\ "reductionFactor": 0,\ "periodFrequency": 0,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 0,\ "dynamicFee": false,\ "configAccount": "9YmoetVvZx1vrfJ9fD8X5YG3FQXREK6ZiPzRghP33Wbf"\ },\ {\ "index": 23,\ "baseFeeValue": 60000000,\ "baseFee": {\ "cliffFeeNumerator": 60000000,\ "numberOfPeriod": 0,\ "reductionFactor": 0,\ "periodFrequency": 0,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 1,\ "dynamicFee": false,\ "configAccount": "Ha2bAcxbLrFr5RiugBgeJVLx1JE7gq16rzAuqUED1v3f"\ },\ {\ "index": 24,\ "baseFeeValue": 2500000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 144,\ "reductionFactor": 3454861,\ "periodFrequency": 600,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 1,\ "dynamicFee": true,\ "configAccount": "GtDtC9gJEAyMje1AW1McMoAFpGqcfYPwnGMBJ3VLS54Q"\ },\ {\ "index": 25,\ "baseFeeValue": 2500000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 144,\ "reductionFactor": 3454861,\ "periodFrequency": 600,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 0,\ "dynamicFee": true,\ "configAccount": "4A95FoEsswvuCEDSFnd8uXBgdkQPqzrjJv2roev8c9mm"\ },\ {\ "index": 26,\ "baseFeeValue": 2500000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 144,\ "reductionFactor": 3454861,\ "periodFrequency": 600,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 1,\ "dynamicFee": false,\ "configAccount": "CsPBLWzLWTJ3p8PG28zQ31Eq3dPpw1wV55JxpRYzdVxg"\ },\ {\ "index": 27,\ "baseFeeValue": 2500000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 144,\ "reductionFactor": 3454861,\ "periodFrequency": 600,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 0,\ "dynamicFee": false,\ "configAccount": "G9EUpuBrDZHQAeaifkx5xbiajAGbB6HHJ4xcVmZyd3eQ"\ },\ {\ "index": 28,\ "baseFeeValue": 2500000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 120,\ "reductionFactor": 432,\ "periodFrequency": 60,\ "feeSchedulerMode": 1\ },\ "collectFeeMode": 1,\ "dynamicFee": true,\ "configAccount": "7f8zQkCTmEE2yPjKoEGpWxcTaw6VYcjB1P3DxnpfFNCc"\ },\ {\ "index": 29,\ "baseFeeValue": 2500000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 120,\ "reductionFactor": 432,\ "periodFrequency": 60,\ "feeSchedulerMode": 1\ },\ "collectFeeMode": 0,\ "dynamicFee": true,\ "configAccount": "G6Sukhgcmaf32PucWqCTMHn4jtWjE2TZTk59eQPSVKsy"\ },\ {\ "index": 30,\ "baseFeeValue": 2500000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 120,\ "reductionFactor": 432,\ "periodFrequency": 60,\ "feeSchedulerMode": 1\ },\ "collectFeeMode": 1,\ "dynamicFee": false,\ "configAccount": "CLL5Wi7pi9SwHiSwtMyz1xbX6HDq3defpotWUFxwu4oj"\ },\ {\ "index": 31,\ "baseFeeValue": 2500000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 120,\ "reductionFactor": 432,\ "periodFrequency": 60,\ "feeSchedulerMode": 1\ },\ "collectFeeMode": 0,\ "dynamicFee": false,\ "configAccount": "9jma77W3ZsJXPude5tnmC51EhMjKHzwsHCz1gFmbfJBc"\ },\ {\ "index": 32,\ "baseFeeValue": 3000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 144,\ "reductionFactor": 3451389,\ "periodFrequency": 600,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 1,\ "dynamicFee": true,\ "configAccount": "EQadgQ6mGX7fHWxWbLiq7LCsKs6RLyoD3gDCKWzAB3qi"\ },\ {\ "index": 33,\ "baseFeeValue": 3000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 144,\ "reductionFactor": 3451389,\ "periodFrequency": 600,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 0,\ "dynamicFee": true,\ "configAccount": "F28LTGGMKxKmicskcBpVd5BD2Dj73bhcvVbBiCBpg7fQ"\ },\ {\ "index": 34,\ "baseFeeValue": 3000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 144,\ "reductionFactor": 3451389,\ "periodFrequency": 600,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 1,\ "dynamicFee": false,\ "configAccount": "3DpKWH6VXcJewqMQcVXQfuSfb95qrbq847wCTTDzviWt"\ },\ {\ "index": 35,\ "baseFeeValue": 3000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 144,\ "reductionFactor": 3451389,\ "periodFrequency": 600,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 0,\ "dynamicFee": false,\ "configAccount": "2gnXvkRvYZ3iosu4d8G7KmZR6Ki9GXPMoxbx5NR4e8bz"\ },\ {\ "index": 36,\ "baseFeeValue": 3000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 120,\ "reductionFactor": 417,\ "periodFrequency": 60,\ "feeSchedulerMode": 1\ },\ "collectFeeMode": 1,\ "dynamicFee": true,\ "configAccount": "BdYG3xCpAYPYPnksHGhVfEMHk3gqt1Y7uqdWUsSUzf4y"\ },\ {\ "index": 37,\ "baseFeeValue": 3000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 120,\ "reductionFactor": 417,\ "periodFrequency": 60,\ "feeSchedulerMode": 1\ },\ "collectFeeMode": 0,\ "dynamicFee": true,\ "configAccount": "uPhetWqk4hhf9swL8xdbABfmGh4GyQ9nVAeYpvnC6pb"\ },\ {\ "index": 38,\ "baseFeeValue": 3000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 120,\ "reductionFactor": 417,\ "periodFrequency": 60,\ "feeSchedulerMode": 1\ },\ "collectFeeMode": 1,\ "dynamicFee": false,\ "configAccount": "TBuzuEMMQizTjpZhRLaUPavALhZmD8U1hwiw1pWSCSq"\ },\ {\ "index": 39,\ "baseFeeValue": 3000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 120,\ "reductionFactor": 417,\ "periodFrequency": 60,\ "feeSchedulerMode": 1\ },\ "collectFeeMode": 0,\ "dynamicFee": false,\ "configAccount": "3z9HHXyWEXc7L3EPEQ5mN8cPoq9wBZr8y2bRiEwUu9u2"\ },\ {\ "index": 40,\ "baseFeeValue": 10000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 144,\ "reductionFactor": 3402778,\ "periodFrequency": 600,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 1,\ "dynamicFee": true,\ "configAccount": "ABWG34FJMHaWSwP2uJrX2S6dKXDmz93MCVSBk9BKZHrs"\ },\ {\ "index": 41,\ "baseFeeValue": 10000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 144,\ "reductionFactor": 3402778,\ "periodFrequency": 600,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 0,\ "dynamicFee": true,\ "configAccount": "HrBAyo6rf8i6dF8S8kh6QsjTmesmFhDoHvwSrsUHKdbX"\ },\ {\ "index": 42,\ "baseFeeValue": 10000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 144,\ "reductionFactor": 3402778,\ "periodFrequency": 600,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 1,\ "dynamicFee": false,\ "configAccount": "DXoY3hDAuvQudWTjpepSJ1bn1yd6jovuvPweHwc1e83P"\ },\ {\ "index": 43,\ "baseFeeValue": 10000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 144,\ "reductionFactor": 3402778,\ "periodFrequency": 600,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 0,\ "dynamicFee": false,\ "configAccount": "69CwWBvDBGvZ9P6bB9UnMwnDcQ136UFuDn2UEZ7Rb5We"\ },\ {\ "index": 44,\ "baseFeeValue": 10000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 120,\ "reductionFactor": 321,\ "periodFrequency": 60,\ "feeSchedulerMode": 1\ },\ "collectFeeMode": 1,\ "dynamicFee": true,\ "configAccount": "BDAbqqPRRg44tsDUEUPFjVaReX1mavngTc9H9SFPDo6F"\ },\ {\ "index": 45,\ "baseFeeValue": 10000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 120,\ "reductionFactor": 321,\ "periodFrequency": 60,\ "feeSchedulerMode": 1\ },\ "collectFeeMode": 0,\ "dynamicFee": true,\ "configAccount": "EZDtwCGcoe3f7BWFxaMrYDTq2WZMrcBZbUktoBKYvYiM"\ },\ {\ "index": 46,\ "baseFeeValue": 10000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 120,\ "reductionFactor": 321,\ "periodFrequency": 60,\ "feeSchedulerMode": 1\ },\ "collectFeeMode": 1,\ "dynamicFee": false,\ "configAccount": "341nQvGfd3b6HXMEaMafZwk5DkHmrZDh7Q2j4BbTCHyk"\ },\ {\ "index": 47,\ "baseFeeValue": 10000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 120,\ "reductionFactor": 321,\ "periodFrequency": 60,\ "feeSchedulerMode": 1\ },\ "collectFeeMode": 0,\ "dynamicFee": false,\ "configAccount": "6Vt8pYzHmtMr4H5v1qp8gR9uot11xVfbjTHmbm9SXMGB"\ },\ {\ "index": 48,\ "baseFeeValue": 20000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 144,\ "reductionFactor": 3333333,\ "periodFrequency": 600,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 1,\ "dynamicFee": true,\ "configAccount": "F7xJjVwqvVBoAkYV3TdZesu4ckwzzVQEebaPiZVqT4Ly"\ },\ {\ "index": 49,\ "baseFeeValue": 20000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 144,\ "reductionFactor": 3333333,\ "periodFrequency": 600,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 0,\ "dynamicFee": true,\ "configAccount": "84tnQ4tQ4N8QGwoEEXcCdWfjSeuL8SfNjsdZWLZ9UiY4"\ },\ {\ "index": 50,\ "baseFeeValue": 20000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 144,\ "reductionFactor": 3333333,\ "periodFrequency": 600,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 1,\ "dynamicFee": false,\ "configAccount": "HKqzgVzaKkX7NPXyVNWuVegtgujkiJ2ZLvpszR1iZjhd"\ },\ {\ "index": 51,\ "baseFeeValue": 20000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 144,\ "reductionFactor": 3333333,\ "periodFrequency": 600,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 0,\ "dynamicFee": false,\ "configAccount": "5LWDYbiD3LwEhAd3eeHpjJscACKo4XdTDzycdHFSBCvE"\ },\ {\ "index": 52,\ "baseFeeValue": 20000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 120,\ "reductionFactor": 265,\ "periodFrequency": 60,\ "feeSchedulerMode": 1\ },\ "collectFeeMode": 1,\ "dynamicFee": true,\ "configAccount": "H6hnWjg6LtpHPK1wN89ieb7Eex9wV2UJkw7pPH2DHSNd"\ },\ {\ "index": 53,\ "baseFeeValue": 20000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 120,\ "reductionFactor": 265,\ "periodFrequency": 60,\ "feeSchedulerMode": 1\ },\ "collectFeeMode": 0,\ "dynamicFee": true,\ "configAccount": "FjPMSBmrawY7b5We2jv7asshi6ZWnMrfYSPUn5ZDzqmA"\ },\ {\ "index": 54,\ "baseFeeValue": 20000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 120,\ "reductionFactor": 265,\ "periodFrequency": 60,\ "feeSchedulerMode": 1\ },\ "collectFeeMode": 1,\ "dynamicFee": false,\ "configAccount": "DgXZtoBcBumq96AtGkG1X4xh9fvHnWwyYuXqaenjeKoe"\ },\ {\ "index": 55,\ "baseFeeValue": 20000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 120,\ "reductionFactor": 265,\ "periodFrequency": 60,\ "feeSchedulerMode": 1\ },\ "collectFeeMode": 0,\ "dynamicFee": false,\ "configAccount": "2rGPJyTHFvHH44hVfcotPXjXNGHCsiLFUaRfVkXXVCYB"\ },\ {\ "index": 56,\ "baseFeeValue": 40000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 144,\ "reductionFactor": 3194444,\ "periodFrequency": 600,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 1,\ "dynamicFee": true,\ "configAccount": "EcfqEkLSeGzDtZrTJWcbDxptfR2nWfX6cjJLFkgttwY6"\ },\ {\ "index": 57,\ "baseFeeValue": 40000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 144,\ "reductionFactor": 3194444,\ "periodFrequency": 600,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 0,\ "dynamicFee": true,\ "configAccount": "GkC7zppTNPjBeoZfKCR9ExbNSycpwi5VphvktqpyPdx3"\ },\ {\ "index": 58,\ "baseFeeValue": 40000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 144,\ "reductionFactor": 3194444,\ "periodFrequency": 600,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 1,\ "dynamicFee": false,\ "configAccount": "7tcR7XawzXCSAtAavjVYU2Rx5RK8mE9rsyrErfYRpkw4"\ },\ {\ "index": 59,\ "baseFeeValue": 40000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 144,\ "reductionFactor": 3194444,\ "periodFrequency": 600,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 0,\ "dynamicFee": false,\ "configAccount": "A4JGKvpXKGfpkSgBSLmR7obESYhqqaeVEve71nWmS4zU"\ },\ {\ "index": 60,\ "baseFeeValue": 40000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 120,\ "reductionFactor": 208,\ "periodFrequency": 60,\ "feeSchedulerMode": 1\ },\ "collectFeeMode": 1,\ "dynamicFee": true,\ "configAccount": "GGD1oNYU62ux15XXpSMeoKcfznHTtu85qLeKrhY7MMMZ"\ },\ {\ "index": 61,\ "baseFeeValue": 40000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 120,\ "reductionFactor": 208,\ "periodFrequency": 60,\ "feeSchedulerMode": 1\ },\ "collectFeeMode": 0,\ "dynamicFee": true,\ "configAccount": "4hKGzanVuqCaVHbXm9rXnYJeJvzWcq5HDogKcrVYh4gP"\ },\ {\ "index": 62,\ "baseFeeValue": 40000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 120,\ "reductionFactor": 208,\ "periodFrequency": 60,\ "feeSchedulerMode": 1\ },\ "collectFeeMode": 1,\ "dynamicFee": false,\ "configAccount": "G4Y8SphEjVCESkodbFU7sjgaPZRykD55dabccDa8Lv7M"\ },\ {\ "index": 63,\ "baseFeeValue": 40000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 120,\ "reductionFactor": 208,\ "periodFrequency": 60,\ "feeSchedulerMode": 1\ },\ "collectFeeMode": 0,\ "dynamicFee": false,\ "configAccount": "GnERyyZgr9JdZ5dCFC46APkcPNZdUQgrJmRqoeBX55dg"\ },\ {\ "index": 64,\ "baseFeeValue": 60000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 144,\ "reductionFactor": 3055556,\ "periodFrequency": 600,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 1,\ "dynamicFee": true,\ "configAccount": "C11DxNAH4NBGNHGzTCq9ZUcJrVJ9dEG5CLwSmis3Y6HJ"\ },\ {\ "index": 65,\ "baseFeeValue": 60000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 144,\ "reductionFactor": 3055556,\ "periodFrequency": 600,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 0,\ "dynamicFee": true,\ "configAccount": "2rbDaKQjxiFgMsYoQxLRaPvtXuLFUUQmypN5bYmJqPjY"\ },\ {\ "index": 66,\ "baseFeeValue": 60000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 144,\ "reductionFactor": 3055556,\ "periodFrequency": 600,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 1,\ "dynamicFee": false,\ "configAccount": "7gE2roG5cBM5hpqDQvQ2J7ZsQE4CqM6eE8sKQ6NTaqRS"\ },\ {\ "index": 67,\ "baseFeeValue": 60000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 144,\ "reductionFactor": 3055556,\ "periodFrequency": 600,\ "feeSchedulerMode": 0\ },\ "collectFeeMode": 0,\ "dynamicFee": false,\ "configAccount": "6Fs8KLaRA1T1aecBVca4VPpJi27oAPLDZUPbrUocEN12"\ },\ {\ "index": 68,\ "baseFeeValue": 60000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 120,\ "reductionFactor": 175,\ "periodFrequency": 60,\ "feeSchedulerMode": 1\ },\ "collectFeeMode": 1,\ "dynamicFee": true,\ "configAccount": "7SDjNZxM4rGNdYF3MyAkDetZ2TNFUxdDUGGE1C3kCeAd"\ },\ {\ "index": 69,\ "baseFeeValue": 60000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 120,\ "reductionFactor": 175,\ "periodFrequency": 60,\ "feeSchedulerMode": 1\ },\ "collectFeeMode": 0,\ "dynamicFee": true,\ "configAccount": "2yAJha5NVgq5mEitTUvdWSUKrcYvxAAc2H6rPDbEQqSu"\ },\ {\ "index": 70,\ "baseFeeValue": 60000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 120,\ "reductionFactor": 175,\ "periodFrequency": 60,\ "feeSchedulerMode": 1\ },\ "collectFeeMode": 1,\ "dynamicFee": false,\ "configAccount": "E4VmzCAgMN2GGAhiRipGfJhaP411Ap7YFy8WmnnV2CKs"\ },\ {\ "index": 71,\ "baseFeeValue": 60000000,\ "baseFee": {\ "cliffFeeNumerator": 500000000,\ "numberOfPeriod": 120,\ "reductionFactor": 175,\ "periodFrequency": 60,\ "feeSchedulerMode": 1\ },\ "collectFeeMode": 0,\ "dynamicFee": false,\ "configAccount": "DJN8YHxQKZnF7bL2GwuKNB2UcfhKCqRspfLe7YYEN3rr"\ }\ ] [​](https://docs.meteora.ag/developer-guide/integrations/damm-v2/2-pool-fee-configs#private-config) Private Config ===================================================================================================================== In a private config, only a specified address (configured in the `pool_creator_authority` field) can create a pool with that config. If you are a launchpad, this helps you prevent front-running of the token launch pool. * Integrators such as launchpads or other partners may need to use their own unique pool config key (with a custom fee schedule), if they want custom `pool_creator_authority` to prevent front-running of the token launch pool. New dedicated config keys can only be created by Meteora, so please reach out to the team if this is required. * If you’re an integrator that’s keen to create your own unique custom pool config key with a custom fee schedule and `pool_fees`, please reach out to the team. * The `pool_creator_authority` doesn’t work with program address. It’s not a program whitelist, it needs to be a PDA (program derived address) or normal account. Integrators can reach out to Meteora to request to create or change their fee schedule. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/damm-v2/1-introduction) [DAMM v2 Formulas\ \ Next](https://docs.meteora.ag/developer-guide/integrations/damm-v2/3-damm-v2-formulas) On this page * [Public Config](https://docs.meteora.ag/developer-guide/integrations/damm-v2/2-pool-fee-configs#public-config) * [Private Config](https://docs.meteora.ag/developer-guide/integrations/damm-v2/2-pool-fee-configs#private-config) Assistant Responses are generated using AI and may contain mistakes. --- # Swagger UI - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation API Swagger UI [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [New Mainnet API Endpoint\ ------------------------\ \ Access the latest DAMM v2 API for enhanced features and performance.](https://dammv2-api.meteora.ag/swagger-ui/) [Old Mainnet API Endpoint\ ------------------------\ \ Access the previous version of the DAMM API for legacy support.](https://cp-amm-api.meteora.ag/swagger-ui/) [Devnet Endpoint\ ---------------\ \ Access the latest DAMM v2 API for devnet testing and development.](https://dammv2-api.devnet.meteora.ag/swagger-ui/) We are deprecating the old API endpoints soon. Please use the new API endpoint. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/damm-v2/rust-sdk/1-rust-integration) [Introduction\ \ Next](https://docs.meteora.ag/developer-guide/integrations/dbc/1-introduction) Assistant Responses are generated using AI and may contain mistakes. --- # Getting Started - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Typescript SDK Getting Started [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) This guide provides instructions on how to get started with the DAMM v2 TypeScript SDK. Before you begin, here are some important resources: * **Program ID (Mainnet & Devnet):** `cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG` * **Program Repository:** [DAMM v2](https://github.com/MeteoraAg/damm-v2) * **TypeScript SDK Repository:** [@meteora-ag/cp-amm-sdk](https://github.com/MeteoraAg/damm-v2-sdk) [​](https://docs.meteora.ag/developer-guide/integrations/damm-v2/typescript-sdk/1-getting-started#installation) Installation =============================================================================================================================== To use the SDK in your project, install it using your preferred package manager: Copy Ask AI npm install @meteora-ag/cp-amm-sdk @solana/web3.js # or pnpm install @meteora-ag/cp-amm-sdk @solana/web3.js # or yarn add @meteora-ag/cp-amm-sdk @solana/web3.js [​](https://docs.meteora.ag/developer-guide/integrations/damm-v2/typescript-sdk/1-getting-started#initialization) Initialization =================================================================================================================================== Once installed, you can initialize the SDK in your TypeScript/JavaScript project like this: Copy Ask AI import { Connection } from "@solana/web3.js"; import { CpAmm } from "@meteora-ag/cp-amm-sdk"; // Initialize a connection to the Solana network (e.g., Mainnet) const connection = new Connection("https://api.mainnet-beta.solana.com"); // Create a new instance of the CpAmm SDK const cpAmm = new CpAmm(connection); [​](https://docs.meteora.ag/developer-guide/integrations/damm-v2/typescript-sdk/1-getting-started#testing-the-sdk-for-contributors) Testing the SDK (for contributors) ========================================================================================================================================================================= If you have cloned the SDK repository and want to run the built-in tests: Copy Ask AI # Install dependencies pnpm install # Run tests pnpm test [​](https://docs.meteora.ag/developer-guide/integrations/damm-v2/typescript-sdk/1-getting-started#development-resources) Development Resources ================================================================================================================================================= [​](https://docs.meteora.ag/developer-guide/integrations/damm-v2/typescript-sdk/1-getting-started#faucets) Faucets --------------------------------------------------------------------------------------------------------------------- [Devnet Faucet\ -------------\ \ When working on devnet, you might need test tokens. Here is a helpful faucet.](https://faucet.raccoons.dev/) Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/damm-v2/3-damm-v2-formulas) [DAMM v2 SDK Functions\ \ Next](https://docs.meteora.ag/developer-guide/integrations/damm-v2/typescript-sdk/2-damm-v2-sdk-functions) On this page * [Installation](https://docs.meteora.ag/developer-guide/integrations/damm-v2/typescript-sdk/1-getting-started#installation) * [Initialization](https://docs.meteora.ag/developer-guide/integrations/damm-v2/typescript-sdk/1-getting-started#initialization) * [Testing the SDK (for contributors)](https://docs.meteora.ag/developer-guide/integrations/damm-v2/typescript-sdk/1-getting-started#testing-the-sdk-for-contributors) * [Development Resources](https://docs.meteora.ag/developer-guide/integrations/damm-v2/typescript-sdk/1-getting-started#development-resources) * [Faucets](https://docs.meteora.ag/developer-guide/integrations/damm-v2/typescript-sdk/1-getting-started#faucets) Assistant Responses are generated using AI and may contain mistakes. --- # Rust Integration - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Rust SDK Rust Integration [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) The `rust-sdk` provides a convenient way to interact with the DAMM v2 program and get swap quotes. Before you begin, here are some important resources: * **Program ID (Mainnet & Devnet):** `cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG` * **Rust SDK:** [DAMM v2](https://github.com/MeteoraAg/damm-v2/tree/main/rust-sdk) [​](https://docs.meteora.ag/developer-guide/integrations/damm-v2/rust-sdk/1-rust-integration#getting-started) Getting Started ================================================================================================================================ To use the Rust SDK, you need to add it as a dependency in your `Cargo.toml` file. Since it’s a local dependency in this workspace, you can add it by specifying its path: Copy Ask AI [dependencies] rust-sdk = { path = "../rust-sdk" } # Adjust the path accordingly cp-amm = { path = "../programs/cp-amm" } # The sdk also needs the cp-amm crate solana-sdk = "1.18.12" # For Pubkey [​](https://docs.meteora.ag/developer-guide/integrations/damm-v2/rust-sdk/1-rust-integration#api-reference) API Reference ============================================================================================================================ [​](https://docs.meteora.ag/developer-guide/integrations/damm-v2/rust-sdk/1-rust-integration#get-quote) `get_quote` ---------------------------------------------------------------------------------------------------------------------- Calculates the result of a swap for a given pool. ### [​](https://docs.meteora.ag/developer-guide/integrations/damm-v2/rust-sdk/1-rust-integration#parameters) Parameters * `pool: &Pool`: A reference to the `Pool` state account, deserialized from on-chain data. * `current_timestamp: u64`: The current blockchain timestamp. * `current_slot: u64`: The current blockchain slot. * `actual_amount_in: u64`: The amount of the input token to be swapped. * `a_to_b: bool`: The direction of the swap. `true` for token A to token B, `false` for token B to token A. * `has_referral: bool`: Indicates if a referral fee should be considered. ### [​](https://docs.meteora.ag/developer-guide/integrations/damm-v2/rust-sdk/1-rust-integration#returns) Returns A `Result` which contains the details of the swap if successful, including `amount_out`, fees, and new liquidity states. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/damm-v2/typescript-sdk/2-damm-v2-sdk-functions) [Swagger UIDAMM v2\ \ Next](https://docs.meteora.ag/developer-guide/integrations/damm-v2/apis/1-api-endpoints) On this page * [Getting Started](https://docs.meteora.ag/developer-guide/integrations/damm-v2/rust-sdk/1-rust-integration#getting-started) * [API Reference](https://docs.meteora.ag/developer-guide/integrations/damm-v2/rust-sdk/1-rust-integration#api-reference) * [get\_quote](https://docs.meteora.ag/developer-guide/integrations/damm-v2/rust-sdk/1-rust-integration#get-quote) * [Parameters](https://docs.meteora.ag/developer-guide/integrations/damm-v2/rust-sdk/1-rust-integration#parameters) * [Returns](https://docs.meteora.ag/developer-guide/integrations/damm-v2/rust-sdk/1-rust-integration#returns) Assistant Responses are generated using AI and may contain mistakes. --- # Launchpad Scaffold - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DBC Launchpad Scaffold [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) The Launchpad Scaffold is a template repository that allows you to create a new launchpad within a few minutes. [​](https://docs.meteora.ag/developer-guide/integrations/dbc/3-launchpad-scaffold#resources) Resources ========================================================================================================= * [Fun Launch Launchpad Scaffold](https://github.com/MeteoraAg/meteora-invent/tree/main/scaffolds/fun-launch) [​](https://docs.meteora.ag/developer-guide/integrations/dbc/3-launchpad-scaffold#features) Features ======================================================================================================= Token Launch Platform --------------------- * **Token Pool Creation:** Create pools with customizable price curves using Meteora’s Dynamic Bonding Curve SDK * **Metadata Management:** Upload token logos and metadata to Cloudflare R2 storage * **Wallet Integration:** Support for Solana wallets via Jupiter’s wallet adapter * **Transaction Handling:** Sign and send transactions to Solana blockchain Token Exploration & Discovery ----------------------------- * **Token Browser:** Explore tokens across different categories (New, Graduating, Graduated) * **Real-time Data:** Live streaming of token data and price updates * **Filtering & Sorting:** Multiple filter options and sorting criteria * **Search Functionality:** Find tokens by various criteria Advanced Trading Interface -------------------------- * **TradingView Charts:** Professional-grade charting with TradingView integration * **Price & Market Cap Views:** Toggle between price and market cap chart modes * **Multiple Timeframes:** Support for various chart intervals (5m, 1h, 6h, 24h) * **Trading Marks:** Display buy/sell transactions on charts * **Volume Analysis:** Volume indicators and studies Token Analytics & Data ---------------------- * **Real-time Statistics:** Price, volume, market cap, holder count * **Transaction History:** Complete transaction table with filtering * **Holder Analysis:** Top holders, holder distribution, holder tags * **Performance Metrics:** Price changes, volume changes across timeframes * **Organic Score:** Algorithm-based token quality scoring [​](https://docs.meteora.ag/developer-guide/integrations/dbc/3-launchpad-scaffold#fun-launch-launchpad-scaffold) Fun Launch Launchpad Scaffold ================================================================================================================================================= A launchpad platform for launching tokens with build with Meteora’s Dynamic Bonding Curve Program. [​](https://docs.meteora.ag/developer-guide/integrations/dbc/3-launchpad-scaffold#setup) Setup ------------------------------------------------------------------------------------------------- 1 Clone the repository Copy Ask AI git clone https://github.com/MeteoraAg/meteora-invent.git 2 Install dependencies Copy Ask AI pnpm install 3 Set up environment variables Create a `.env` file in the root directory with the following variables: Copy Ask AI cp scaffolds/fun-launch/.env.example scaffolds/fun-launch/.env Copy Ask AI # Cloudflare R2 Storage R2_ACCESS_KEY_ID=your_r2_access_key_id R2_SECRET_ACCESS_KEY=your_r2_secret_access_key R2_ACCOUNT_ID=your_r2_account_id R2_BUCKET=your_r2_bucket_name # Solana RPC URL RPC_URL=your_rpc_url # Pool Configuration POOL_CONFIG_KEY=your_pool_config_key ### [​](https://docs.meteora.ag/developer-guide/integrations/dbc/3-launchpad-scaffold#getting-r2-credentials) Getting R2 Credentials 1. Go to [Cloudflare Dashboard](https://dash.cloudflare.com/) 2. Navigate to R2 3. Create a new bucket or select an existing one 4. Go to “Manage R2 API Tokens” 5. Create a new API token with the following permissions: * Account R2 Storage: Edit * Bucket: Your bucket name 6. Copy the Access Key ID and Secret Access Key 7. Your Account ID can be found in the Cloudflare dashboard URL or in the Account Home page ### [​](https://docs.meteora.ag/developer-guide/integrations/dbc/3-launchpad-scaffold#getting-rpc-url) Getting RPC URL 1. Get your RPC URL from any 3rd party provider ### [​](https://docs.meteora.ag/developer-guide/integrations/dbc/3-launchpad-scaffold#pool-config-key) Pool Config Key The pool config key is used to configure the bonding curve parameters. You’ll need to: 1. Deploy your own pool config program 2. Or use an existing pool config program 3. Get the public key of the pool config account 4. **Run the development server** Copy Ask AI npm run dev [​](https://docs.meteora.ag/developer-guide/integrations/dbc/3-launchpad-scaffold#tech-stack) Tech Stack =========================================================================================================== * Next.js * TypeScript * Tailwind CSS * Solana Web3.js * Dynamic Bonding Curve SDK * Cloudflare R2 for storage Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/dbc/2-bonding-curve-formulas) [Trading Terminal Integration\ \ Next](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration) On this page * [Resources](https://docs.meteora.ag/developer-guide/integrations/dbc/3-launchpad-scaffold#resources) * [Features](https://docs.meteora.ag/developer-guide/integrations/dbc/3-launchpad-scaffold#features) * [Fun Launch Launchpad Scaffold](https://docs.meteora.ag/developer-guide/integrations/dbc/3-launchpad-scaffold#fun-launch-launchpad-scaffold) * [Setup](https://docs.meteora.ag/developer-guide/integrations/dbc/3-launchpad-scaffold#setup) * [Getting R2 Credentials](https://docs.meteora.ag/developer-guide/integrations/dbc/3-launchpad-scaffold#getting-r2-credentials) * [Getting RPC URL](https://docs.meteora.ag/developer-guide/integrations/dbc/3-launchpad-scaffold#getting-rpc-url) * [Pool Config Key](https://docs.meteora.ag/developer-guide/integrations/dbc/3-launchpad-scaffold#pool-config-key) * [Tech Stack](https://docs.meteora.ag/developer-guide/integrations/dbc/3-launchpad-scaffold#tech-stack) Assistant Responses are generated using AI and may contain mistakes. --- # Introduction - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DBC Introduction [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Build your own fully customizable bonding curve with DBC. DBC allows you to configure everything from the curve shape to the trading fees. [​](https://docs.meteora.ag/developer-guide/integrations/dbc/1-introduction#program-address) Program Address =============================================================================================================== * Mainnet-beta: `dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN` * Devnet: `dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN` [​](https://docs.meteora.ag/developer-guide/integrations/dbc/1-introduction#resources) Resources =================================================================================================== * [Dynamic Bonding Curve Program](https://github.com/MeteoraAg/dynamic-bonding-curve) * [Dynamic Bonding Curve Typescript SDK](https://github.com/MeteoraAg/dynamic-bonding-curve-sdk) * [Interface Definition Language (IDL)](https://github.com/MeteoraAg/dynamic-bonding-curve-sdk/blob/main/packages/dynamic-bonding-curve/src/idl/dynamic-bonding-curve/idl.json) [​](https://docs.meteora.ag/developer-guide/integrations/dbc/1-introduction#flow-of-dbc-pool-%3E-damm-v1%2Fv2-pool) Flow of DBC Pool -> DAMM v1/v2 Pool ========================================================================================================================================================== [​](https://docs.meteora.ag/developer-guide/integrations/dbc/1-introduction#concepts) Concepts ------------------------------------------------------------------------------------------------- * **Pre-bonding**: DBC pool - where the newly minted token discovers its price. No need for an LP. * **Post-bonding**: DAMM v1/v2 pool - where the accumulated `quote_mint` tokens in the bonding curve + a portion of the `base_mint` tokens are migrated to form the liquidity pool of the new token * **Partner**: Launchpad * **Creator**: Token Pool Creator [​](https://docs.meteora.ag/developer-guide/integrations/dbc/1-introduction#flow) Flow ----------------------------------------------------------------------------------------- 1 Step 1: Create DBC Config Key Partner creates a DBC Config Key that consists of the curve shape, migrated pool fee, and many more. 2 Step 2: Create DBC Token Pool Creator creates a DBC Token Pool with the Partner’s DBC Config Key. This action will mint the new token and initialise a DBC Pool. 3 Step 3: Trade DBC Token Pool The DBC Token Pool is tradeable on all trading terminals and trading bots (including Jupiter Pro, Axiom, Photon, GMGN, BullX etc.) 4 Step 4: Migrate to DAMM Pool Once the DBC Token Pool has accumulated enough `quote_mint` tokens (`pool_state::quote_reserve >= pool_config::migration_quote_threshold`), our migrator keeper will automatically migrate the DBC pool to a DAMM Pool. The `migration_quote_threshold` and a portion of the `base_mint` tokens will form the liquidity pool of the DAMM Pool. 5 Step 5: Trade on graduated DAMM v1/v2 Pool The graduated DAMM v1/v2 Pool is also tradeable on all trading terminals and trading bots (including Jupiter Pro, Axiom, Photon, GMGN, BullX etc.) [​](https://docs.meteora.ag/developer-guide/integrations/dbc/1-introduction#migration) Migration =================================================================================================== [​](https://docs.meteora.ag/developer-guide/integrations/dbc/1-introduction#damm-fee-config-keys) DAMM Fee Config Keys ------------------------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/developer-guide/integrations/dbc/1-introduction#damm-v1-migration-fee-config-keys%3A) DAMM (v1) Migration Fee Config Keys: * `migration_fee_option == 0:` 8f848CEy8eY6PhJ3VcemtBDzPPSD4Vq7aJczLZ3o8MmX * `migration_fee_option == 1:` HBxB8Lf14Yj8pqeJ8C4qDb5ryHL7xwpuykz31BLNYr7S * `migration_fee_option == 2:` 7v5vBdUQHTNeqk1HnduiXcgbvCyVEZ612HLmYkQoAkik * `migration_fee_option == 3:` EkvP7d5yKxovj884d2DwmBQbrHUWRLGK6bympzrkXGja * `migration_fee_option == 4:` 9EZYAJrcqNWNQzP2trzZesP7XKMHA1jEomHzbRsdX8R2 * `migration_fee_option == 5:` 8cdKo87jZU2R12KY1BUjjRPwyjgdNjLGqSGQyrDshhud ### [​](https://docs.meteora.ag/developer-guide/integrations/dbc/1-introduction#damm-v2-migration-fee-config-keys%3A) DAMM v2 Migration Fee Config Keys: * `migration_fee_option == 0:` 7F6dnUcRuyM2TwR8myT1dYypFXpPSxqwKNSFNkxyNESd * `migration_fee_option == 1:` 2nHK1kju6XjphBLbNxpM5XRGFj7p9U8vvNzyZiha1z6k * `migration_fee_option == 2:` Hv8Lmzmnju6m7kcokVKvwqz7QPmdX9XfKjJsXz8RXcjp * `migration_fee_option == 3:` 2c4cYd4reUYVRAB9kUUkrq55VPyy2FNQ3FDL4o12JXmq * `migration_fee_option == 4:` AkmQWebAwFvWk55wBoCr5D62C6VVDTzi84NJuD9H7cFD * `migration_fee_option == 5:` DbCRBj8McvPYHJG1ukj8RE15h2dCNUdTAESG49XpQ44u [​](https://docs.meteora.ag/developer-guide/integrations/dbc/1-introduction#migration-keeper) Migration Keeper ----------------------------------------------------------------------------------------------------------------- We run 2 migration keepers on Mainnet to automatically migrate DBC pools to DAMM pools. Keeper addresses that we are running: 1. [CQdrEsYAxRqkwmpycuTwnMKggr3cr9fqY8Qma4J9TudY](https://solscan.io/account/CQdrEsYAxRqkwmpycuTwnMKggr3cr9fqY8Qma4J9TudY) * `pool_config.migration_quote_threshold` requirements: * 10 SOL * 750 USDC * 1500 JUP 2. [DeQ8dPv6ReZNQ45NfiWwS5CchWpB2BVq1QMyNV8L2uSW](https://solscan.io/account/DeQ8dPv6ReZNQ45NfiWwS5CchWpB2BVq1QMyNV8L2uSW) * `pool_config.migration_quote_threshold` requirements: * \>= 750 USD (`quote_mint` token) The Migration Keepers only runs on Mainnet. [​](https://docs.meteora.ag/developer-guide/integrations/dbc/1-introduction#manual-migrator) Manual Migrator --------------------------------------------------------------------------------------------------------------- We have created a [Manual Migrator](https://migrator.meteora.ag/) user interface that allows you to manually migrate your DBC pool to a DAMM pool on both Mainnet and Devnet. Depending on your DBC Config Key, the migration process will require you to sign more than one transaction to call each instruction. [​](https://docs.meteora.ag/developer-guide/integrations/dbc/1-introduction#config-key-parameters) Config Key Parameters =========================================================================================================================== pool\_fees ---------- **Type:** `object` (includes `base_fee` and optional `dynamic_fee`) Defines the trading fee for any pool created from this configuration. Partner can add a fee scheduler or rate limiter in `base_fee` or just a fixed fee. collect\_fee\_mode ------------------ **Type:** `0 | 1` **0:** Only collects fee in quote token. **1:** Collects fee in both tokens. migration\_option ----------------- **Type:** `number` Currently only supports migration to Meteora DAMM. Set to `0`. activation\_type ---------------- **Type:** `0 | 1` **0:** Slot **1:** Timestamp Indicates the time unit for pool operations, mainly for fee scheduler/rate limiter and dynamic fee calculations. token\_type ----------- **Type:** `0 | 1` **0:** SPL Token **1:** Token2022 token\_decimal -------------- **Type:** `number` (6-9) Token decimals used when creating the virtual pool. Only supports 6 to 9. partner\_lp\_percentage ----------------------- **Type:** `number` Percentage of LP that partner can claim after migration. partner\_locked\_lp\_percentage ------------------------------- **Type:** `number` Percentage of LP that partner will have locked after migration. creator\_lp\_percentage ----------------------- **Type:** `number` Percentage of LP that creator can claim after migration. creator\_locked\_lp\_percentage ------------------------------- **Type:** `number` Percentage of LP that creator will have locked after migration. migration\_quote\_threshold --------------------------- **Type:** `number` Threshold for quote token. When the virtual pool reserve reaches this amount, the token will graduate and be migrated. fee\_claimer ------------ **Type:** `address` Address of the partner that can claim trading fees from virtual pools and locked LPs. owner ----- **Type:** `address` Owner of the configuration. quote\_mint ----------- **Type:** `address` Quote mint address that the virtual pool will support. locked\_vesting --------------- **Type:** `object` Locked vesting for creator after migration (tokens will be migrated to [Jup lock](https://lock.jup.ag/) ). migration\_fee\_option ---------------------- **Type:** `number` Fee option for graduated pool. Supported: 0.25%, 0.3%, 1%, 2%, 4%, 6%. token\_supply ------------- **Type:** `number` If specified, token will have fixed supply pre- and post-migration. Leftover will be returned to `leftover_receiver` (configured in config key). creator\_trading\_fee\_percentage --------------------------------- **Type:** `number` Percentage of trading fee and surplus pool creator can get for a pool. token\_update\_authority ------------------------ **Type:** `0 | 1` **0:** Mutable **1:** Immutable Option to allow creator to update token metadata. migration\_fee -------------- **Type:** `number` Option to configure migration fee from migration quote threshold. Migration fee can be shared between partner and creator. sqrt\_start\_price ------------------ **Type:** `number` Square root of min price in the bonding curve for the virtual pools. curve ----- **Type:** `array` of (square price, liquidity) Defines the liquidity distribution for the virtual pools. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/damm-v2/apis/1-api-endpoints) [Bonding Curve Formulas\ \ Next](https://docs.meteora.ag/developer-guide/integrations/dbc/2-bonding-curve-formulas) On this page * [Program Address](https://docs.meteora.ag/developer-guide/integrations/dbc/1-introduction#program-address) * [Resources](https://docs.meteora.ag/developer-guide/integrations/dbc/1-introduction#resources) * [Flow of DBC Pool -> DAMM v1/v2 Pool](https://docs.meteora.ag/developer-guide/integrations/dbc/1-introduction#flow-of-dbc-pool-%3E-damm-v1%2Fv2-pool) * [Concepts](https://docs.meteora.ag/developer-guide/integrations/dbc/1-introduction#concepts) * [Flow](https://docs.meteora.ag/developer-guide/integrations/dbc/1-introduction#flow) * [Migration](https://docs.meteora.ag/developer-guide/integrations/dbc/1-introduction#migration) * [DAMM Fee Config Keys](https://docs.meteora.ag/developer-guide/integrations/dbc/1-introduction#damm-fee-config-keys) * [DAMM (v1) Migration Fee Config Keys:](https://docs.meteora.ag/developer-guide/integrations/dbc/1-introduction#damm-v1-migration-fee-config-keys%3A) * [DAMM v2 Migration Fee Config Keys:](https://docs.meteora.ag/developer-guide/integrations/dbc/1-introduction#damm-v2-migration-fee-config-keys%3A) * [Migration Keeper](https://docs.meteora.ag/developer-guide/integrations/dbc/1-introduction#migration-keeper) * [Manual Migrator](https://docs.meteora.ag/developer-guide/integrations/dbc/1-introduction#manual-migrator) * [Config Key Parameters](https://docs.meteora.ag/developer-guide/integrations/dbc/1-introduction#config-key-parameters) Assistant Responses are generated using AI and may contain mistakes. --- # Rust Integration - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Rust SDK Rust Integration [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) The `dynamic-bonding-curve-sdk` provides a convenient way to interact with the Dynamic Bonding Curve program and get swap quotes. Before you begin, here are some important resources: * **Program ID (Mainnet & Devnet):** `dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN` * **Rust SDK:** [Dynamic Bonding Curve](https://github.com/MeteoraAg/dynamic-bonding-curve/tree/main/dynamic-bonding-curve-sdk) [​](https://docs.meteora.ag/developer-guide/integrations/dbc/rust-sdk/1-rust-integration#quote-exact-in) `quote_exact_in` ============================================================================================================================ This function calculates the result of a swap for a given amount of an exact input token. It’s useful for estimating the outcome of a trade before executing it on-chain. [​](https://docs.meteora.ag/developer-guide/integrations/dbc/rust-sdk/1-rust-integration#function-signature) Function Signature ---------------------------------------------------------------------------------------------------------------------------------- Copy Ask AI pub fn quote_exact_in( virtual_pool: &VirtualPool, config: &PoolConfig, swap_base_for_quote: bool, current_timestamp: u64, current_slot: u64, transfer_fee_excluded_amount_in: u64, has_referral: bool, ) -> Result [​](https://docs.meteora.ag/developer-guide/integrations/dbc/rust-sdk/1-rust-integration#parameters) Parameters ------------------------------------------------------------------------------------------------------------------ * `virtual_pool`: A reference to the `VirtualPool` state. * `config`: A reference to the `PoolConfig` for the pool. * `swap_base_for_quote`: A boolean indicating the direction of the trade. `true` for swapping base token for quote token, `false` otherwise. * `current_timestamp`: The current Solana cluster timestamp. * `current_slot`: The current Solana cluster slot. * `transfer_fee_excluded_amount_in`: The amount of input tokens for the swap, excluding any transfer fees. * `has_referral`: A boolean indicating if a referral fee should be considered. [​](https://docs.meteora.ag/developer-guide/integrations/dbc/rust-sdk/1-rust-integration#returns) Returns ------------------------------------------------------------------------------------------------------------ It returns a `Result`, where `SwapResult` contains detailed information about the outcome of the swap, such as the amount out, fees, and the new state of the pool. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/3-dbc-scripts) [Introduction\ \ Next](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/1-introduction) On this page * [quote\_exact\_in](https://docs.meteora.ag/developer-guide/integrations/dbc/rust-sdk/1-rust-integration#quote-exact-in) * [Function Signature](https://docs.meteora.ag/developer-guide/integrations/dbc/rust-sdk/1-rust-integration#function-signature) * [Parameters](https://docs.meteora.ag/developer-guide/integrations/dbc/rust-sdk/1-rust-integration#parameters) * [Returns](https://docs.meteora.ag/developer-guide/integrations/dbc/rust-sdk/1-rust-integration#returns) Assistant Responses are generated using AI and may contain mistakes. --- # Swagger UI - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation API Swagger UI [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [DLMM API Endpoint\ -----------------\ \ Access the DLMM API for comprehensive liquidity management features and operations.](https://dlmm-api.meteora.ag/swagger-ui/) Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/dlmm/cpi/1-cpi-examples) [Introduction\ \ Next](https://docs.meteora.ag/developer-guide/integrations/damm-v1/1-introduction) Assistant Responses are generated using AI and may contain mistakes. --- # Getting Started - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Typescript SDK Getting Started [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) This guide provides instructions on how to get started with the DBC TypeScript SDK. Before you begin, here are some important resources: * **Program ID (Mainnet & Devnet):** `dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN` * **Program Repository:** [Dynamic Bonding Curve](https://github.com/MeteoraAg/dynamic-bonding-curve) * **TypeScript SDK Repository:** [@meteora-ag/dynamic-bonding-curve-sdk](https://github.com/MeteoraAg/dynamic-bonding-curve-sdk) [​](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/1-getting-started#installation) Installation =========================================================================================================================== To use the SDK in your project, install it using your preferred package manager: Copy Ask AI npm install @meteora-ag/dynamic-bonding-curve-sdk @solana/web3.js # or pnpm install @meteora-ag/dynamic-bonding-curve-sdk @solana/web3.js # or yarn add @meteora-ag/dynamic-bonding-curve-sdk @solana/web3.js [​](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/1-getting-started#initialization) Initialization =============================================================================================================================== Once installed, you can initialize the SDK in your TypeScript/JavaScript project like this: Copy Ask AI import { Connection } from "@solana/web3.js"; import { DynamicBondingCurveClient } from "@meteora-ag/dynamic-bonding-curve-sdk"; // Initialize a connection to the Solana network (e.g., Mainnet) const connection = new Connection("https://api.mainnet-beta.solana.com"); // Create a new instance of the DynamicBondingCurveClient const dbcClient = new DynamicBondingCurveClient(connection, "confirmed"); [​](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/1-getting-started#testing-the-sdk-for-contributors) Testing the SDK (for contributors) ===================================================================================================================================================================== If you have cloned the SDK repository and want to run the built-in tests: Copy Ask AI # Install dependencies bun install # Run tests bun test [​](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/1-getting-started#damm-v1%2Fv2-fee-config-keys) DAMM v1/v2 Fee Config Keys ========================================================================================================================================================= [​](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/1-getting-started#damm-v1) DAMM v1 ----------------------------------------------------------------------------------------------------------------- Accessible via `DAMM_V1_MIGRATION_FEE_ADDRESS[i]` in the SDK. * `MigrationFeeOption.FixedBps25 == 0`: 8f848CEy8eY6PhJ3VcemtBDzPPSD4Vq7aJczLZ3o8MmX * `MigrationFeeOption.FixedBps30 == 1`: HBxB8Lf14Yj8pqeJ8C4qDb5ryHL7xwpuykz31BLNYr7S * `MigrationFeeOption.FixedBps100 == 2`: 7v5vBdUQHTNeqk1HnduiXcgbvCyVEZ612HLmYkQoAkik * `MigrationFeeOption.FixedBps200 == 3`: EkvP7d5yKxovj884d2DwmBQbrHUWRLGK6bympzrkXGja * `MigrationFeeOption.FixedBps400 == 4`: 9EZYAJrcqNWNQzP2trzZesP7XKMHA1jEomHzbRsdX8R2 * `MigrationFeeOption.FixedBps600 == 5`: 8cdKo87jZU2R12KY1BUjjRPwyjgdNjLGqSGQyrDshhud [​](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/1-getting-started#damm-v2) DAMM v2 ----------------------------------------------------------------------------------------------------------------- Accessible via `DAMM_V2_MIGRATION_FEE_ADDRESS[i]` in the SDK. * `MigrationFeeOption.FixedBps25 == 0`: 7F6dnUcRuyM2TwR8myT1dYypFXpPSxqwKNSFNkxyNESd * `MigrationFeeOption.FixedBps30 == 1`: 2nHK1kju6XjphBLbNxpM5XRGFj7p9U8vvNzyZiha1z6k * `MigrationFeeOption.FixedBps100 == 2`: Hv8Lmzmnju6m7kcokVKvwqz7QPmdX9XfKjJsXz8RXcjp * `MigrationFeeOption.FixedBps200 == 3`: 2c4cYd4reUYVRAB9kUUkrq55VPyy2FNQ3FDL4o12JXmq * `MigrationFeeOption.FixedBps400 == 4`: AkmQWebAwFvWk55wBoCr5D62C6VVDTzi84NJuD9H7cFD * `MigrationFeeOption.FixedBps600 == 5`: DbCRBj8McvPYHJG1ukj8RE15h2dCNUdTAESG49XpQ44u [​](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/1-getting-started#development-resources) Development Resources ============================================================================================================================================= [​](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/1-getting-started#faucets) Faucets ----------------------------------------------------------------------------------------------------------------- [Devnet Faucet\ -------------\ \ When working on devnet, you might need test tokens. Here is a helpful faucet.](https://faucet.raccoons.dev/) Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration) [DBC SDK Functions\ \ Next](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/2-dbc-sdk-functions) On this page * [Installation](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/1-getting-started#installation) * [Initialization](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/1-getting-started#initialization) * [Testing the SDK (for contributors)](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/1-getting-started#testing-the-sdk-for-contributors) * [DAMM v1/v2 Fee Config Keys](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/1-getting-started#damm-v1%2Fv2-fee-config-keys) * [DAMM v1](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/1-getting-started#damm-v1) * [DAMM v2](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/1-getting-started#damm-v2) * [Development Resources](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/1-getting-started#development-resources) * [Faucets](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/1-getting-started#faucets) Assistant Responses are generated using AI and may contain mistakes. --- # Introduction - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Dynamic Fee Sharing Introduction [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Dynamic Fee Sharing is a program that allows any project to configure a fee sharing mechanism for their fees earned. [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/1-introduction#program-address) Program Address =============================================================================================================================== * Mainnet-beta: `dfsdo2UqvwfN8DuUVrMRNfQe11VaiNoKcMqLHVvDPzh` * Devnet: `dfsdo2UqvwfN8DuUVrMRNfQe11VaiNoKcMqLHVvDPzh` [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/1-introduction#resources) Resources =================================================================================================================== * [Dynamic Fee Sharing Program](https://github.com/MeteoraAg/dynamic-fee-sharing) * [Dynamic Fee Sharing Typescript SDK](https://github.com/MeteoraAg/dynamic-fee-sharing-sdk) * [Interface Definition Language (IDL)](https://github.com/MeteoraAg/dynamic-fee-sharing-sdk/blob/main/src/idl/idl.json) [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/1-introduction#features) Features ================================================================================================================= Dynamic Fee Vault Creation -------------------------- **Two initialization methods:** * `initialize_fee_vault`: Creates a fee vault with a signer keypair * `initialize_fee_vault_pda`: Creates a fee vault using PDA for deterministic addresses **Multi-user support:** Supports 2-5 users per vault (configurable via MAX\_USER constant)**Token compatibility:** Supports both SPL Token and Token-2022 standards Proportional Fee Distribution System ------------------------------------ **Share-based allocation:** Each user has a defined share amount that determines their portion of fees**Precision calculations:** Uses 52-bit precision scaling for accurate fee distribution math**Dynamic fee accumulation:** Tracks `fee_per_share` to calculate individual user rewards over time Fee Funding Mechanism --------------------- **Flexible funding:** Anyone can fund fees into the vault via `fund_fee` instruction**Transfer fee handling:** Automatically accounts for token transfer fees (important for Token-2022)**Amount validation:** Ensures funded amounts are greater than zero**Real-time distribution:** Fees are immediately distributed proportionally to all users Individual Fee Claiming ----------------------- **Index-based claiming:** Users claim fees using their assigned index (0-4)**Authorization:** Only the designated user can claim their fees**Checkpoint system:** Tracks `fee_per_share_checkpoint` to calculate unclaimed rewards**Accumulated tracking:** Maintains running total of claimed fees per user Token Management ---------------- **Vault authority:** Uses PDA-based authority for secure token operations**Token vault:** Dedicated token account for holding fees**Multi-token support:** Each vault is tied to a specific token mint**Transfer utilities:** Includes helper functions for token transfers Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/2-meteora-lock-sdk-functions) [Getting StartedDynamic Fee Sharing\ \ Next](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/1-getting-started) On this page * [Program Address](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/1-introduction#program-address) * [Resources](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/1-introduction#resources) * [Features](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/1-introduction#features) Assistant Responses are generated using AI and may contain mistakes. --- # Introduction - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DLMM Introduction [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Initialize your own concentrated liquidity pool with DLMM. DLMM allows you to earn fees for liquidity provision, earn dynamic fees during market volatility and earn liquidity mining rewards where available. [​](https://docs.meteora.ag/developer-guide/integrations/dlmm/1-introduction#program-address) Program Address ================================================================================================================ * Mainnet-beta: `LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo` * Devnet: `LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo` [​](https://docs.meteora.ag/developer-guide/integrations/dlmm/1-introduction#resources) Resources ==================================================================================================== * [DLMM Typescript SDK](https://github.com/MeteoraAg/dlmm-sdk) * [Interface Definition Language Types (IDL Types)](https://github.com/MeteoraAg/dlmm-sdk/blob/main/ts-client/src/dlmm/idl.ts) [​](https://docs.meteora.ag/developer-guide/integrations/dlmm/1-introduction#features) Features ================================================================================================== Multiple Pool Types ------------------- **Permissionless Pools**: Open to anyone, fully decentralized**Permission Pools**: Restricted access with admin controls and activation mechanics**Customizable Permissionless Pools**: Enhanced permissionless pools with more configuration options**Permission V2 Pools**: Enhanced permission pools with Token2022 support Concentrated Liquidity Management --------------------------------- **Bin-based Liquidity**: Liquidity organized in discrete price bins (similar to Uniswap V3 ticks)**Dynamic Active Bin**: Automatically shifts based on trading activity**Bin Array Management**: Efficient storage and management of multiple price ranges**Position Management**: Support for up to 70 bins per position**Multiple Liquidity Strategies**: Add liquidity by weight distribution, strategy (balanced/imbalanced), single side, precise amounts, or seed liquidity for initial setup Advanced Swap Features ---------------------- **Exact Input Swaps**: Standard swap with specified input amount**Exact Output Swaps**: Reverse swaps with specified output amount**Price Impact Protection**: Configurable maximum price impact limits**Multi-hop Swapping**: Through bin arrays**Host Fee Support**: Referral fee mechanism**Swap Access Controls**: Whitelisting and activation-based restrictions Dynamic Fee System ------------------ **Base Fees**: Configurable base fee rates per bin step**Variable Fees**: Dynamic fees based on volatility**Composition Fees**: Additional fees for complex operations**Fee Parameter Updates**: Admin-controlled fee adjustments with time windows Farming & Rewards System ------------------------ **Dual Reward Support**: Up to 2 different reward tokens per pool**Time-based Rewards**: Configurable reward duration and rates**Reward Funding**: Flexible reward funding mechanisms**Reward Claims**: Granular reward claiming per bin range**Reward Funder Management**: Transferable reward management rights Position Features ----------------- **Position Initialization**: Create liquidity positions across bin ranges**Position Migration**: Upgrade positions from V1 to V2**Position Operators**: Delegate position management to operators**Position Locking**: Time-based liquidity lock mechanisms**Fee Ownership**: Separate fee collection rights**Position Closure**: Automatic and manual position closing**Minimum Liquidity Enforcement**: Prevents dust positions Token Standard Support ---------------------- **SPL Token Support**: Standard Solana tokens**Token2022 Support**: New token standard with additional features**Token Metadata**: Pointer and metadata support**Transfer Hooks**: Custom transfer logic support**Transfer Fees**: Token-level fee support**Permanent Delegate**: Enhanced token control features Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/home) [DLMM Formulas\ \ Next](https://docs.meteora.ag/developer-guide/integrations/dlmm/2-dlmm-formulas) On this page * [Program Address](https://docs.meteora.ag/developer-guide/integrations/dlmm/1-introduction#program-address) * [Resources](https://docs.meteora.ag/developer-guide/integrations/dlmm/1-introduction#resources) * [Features](https://docs.meteora.ag/developer-guide/integrations/dlmm/1-introduction#features) Assistant Responses are generated using AI and may contain mistakes. --- # Getting Started - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Typescript SDK Getting Started [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) This guide provides instructions on how to get started with the Dynamic Fee Sharing TypeScript SDK. Before you begin, here are some important resources: * **Program ID (Mainnet & Devnet):** `dfsdo2UqvwfN8DuUVrMRNfQe11VaiNoKcMqLHVvDPzh` * **TypeScript SDK Repository:** [@meteora-ag/dynamic-fee-sharing-sdk](https://github.com/MeteoraAg/dynamic-fee-sharing-sdk) [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/1-getting-started#installation) Installation =========================================================================================================================================== To use the SDK in your project, install it using your preferred package manager: Copy Ask AI npm install @meteora-ag/dynamic-fee-sharing-sdk @solana/web3.js # or pnpm install @meteora-ag/dynamic-fee-sharing-sdk @solana/web3.js # or yarn add @meteora-ag/dynamic-fee-sharing-sdk @solana/web3.js [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/1-getting-started#initialization) Initialization =============================================================================================================================================== Once installed, you can initialize the SDK in your TypeScript/JavaScript project like this: Copy Ask AI import { Connection } from "@solana/web3.js"; import { DynamicFeeSharingClient } from "@meteora-ag/dynamic-fee-sharing-sdk"; // Initialize a connection to the Solana network (e.g., Mainnet) const connection = new Connection("https://api.mainnet-beta.solana.com"); // Create a new instance of the DynamicFeeSharingClient const client = new DynamicFeeSharingClient(connection, "confirmed"); [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/1-getting-started#testing-the-sdk-for-contributors) Testing the SDK (for contributors) ===================================================================================================================================================================================== If you have cloned the SDK repository and want to run the built-in tests: Copy Ask AI # Install dependencies bun install # Run tests bun test [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/1-getting-started#development-resources) Development Resources ============================================================================================================================================================= [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/1-getting-started#faucets) Faucets --------------------------------------------------------------------------------------------------------------------------------- [Devnet Faucet\ -------------\ \ When working on devnet, you might need test tokens. Here is a helpful faucet.](https://faucet.raccoons.dev/) Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/1-introduction) [Dynamic Fee Sharing SDK Functions\ \ Next](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/2-dynamic-fee-sharing-sdk-functions) On this page * [Installation](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/1-getting-started#installation) * [Initialization](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/1-getting-started#initialization) * [Testing the SDK (for contributors)](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/1-getting-started#testing-the-sdk-for-contributors) * [Development Resources](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/1-getting-started#development-resources) * [Faucets](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/1-getting-started#faucets) Assistant Responses are generated using AI and may contain mistakes. --- # Introduction - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Dynamic Vault Introduction [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Dynamic Vault are vaults that rebalance every minute across lending platforms to find the best possible yield while prioritizing keeping user funds as accessible as possible. [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/1-introduction#program-address) Program Address ========================================================================================================================= * Mainnet-beta: `24Uqj9JCLxUeoC3hGfh5W3s9FM9uCHDS2SG3LYwBpyTi` * Devnet: `24Uqj9JCLxUeoC3hGfh5W3s9FM9uCHDS2SG3LYwBpyTi` [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/1-introduction#resources) Resources ============================================================================================================= * [Dynamic Vault Typescript SDK](https://github.com/MeteoraAg/vault-sdk) * [Interface Definition Language Types (IDL Types)](https://github.com/MeteoraAg/vault-sdk/blob/main/ts-client/src/vault/idl.ts) [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/1-introduction#features) Features =========================================================================================================== Vault Types ----------- **Regular Vault (RebalanceVault)**: Meteora can rebalance funds across multiple lending strategies**Idle Vault**: 100% liquidity stays in the vault without rebalancing capabilities User Operations --------------- **Deposit**: Users can deposit tokens and receive LP tokens representing their share**Withdraw**: Users can withdraw tokens by burning LP tokens**Direct Strategy Withdrawal**: If vault doesn’t have enough liquidity, can withdraw directly from strategies Multi-Strategy Support ---------------------- The vault supports up to 30 different strategies simultaneously, integrating with various DeFi protocols:**Currently Supported**: Solend (with and without liquidity mining), Marginfi, Kamino**Previously Supported**: PortFinance, Mango, Apricot, Francium, Tulip, Drift, Frakt (now deprecated) Strategy Management ------------------- **Initialize Strategy**: Meteora can add new strategies to the vault**Add/Remove Strategy**: Connect or disconnect strategies with standard or advanced removal options**Rebalance Strategies**: Deposit or withdraw liquidity from strategies Rewards System -------------- **Claim Rewards**: Collect rewards from lending protocols**Automatic Distribution**: Rewards go to treasury address**Multiple Token Support**: Can handle rewards in different tokens Fee System ---------- **Performance Fee**: 5% fee on profits charged when rebalancing**Fee Vault**: Dedicated account for collecting fees owned by treasury**Locked Profit Mechanism**: Gradual profit release over 6 hours to prevent MEV Security Features ----------------- **Slippage Protection**: Minimum output amount checks on deposits/withdrawals**Vault Controls**: Meteora can halt deposits while allowing withdrawals**Strategy Validation**: Ensures strategies are properly configured before use Advanced Financial Features --------------------------- **Locked Profit Tracking**: Prevents sudden profit realization affecting LP token prices**Virtual Price Stability**: Maintains consistent LP token pricing during rebalancing**Multi-token Support**: Each vault supports a specific token (USDC, SOL, etc.) Risk Management --------------- **Diversification**: Spreads risk across multiple lending protocols**Automated Rebalancing**: Optimizes yield while managing risk Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/stake2earn/apis/1-api-endpoints) [Getting StartedDynamic Vault\ \ Next](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/1-getting-started) On this page * [Program Address](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/1-introduction#program-address) * [Resources](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/1-introduction#resources) * [Features](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/1-introduction#features) Assistant Responses are generated using AI and may contain mistakes. --- # DLMM CPI Examples - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation CPI DLMM CPI Examples [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) This [repository](https://github.com/MeteoraAg/cpi-examples) contains examples for CPI (Cross-Program Invocation) to swap using DLMM programs. [​](https://docs.meteora.ag/developer-guide/integrations/dlmm/cpi/1-cpi-examples#dependencies) Dependencies ============================================================================================================== * **Anchor:** 0.28.0 * **Solana:** 1.16.1 * **Rust:** 1.68.0 [​](https://docs.meteora.ag/developer-guide/integrations/dlmm/cpi/1-cpi-examples#cpi-examples) CPI Examples ============================================================================================================== Access this [repository](https://github.com/MeteoraAg/dlmm-sdk/tree/main/programs/lb_clmm) in the SDK, import, and use CPI for the following. [CPI Example to DLMM Swap\ ------------------------\ \ Example implementation of Cross-Program Invocation for DLMM swap operations.](https://github.com/MeteoraAg/cpi-examples/blob/main/programs/cpi-example/src/instructions/dlmm_cpi/swap.rs) [Tests\ -----\ \ Test cases and examples for CPI integration with DLMM programs.](https://github.com/MeteoraAg/cpi-examples/blob/main/programs/cpi-example/tests) [​](https://docs.meteora.ag/developer-guide/integrations/dlmm/cpi/1-cpi-examples#rust-examples) Rust Examples ================================================================================================================ [CLI Examples\ ------------\ \ Command-line interface examples for DLMM SDK integration and usage.](https://github.com/MeteoraAg/dlmm-sdk/tree/main/cli) [Market Making Examples\ ----------------------\ \ Market making strategies and examples using the DLMM SDK.](https://github.com/MeteoraAg/dlmm-sdk/tree/main/market_making) Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/dlmm/typescript-sdk/2-dlmm-sdk-functions) [Swagger UIDLMM\ \ Next](https://docs.meteora.ag/developer-guide/integrations/dlmm/apis/1-api-endpoints) On this page * [Dependencies](https://docs.meteora.ag/developer-guide/integrations/dlmm/cpi/1-cpi-examples#dependencies) * [CPI Examples](https://docs.meteora.ag/developer-guide/integrations/dlmm/cpi/1-cpi-examples#cpi-examples) * [Rust Examples](https://docs.meteora.ag/developer-guide/integrations/dlmm/cpi/1-cpi-examples#rust-examples) Assistant Responses are generated using AI and may contain mistakes. --- # Getting Started - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Typescript SDK Getting Started [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) This guide provides instructions on how to get started with the DLMM TypeScript SDK. Before you begin, here are some important resources: * **Program ID (Mainnet & Devnet):** `LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo` * **TypeScript SDK Repository:** [@meteora-ag/dlmm](https://github.com/MeteoraAg/dlmm-sdk) [​](https://docs.meteora.ag/developer-guide/integrations/dlmm/typescript-sdk/1-getting-started#installation) Installation ============================================================================================================================ To use the SDK in your project, install it using your preferred package manager: Copy Ask AI npm install @meteora-ag/dlmm @solana/web3.js # or pnpm install @meteora-ag/dlmm @solana/web3.js # or yarn add @meteora-ag/dlmm @solana/web3.js [​](https://docs.meteora.ag/developer-guide/integrations/dlmm/typescript-sdk/1-getting-started#initialization) Initialization ================================================================================================================================ Once installed, you can initialize the SDK in your TypeScript/JavaScript project like this: Copy Ask AI import DLMM from '@meteora-ag/dlmm' import { Connection, PublicKey } from '@solana/web3.js'; const mainnetConnection = new Connection('https://api.mainnet-beta.solana.com'); // Create pool instances // e.g. creating a DLMM pool // You can get your desired pool address from the API https://dlmm-api.meteora.ag/pair/all const USDC_USDT_POOL = new PublicKey('ARwi1S4DaiTG5DX7S4M4ZsrXqpMD1MrTmbu9ue2tpmEq') const dlmmPool = await DLMM.create(connection, USDC_USDT_POOL); // e.g. creating multiple pools const dlmmPool = await DLMM.createMultiple(connection, [USDC_USDT_POOL, ...]); [​](https://docs.meteora.ag/developer-guide/integrations/dlmm/typescript-sdk/1-getting-started#testing-the-sdk-for-contributors) Testing the SDK (for contributors) ====================================================================================================================================================================== If you have cloned the SDK repository and want to run the built-in tests: Copy Ask AI # Install dependencies cd ts-client bun install # Run tests bun test [​](https://docs.meteora.ag/developer-guide/integrations/dlmm/typescript-sdk/1-getting-started#development-resources) Development Resources ============================================================================================================================================== [​](https://docs.meteora.ag/developer-guide/integrations/dlmm/typescript-sdk/1-getting-started#faucets) Faucets ------------------------------------------------------------------------------------------------------------------ [Devnet Faucet\ -------------\ \ When working on devnet, you might need test tokens. Here is a helpful faucet.](https://faucet.raccoons.dev/) Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/dlmm/2-dlmm-formulas) [DLMM SDK Functions\ \ Next](https://docs.meteora.ag/developer-guide/integrations/dlmm/typescript-sdk/2-dlmm-sdk-functions) On this page * [Installation](https://docs.meteora.ag/developer-guide/integrations/dlmm/typescript-sdk/1-getting-started#installation) * [Initialization](https://docs.meteora.ag/developer-guide/integrations/dlmm/typescript-sdk/1-getting-started#initialization) * [Testing the SDK (for contributors)](https://docs.meteora.ag/developer-guide/integrations/dlmm/typescript-sdk/1-getting-started#testing-the-sdk-for-contributors) * [Development Resources](https://docs.meteora.ag/developer-guide/integrations/dlmm/typescript-sdk/1-getting-started#development-resources) * [Faucets](https://docs.meteora.ag/developer-guide/integrations/dlmm/typescript-sdk/1-getting-started#faucets) Assistant Responses are generated using AI and may contain mistakes. --- # Introduction - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Meteora Lock Introduction [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Meteora Lock is a program that allows any project to release their tokens over-time for free. [​](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/1-introduction#program-address) Program Address ======================================================================================================================== * Mainnet-beta: `LocpQgucEQHbqNABEYvBvwoxCPsSbG91A1QaQhQQqjn` * Devnet: `LocpQgucEQHbqNABEYvBvwoxCPsSbG91A1QaQhQQqjn` [​](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/1-introduction#resources) Resources ============================================================================================================ * [Lock Program](https://github.com/jup-ag/jup-lock) * [Meteora Lock Typescript SDK](https://github.com/MeteoraAg/met-lock-sdk) * [Interface Definition Language (IDL)](https://github.com/MeteoraAg/met-lock-sdk/blob/main/src/idl/idl.json) [​](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/1-introduction#features) Features ========================================================================================================== Token Vesting Escrows --------------------- The program allows creation of sophisticated token vesting schedules with: * **Cliff period**: Initial lock period before any tokens can be claimed * **Cliff unlock amount**: Amount released immediately after cliff period * **Periodic vesting**: Tokens released at regular intervals (frequency) * **Customizable periods**: Define amount per period and total number of periods * **Flexible start times**: Set custom vesting start times Access Control Modes -------------------- Each escrow has configurable permissions for updating or cancelling the escrow: * **Neither creator nor recipient** * **Only creator** * **Only recipient** * **Either creator or recipient** Token Support ------------- * **SPL Token support** * **Token-2022 support** with transfer fees, confidential transfers, transfer hooks etc. Merkle Tree Distribution (Root Escrow) -------------------------------------- * **Create** a “root escrow” funded with tokens * **Define** recipients and vesting schedules via Merkle tree * Recipients can **claim** their escrows by providing Merkle proofs Escrow Management ----------------- * **Claim tokens**: Recipients can claim unlocked tokens at any time * **Update recipient**: Change beneficiary (based on permissions) * **Cancel escrow**: Cancel and redistribute tokens (based on permissions) * Claimable tokens go to recipient * Remaining tokens return to creator * **Close escrow**: Clean up fully claimed escrows to recover rent Metadata Support ---------------- Attach metadata to escrows such as name, description, creator and recipient emails. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/cpi/1-cpi-examples) [Getting StartedMeteora Lock\ \ Next](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/1-getting-started) On this page * [Program Address](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/1-introduction#program-address) * [Resources](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/1-introduction#resources) * [Features](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/1-introduction#features) Assistant Responses are generated using AI and may contain mistakes. --- # Introduction - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Stake2Earn Introduction [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Stake2Earn is a hassle-free solution that creators can use immediately to implement an automated staking mechanism for their memecoins. [​](https://docs.meteora.ag/developer-guide/integrations/stake2earn/1-introduction#program-address) Program Address ====================================================================================================================== * Mainnet-beta: `FEESngU3neckdwib9X3KWqdL7Mjmqk9XNp3uh5JbP4KP` * Devnet: `FEESngU3neckdwib9X3KWqdL7Mjmqk9XNp3uh5JbP4KP` [​](https://docs.meteora.ag/developer-guide/integrations/stake2earn/1-introduction#resources) Resources ========================================================================================================== * [Stake2Earn Typescript SDK](https://github.com/MeteoraAg/stake-for-fee-sdk) * [Interface Definition Language (IDL)](https://github.com/MeteoraAg/stake-for-fee-sdk/blob/main/ts-client/src/stake-for-fee/idls/stake_for_fee.ts) [​](https://docs.meteora.ag/developer-guide/integrations/stake2earn/1-introduction#features) Features ======================================================================================================== Staking System for Fee Distribution ----------------------------------- Users can stake meme tokens to earn trading fees from a DAMM v1 pool. Only the top stakers (configurable number) receive fee distributions. The program maintains a top staker list and a full balance list to track all participants. Vault Initialization -------------------- Creates a vault associated with a specific AMM pool (Dynamic AMM) with configurable parameters: * `top_list_length`: Number of top holders who receive fees (min: 10, max: 300) * `seconds_to_full_unlock`: Time for locked fees to be fully distributed (min: 60s, max: 30 days) * `unstake_lock_duration`: Lock period for unstaking (min: 1 hour, max: 30 days) * `start_fee_distribute_timestamp`: When fee distribution begins Staking Operations ------------------ * **Stake**: Users deposit meme tokens to participate in fee sharing * **Initialize Stake Escrow**: Creates an escrow account for each staker * Automatic tracking of stake amounts and positions in the top holder list Fee Claiming Mechanism ---------------------- Claims fees from the associated DAMM v1 pool with: * **Dual token fees**: Supports both base (meme) and quote (SOL/USDC) tokens * **Auto-restaking**: Claimed meme tokens are automatically restaked * **Quote token withdrawal**: Only quote tokens (SOL/USDC) are sent to users * Fees distributed proportionally based on stake amount among top holders * Time-locked fee release mechanism for gradual distribution Unstaking Process ----------------- * **Request Unstake**: Initiates unstaking with a lock period * **Cancel Unstake**: Allows cancellation before the lock period ends * **Withdraw**: Complete withdrawal after the lock period expires * Maintains `ongoing_total_partial_unstake_amount` to track pending unstakes Dynamic Top Holder Management ----------------------------- * Automatically updates the top staker list when stakes change * Tracks whether a staker is in the top list (in\_top\_list flag) * Adjusts fee distribution checkpoints when users enter/exit the top list Fee Distribution Algorithm -------------------------- * Uses a checkpoint system with cumulative fee per liquidity * Calculates pending fees based on stake amount and time in the top list * Supports gradual fee release over `seconds_to_full_unlock` period Permissionless -------------- * **Claim Fee Crank**: Anyone can trigger fee claims from the AMM pool * Helps ensure regular fee collection even if users don’t claim Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/alpha-vault/typescript-sdk/3-alpha-vault-with-whitelist) [Getting StartedStake2Earn\ \ Next](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/1-getting-started) On this page * [Program Address](https://docs.meteora.ag/developer-guide/integrations/stake2earn/1-introduction#program-address) * [Resources](https://docs.meteora.ag/developer-guide/integrations/stake2earn/1-introduction#resources) * [Features](https://docs.meteora.ag/developer-guide/integrations/stake2earn/1-introduction#features) Assistant Responses are generated using AI and may contain mistakes. --- # Bonding Curve Formulas - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DBC Bonding Curve Formulas [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) The Dynamic Bonding Curve is a customizable bonding curve that allows you to configure up to 16 curve segments to control the curve’s shape and price action. Each curve segment follows a constant product formula: x×y\=kx \\times y = k x×y\=k [​](https://docs.meteora.ag/developer-guide/integrations/dbc/2-bonding-curve-formulas#mathematical-foundation) Mathematical Foundation ========================================================================================================================================= A simple constant product formula can be expressed as: x×y\=Virtual Base Reserve×Virtual Curve Reservex \\times y = \\text{Virtual Base Reserve} \\times \\text{Virtual Curve Reserve} x×y\=Virtual Base Reserve×Virtual Curve Reserve This can also be represented as: x×y\=Liquidity2x \\times y = \\text{Liquidity}^2 x×y\=Liquidity2 Where: Liquidity\= Virtual Base Reserve×Virtual Curve Reserve \\text{Liquidity} = \\sqrt{\\,\\text{Virtual Base Reserve} \\times \\text{Virtual Curve Reserve}\\,} Liquidity\=Virtual Base Reserve×Virtual Curve Reserve​ With a constraint on `migration_quote_threshold`, this can be presented as a function of liquidity, minimum price, and maximum price. We denote: * `l` = liquidity * `pa` = minimum price * `pb` = maximum price Therefore: Bonding Curve Constant Product\=f(l,pa,pb)\\text{Bonding Curve Constant Product} = f(l, p\_a, p\_b) Bonding Curve Constant Product\=f(l,pa​,pb​) [​](https://docs.meteora.ag/developer-guide/integrations/dbc/2-bonding-curve-formulas#example-configuration) Example Configuration ------------------------------------------------------------------------------------------------------------------------------------- Consider a pool with the following configuration: Copy Ask AI sqrt_start_price = 1 curve = [\ (sqrt_price = 2, liquidity = 100),\ (sqrt_price = 4, liquidity = 500)\ ] The bonding curve will function across 2 price ranges: * **Range 1**: `(l = 100, pa = 1, pb = 2)` * **Range 2**: `(l = 500, pa = 2, pb = 4)` These are just example values and are not real values in the actual curve. You will have to calculate the actual `sqrt_price` and `liquidity` values which will be much bigger. [​](https://docs.meteora.ag/developer-guide/integrations/dbc/2-bonding-curve-formulas#core-formulas) Core Formulas ===================================================================================================================== Below are the core formulas used in the dynamic bonding curve program. We use the following notation: * Let LiL\_iLi​ = liquidity in iii index * Let PiP\_iPi​ = price at iii index * Pi−1P\_{i-1}Pi−1​ = price at the lower boundary of iii index * * * [​](https://docs.meteora.ag/developer-guide/integrations/dbc/2-bonding-curve-formulas#1-bonding-curve-amount) 1\. Bonding Curve Amount ----------------------------------------------------------------------------------------------------------------------------------------- The total amount of base mint tokens in the bonding curve is given by: Bonding Curve Amount\=∑iLi(1Pi−1−1Pi)\\text{Bonding Curve Amount} = \\sum\_{i} L\_i \\left( \\frac{1}{P\_{i-1}} - \\frac{1}{P\_i} \\right) Bonding Curve Amount\=i∑​Li​(Pi−1​1​−Pi​1​) * * * [​](https://docs.meteora.ag/developer-guide/integrations/dbc/2-bonding-curve-formulas#2-migration-quote-threshold) 2\. Migration Quote Threshold --------------------------------------------------------------------------------------------------------------------------------------------------- The migration quote threshold required for the pool to migrate is calculated as: Migration Quote Threshold\=∑iLi(Pi−Pi−1)\\text{Migration Quote Threshold} = \\sum\_{i} L\_i (P\_i - P\_{i-1}) Migration Quote Threshold\=i∑​Li​(Pi​−Pi−1​) * * * [​](https://docs.meteora.ag/developer-guide/integrations/dbc/2-bonding-curve-formulas#3-migration-price-calculation) 3\. Migration Price Calculation ------------------------------------------------------------------------------------------------------------------------------------------------------- To determine the migration price squared (pmax2p\_\\text{max}^2pmax2​) during migration, use: pmax2\=Migration Quote Threshold×(1−Migration Fee Percentage)Migration Amountp\_\\text{max}^2 = \\frac{\\text{Migration Quote Threshold} \\times (1 - \\text{Migration Fee Percentage})}{\\text{Migration Amount}} pmax2​\=Migration AmountMigration Quote Threshold×(1−Migration Fee Percentage)​ Where: * `Migration Fee Percentage` is the fee (as a decimal, e.g., 0.01 for 1%) * `Migration Amount` is the total amount of base mint tokens being migrated * * * These formulas allow you to compute swap amounts, migration thresholds, and price limits for any custom liquidity distribution along the bonding curve. [​](https://docs.meteora.ag/developer-guide/integrations/dbc/2-bonding-curve-formulas#fee-formulas) Fee Formulas =================================================================================================================== The total swap fee (fsf\_sfs​) will have two components: 1. **A base fee** (fbf\_bfb​) 2. **A variable fee** (fvf\_vfv​) The **total swap fee** is calculated as: fs\=fb+fvf\_s = f\_b + f\_v fs​\=fb​+fv​ [​](https://docs.meteora.ag/developer-guide/integrations/dbc/2-bonding-curve-formulas#pool-fee-interface) Pool Fee Interface ------------------------------------------------------------------------------------------------------------------------------- Copy Ask AI poolFees: { baseFee: { cliffFeeNumerator: BN // Initial fee numerator (base fee) firstFactor: number // feeScheduler: numberOfPeriod, rateLimiter: feeIncrementBps secondFactor: BN // feeScheduler: periodFrequency, rateLimiter: maxLimiterDuration thirdFactor: BN // feeScheduler: reductionFactor, rateLimiter: referenceAmount baseFeeMode: number // 0: FeeSchedulerLinear, 1: FeeSchedulerExponential, 2: RateLimiter } dynamicFee: { // Optional dynamic fee binStep: number // u16 value representing the bin step in bps binStepU128: BN // u128 value for a more accurate bin step filterPeriod: number // Minimum time that must pass between fee updates decayPeriod: number // Period after the volatility starts decaying (must be > filterPeriod) reductionFactor: number // Controls how quickly volatility decys over time variableFeeControl: number // Multiplier that determines how much volatility affects fees maxVolatilityAccumulator: number // Caps the maximum volatility that can be accumulated } | null } Using the relevant parameters, you can calculate the base fee and variable fee for any given swap. * For **Fee Scheduler** you can refer to the [Fee Scheduler Formulas](https://docs.meteora.ag/anti-sniper-suite/fee-scheduler/2-fee-scheduler-math) . * For **Rate Limiter** you can refer to the [Rate Limiter Formulas](https://docs.meteora.ag/anti-sniper-suite/rate-limiter/2-rate-limiter-math) . * For **Dynamic Fees** you can refer to the [Dynamic Fee Formulas](https://docs.meteora.ag/overview/products/dbc/3-trading-fees-calculation#dynamic-fee-variable-fee) . [​](https://docs.meteora.ag/developer-guide/integrations/dbc/2-bonding-curve-formulas#migration-fee) Migration Fee ===================================================================================================================== We introduced a new migration fee feature that allows users to collect a percentage of the `quote_min` from the `migration_quote_threshold` amount. Copy Ask AI migrationFee: { // Optional migration fee (set as 0 for feePercentage and 0 for creatorFeePercentage for no migration fee) feePercentage: number // The percentage of fee taken from migration quote threshold (0-50) creatorFeePercentage: number // The fee share percentage for the creator from the migration fee (0-100) } ONLY if you are using the `buildCurveWithMarketCap` function from the DBC Typescript SDK, you will need to calculate the actual `initial_market_cap` value that you want based on the desired initial market cap. [​](https://docs.meteora.ag/developer-guide/integrations/dbc/2-bonding-curve-formulas#formula) Formula --------------------------------------------------------------------------------------------------------- Copy Ask AI let D = desiredMarketCap and M = migrationMarketCap and f = migrationFee and I = initialMarketCap requiredRatio = sqrt(D / M) percentageSupplyOnMigration = (requiredRatio * (1 - f) * 100) / (1 + requiredRatio * (1 - f)) x = percentageSupplyOnMigration / ((100 - V - L) - percentageSupplyOnMigration) I = M * x² [​](https://docs.meteora.ag/developer-guide/integrations/dbc/2-bonding-curve-formulas#example) Example --------------------------------------------------------------------------------------------------------- Copy Ask AI let D = 10000 / SOL_PRICE let M = 80000 / SOL_PRICE let f = 0.5 let V = 0 let L = 1 / 1000000000 // leftover needs to be indicated to cover precision loss let requiredRatio = Math.sqrt(D / M) let percentageSupplyOnMigration = (requiredRatio * (1 - f) * 100) / (1 + requiredRatio * (1 - f)) let x = percentageSupplyOnMigration / (100 - V - L - percentageSupplyOnMigration) let I = M * x * x const curveConfig = buildCurveWithMarketCap({ totalTokenSupply: 1000000000, initialMarketCap: I, migrationMarketCap: M, migrationOption: MigrationOption.MET_DAMM_V2, tokenBaseDecimal: TokenDecimal.SIX, tokenQuoteDecimal: TokenDecimal.NINE, lockedVestingParam: { totalLockedVestingAmount: 0, numberOfVestingPeriod: 0, cliffUnlockAmount: 0, totalVestingDuration: 0, cliffDurationFromMigrationTime: 0, }, baseFeeParams: { baseFeeMode: BaseFeeMode.FeeSchedulerLinear, feeSchedulerParam: { startingFeeBps: 100, endingFeeBps: 100, numberOfPeriod: 0, totalDuration: 0, }, }, dynamicFeeEnabled: false, activationType: ActivationType.Slot, collectFeeMode: CollectFeeMode.QuoteToken, migrationFeeOption: MigrationFeeOption.FixedBps100, tokenType: TokenType.SPL, partnerLpPercentage: 0, creatorLpPercentage: 0, partnerLockedLpPercentage: 100, creatorLockedLpPercentage: 0, creatorTradingFeePercentage: 0, leftover: 1, tokenUpdateAuthority: 0, migrationFee: { feePercentage: 50, creatorFeePercentage: 0, }, }) A leftover value is needed to cover precision loss when you indicate a migration fee. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/dbc/1-introduction) [Launchpad Scaffold\ \ Next](https://docs.meteora.ag/developer-guide/integrations/dbc/3-launchpad-scaffold) On this page * [Mathematical Foundation](https://docs.meteora.ag/developer-guide/integrations/dbc/2-bonding-curve-formulas#mathematical-foundation) * [Example Configuration](https://docs.meteora.ag/developer-guide/integrations/dbc/2-bonding-curve-formulas#example-configuration) * [Core Formulas](https://docs.meteora.ag/developer-guide/integrations/dbc/2-bonding-curve-formulas#core-formulas) * [1\. Bonding Curve Amount](https://docs.meteora.ag/developer-guide/integrations/dbc/2-bonding-curve-formulas#1-bonding-curve-amount) * [2\. Migration Quote Threshold](https://docs.meteora.ag/developer-guide/integrations/dbc/2-bonding-curve-formulas#2-migration-quote-threshold) * [3\. Migration Price Calculation](https://docs.meteora.ag/developer-guide/integrations/dbc/2-bonding-curve-formulas#3-migration-price-calculation) * [Fee Formulas](https://docs.meteora.ag/developer-guide/integrations/dbc/2-bonding-curve-formulas#fee-formulas) * [Pool Fee Interface](https://docs.meteora.ag/developer-guide/integrations/dbc/2-bonding-curve-formulas#pool-fee-interface) * [Migration Fee](https://docs.meteora.ag/developer-guide/integrations/dbc/2-bonding-curve-formulas#migration-fee) * [Formula](https://docs.meteora.ag/developer-guide/integrations/dbc/2-bonding-curve-formulas#formula) * [Example](https://docs.meteora.ag/developer-guide/integrations/dbc/2-bonding-curve-formulas#example) Assistant Responses are generated using AI and may contain mistakes. --- # Trading Terminal Integration - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DBC Trading Terminal Integration [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [​](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#math-calculation) Math Calculation ================================================================================================================================= [​](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#bonding-curve-progress) Bonding Curve Progress --------------------------------------------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#core-formula) Core Formula Copy Ask AI bondingCurveProgress = poolState.quoteReserve / poolConfigState.migration_quote_threshold There are 2 ways you can get the quote reserve: 1. From the `poolState.quoteReserve` state in a DBC pool. 2. From the `nextSqrtPrice` in the swap CPI logs. ### [​](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#1-get-quote-reserve-from-pool-state) 1\. Get Quote Reserve from Pool State Copy Ask AI const client = new DynamicBondingCurveClient(connection, "confirmed"); const poolState = await client.state.getPool(poolAddress); const quoteReserve = poolState.quoteReserve; ### [​](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#2-get-quote-reserve-from-next-sqrt-price) 2\. Get Quote Reserve from Next Sqrt Price #### [​](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#using-the-get-quote-token-from-sqrt-price-function) Using the `get_quote_token_from_sqrt_price` function Copy Ask AI pub fn get_quote_token_from_sqrt_price(next_sqrt_price: u128, config: &PoolConfig) -> Result { let mut total_amount = U256::ZERO; for i in 0..MAX_CURVE_POINT { let lower_sqrt_price = if i == 0 { config.sqrt_start_price } else { config.curve[i - 1].sqrt_price }; if next_sqrt_price > lower_sqrt_price { let upper_sqrt_price = if next_sqrt_price < config.curve[i + 1].sqrt_price { next_sqrt_price } else { config.curve[i + 1].sqrt_price }; let max_amount_in = get_delta_amount_quote_unsigned_256( lower_sqrt_price, upper_sqrt_price, config.curve[i].liquidity, Rounding::Up, )?; total_amount = total_amount.safe_add(max_amount_in)?; } } Ok(total_amount) } #### [​](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#using-the-getquotereservefromnextsqrtprice-function-in-the-dbc-typescript-sdk) Using the `getQuoteReserveFromNextSqrtPrice` function in the DBC TypeScript SDK [getQuoteReserveFromNextSqrtPrice](https://github.com/MeteoraAg/dynamic-bonding-curve-sdk/blob/main/packages/dynamic-bonding-curve/docs.md#getQuoteReserveFromNextSqrtPrice) [​](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#total-fees) Total Fees --------------------------------------------------------------------------------------------------------------------- Copy Ask AI totalFees = baseFees + dynamicFees ### [​](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#base-fees) Base Fees Base Fees includes either a Flat Fee or a Fee Scheduler or Rate Limiter. `BaseFeeMode` can only be enums 0, 1, or 2. #### [​](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#flat-fee) Flat Fee Copy Ask AI // Example baseFee: { cliffFeeNumerator: , // 1% flat fee firstFactor: 0, secondFactor: , thirdFactor: , baseFeeMode: 0 } #### [​](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#fee-scheduler) Fee Scheduler Copy Ask AI type base_fee = { cliff_fee_numerator: BN first_factor: number // numberOfPeriod second_factor: BN // periodFrequency third_factor: BN // reductionFactor base_fee_mode: BaseFeeMode // 0 or 1 } Copy Ask AI when in Linear (0) baseFeeMode: fee = cliff_fee_numerator - (period * reduction_factor) when in Exponential (1) baseFeeMode: fee = cliff_fee_numerator * (1 - reduction_factor/10_000)^period Copy Ask AI // Fee Scheduler: 50% reduce to 1% in 10 minutes linearly baseFee: { cliffFeeNumerator: , firstFactor: 60, // numberOfPeriods secondFactor: , // periodFrequency thirdFactor: , // reduction factor baseFeeMode: 0 }, Copy Ask AI // Fee Scheduler: 50% reduce to 1% in 10 minutes exponentially baseFee: { cliffFeeNumerator: , firstFactor: 60, // numberOfPeriods secondFactor: , // periodFrequency thirdFactor: , // reduction factor baseFeeMode: 1 }, #### [​](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#rate-limiter) Rate Limiter Copy Ask AI type base_fee = { cliff_fee_numerator: BN first_factor: number //feeIncrementBps second_factor: BN // maxLimiterDuration third_factor: BN // referenceAmount base_fee_mode: BaseFeeMode // 2 } Copy Ask AI when in RateLimiter (2) baseFeeMode: For input_amount ≤ reference_amount: fee = input_amount * cliff_fee_numerator For input_amount > reference_amount: -> Let x0 = reference_amount -> Let c = cliff_fee_numerator -> Let i = fee_increment -> Let a = (input_amount - reference_amount) / reference_amount -> Let b = (input_amount - reference_amount) % reference_amount If a < max_index: fee = x0 * (c + c*a + i*a*(a+1)/2) + b * (c + i*(a+1)) If a ≥ max_index: fee = x0 * (c + c*max_index + i*max_index*(max_index+1)/2) + (d*x0 + b) * MAX_FEE where: -> d = a - max_index -> MAX_FEE is the maximum allowed fee (99%) **Note:** The Fee Scheduler and Rate Limiter depends on the `poolState.activationType`. * If the `poolState.activationType == 0`, then `numberOfPeriod` and `periodFrequency` is calculated in `SLOT == 400ms` * If the `poolState.activationType == 1`, then `numberOfPeriod` and `periodFrequency` is calculated in `SECONDS == 1000ms` Copy Ask AI // Rate Limiter: Starts at 1% fee -> Exponential increase in fee for 10 slots based on trade size // 0.5 SOL trade // fee = 0.5 SOL * 0.1% = 0.0005 SOL // 1.5 SOL trade // fee = 1 SOL * 0.1% + 0.5 SOL * 0.2% = 0.002 SOL // 3 SOL trade // fee = 1 SOL * 0.1% + 1 SOL * 0.2% + 1 SOL * 0.3% = 0.006 SOL baseFee: { cliffFeeNumerator: new BN(10_000_000), firstFactor: 10, // feeIncrementBps secondFactor: new BN(10), // maxLimiterDuration thirdFactor: new BN(1000000000), // referenceAmount baseFeeMode: 2, // rate limiter mode } ### [​](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#dynamic-fees-variable-fee) Dynamic Fees (Variable Fee) You can refer to the Dynamic Fee calculation [here](https://docs.meteora.ag/overview/products/dbc/3-trading-fees-calculation#dynamic-fee-variable-fee) [​](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#liquidity) Liquidity ------------------------------------------------------------------------------------------------------------------- Copy Ask AI liquidity = poolState.quoteReserve * quoteTokenPrice [​](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#fdv) FDV ------------------------------------------------------------------------------------------------------- Copy Ask AI fdv = poolConfigState.postMigrationTokenSupply * baseTokenPrice [​](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#market-cap) Market Cap --------------------------------------------------------------------------------------------------------------------- Using Transfer logs from Swap transactions is not the correct way of getting the token price as we have Anti-Sniper Suite features that can cause huge fee deductions from `TokenAmountIn` OR `TokenAmountOut`. The correct way is to fetch the Swap CPI logs from the Swap transaction. ### [​](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#formula) Formula Copy Ask AI marketCap = tokenPrice * circulatingTokenSupply #### [​](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#with-dbc-pool-config-state) With DBC Pool Config State Copy Ask AI // For poolConfig.feeCollectMode == 0 [QuoteToken] && tradeDirection == 1 [Quote to Base] // quoteMint -> fee deducted from quoteMint amountIn = actualAmountIn / tokenQuoteDecimal // baseMint amountOut = outputAmount / tokenBaseDecimal tokenPrice = (amountIn * quoteMintPrice) / amountOut Copy Ask AI // For poolConfig.feeCollectMode == 0 [QuoteToken] && tradeDirection == 0 [Base to Quote] // baseMint amountIn = actualAmountIn / tokenBaseDecimal // quoteMint -> fee deducted from quoteMint amountOut = (outputAmount + tradingFee + protocolFee + referralFee) / tokenQuoteDecimal tokenPrice = (amountOut * quoteMintPrice) / amountIn Copy Ask AI // For poolConfig.feeCollectMode == 1 [OutputToken] && tradeDirection == 1 [Quote to Base] // quoteMint amountIn = actualAmountIn / tokenQuoteDecimal // baseMint -> fee deducted from baseMint amountOut = (outputAmount + tradingFee + protocolFee + referralFee) / tokenBaseDecimal tokenPrice = (amountIn * quoteMintPrice) / amountOut Copy Ask AI // For poolConfig.feeCollectMode == 1 [OutputToken] && tradeDirection == 0 [Base to Quote] // baseMint amountIn = actualAmountIn / tokenBaseDecimal // quoteMint -> fee deducted from quoteMint amountOut = (outputAmount + tradingFee + protocolFee + referralFee) / tokenQuoteDecimal tokenPrice = (amountOut * quoteMintPrice) / amountIn #### [​](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#with-cpi-logs) With CPI Logs Alternatively, if you don’t fetch poolConfig in your current code and are unable to get `collectFeeMode`, you can base it all on the CPI logs: Copy Ask AI 1. if actualInputAmount === amountIn: then amountIn <> outputAmount + tradingFee + protocolFee + referralFee 2. if actualInputAmount !== amountIn: then actualAmountIn <> outputAmount [​](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#locked-vesting) Locked Vesting ----------------------------------------------------------------------------------------------------------------------------- Copy Ask AI total_vesting_amount = cliff_unlock_amount + (amount_per_period * number_of_period) [​](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#trading-volume) Trading Volume ----------------------------------------------------------------------------------------------------------------------------- Track from Swap CPI logs: Copy Ask AI // Depending on Trade Direction: trading_volume += amount_in * token_price [​](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#migration) Migration ------------------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#migration-process) Migration Process Once `getPoolCurveProgress == 100%`, then check `migrationProgress` and `isMigrated` status form the [DBC pool state](https://github.com/MeteoraAg/dynamic-bonding-curve/blob/main/programs/dynamic-bonding-curve/src/state/virtual_pool.rs) . Copy Ask AI IsMigrated::NotMigrated // 0 IsMigrated::Migrated // 1 Copy Ask AI MigrationProgress::PreBondingCurve // 0 MigrationProgress::PostBondingCurve // 1 MigrationProgress::LockedVesting // 2 MigrationProgress::CreatedPool // 3 ### [​](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#current-auto-migrators-running) Current Auto Migrators Running You can refer to the [DBC Auto Migrator](https://docs.meteora.ag/developer-guide/integrations/dbc/1-introduction#migration-keeper) for the current auto migrators running. ### [​](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#how-to-identify-launchpads-using-dbc) How to Identify Launchpads Using DBC We will provide a list of all DBC integrators. You can ping us on Discord if you want to get access to the list. [​](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#referral-account) Referral Account --------------------------------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#dbc) DBC For referral fees, simply add your [referral token account](https://github.com/MeteoraAg/dynamic-bonding-curve/blob/main/programs/dynamic-bonding-curve/src/instructions/ix_swap.rs#L30) within the swap instruction & you will receive 20% of the protocol fees for all trades. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/dbc/3-launchpad-scaffold) [Getting StartedDBC\ \ Next](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/1-getting-started) On this page * [Math Calculation](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#math-calculation) * [Bonding Curve Progress](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#bonding-curve-progress) * [Core Formula](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#core-formula) * [1\. Get Quote Reserve from Pool State](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#1-get-quote-reserve-from-pool-state) * [2\. Get Quote Reserve from Next Sqrt Price](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#2-get-quote-reserve-from-next-sqrt-price) * [Using the get\_quote\_token\_from\_sqrt\_price function](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#using-the-get-quote-token-from-sqrt-price-function) * [Using the getQuoteReserveFromNextSqrtPrice function in the DBC TypeScript SDK](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#using-the-getquotereservefromnextsqrtprice-function-in-the-dbc-typescript-sdk) * [Total Fees](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#total-fees) * [Base Fees](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#base-fees) * [Flat Fee](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#flat-fee) * [Fee Scheduler](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#fee-scheduler) * [Rate Limiter](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#rate-limiter) * [Dynamic Fees (Variable Fee)](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#dynamic-fees-variable-fee) * [Liquidity](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#liquidity) * [FDV](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#fdv) * [Market Cap](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#market-cap) * [Formula](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#formula) * [With DBC Pool Config State](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#with-dbc-pool-config-state) * [With CPI Logs](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#with-cpi-logs) * [Locked Vesting](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#locked-vesting) * [Trading Volume](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#trading-volume) * [Migration](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#migration) * [Migration Process](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#migration-process) * [Current Auto Migrators Running](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#current-auto-migrators-running) * [How to Identify Launchpads Using DBC](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#how-to-identify-launchpads-using-dbc) * [Referral Account](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#referral-account) * [DBC](https://docs.meteora.ag/developer-guide/integrations/dbc/4-trading-terminal-integration#dbc) Assistant Responses are generated using AI and may contain mistakes. --- # DLMM Formulas - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DLMM DLMM Formulas [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) DLMM is a concentrated liquidity AMM that uses a dynamic fee mechanism to adjust liquidity based on market conditions. [​](https://docs.meteora.ag/developer-guide/integrations/dlmm/2-dlmm-formulas#price-calculation-formulas) Price Calculation Formulas ======================================================================================================================================= [​](https://docs.meteora.ag/developer-guide/integrations/dlmm/2-dlmm-formulas#base-price-formula) Base Price Formula ----------------------------------------------------------------------------------------------------------------------- price\=(1+bin\_stepBASIS\_POINT\_MAX)active\_id\\text{price} = \\left(1 + \\frac{\\text{bin\\\_step}}{\\text{BASIS\\\_POINT\\\_MAX}}\\right)^{\\text{active\\\_id}} price\=(1+BASIS\_POINT\_MAXbin\_step​)active\_id **Where:** * `BASIS_POINT_MAX` = 10,000 * Uses Q64.64 fixed-point arithmetic * Example: For `bin_step = 10`, `price = (1.001)^active_id` [​](https://docs.meteora.ag/developer-guide/integrations/dlmm/2-dlmm-formulas#price-impact-formulas) Price Impact Formulas ----------------------------------------------------------------------------------------------------------------------------- **Selling X for Y:** min\_price\=spot\_price×BASIS\_POINT\_MAX−max\_price\_impact\_bpsBASIS\_POINT\_MAX\\text{min\\\_price} = \\text{spot\\\_price} \\times \\frac{\\text{BASIS\\\_POINT\\\_MAX} - \\text{max\\\_price\\\_impact\\\_bps}}{\\text{BASIS\\\_POINT\\\_MAX}} min\_price\=spot\_price×BASIS\_POINT\_MAXBASIS\_POINT\_MAX−max\_price\_impact\_bps​ **Selling Y for X:** min\_price\=spot\_price×BASIS\_POINT\_MAXBASIS\_POINT\_MAX−max\_price\_impact\_bps\\text{min\\\_price} = \\text{spot\\\_price} \\times \\frac{\\text{BASIS\\\_POINT\\\_MAX}}{\\text{BASIS\\\_POINT\\\_MAX} - \\text{max\\\_price\\\_impact\\\_bps}} min\_price\=spot\_price×BASIS\_POINT\_MAX−max\_price\_impact\_bpsBASIS\_POINT\_MAX​ [​](https://docs.meteora.ag/developer-guide/integrations/dlmm/2-dlmm-formulas#fee-calculation-formulas) Fee Calculation Formulas ----------------------------------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/developer-guide/integrations/dlmm/2-dlmm-formulas#total-trading-fee) Total Trading Fee total\_fee\_rate\=min⁡(base\_fee\_rate+variable\_fee\_rate,MAX\_FEE\_RATE)\\text{total\\\_fee\\\_rate} = \\min(\\text{base\\\_fee\\\_rate} + \\text{variable\\\_fee\\\_rate}, \\text{MAX\\\_FEE\\\_RATE}) total\_fee\_rate\=min(base\_fee\_rate+variable\_fee\_rate,MAX\_FEE\_RATE) #### [​](https://docs.meteora.ag/developer-guide/integrations/dlmm/2-dlmm-formulas#base-fee-formula) Base Fee Formula base\_fee\_rate\=base\_factor×bin\_step×10×10base\_fee\_power\_factor\\text{base\\\_fee\\\_rate} = \\text{base\\\_factor} \\times \\text{bin\\\_step} \\times 10 \\times 10^{\\text{base\\\_fee\\\_power\\\_factor}} base\_fee\_rate\=base\_factor×bin\_step×10×10base\_fee\_power\_factor #### [​](https://docs.meteora.ag/developer-guide/integrations/dlmm/2-dlmm-formulas#variable-fee-formula) Variable Fee Formula variable\_fee\_rate\=(volatility\_accumulator×bin\_step)2×variable\_fee\_control+OFFSETSCALE\\text{variable\\\_fee\\\_rate} = \\frac{(\\text{volatility\\\_accumulator} \\times \\text{bin\\\_step})^2 \\times \\text{variable\\\_fee\\\_control} + \\text{OFFSET}}{\\text{SCALE}} variable\_fee\_rate\=SCALE(volatility\_accumulator×bin\_step)2×variable\_fee\_control+OFFSET​ **Where:** * `OFFSET` = 99,999,999,999 * `SCALE` = 100,000,000,000 #### [​](https://docs.meteora.ag/developer-guide/integrations/dlmm/2-dlmm-formulas#composition-fee-formula) Composition Fee Formula composition\_fee\=swap\_amount×total\_fee\_rate×(1+total\_fee\_rate)FEE\_PRECISION2\\text{composition\\\_fee} = \\frac{\\text{swap\\\_amount} \\times \\text{total\\\_fee\\\_rate} \\times (1 + \\text{total\\\_fee\\\_rate})}{\\text{FEE\\\_PRECISION}^2} composition\_fee\=FEE\_PRECISION2swap\_amount×total\_fee\_rate×(1+total\_fee\_rate)​ **Where:** * `MAX_FEE_RATE` = 100,000,000 [​](https://docs.meteora.ag/developer-guide/integrations/dlmm/2-dlmm-formulas#liquidity-and-bin-math-formulas) Liquidity and Bin Math Formulas ------------------------------------------------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/developer-guide/integrations/dlmm/2-dlmm-formulas#liquidity-formula-constant-sum) Liquidity Formula (Constant Sum) L\=price×x+yL = \\text{price} \\times x + y L\=price×x+y **Where:** * `L` is liquidity * `x` and `y` are token amounts * Price is in Q64.64 format ### [​](https://docs.meteora.ag/developer-guide/integrations/dlmm/2-dlmm-formulas#liquidity-share-formula) Liquidity Share Formula liquidity\_share\=in\_liquidity×liquidity\_supplybin\_liquidity\\text{liquidity\\\_share} = \\frac{\\text{in\\\_liquidity} \\times \\text{liquidity\\\_supply}}{\\text{bin\\\_liquidity}} liquidity\_share\=bin\_liquidityin\_liquidity×liquidity\_supply​ Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/dlmm/1-introduction) [Getting StartedDLMM\ \ Next](https://docs.meteora.ag/developer-guide/integrations/dlmm/typescript-sdk/1-getting-started) On this page * [Price Calculation Formulas](https://docs.meteora.ag/developer-guide/integrations/dlmm/2-dlmm-formulas#price-calculation-formulas) * [Base Price Formula](https://docs.meteora.ag/developer-guide/integrations/dlmm/2-dlmm-formulas#base-price-formula) * [Price Impact Formulas](https://docs.meteora.ag/developer-guide/integrations/dlmm/2-dlmm-formulas#price-impact-formulas) * [Fee Calculation Formulas](https://docs.meteora.ag/developer-guide/integrations/dlmm/2-dlmm-formulas#fee-calculation-formulas) * [Total Trading Fee](https://docs.meteora.ag/developer-guide/integrations/dlmm/2-dlmm-formulas#total-trading-fee) * [Base Fee Formula](https://docs.meteora.ag/developer-guide/integrations/dlmm/2-dlmm-formulas#base-fee-formula) * [Variable Fee Formula](https://docs.meteora.ag/developer-guide/integrations/dlmm/2-dlmm-formulas#variable-fee-formula) * [Composition Fee Formula](https://docs.meteora.ag/developer-guide/integrations/dlmm/2-dlmm-formulas#composition-fee-formula) * [Liquidity and Bin Math Formulas](https://docs.meteora.ag/developer-guide/integrations/dlmm/2-dlmm-formulas#liquidity-and-bin-math-formulas) * [Liquidity Formula (Constant Sum)](https://docs.meteora.ag/developer-guide/integrations/dlmm/2-dlmm-formulas#liquidity-formula-constant-sum) * [Liquidity Share Formula](https://docs.meteora.ag/developer-guide/integrations/dlmm/2-dlmm-formulas#liquidity-share-formula) Assistant Responses are generated using AI and may contain mistakes. --- # Getting Started - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Typescript SDK Getting Started [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) This guide provides instructions on how to get started with the Dynamic Vault TypeScript SDK. Before you begin, here are some important resources: * **Program ID (Mainnet & Devnet):** `24Uqj9JCLxUeoC3hGfh5W3s9FM9uCHDS2SG3LYwBpyTi` * **TypeScript SDK Repository:** [@meteora-ag/vault-sdk](https://github.com/MeteoraAg/vault-sdk) [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/1-getting-started#installation) Installation ===================================================================================================================================== To use the SDK in your project, install it using your preferred package manager: Copy Ask AI npm install @meteora-ag/vault-sdk @solana/web3.js # or pnpm install @meteora-ag/vault-sdk @solana/web3.js # or yarn add @meteora-ag/vault-sdk @solana/web3.js [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/1-getting-started#initialization) Initialization ========================================================================================================================================= Once installed, you can initialize the SDK in your TypeScript/JavaScript project like this: Copy Ask AI import { Connection } from "@solana/web3.js"; import VaultImpl from '@meteora-ag/vault-sdk'; import { StaticTokenListResolutionStrategy, TokenInfo } from "@solana/spl-token-registry"; // Initialize a connection to the Solana network (e.g., Mainnet) const connection = new Connection("https://api.mainnet-beta.solana.com"); // Retrieve the token info for the vault (example: SOL) const tokenMap = new StaticTokenListResolutionStrategy().resolve(); const SOL_TOKEN_INFO = tokenMap.find(token => token.symbol === 'SOL') as TokenInfo; // Getting a Vault Implementation instance (SOL) const vault: VaultImpl = await VaultImpl.create( connection, SOL_TOKEN_INFO, { cluster: 'mainnet-beta' } ); [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/1-getting-started#testing-the-sdk-for-contributors) Testing the SDK (for contributors) =============================================================================================================================================================================== If you have cloned the SDK repository and want to run the built-in tests: Copy Ask AI # Install dependencies cd ts-client bun install # Run tests bun test [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/1-getting-started#development-resources) Development Resources ======================================================================================================================================================= [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/1-getting-started#faucets) Faucets --------------------------------------------------------------------------------------------------------------------------- [Devnet Faucet\ -------------\ \ When working on devnet, you might need test tokens. Here is a helpful faucet.](https://faucet.raccoons.dev/) Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/1-introduction) [Dynamic Vault SDK Functions\ \ Next](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions) On this page * [Installation](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/1-getting-started#installation) * [Initialization](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/1-getting-started#initialization) * [Testing the SDK (for contributors)](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/1-getting-started#testing-the-sdk-for-contributors) * [Development Resources](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/1-getting-started#development-resources) * [Faucets](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/1-getting-started#faucets) Assistant Responses are generated using AI and may contain mistakes. --- # Getting Started - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Typescript SDK Getting Started [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) This guide provides instructions on how to get started with the Alpha Vault TypeScript SDK. Before you begin, here are some important resources: * **Program ID (Mainnet & Devnet):** `FEESngU3neckdwib9X3KWqdL7Mjmqk9XNp3uh5JbP4KP` * **TypeScript SDK Repository:** [@meteora-ag/m3m3](https://github.com/MeteoraAg/stake-for-fee-sdk) [​](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/1-getting-started#installation) Installation ================================================================================================================================== To use the SDK in your project, install it using your preferred package manager: Copy Ask AI npm install @meteora-ag/m3m3 @solana/web3.js # or pnpm install @meteora-ag/m3m3 @solana/web3.js # or yarn add @meteora-ag/m3m3 @solana/web3.js [​](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/1-getting-started#initialization) Initialization ====================================================================================================================================== Once installed, you can initialize the SDK in your TypeScript/JavaScript project like this: Copy Ask AI import StakeForFee from "@meteora-ag/m3m3"; import { PublicKey } from "@solana/web3.js"; // Initialize a connection to the Solana network (e.g., Mainnet) const connection = new Connection("https://api.mainnet-beta.solana.com"); // Intialize the DAMM v1 pool const poolAddress = new PublicKey( "G2MRSjNjCbFUmMf32Z1aXYhy6pc1ihLyYg6orKedyjJG" ); // Create a new instance of the Stake2Earn const stake2earn = await Stake2Earn.create(connection, poolAddress); [​](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/1-getting-started#testing-the-sdk-for-contributors) Testing the SDK (for contributors) ============================================================================================================================================================================ If you have cloned the SDK repository and want to run the built-in tests: Copy Ask AI # Install dependencies cd ts-client bun install # Run tests bun test [​](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/1-getting-started#development-resources) Development Resources ==================================================================================================================================================== [​](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/1-getting-started#faucets) Faucets ------------------------------------------------------------------------------------------------------------------------ [Devnet Faucet\ -------------\ \ When working on devnet, you might need test tokens. Here is a helpful faucet.](https://faucet.raccoons.dev/) Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/stake2earn/1-introduction) [Stake2Earn Integration\ \ Next](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration) On this page * [Installation](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/1-getting-started#installation) * [Initialization](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/1-getting-started#initialization) * [Testing the SDK (for contributors)](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/1-getting-started#testing-the-sdk-for-contributors) * [Development Resources](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/1-getting-started#development-resources) * [Faucets](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/1-getting-started#faucets) Assistant Responses are generated using AI and may contain mistakes. --- # What's a DLMM Launch Pool? - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DLMM Launch Pool What's a DLMM Launch Pool? [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) DLMM Launch Pool is a pool type designed for new token launches. It comes fundamentally equipped with a feature set that makes it optimal for bootstrapping liquidity for new tokens and making the tokens accessible on Jupiter and other trading integrations. The Launch Pool has some differences from a standard DLMM Pool (e.g. those created via the Meteora UI). Its setup builds upon the standard DLMM pool tech and features to provide the following benefits: Customisable DLMM pool to suit different project needs; design your liquidity distribution curve and other parameters using the [ILM curve tool](https://ilm.jup.ag/) at launch. Ability to set your activation point (token launch timing). Single-sided bootstrapping of liquidity using project tokens, without the need for initial USDC or SOL capital Token immediately tradable on Jupiter (Swap, DCA, LO) and all Jupiter integrations at launch, including Phantom, Solflare, and Birdeye, and popular trading bots Concentrated liquidity with zero-slippage bins and Dynamic Fees (average 6-7% for launch pools) [​](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/1-what-is-a-dlmm-launch-pool#who-should-use-dlmm-launch-pool%3F) Who should use DLMM Launch Pool? ------------------------------------------------------------------------------------------------------------------------------------------------------------------ The Launch Pool is targeted at new projects and token creators on Solana looking for a customizable liquidity pool setup to bootstrap liquidity for their new token and help ensure widespread token accessibility and distribution. The aim is for projects to bootstrap liquidity on their terms, with the flexibility to set their preferred price curve, liquidity distribution, and launch parameters exactly the way they want. This is also the same underlying technology used by Jupiter LFG Launchpad. Anyone can use our docs to create their own permissionless Launch Pool to be used for their token launch. [​](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/1-what-is-a-dlmm-launch-pool#checklist) Checklist ------------------------------------------------------------------------------------------------------------------ ### [​](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/1-what-is-a-dlmm-launch-pool#liquidity-distribution-parameters) Liquidity Distribution parameters Use the [ILM (Intuitive Liquidity Modelling)](https://ilm.jup.ag/) tool to design the liquidity distribution for your pool and decide on your final parameters. * **Curvature**: Determines how liquidity is distributed across the price range * **Initial Price**: Initial price for the token at the start of the launch * **Maximum Price**: Maximum price for the token during the launch * **Percentage of Total Supply in the pool** * **Total Supply of the Token (in Millions)** * **Bin Step**: Determines the granularity of the price by changing the number of price bins available. Each bin represents a single price point, and the difference between 2 consecutive bins is the bin step. Bin steps are calculated based on basis points. * **Base Fee**: The minimum fee charged per swap in the pool. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/2-dynamic-fee-sharing-sdk-functions) [Create a DLMM Launch Pool\ \ Next](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/2-create-a-dlmm-launch-pool) On this page * [Who should use DLMM Launch Pool?](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/1-what-is-a-dlmm-launch-pool#who-should-use-dlmm-launch-pool%3F) * [Checklist](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/1-what-is-a-dlmm-launch-pool#checklist) * [Liquidity Distribution parameters](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/1-what-is-a-dlmm-launch-pool#liquidity-distribution-parameters) Assistant Responses are generated using AI and may contain mistakes. --- # Swagger UI - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation API Swagger UI [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Mainnet API Endpoint\ --------------------\ \ Access the Stake2Earn Mainnet API for production use.](https://stake-for-fee-api.meteora.ag/swagger-ui/) [Devnet API Endpoint\ -------------------\ \ Access the Stake2Earn Devnet API for devnet testing and development.](https://devnet.stake-for-fee-api.meteora.ag/swagger-ui/) Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration) [Introduction\ \ Next](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/1-introduction) Assistant Responses are generated using AI and may contain mistakes. --- # What's Dynamic Fee Sharing? - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Dynamic Fee Sharing What's Dynamic Fee Sharing? [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) The Dynamic Fee Sharing program allows for the creation of fee vaults where collected fees can be automatically distributed among multiple recipients based on predetermined share allocations. [​](https://docs.meteora.ag/overview/other-products/dynamic-fee-sharing/1-what-is-dynamic-fee-sharing#key-features) Key Features =================================================================================================================================== Secure Fee Management --------------------- On-chain fee collection and distribution with support for both SPL tokens and Token-2022 tokens. Features precise mathematical calculations with overflow protection and immutable share configurations after initialization. Multi-User Support ------------------ Support for 2-5 users per fee vault with configurable share allocations for each user. Includes individual claim tracking to prevent double claims and user-specific checkpoints for accurate fee distribution. Flexible Fee Distribution ------------------------- Real-time fee accumulation with pro-rata distribution based on share percentages. Uses lazy evaluation for gas efficiency and supports partial funding and claiming. [​](https://docs.meteora.ag/overview/other-products/dynamic-fee-sharing/1-what-is-dynamic-fee-sharing#core-components) Core Components ========================================================================================================================================= 1. **Fee Vault**: The main account that stores user shares, accumulated fees, and distribution state 2. **Token Vault**: A PDA-controlled token account that holds the actual fee tokens 3. **Fee Vault Authority**: A PDA that controls the token vault for secure transfers Was this page helpful? YesNo [Previous\ \ What's Meteora Lock?Meteora Lock is an open source program that allows users to lock tokens based on a vesting plan.](https://docs.meteora.ag/overview/other-products/meteora-lock/1-what-is-meteora-lock) On this page * [Key Features](https://docs.meteora.ag/overview/other-products/dynamic-fee-sharing/1-what-is-dynamic-fee-sharing#key-features) * [Core Components](https://docs.meteora.ag/overview/other-products/dynamic-fee-sharing/1-what-is-dynamic-fee-sharing#core-components) Assistant Responses are generated using AI and may contain mistakes. --- # Create a DAMM v1 Launch Pool - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DAMM v1 Launch Pool Create a DAMM v1 Launch Pool [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Get an overview about Dynamic AMM Pools here. Below we provide the steps to use Bun to configure and run sample scripts to conveniently set up a permissionless Dynamic AMM Pool (with fixed fee %) on your own. For a Dynamic AMM Pool with a fee scheduler and liquidity permanently locked at pool creation (a.k.a Memecoin Pool v1), visit Create: Memecoin Pool v1. [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool#getting-started) Getting Started ----------------------------------------------------------------------------------------------------------------------------------- * Clone repo: [https://github.com/MeteoraAg/meteora-pool-setup](https://github.com/MeteoraAg/meteora-pool-setup) * Config list to reference: [https://github.com/MeteoraAg/meteora-pool-setup/tree/main/config](https://github.com/MeteoraAg/meteora-pool-setup/tree/main/config) * Readme: [https://github.com/MeteoraAg/meteora-pool-setup/blob/main/README.md](https://github.com/MeteoraAg/meteora-pool-setup/blob/main/README.md) [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool#resources) Resources ----------------------------------------------------------------------------------------------------------------------- * **Dynamic AMM Program ID**: Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB * **Dynamic AMM API endpoints**: [https://damm-api.meteora.ag/swagger-ui/](https://damm-api.meteora.ag/swagger-ui/) * **Devnet**: [https://damm-api.devnet.meteora.ag/swagger-ui/](https://damm-api.devnet.meteora.ag/swagger-ui/) [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool#dependencies) Dependencies ----------------------------------------------------------------------------------------------------------------------------- Install Bun: You’ll also need bun to run the scripts. Install it via bun installation. Then install the dependencies by running the command `bun install` [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool#scripts) Scripts ------------------------------------------------------------------------------------------------------------------- The following code examples can be used to initialize and seed a Dynamic AMM liquidity pool on Meteora. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool#create-dynamic-amm-pool-fixed-fee-%25-for-token-launch) Create Dynamic AMM Pool (fixed fee %) for Token Launch Clone repo: [https://github.com/MeteoraAg/meteora-pool-setup](https://github.com/MeteoraAg/meteora-pool-setup) Select an example config from the list to reference and change the parameters inside according to your needs: [https://github.com/MeteoraAg/meteora-pool-setup/tree/main/config](https://github.com/MeteoraAg/meteora-pool-setup/tree/main/config) Run the script with the config file which is set with your preferred parameters [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool#examples) Examples --------------------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool#create-a-dynamic-amm-pool-with-an-existing-token) Create a Dynamic AMM Pool with an existing token To create a Dynamic AMM Pool with an existing token (without minting a new token). Run this script with the config file which is set with your preferred parameters: Copy Ask AI bun run src/create_pool.ts --config ./config/create_dynamic_amm_pool.json Replace `./config/create_dynamic_amm_pool.json` with the path to your config file, after you have selected the type of config from the list and set your config parameters. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool#create-a-dynamic-amm-pool-with-new-token-mint) Create a Dynamic AMM Pool with new token mint To mint a new token and create a Dynamic AMM Pool for this token. Run this script with the config file which is set with your preferred parameters: Copy Ask AI bun run src/create_pool.ts --config ./config/create_dynamic_amm_pool_with_new_token.json ### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool#lock-liquidity-for-dynamic-amm-pool-optional) Lock Liquidity for Dynamic AMM Pool (Optional) You have the option to lock liquidity in the Dynamic AMM Pool you created. Run this script with the config file which is set with your preferred parameters: Copy Ask AI bun run src/lock_liquidity.ts --config ./config/lock_liquidity.json **Allocating fees from locked liquidity**: In the config file, you can also specify different wallet addresses to receive fees from the locked liquidity, and the % to allocate to each wallet. Multiple wallets are possible, but their allocations must add up to 100%. [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool#after-deployment) After deployment ------------------------------------------------------------------------------------------------------------------------------------- To view pool on the UI, access the link below For Dynamic AMM pool: [https://app.meteora.ag/pools/\`POOL\_ADDRESS\`](https://app.meteora.ag/pools/%60POOL_ADDRESS%60) ### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool#when-can-you-withdraw-tokens-from-the-pool%3F) When can you withdraw tokens from the pool? **Customizable Permissionless Dynamic AMM**: After pool activation point (trading starts) [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool#other-configuration-details) Other Configuration Details ----------------------------------------------------------------------------------------------------------------------------------------------------------- There are various config files that can be found in the config directory. It contains all the configurations required to run the scripts. We also need to provide the keypair for the payer wallet in keypair.json file. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool#general-configuration) General configuration * `rpcUrl`: Solana RPC URL to get data and send transactions. * `keypairFilePath`: Keypair file path to send transactions. * `dryRun`: Set to true to send transactions. * `computeUnitPriceMicroLamports`: CU price in micro lamports unit. For example: 100000. * `createBaseToken`: Configuration to create base token. * `baseMint`: Base token address if the createBaseToken field is not set. * `quoteSymbol`: Quote token symbol, only SOL or USDC is supported. * `quoteMint`: Quote token mint, in case the user wants to create a DLMM launch pool with a token other than SOL or USDC. * `dynamicAmm`: Dynamic AMM pool configuration. **Some configuration constraints:** * `createBaseToken` and `baseMint` cannot be used together. * `dynamicAmm` and `dlmm` cannot be used together. **Create Base Token configuration** * `mintBaseTokenAmount`: Base token amount to be minted. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool#dynamic-amm-configuration) Dynamic AMM configuration * `baseAmount`: Base token amount. * `quoteAmount`: Quote token amount. * `tradeFeeNumerator`: Trade fee numerator, with fee denominator is set to 100\_000. * `activationType`: To activate pool trading based on slot or timestamp. * `activationPoint`: To activate pool trading at a point, either slot valut or timestamp value based on activationType. * `hasAlphaVault`: Whether alpha vault is enabled or not for this pool. [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool#for-testing-bun-scripts) For Testing Bun Scripts --------------------------------------------------------------------------------------------------------------------------------------------------- First, run the localnet Copy Ask AI bun run start-test-validator Then run the test: Copy Ask AI bun test Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault) [Create a Stake2Earn v1 Launch Pool\ \ Next](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool) On this page * [Getting Started](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool#getting-started) * [Resources](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool#resources) * [Dependencies](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool#dependencies) * [Scripts](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool#scripts) * [Create Dynamic AMM Pool (fixed fee %) for Token Launch](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool#create-dynamic-amm-pool-fixed-fee-%25-for-token-launch) * [Examples](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool#examples) * [Create a Dynamic AMM Pool with an existing token](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool#create-a-dynamic-amm-pool-with-an-existing-token) * [Create a Dynamic AMM Pool with new token mint](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool#create-a-dynamic-amm-pool-with-new-token-mint) * [Lock Liquidity for Dynamic AMM Pool (Optional)](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool#lock-liquidity-for-dynamic-amm-pool-optional) * [After deployment](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool#after-deployment) * [When can you withdraw tokens from the pool?](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool#when-can-you-withdraw-tokens-from-the-pool%3F) * [Other Configuration Details](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool#other-configuration-details) * [General configuration](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool#general-configuration) * [Dynamic AMM configuration](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool#dynamic-amm-configuration) * [For Testing Bun Scripts](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool#for-testing-bun-scripts) Assistant Responses are generated using AI and may contain mistakes. --- # Getting Started - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Typescript SDK Getting Started [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) This guide provides instructions on how to get started with the Meteora Lock TypeScript SDK. Before you begin, here are some important resources: * **Program ID (Mainnet & Devnet):** `LocpQgucEQHbqNABEYvBvwoxCPsSbG91A1QaQhQQqjn` * **Program Repository:** [Meteora Lock](https://github.com/jup-ag/jup-lock) * **TypeScript SDK Repository:** [@meteora-ag/met-lock-sdk](https://github.com/MeteoraAg/met-lock-sdk) [​](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/1-getting-started#installation) Installation ==================================================================================================================================== To use the SDK in your project, install it using your preferred package manager: Copy Ask AI npm install @meteora-ag/met-lock-sdk @solana/web3.js # or pnpm install @meteora-ag/met-lock-sdk @solana/web3.js # or yarn add @meteora-ag/met-lock-sdk @solana/web3.js [​](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/1-getting-started#initialization) Initialization ======================================================================================================================================== Once installed, you can initialize the SDK in your TypeScript/JavaScript project like this: Copy Ask AI import { Connection } from "@solana/web3.js"; import { LockClient } from "@meteora-ag/met-lock-sdk"; // Initialize a connection to the Solana network (e.g., Mainnet) const connection = new Connection("https://api.mainnet-beta.solana.com"); // Create a new instance of the LockClient const client = new LockClient(connection, "confirmed"); [​](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/1-getting-started#development-resources) Development Resources ====================================================================================================================================================== [​](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/1-getting-started#faucets) Faucets -------------------------------------------------------------------------------------------------------------------------- [Devnet Faucet\ -------------\ \ When working on devnet, you might need test tokens. Here is a helpful faucet.](https://faucet.raccoons.dev/) Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/1-introduction) [Meteora Lock SDK Functions\ \ Next](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/2-meteora-lock-sdk-functions) On this page * [Installation](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/1-getting-started#installation) * [Initialization](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/1-getting-started#initialization) * [Development Resources](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/1-getting-started#development-resources) * [Faucets](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/1-getting-started#faucets) Assistant Responses are generated using AI and may contain mistakes. --- # Dynamic Vault CPI Examples - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation CPI Dynamic Vault CPI Examples [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Vault Periphery Examples\ ------------------------\ \ Example implementation of a program that integrates with vault program on-chain.](https://github.com/MeteoraAg/vault-periphery) [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/cpi/1-cpi-examples#add-mercurial-vault-to-dependencies) Add mercurial-vault to dependencies --------------------------------------------------------------------------------------------------------------------------------------------------------------------- If you are using rust, you can include the mercurial-vault link in your Cargo.toml file under “dependencies”. Copy Ask AI mercurial-vault = { git = "https://github.com/mercurial-finance/vault-sdk", rev="9ea05048146878f5e22549ce270d0e5d6776ccc9", features = ["cpi"] } [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/cpi/1-cpi-examples#cpi-to-vault-program) CPI to Vault program --------------------------------------------------------------------------------------------------------------------------------------- Copy Ask AI //! Vault utilities use anchor_lang::prelude::*; use mercurial_vault::cpi::accounts::{DepositWithdrawLiquidity, WithdrawDirectlyFromStrategy}; use mercurial_vault::cpi::*; use mercurial_vault::state::Vault; /// MercurialVault struct #[derive(Clone)] pub struct MercurialVault; impl anchor_lang::Id for MercurialVault { fn id() -> Pubkey { mercurial_vault::id() } } /// VaultUtils struct pub struct VaultUtils; impl VaultUtils { /// deposit to vault #[allow(clippy::too_many_arguments)] pub fn deposit<'info>( vault: &AccountInfo<'info>, lp_mint: &AccountInfo<'info>, user_token: &AccountInfo<'info>, user_lp: &AccountInfo<'info>, user: &AccountInfo<'info>, token_vault: &AccountInfo<'info>, token_program: &AccountInfo<'info>, vault_program: &AccountInfo<'info>, token_amount: u64, minimum_lp_amount: u64, ) -> Result<()> { let accounts = DepositWithdrawLiquidity { vault: vault.to_account_info(), lp_mint: lp_mint.to_account_info(), user_token: user_token.to_account_info(), user_lp: user_lp.to_account_info(), user: user.to_account_info(), token_vault: token_vault.to_account_info(), token_program: token_program.to_account_info(), }; let cpi_ctx = CpiContext::new(vault_program.to_account_info(), accounts); deposit(cpi_ctx, token_amount, minimum_lp_amount) } /// withdraw from vault #[allow(clippy::too_many_arguments)] pub fn withdraw<'info>( vault: &AccountInfo<'info>, lp_mint: &AccountInfo<'info>, user_token: &AccountInfo<'info>, user_lp: &AccountInfo<'info>, user: &AccountInfo<'info>, token_vault: &AccountInfo<'info>, token_program: &AccountInfo<'info>, vault_program: &AccountInfo<'info>, unmint_amount: u64, minimum_out_amount: u64, signers: &[&[&[u8]]], ) -> Result<()> { let accounts = DepositWithdrawLiquidity { vault: vault.to_account_info(), lp_mint: lp_mint.to_account_info(), user_token: user_token.to_account_info(), user_lp: user_lp.to_account_info(), user: user.to_account_info(), token_vault: token_vault.to_account_info(), token_program: token_program.to_account_info(), }; let cpi_ctx = CpiContext::new_with_signer(vault_program.to_account_info(), accounts, signers); withdraw(cpi_ctx, unmint_amount, minimum_out_amount) } /// withdraw directly from strategy #[allow(clippy::too_many_arguments)] pub fn withdraw_directly_from_strategy<'info>( vault: &AccountInfo<'info>, strategy: &AccountInfo<'info>, reserve: &AccountInfo<'info>, strategy_program: &AccountInfo<'info>, collateral_vault: &AccountInfo<'info>, token_vault: &AccountInfo<'info>, lp_mint: &AccountInfo<'info>, fee_vault: &AccountInfo<'info>, user_token: &AccountInfo<'info>, user_lp: &AccountInfo<'info>, user: &AccountInfo<'info>, token_program: &AccountInfo<'info>, vault_program: &AccountInfo<'info>, remaining_accounts: &[AccountInfo<'info>], unmint_amount: u64, minimum_out_amount: u64, signers: &[&[&[u8]]], ) -> Result<()> { let accounts = WithdrawDirectlyFromStrategy { vault: vault.clone(), strategy: strategy.clone(), reserve: reserve.clone(), strategy_program: strategy_program.clone(), collateral_vault: collateral_vault.clone(), token_vault: token_vault.clone(), lp_mint: lp_mint.clone(), fee_vault: fee_vault.clone(), user_token: user_token.clone(), user_lp: user_lp.clone(), user: user.clone(), token_program: token_program.clone(), }; let cpi_ctx = CpiContext::new_with_signer(vault_program.to_account_info(), accounts, signers) .with_remaining_accounts(remaining_accounts.to_vec()); withdraw_directly_from_strategy(cpi_ctx, unmint_amount, minimum_out_amount) } } Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration) [Introduction\ \ Next](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/1-introduction) On this page * [Add mercurial-vault to dependencies](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/cpi/1-cpi-examples#add-mercurial-vault-to-dependencies) * [CPI to Vault program](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/cpi/1-cpi-examples#cpi-to-vault-program) Assistant Responses are generated using AI and may contain mistakes. --- # Dynamic Fee Sharing SDK Functions - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Typescript SDK Dynamic Fee Sharing SDK Functions [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/2-dynamic-fee-sharing-sdk-functions#core-functions) Core Functions ----------------------------------------------------------------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/2-dynamic-fee-sharing-sdk-functions#createfeevault) createFeeVault Creates a fee vault. **Function** Copy Ask AI async createFeeVault(createFeeVaultParam: CreateFeeVaultParam): Promise **Parameters** Copy Ask AI interface CreateFeeVaultParam { feeVault: PublicKey; // The fee vault address tokenMint: PublicKey; // The token mint address tokenProgram: PublicKey; // The token program address owner: PublicKey; // The owner of the fee vault payer: PublicKey; // The wallet that will pay for the transaction userShare: UserShare[]; // The user share of the fee vault } interface UserShare { address: PublicKey; // The user address share: number; // The user share } **Returns** A transaction that can be signed and sent to the network. **Example** Copy Ask AI const feeVault = Keypair.generate(); const transaction = await client.createFeeVault({ feeVault: feeVault.publicKey, tokenMint: new PublicKey("tokenMint1234567890abcdefghijklmnopqrstuvwxyz"), tokenProgram: TOKEN_PROGRAM_ID, owner: owner.publicKey, payer: payer.publicKey, userShare: [\ {\ address: new PublicKey("user1234567890abcdefghijklmnopqrstuvwxyz"),\ share: new BN(1000000),\ },\ {\ address: new PublicKey("user1234567890abcdefghijklmnopqrstuvwxyz"),\ share: new BN(1000000),\ },\ ], }); **Notes** * The `payer` and `feeVault` is required to sign the transaction. * `UserShare` is an array of objects with `address` and `share`. * Minimum: At least 2 users must be included * Maximum: No more than 5 users can be included * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/2-dynamic-fee-sharing-sdk-functions#createfeevaultpda) createFeeVaultPda Creates a fee vault PDA. **Function** Copy Ask AI async createFeeVaultPda(createFeeVaultPdaParam: CreateFeeVaultPdaParam): Promise **Parameters** Copy Ask AI interface CreateFeeVaultParam { base: PublicKey; // The base address tokenMint: PublicKey; // The token mint address owner: PublicKey; // The owner of the fee vault payer: PublicKey; // The wallet that will pay for the transaction userShare: UserShare[]; // The user share of the fee vault } interface UserShare { address: PublicKey; // The user address share: number; // The user share } **Returns** A transaction that can be signed and sent to the network. **Example** Copy Ask AI const base = Keypair.generate(); const transaction = await client.createFeeVaultPda({ base: base.publicKey, tokenMint: new PublicKey("tokenMint1234567890abcdefghijklmnopqrstuvwxyz"), owner: owner.publicKey, payer: payer.publicKey, userShare: [\ {\ address: new PublicKey("user1234567890abcdefghijklmnopqrstuvwxyz"),\ share: new BN(1000000),\ },\ {\ address: new PublicKey("user1234567890abcdefghijklmnopqrstuvwxyz"),\ share: new BN(1000000),\ },\ ], }); **Notes** * The `payer` and `base` is required to sign the transaction. * `UserShare` is an array of objects with `address` and `share`. * Minimum: At least 2 users must be included * Maximum: No more than 5 users can be included * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/2-dynamic-fee-sharing-sdk-functions#fundfeevault) fundFeeVault Funds the fee vault. **Function** Copy Ask AI async fundFeeVault(fundFeeVaultParam: FundFeeVaultParam): Promise **Parameters** Copy Ask AI interface FundFeeVaultParam { fundAmount: BN; // The amount to fund feeVault: PublicKey; // The fee vault address funder: PublicKey; // The funder address } **Returns** A transaction that can be signed and sent to the network. **Example** Copy Ask AI const transaction = await client.fundFeeVault({ fundAmount: new BN(1000000), feeVault: new PublicKey("user1234567890abcdefghijklmnopqrstuvwxyz"), funder: funder.publicKey, }); **Notes** * The `funder` is required to sign the transaction. * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/2-dynamic-fee-sharing-sdk-functions#claimuserfee) claimUserFee Claims the fee for the user. **Function** Copy Ask AI async claimUserFee(claimUserFeeParam: ClaimUserFeeParam): Promise **Parameters** Copy Ask AI interface ClaimUserFeeParam { feeVault: PublicKey; // The fee vault address user: PublicKey; // The user address payer: PublicKey; // The wallet that will pay for the transaction } **Returns** A transaction that can be signed and sent to the network. **Example** Copy Ask AI const transaction = await client.claimUserFee({ feeVault: new PublicKey("user1234567890abcdefghijklmnopqrstuvwxyz"), user: user.publicKey, payer: payer.publicKey, }); **Notes** * The `payer` and `user` is required to sign the transaction. * * * [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/2-dynamic-fee-sharing-sdk-functions#state-functions) State Functions ------------------------------------------------------------------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/2-dynamic-fee-sharing-sdk-functions#getfeevault) getFeeVault Get the fee vault state. **Function** Copy Ask AI async getFeeVault(feeVault: PublicKey): Promise **Parameters** Copy Ask AI feeVault: PublicKey; **Returns** A transaction that can be signed and sent to the network. **Example** Copy Ask AI const feeVault = await client.getFeeVault( new PublicKey("vault1234567890abcdefghijklmnopqrstuvwxyz") }); **Notes** * This function returns the fee vault state. * * * [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/2-dynamic-fee-sharing-sdk-functions#helper-functions) Helper Functions --------------------------------------------------------------------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/2-dynamic-fee-sharing-sdk-functions#derivefeevaultpdaaddress) deriveFeeVaultPdaAddress Derive the fee vault PDA address. **Function** Copy Ask AI deriveFeeVaultPdaAddress(base: PublicKey, tokenMint: PublicKey): PublicKey **Parameters** Copy Ask AI base: PublicKey; tokenMint: PublicKey; **Returns** A PDA address. **Example** Copy Ask AI const feeVaultPda = deriveFeeVaultPdaAddress( new PublicKey("base1234567890abcdefghijklmnopqrstuvwxyz"), new PublicKey("tokenMint1234567890abcdefghijklmnopqrstuvwxyz") ); **Notes** * This function returns the PDA address of the fee vault. * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/2-dynamic-fee-sharing-sdk-functions#converttolamportsbn) convertToLamportsBN Convert to lamports in BN type. **Function** Copy Ask AI convertToLamportsBN(amount: number | string, tokenDecimal: number): BN **Parameters** Copy Ask AI amount: number | string; tokenDecimal: number; **Returns** A token amount in BN type. **Example** Copy Ask AI const fundAmount = convertToLamportsBN(1, 9); **Notes** * This function returns the lamports in BN type. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/1-getting-started) [What's a DLMM Launch Pool?\ \ Next](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/1-what-is-a-dlmm-launch-pool) On this page * [Core Functions](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/2-dynamic-fee-sharing-sdk-functions#core-functions) * [createFeeVault](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/2-dynamic-fee-sharing-sdk-functions#createfeevault) * [createFeeVaultPda](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/2-dynamic-fee-sharing-sdk-functions#createfeevaultpda) * [fundFeeVault](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/2-dynamic-fee-sharing-sdk-functions#fundfeevault) * [claimUserFee](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/2-dynamic-fee-sharing-sdk-functions#claimuserfee) * [State Functions](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/2-dynamic-fee-sharing-sdk-functions#state-functions) * [getFeeVault](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/2-dynamic-fee-sharing-sdk-functions#getfeevault) * [Helper Functions](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/2-dynamic-fee-sharing-sdk-functions#helper-functions) * [deriveFeeVaultPdaAddress](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/2-dynamic-fee-sharing-sdk-functions#derivefeevaultpdaaddress) * [convertToLamportsBN](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/typescript-sdk/2-dynamic-fee-sharing-sdk-functions#converttolamportsbn) Assistant Responses are generated using AI and may contain mistakes. --- # What's Stake2Earn? - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Stake2Earn What's Stake2Earn? [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [​](https://docs.meteora.ag/overview/other-products/stake2earn/1-what-is-stake2earn#overview) Overview ========================================================================================================= Stake2Earn is a mechanism where top memecoin stakers compete to earn fee rewards from permanently-locked liquidity in the memecoin pool, transforming memecoins from a race to dump to a race to stake. [​](https://docs.meteora.ag/overview/other-products/stake2earn/1-what-is-stake2earn#how-does-stake2earn-work%3F) How does Stake2Earn work? ============================================================================================================================================= Whether as a memecoin holder right from launch or a new holder just entering the game, Stake2Earn offers a unique opportunity to earn fee rewards through staking. Fee rewards are collected in the Stake2Earn fee vault for the pool, and distributed to top stakers. [​](https://docs.meteora.ag/overview/other-products/stake2earn/1-what-is-stake2earn#top-stakers-earn-fee-rewards) Top Stakers Earn Fee Rewards ------------------------------------------------------------------------------------------------------------------------------------------------- If you are going to hold the memecoin anyway, you can stake it to earn fee rewards. Only top memecoin stakers (configurable from 5 to 1000 stakers) are eligible to earn fee rewards from the associated liquidity pools. In addition, the **higher you stake**, **the larger your share of the fee rewards** generated by the permanently-locked liquidity. This competitive element incentivizes users to secure a ranked position and buy & stake more to increase and maximize their fee rewards. **Note**: The actual memecoin has to be staked and not an LP token, so there’s no risk of IL (impermanent loss). [​](https://docs.meteora.ag/overview/other-products/stake2earn/1-what-is-stake2earn#dynamic-competition-for-fee-rewards) Dynamic Competition for Fee Rewards --------------------------------------------------------------------------------------------------------------------------------------------------------------- If a staker falls out of the rankings (e.g. out of Top 100), they immediately stop earning fee rewards. This mechanic ensures that participants stay committed to staking in order to retain their fee rewards. As more participants seek to rank in the leaderboard, competition grows, driving a higher demand for the memecoin. [​](https://docs.meteora.ag/overview/other-products/stake2earn/1-what-is-stake2earn#real-time-earning-%E2%80%94-stake-more%2C-earn-more) Real-Time Earning — Stake More, Earn More! -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Stake2Earn operates in real-time. As you stake more, you instantly earn more fee rewards per block that you can manually claim later, providing an engaging experience for stakers who want to see returns on their stake. [​](https://docs.meteora.ag/overview/other-products/stake2earn/1-what-is-stake2earn#claim-quote-token-rewards%2C-compound-memecoin-rewards) Claim Quote Token Rewards, Compound Memecoin Rewards --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- For both token fee collection mode pools on DAMM v1 and DAMM v2, top stakers earn fee rewards in a combination of Quote Token and memecoins. **Example:** * **SOL rewards**: Can be manually claimed right away * **Memecoin rewards**: The memecoin portion of the claimed fee gets added to your stake, compounding earnings while mitigating sell pressure This dual reward structure — claiming SOL right away combined with restaking memecoin fee rewards makes it convenient for stakers to get rewarded without adding sell pressure to their holdings. [​](https://docs.meteora.ag/overview/other-products/stake2earn/1-what-is-stake2earn#cooldown-period-for-unstaking) Cooldown Period for Unstaking --------------------------------------------------------------------------------------------------------------------------------------------------- Staked memecoins must go through a cooldown period (customizable at Stake2Earn creation, minimum 6 hours) where the stakers must wait before they can withdraw their memecoins. Any memecoins undergoing this cooldown period do not count towards your staked memecoins and potential fee rewards. If users change their mind, they may cancel anytime and their memecoins will immediately count towards earning fee rewards if they are a top staker. [​](https://docs.meteora.ag/overview/other-products/stake2earn/1-what-is-stake2earn#benefits-for-creators) Benefits for Creators =================================================================================================================================== [​](https://docs.meteora.ag/overview/other-products/stake2earn/1-what-is-stake2earn#automated-staking-mechanism) Automated Staking Mechanism ----------------------------------------------------------------------------------------------------------------------------------------------- Stake2Earn is a hassle-free solution that creators can use immediately to implement an automated staking mechanism for their memecoins. **Key Benefits:** * **No Extra Costs**: Rewards come entirely from trading fees on permanently-locked liquidity, not from tokenomics * **No Development Required**: There’s no need to build a new program, design a UI, or handle any technical work * **Automated Reloading of Rewards**: Unlike traditional liquidity pool farms that require manual reloading of token incentives that also impact emissions, Stake2Earn automatically top up rewards from trading fees so creators do not have to do anything [​](https://docs.meteora.ag/overview/other-products/stake2earn/1-what-is-stake2earn#launchpad-integration) Launchpad Integration =================================================================================================================================== [​](https://docs.meteora.ag/overview/other-products/stake2earn/1-what-is-stake2earn#easy-integration-and-customization) Easy Integration and Customization ------------------------------------------------------------------------------------------------------------------------------------------------------------- Easily integrate Stake2Earn’s staking mechanism and customize it according to your launchpad needs to support different token launch models: **Value-additive staking mechanism**: Stake2Earn offers a unique, value-additive staking mechanism for memecoins launching on your launchpad, without having to change your existing launch process. [​](https://docs.meteora.ag/overview/other-products/stake2earn/1-what-is-stake2earn#highly-configurable-fee-structure) Highly Configurable Fee Structure ----------------------------------------------------------------------------------------------------------------------------------------------------------- Stake2Earn fees are highly configurable to be aligned with your launchpad goals and needs. A percentage of fees can be allocated towards different actions, for example: * Reward stakers and incentivize participation * Taken as a launchpad fee * Given to creators to attract more memecoin launches * Permanently-locked for deflationary purposes * Given to your launchpad users to incentivize any action you want [​](https://docs.meteora.ag/overview/other-products/stake2earn/1-what-is-stake2earn#configuration-parameters) Configuration Parameters ========================================================================================================================================= Stake2Earn’s configurability adapts to all types of memecoins. Creators and launchpads can define key parameters based on their requirements: [​](https://docs.meteora.ag/overview/other-products/stake2earn/1-what-is-stake2earn#key-parameters) Key Parameters --------------------------------------------------------------------------------------------------------------------- * **Fee allocation**: % of fee rewards from permanently-locked liquidity to allocate to top stakers vs keeping it solely for themselves * **Eligible stakers**: Number of stakers who will receive fee rewards (e.g. Top 100 stakers) * **Unstake cooldown**: Time period before staked memecoins can be withdrawn for users who unstaked (minimum 6 hours) * **Fee distribution duration**: Time period over which fee rewards are distributed (minimum 7 days) * **Fee unlock start time**: When fee rewards will start unlocking for stakers (immediate or at a custom time) Was this page helpful? YesNo [Previous](https://docs.meteora.ag/overview/other-products/alpha-vault/Alpha-Vault) [What's Dynamic Vault?Dynamic Vault is DeFi's first dynamic yield infrastructure.\ \ Next](https://docs.meteora.ag/overview/other-products/dynamic-vault/1-what-is-dynamic-vault) On this page * [Overview](https://docs.meteora.ag/overview/other-products/stake2earn/1-what-is-stake2earn#overview) * [How does Stake2Earn work?](https://docs.meteora.ag/overview/other-products/stake2earn/1-what-is-stake2earn#how-does-stake2earn-work%3F) * [Top Stakers Earn Fee Rewards](https://docs.meteora.ag/overview/other-products/stake2earn/1-what-is-stake2earn#top-stakers-earn-fee-rewards) * [Dynamic Competition for Fee Rewards](https://docs.meteora.ag/overview/other-products/stake2earn/1-what-is-stake2earn#dynamic-competition-for-fee-rewards) * [Real-Time Earning — Stake More, Earn More!](https://docs.meteora.ag/overview/other-products/stake2earn/1-what-is-stake2earn#real-time-earning-%E2%80%94-stake-more%2C-earn-more) * [Claim Quote Token Rewards, Compound Memecoin Rewards](https://docs.meteora.ag/overview/other-products/stake2earn/1-what-is-stake2earn#claim-quote-token-rewards%2C-compound-memecoin-rewards) * [Cooldown Period for Unstaking](https://docs.meteora.ag/overview/other-products/stake2earn/1-what-is-stake2earn#cooldown-period-for-unstaking) * [Benefits for Creators](https://docs.meteora.ag/overview/other-products/stake2earn/1-what-is-stake2earn#benefits-for-creators) * [Automated Staking Mechanism](https://docs.meteora.ag/overview/other-products/stake2earn/1-what-is-stake2earn#automated-staking-mechanism) * [Launchpad Integration](https://docs.meteora.ag/overview/other-products/stake2earn/1-what-is-stake2earn#launchpad-integration) * [Easy Integration and Customization](https://docs.meteora.ag/overview/other-products/stake2earn/1-what-is-stake2earn#easy-integration-and-customization) * [Highly Configurable Fee Structure](https://docs.meteora.ag/overview/other-products/stake2earn/1-what-is-stake2earn#highly-configurable-fee-structure) * [Configuration Parameters](https://docs.meteora.ag/overview/other-products/stake2earn/1-what-is-stake2earn#configuration-parameters) * [Key Parameters](https://docs.meteora.ag/overview/other-products/stake2earn/1-what-is-stake2earn#key-parameters) Assistant Responses are generated using AI and may contain mistakes. --- # Create a DLMM Launch Pool - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DLMM Launch Pool Create a DLMM Launch Pool [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) DLMM Launch Pool is a special pool type designed for new token launches. It is based on DLMM and comes fundamentally equipped with a feature set that makes it optimal for bootstrapping liquidity for new tokens and making the tokens accessible on Jupiter and other trading integrations. DLMM Launch Pools can also be created with an Alpha Vault as part of the token launch process. This is optional. Below we provide the steps to use Bun to configure and run sample scripts to conveniently set up a DLMM Launch Pool on your own. [​](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/2-create-a-dlmm-launch-pool#getting-started) Getting Started ----------------------------------------------------------------------------------------------------------------------------- * Clone repo: [https://github.com/MeteoraAg/meteora-pool-setup](https://github.com/MeteoraAg/meteora-pool-setup) * Config list to reference: [https://github.com/MeteoraAg/meteora-pool-setup/tree/main/config](https://github.com/MeteoraAg/meteora-pool-setup/tree/main/config) * Readme: [https://github.com/MeteoraAg/meteora-pool-setup/blob/main/README.md](https://github.com/MeteoraAg/meteora-pool-setup/blob/main/README.md) [​](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/2-create-a-dlmm-launch-pool#dependencies) Dependencies ----------------------------------------------------------------------------------------------------------------------- Install Bun: You’ll also need bun to run the scripts. Install it via bun installation. Then install the dependencies by running the command bun install [​](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/2-create-a-dlmm-launch-pool#scripts) Scripts ------------------------------------------------------------------------------------------------------------- The following code examples can be used to initialize and seed a DLMM liquidity pool on Meteora using a customizable permissionless liquidity bin pair (LB pair). It allows you to configure parameters for the pool, including fees, pricing, curvature, and activation conditions, before executing initialization and seeding commands. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/2-create-a-dlmm-launch-pool#1-create-dlmm-launch-pool) 1\. Create DLMM Launch Pool Clone repo: [https://github.com/MeteoraAg/meteora-pool-setup](https://github.com/MeteoraAg/meteora-pool-setup) Select an example config to reference and change the parameters inside according to your needs: [https://github.com/MeteoraAg/meteora-pool-setup/tree/main/config](https://github.com/MeteoraAg/meteora-pool-setup/tree/main/config) Run the script with the config file which is updated with your preferred parameters. For example, run: Copy Ask AI bun run src/create_pool.ts --config ./config/create_dlmm_pool.json Replace `./config/create_dlmm_pool.json` with the path to your config file, after you have set your config parameters. **Important Notes:** * The max bin step you can set for a DLMM pool is 400 bin step. * When creating a DLMM pool, there are 3 roles in position that you can config: * Position Owner: Wallet that owns the liquidity * Operator: Wallet that can deposit and withdraw tokens on behalf of the Position Owner * Fee Owner: Wallet that gets the fees from that position During the initialization of the DLMM pool, pool creator needs to have at least 1 lamport worth of the base token in the wallet to prove ownership. If you plan to use a multisig on the Meteora website, please make sure it is the SquadsX multisig, as that is the only type supported on Meteora website. Otherwise, you can’t manage liquidity through the website. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/2-create-a-dlmm-launch-pool#2-seed-liquidity) 2\. Seed liquidity There are two different strategy options when it comes to seeding liquidity in a DLMM Launch Pool. #### [​](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/2-create-a-dlmm-launch-pool#2-1-seed-liquidity-using-ilm-curve-distribution-strategy) 2.1 Seed liquidity using ilm curve distribution strategy This is the standard type of token launch liquidity distribution used by past LFG projects such as JUP, WEN, CLOUD etc. You can first use this ilm curve tool to determine the suitable parameters for your launch. Reference this config file [https://github.com/MeteoraAg/meteora-pool-setup/blob/main/config/seed\_liquidity\_lfg.json](https://github.com/MeteoraAg/meteora-pool-setup/blob/main/config/seed_liquidity_lfg.json) and set your preferred parameters. Run the script with the config file which is set with your preferred parameters. For example, run: Copy Ask AI bun run src/seed_liquidity_lfg.ts --config ./config/seed_liquidity_lfg.json Replace `./config/seed_liquidity_lfg.json` with the path to your config file, after you have set your config parameters. #### [​](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/2-create-a-dlmm-launch-pool#2-2-seed-liquidity-using-single-bin-strategy) 2.2 Seed liquidity using single bin strategy This is a unique token launch strategy where all liquidity is allocated into a single bin. Reference this config file [https://github.com/MeteoraAg/meteora-pool-setup/blob/main/config/seed\_liquidity\_single\_bin.json](https://github.com/MeteoraAg/meteora-pool-setup/blob/main/config/seed_liquidity_single_bin.json) and set your preferred parameters. Run the script with the config file which is set with your preferred parameters. For example, run: Copy Ask AI bun run src/seed_liquidity_single_bin.ts --config ./config/seed_liquidity_single_bin.json Replace `./config/seed_liquidity_single_bin.json` with the path to your config file, after you have set your config parameters. **Important Notes:** When seeding liquidity using the endpoint, both Operator and Position Owner need to have at least 1 lamport worth of the base tokens to prove ownership. If the Position Owner doesn’t have any base tokens, then the Operator will need to send 1 lamport worth of the base token to Position Owner. But the script will check if Position Owner has tokens and if not, it will bundle a transfer instruction to send 1 lamport worth of the base token from the Operator to the Position Owner. In the code example, lock\_release\_point refers to the time the liquidity position can be withdrawn. If it is set to zero, it means the position can be withdrawn immediately after trading starts. If it is set to an extremely large number, it means the position can only be withdrawn in the distant future, essentially “locking” the liquidity position. However, since DLMM doesn’t cover an infinite price range, if the price is out of range, the locked position won’t get any fees. If you plan to use a multisig on the Meteora website, please make sure it is the SquadsX multisig, as that is the only type supported on Meteora website. Otherwise, you can’t manage liquidity through the website. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/2-create-a-dlmm-launch-pool#3-set-dlmm-launch-pool-status) 3\. Set DLMM Launch Pool status You are able to disable the pool prior to pool activation time (before trading starts) and enable it later before or after pool activation time. After pool activation time, once enabled the pool cannot be disabled by you again. Reference this config file [https://github.com/MeteoraAg/meteora-pool-setup/blob/main/config/set\_dlmm\_pool\_status.json](https://github.com/MeteoraAg/meteora-pool-setup/blob/main/config/set_dlmm_pool_status.json) and set your preferred parameters. Run the script with the config file which is set with your preferred parameters. For example, run: Copy Ask AI bun run src/set_dlmm_pool_status.ts --config ./config/set_dlmm_pool_status.json Replace `./config/set_dlmm_pool_status.json` with the path to your config file, after you have set your config parameters. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/2-create-a-dlmm-launch-pool#after-deployment) After deployment To view pool on the UI, access the link below For DLMM pool: [https://app.meteora.ag/dlmm/\`POOL\_ADDRESS\`](https://app.meteora.ag/dlmm/%60POOL_ADDRESS%60) ### [​](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/2-create-a-dlmm-launch-pool#when-can-you-withdraw-tokens-from-the-pool-to-the-position-owner%3F) When can you withdraw tokens from the pool to the position owner? CustomizablePermissionless DLMM: After pool activation point (trading starts) ### [​](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/2-create-a-dlmm-launch-pool#other-configuration-details) Other Configuration Details There are various config files that can be found in the config directory. It contains all the configurations required to run the scripts. We also need to provide the keypair for the payer wallet in keypair.json file. DLMM Pool can also lock liquidity, so the lock\_release\_point can be set to some indefinite time then it ‘unlocks’ ### [​](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/2-create-a-dlmm-launch-pool#general-configuration) General configuration * `rpcUrl`: Solana RPC URL to get data and send transactions. * `keypairFilePath`: Keypair file path to send transactions. * `dryRun`: Set to true to send transactions. * `computeUnitPriceMicroLamports`: CU price in micro lamports unit. For example: 100000. * `createBaseToken`: Configuration to create base token. * `baseMint`: Base token address if the createBaseToken field is not set. * `quoteSymbol`: Quote token symbol, only SOL or USDC is supported. * `quoteMint`: Quote token mint, in case the user wants to create a DLMM launch pool with a token other than SOL or USDC. * `dlmm`: DLMM pool configuration. **Some configuration constraints:** * `createBaseToken` and `baseMint` cannot be used together. * `dynamicAmm` and `dlmm` cannot be used together. **Create Base Token configuration** * `mintBaseTokenAmount`: Base token amount to be minted. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/2-create-a-dlmm-launch-pool#dlmm-configuration) DLMM configuration * `binStep`: DLMM pool bin step. * `feeBps`: Fee bps for DLMM pool. * `initialPrice`: Initial pool price. * `activationType`: To activate pool trading based on slot or timestamp. * `activationPoint`: To activate pool trading at a point, either slot valut or timestamp value based on activationType. * `priceRounding`: Should be up or down. * `hasAlphaVault`: Whether alpha vault is enabled or not for this pool. * `creatorPoolOnOffControl`: Allow creator to turn on/off pool control. There is only one DLMM pool that can be created with the same base and quote tokens, using the instruction initializeCustomizablePermissionlessLbPair. So if users are using that instruction to create a new DLMM pool with the same base and quote tokens, but with different parameters, then the transaction will be failed. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/1-what-is-a-dlmm-launch-pool) [Create a DLMM Launch Pool with Alpha Vault\ \ Next](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault) On this page * [Getting Started](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/2-create-a-dlmm-launch-pool#getting-started) * [Dependencies](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/2-create-a-dlmm-launch-pool#dependencies) * [Scripts](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/2-create-a-dlmm-launch-pool#scripts) * [1\. Create DLMM Launch Pool](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/2-create-a-dlmm-launch-pool#1-create-dlmm-launch-pool) * [2\. Seed liquidity](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/2-create-a-dlmm-launch-pool#2-seed-liquidity) * [2.1 Seed liquidity using ilm curve distribution strategy](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/2-create-a-dlmm-launch-pool#2-1-seed-liquidity-using-ilm-curve-distribution-strategy) * [2.2 Seed liquidity using single bin strategy](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/2-create-a-dlmm-launch-pool#2-2-seed-liquidity-using-single-bin-strategy) * [3\. Set DLMM Launch Pool status](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/2-create-a-dlmm-launch-pool#3-set-dlmm-launch-pool-status) * [After deployment](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/2-create-a-dlmm-launch-pool#after-deployment) * [When can you withdraw tokens from the pool to the position owner?](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/2-create-a-dlmm-launch-pool#when-can-you-withdraw-tokens-from-the-pool-to-the-position-owner%3F) * [Other Configuration Details](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/2-create-a-dlmm-launch-pool#other-configuration-details) * [General configuration](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/2-create-a-dlmm-launch-pool#general-configuration) * [DLMM configuration](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/2-create-a-dlmm-launch-pool#dlmm-configuration) Assistant Responses are generated using AI and may contain mistakes. --- # What's Meteora Lock? - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Meteora Lock What's Meteora Lock? [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Meteora Lock is an open-source, permissionless, free and audited alternative to release your project’s tokens over time. Meteora Lock is **free — zero fees**, allowing any project to release their tokens over-time for free. Any team can access Meteora Lock, without any BD calls or permission, and quickly and securely release their tokens over time. With 2 separate audits done and fully open-sourced, it’s a worry-free experience to lock your project’s assets for the longer term. [​](https://docs.meteora.ag/overview/other-products/meteora-lock/1-what-is-meteora-lock#how-does-meteora-lock-work%3F) How does Meteora Lock work? ===================================================================================================================================================== Meteora Lock allows you to lock tokens based on a vesting plan. The vesting plan is defined by the user, specifying how many tokens are released at each time interval. [​](https://docs.meteora.ag/overview/other-products/meteora-lock/1-what-is-meteora-lock#variables) Variables --------------------------------------------------------------------------------------------------------------- * `vesting_start_time`: The timestamp when the vesting starts. * `cliff_time`: The timestamp when the cliff period ends and cliff tokens can be unlocked. * `frequency`: The time interval (in seconds) between each period unlock. * `cliff_unlock_amount`: The amount of tokens to be unlocked at the cliff. * `amount_per_period`: The amount of tokens to be unlocked at each period. * `number_of_period`: The number of periods to be unlocked. [​](https://docs.meteora.ag/overview/other-products/meteora-lock/1-what-is-meteora-lock#formula) Formula ----------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/overview/other-products/meteora-lock/1-what-is-meteora-lock#total-locked-vesting-amount) Total Locked Vesting Amount total\_amount\=cliff\_unlock\_amount+(amount\_per\_period×number\_of\_period)\\text{total\\\_amount} = \\text{cliff\\\_unlock\\\_amount} + (\\text{amount\\\_per\\\_period} \\times \\text{number\\\_of\\\_period}) total\_amount\=cliff\_unlock\_amount+(amount\_per\_period×number\_of\_period) [​](https://docs.meteora.ag/overview/other-products/meteora-lock/1-what-is-meteora-lock#benefits) Benefits ============================================================================================================= Meteora Lock is made for both projects and users. For Projects ------------ Projects can trustlessly lock tokens for various parties to align incentives. As a project team, you can configure parameters such as vesting, cliff period, unlock schedule. Projects can also burn tokens by setting the recipient wallet address to a burn address and this ensures that actions like dumping are curbed on the team level. These will be embedded into the smart contract and vest accordingly. For Users --------- Users can view all locks associated with each token powered by Jupiter Lock. Distribution complexity such as percentage of tokens belonging to different groups (team, DAO, presale, investors) and percentage of tokens belonging to various purposes (airdrop, liquidity bootstrapping) are shown transparently. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/overview/other-products/dynamic-vault/4-risk-management) [What's Dynamic Fee Sharing?Dynamic Fee Sharing is a program that allows you to dynamically configure sharing of fees.\ \ Next](https://docs.meteora.ag/overview/other-products/dynamic-fee-sharing/1-what-is-dynamic-fee-sharing) On this page * [How does Meteora Lock work?](https://docs.meteora.ag/overview/other-products/meteora-lock/1-what-is-meteora-lock#how-does-meteora-lock-work%3F) * [Variables](https://docs.meteora.ag/overview/other-products/meteora-lock/1-what-is-meteora-lock#variables) * [Formula](https://docs.meteora.ag/overview/other-products/meteora-lock/1-what-is-meteora-lock#formula) * [Total Locked Vesting Amount](https://docs.meteora.ag/overview/other-products/meteora-lock/1-what-is-meteora-lock#total-locked-vesting-amount) * [Benefits](https://docs.meteora.ag/overview/other-products/meteora-lock/1-what-is-meteora-lock#benefits) Assistant Responses are generated using AI and may contain mistakes. --- # Design Goals - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Dynamic Vault Design Goals [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) The goal of Meteora Dynamic vaults is to solve the key challenges of optimizing funds for yield generation while keeping funds safe and accessible for users and protocols alike. In this section, we will discuss the design goals of our vaults. [​](https://docs.meteora.ag/overview/other-products/dynamic-vault/3-design-goals#security-and-safety-of-principals) Security and Safety of Principals ======================================================================================================================================================== * **Principals are always safe:** Funds can only be deposited into trusted and decentralized protocols for yield generation. * **Separation of concerns:** The keeper program only contains logic to find optimal yield allocations and to limit fund flows from the vaults to the protocols. It cannot access or claim principals. * **Decentralized governance:** We aim to upgrade authority for decisions around lending protocol integrations and allocations to a decentralized Autonomous Organization (DAO). * * * [​](https://docs.meteora.ag/overview/other-products/dynamic-vault/3-design-goals#full-liquidity-at-all-times) Full Liquidity at All Times ============================================================================================================================================ * **Instant access:** Deposited assets remain liquid and accessible at all times, allowing users to withdraw funds at will. * **Liquidity checks:** The vault’s total deposit amount is always checked against the reserves left in the lending platform. * **Automatic withdrawals:** If the liquidity reserve in a pool drops below a predetermined threshold, the vault will withdraw from the pool to ensure sufficient liquidity for user withdrawals. * * * [​](https://docs.meteora.ag/overview/other-products/dynamic-vault/3-design-goals#optimized-yield-returns) Optimized Yield Returns ==================================================================================================================================== * **Dynamic allocation:** The vault program monitors and calculates yield variations across all connected lending platforms, dynamically allocating and rebalancing assets to those with the highest returns. * **APR awareness:** The annual percentage rate (APR) of a lending pool depends on factors such as borrowing amount, deposit amount, and the interest rate model. Deposit APR decreases as more is deposited, since borrowing interest is shared among depositors. * **Optimal allocation algorithm:** The algorithm must compare and find the best APR among platforms for a given deposit sum. * * * [​](https://docs.meteora.ag/overview/other-products/dynamic-vault/3-design-goals#ease-of-integration-and-usage) Ease of Integration and Usage ================================================================================================================================================ * **User-friendly design:** Vaults and SDKs are designed to be straightforward and easy for any user or protocol to utilize and build applications on top of. * **Comprehensive resources:** We provide full guides, code examples, and an API to help anyone connect to the vaults and access all integrated lending reserves. * **Ecosystem vision:** Our goal is to make the vaults the yield infrastructure for all of Solana. * * * [​](https://docs.meteora.ag/overview/other-products/dynamic-vault/3-design-goals#event-monitoring-and-tracking) Event Monitoring and Tracking ================================================================================================================================================ * **Continuous monitoring:** Lending pool APY, utilization rates, and reserve levels are continuously monitored for better yield opportunities and risk management. * **On-chain advantages:** Solana’s composability, speed, and low transaction fees enable on-chain event monitoring that surpasses other blockchains, helping us achieve these design principles. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-4-operation-fee-calculation) [Risk Management\ \ Next](https://docs.meteora.ag/overview/other-products/dynamic-vault/4-risk-management) On this page * [Security and Safety of Principals](https://docs.meteora.ag/overview/other-products/dynamic-vault/3-design-goals#security-and-safety-of-principals) * [Full Liquidity at All Times](https://docs.meteora.ag/overview/other-products/dynamic-vault/3-design-goals#full-liquidity-at-all-times) * [Optimized Yield Returns](https://docs.meteora.ag/overview/other-products/dynamic-vault/3-design-goals#optimized-yield-returns) * [Ease of Integration and Usage](https://docs.meteora.ag/overview/other-products/dynamic-vault/3-design-goals#ease-of-integration-and-usage) * [Event Monitoring and Tracking](https://docs.meteora.ag/overview/other-products/dynamic-vault/3-design-goals#event-monitoring-and-tracking) Assistant Responses are generated using AI and may contain mistakes. --- # What's DAMM v2? - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DAMM v2 What's DAMM v2? [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) DAMM v2 is a brand new constant-product AMM program for liquidity pools, with a set of features to optimize transaction fees and provide greater flexibility for liquidity providers, launchpads, and token launches. DAMM v2 is a new program, and not an upgrade of the Dynamic AMM v1 program. [​](https://docs.meteora.ag/overview/products/damm-v2/1-what-is-damm-v2#key-features) Key Features ===================================================================================================== DAMM v2 would come with the following features. SPL and Token 2022 Support -------------------------- Supports both SPL and Token 2022 tokens, enabling a broader range of assets. Dynamic Fee ----------- Choose between a fixed base fee or a dynamic fee that helps maximize returns during periods of higher volatility. Anti-Sniper Suite ----------------- Optional on-chain anti-sniper mechanisms to deter snipers from buying up a substantial portion of the initial token supply right at the activation slot. Versatile LP Fee Claiming ------------------------- LP fees do not auto-compound into pool liquidity and can be claimed separately from liquidity withdrawal, allowing for more flexible fee distribution. LP Fee Collection Mode ---------------------- Select your preferred token for LP fee collection: Base + Quote or Quote token only. Transferrable Position NFT -------------------------- Liquidity positions are represented by Position NFTs (not LP tokens), allowing ownership transfer to another wallet if needed. Lock Liquidity Options ---------------------- Option to lock liquidity with vesting (non-permanent) or permanently, while still allowing fee claims. Concentrated Liquidity ---------------------- Ability to partially concentrate liquidity within a configured min-max price range for higher capital efficiency. **Note:** Currently only available on permissioned pools created by the team. Single-Sided Liquidity Launch ----------------------------- Projects can programmatically create single-sided liquidity pools with only one token, similar to DLMM, for greater launch flexibility. Built-in Farming Mechanism -------------------------- Farming is built directly into the program, not as a separate farm program. Greater Cost Efficiency ----------------------- Creating a single DAMM v2 pool + position costs ~0.022 SOL, compared to ~0.25 SOL for binArrays and positions on DLMM pools Custom Start Time ----------------- Set a custom pool activation time during creation, so you can launch your token at a specific time. [​](https://docs.meteora.ag/overview/products/damm-v2/1-what-is-damm-v2#case-studies) Case Studies ===================================================================================================== [ElizaOS\ -------\ \ Learn how ElizaOS leveraged DAMM v2 for their token launch and liquidity management.](https://meteoraag.medium.com/damm-v2-case-study-elizaos-e5a30f19b9bf) [Pump Science\ ------------\ \ Discover how Pump Science utilized DAMM v2 features to optimize their pool and trading experience.](https://meteoraag.medium.com/damm-v2-case-study-pump-science-d18501c5ef4b) [Single-Sided Launch Pools\ -------------------------\ \ Explore how DAMM v2 enables single-sided launch pools for greater flexibility and capital efficiency.](https://meteoraag.medium.com/damm-v2-single-sided-launch-pools-80dba79ac934) Was this page helpful? YesNo [Previous](https://docs.meteora.ag/overview/products/damm-v1/6-additional-yield-from-dynamic-vaults) [Pool Fees Calculation\ \ Next](https://docs.meteora.ag/overview/products/damm-v2/2-pool-fees-calculation) On this page * [Key Features](https://docs.meteora.ag/overview/products/damm-v2/1-what-is-damm-v2#key-features) * [Case Studies](https://docs.meteora.ag/overview/products/damm-v2/1-what-is-damm-v2#case-studies) Assistant Responses are generated using AI and may contain mistakes. --- # Risk Management - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Dynamic Vault Risk Management [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) This section outlines the security measures implemented to mitigate various risk factors. In addition to executing the algorithm for optimal yield allocations, our keeper program must also assess and address certain risks before determining the final allocation. Risks are generally categorized into two main types: * **Operational Risk** * **Lending Risk** * * * [​](https://docs.meteora.ag/overview/other-products/dynamic-vault/4-risk-management#operation-risk) Operation Risk ===================================================================================================================== Risks that are related to source code such as when a partner protocol or team has a program update, or when lending platforms are not well audited. In minor cases, the source code changes break the integration, users are unable to perform any vault withdrawals or deposits. In major cases, the vault program or lending protocols may be exploited, losing the tokens in the vaults. We implement a maximum allocation mechanism that the vault can deposit into each lending pool to mitigate this risk. All lending protocols’ maximum allocation starts at 100%. We will assess them across a set of criteria which includes the existence of audits, open-source code, insurance funds, main token pools, program multi-sig / verified & non-updatable status as well as the length of integration with Meteora. This set of criteria will eventually be governed by the DAO. For every criterion not met, we will reduce the maximum allocation allowed to the protocol according to this matrix: | Criteria | Maximum Allocation Reduction | | --- | --- | | Audit | 20 | | Open-source | 30 | | Official Insurance Funds? | 20 | | Main Pool | 10 | | Existing integration > 1 month | 10 | | Program multi-sig / or Verified & Non-Updatable | 20 | **Example:** Lending Protocol Xyz (with Audited, Open-sourced, Main Pool, and Program multi-sig) The score for allocation will be 100-20 (No official insurance funds) - 10 (Existing integration < 1 month) = 70. The maximum allocation for Xyz will be 70% of total liquidity. We also limit max allocation in each lending as 30% of total liquidity. Hermes is not allowed to withdraw funds from the lending protocols to external wallets. In the event that Hermes is hacked, the hackers will only be able to control the flow of funds to and from between the vaults and lending protocols; the principals are still safe in either of them. * * * [​](https://docs.meteora.ag/overview/other-products/dynamic-vault/4-risk-management#lending-risk) Lending Risk ================================================================================================================= This risk occurs when depositors are unable to withdraw their funds from the lending pools. This is caused when utilization rates of the reserves reach full capacity at 100% where borrowed amount equals the deposited amount, or when the amount of reserves remaining in the lending pools is less than the vault deposits. When this happens, depositors are unable to withdraw funds on demand. To avoid lending risks, we have developed the following mechanisms to protect principals: Diversified Allocations ----------------------- Allocations are stretched across multiple lending protocols to diversify and manage risk, reducing exposure to any single platform. Active Utilization Monitoring ----------------------------- Hermes continuously monitors the utilization rates of each lending pool. If utilization exceeds the 80% threshold, Hermes is ready to withdraw funds, ensuring a buffer for timely action even in high-demand pools. Lending Reserve Buffer ---------------------- Vaults always maintain a buffer in the lending reserve, providing Hermes with additional time to react to liquidity movements and protect principal. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/overview/other-products/dynamic-vault/3-design-goals) [What's Meteora Lock?Meteora Lock is an open source program that allows users to lock tokens based on a vesting plan.\ \ Next](https://docs.meteora.ag/overview/other-products/meteora-lock/1-what-is-meteora-lock) On this page * [Operation Risk](https://docs.meteora.ag/overview/other-products/dynamic-vault/4-risk-management#operation-risk) * [Lending Risk](https://docs.meteora.ag/overview/other-products/dynamic-vault/4-risk-management#lending-risk) Assistant Responses are generated using AI and may contain mistakes. --- # DBC Config Key - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DBC DBC Config Key [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [​](https://docs.meteora.ag/overview/products/dbc/2-dbc-config-key#what-is-a-dbc-config-key%3F) What is a DBC Config Key? ============================================================================================================================ A DBC Config Key is a unique configuration key that will dictate your curve structure and graduated pool fees structure. Here is an example of a [DBC Config Key](https://solscan.io/account/FbKf76ucsQssF7XZBuzScdJfugtsSKwZFYztKsMEhWZM#anchorData) Quote Mint ---------- The quote mint that all baseMint tokens launched with this config will be paired to (e.g., SOL, USDC, MET) Pool Fees --------- * **Base Fees** - Constant fee or Fee Scheduler with decay mechanism * **Dynamic Fees** - Variable fees based on market volatility (max 20% of base fee) Fee Collection Mode ------------------- Determines fee collection: Only Quote tokens or Both Quote and Base tokens Activation Type --------------- Slot-based (400ms) or Timestamp-based (100ms) calculation for vesting and fee scheduler Locked Vesting -------------- Vesting schedule for baseMint tokens to pool creator after migration Token Supply ------------ * **Pre-migration** - Fixed token supply before migration * **Post-migration** - Fixed token supply after migration * **Dynamic** - Optional null value for dynamic supply Migration Configuration ----------------------- * **DAMM Pool Option** - DAMM V1 (0) or DAMM V2 (1) * **Fee Config** - Base fees for migrated pools (0.25%, 0.3%, 1%, 2%, 4% and 6%) * **Migration Quote Threshold** - Minimum quote amount for migration * **Migration Fee** - Collect a percentage of fees from the pool’s quote reserve LP Percentages -------------- * **Creator LP** - Claimable LP percentage for pool creator * **Partner LP** - Claimable LP percentage for config creator * **Creator Locked LP** - Forever locked LP for creator fees * **Partner Locked LP** - Forever locked LP for partner fees Creator Trading Fee ------------------- Percentage of trading fees shared with pool creators (default: 0% to partner only) Base Mint Token --------------- * **Token Type** - SPL or Token2022 * **Token Decimal** - 6 or 9 decimal places Price & Curve ------------- * **SqrtStartPrice** - Starting price in square root format * **Curve** - Up to 16 curve segments with sqrtPrice and liquidity Additional Parameters --------------------- * **Config** - Vanity address for the config key * **Leftover Receiver** - Claims leftover baseMint tokens after curve completion * **Fee Claimer** - Claims bonding curve fees * **Payer** - Pays for config key creation [​](https://docs.meteora.ag/overview/products/dbc/2-dbc-config-key#how-to-create-a-dbc-config-key%3F) How to create a DBC Config Key? ======================================================================================================================================== You can create a DBC Config Key by using the [DBC Typescript SDK](https://github.com/MeteoraAg/dynamic-bonding-curve-sdk) or via [launch.meteora.ag](https://launch.meteora.ag/) Was this page helpful? YesNo [Previous](https://docs.meteora.ag/overview/products/dbc/1-what-is-dbc) [Trading Fees Calculation\ \ Next](https://docs.meteora.ag/overview/products/dbc/3-trading-fees-calculation) On this page * [What is a DBC Config Key?](https://docs.meteora.ag/overview/products/dbc/2-dbc-config-key#what-is-a-dbc-config-key%3F) * [How to create a DBC Config Key?](https://docs.meteora.ag/overview/products/dbc/2-dbc-config-key#how-to-create-a-dbc-config-key%3F) Assistant Responses are generated using AI and may contain mistakes. --- # What's Dynamic Vault? - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Dynamic Vault What's Dynamic Vault? [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Meteora’s Dynamic Vaults are DeFi’s first dynamic yield infrastructure, where the vaults rebalance every minute across lending platforms to find the best possible yield while prioritizing keeping user funds as accessible as possible. 1 Calculate yields across lending platforms Our off-chain yield optimizer keeper program will calculate the yield across all the lending platforms. 2 Monitor key metrics Every few minutes, the off-chain keeper will constantly monitor the key metrics within each lending pool/protocol. 3 Select highest APY The keeper will pick the highest APY based on the keeper calculation and deposit to the respective lending pools. 4 Rebalance when necessary As the lending pools fluctuate based on its usage, a rebalance would occur every few minutes if necessary. Key metrics include: Total Deposit, Deposit Limits, Pool Utilization Rate, APY, and more. Having a trusted capital allocation layer is important to help allocate liquidity to where it is needed the most, while mitigating risks that come along when depositing to these lending protocols. By providing a trusted and optimized way for users to participate in DeFi lending, we will attract more capital and participants to the ecosystem, driving innovation, and growth. The vaults prioritize safety by monitoring utilization rates and reserve levels, and withdrawing funds if thresholds are reached. To ensure secure yields, we have maximum allocation measures based on factors like audit, open-source code, and insurance coverage of lending platforms. These measures will be consistently refined with the community. [​](https://docs.meteora.ag/overview/other-products/dynamic-vault/1-what-is-dynamic-vault#how-does-it-work%3F) How does it work? =================================================================================================================================== Meteora Dynamic Vaults allow users and integrated protocols to deposit and/or withdraw assets from the vault program at any time. Deposited assets are distributed to various lending protocols like Solend and Tulip, with maximum allocation based on a combination of yield percentages and risk mitigation strategies around protocol audit, insurance coverage, and open source status. ![Dynamic Vault](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/overview/other-products/dynamic-vault/dynamic-vault.png) [​](https://docs.meteora.ag/overview/other-products/dynamic-vault/1-what-is-dynamic-vault#core-components) Core Components ============================================================================================================================= [​](https://docs.meteora.ag/overview/other-products/dynamic-vault/1-what-is-dynamic-vault#core-components-2) Core Components ------------------------------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/overview/other-products/dynamic-vault/1-what-is-dynamic-vault#1-vault) 1\. Vault Each Vault in the infrastructure layer stores single token assets (e.g., USDC or SOL), with the majority of assets allocated to various lending protocols to earn yield. Common tokens used across connecting protocols, AMMs, or wallets are stored in a single vault. For example, USDC from an AMM and wallet holdings are consolidated in the USDC vault. Users and protocols can deposit liquidity directly to each Vault through a simple interface. ### [​](https://docs.meteora.ag/overview/other-products/dynamic-vault/1-what-is-dynamic-vault#2-keeper-hermes) 2\. Keeper - Hermes We’ve created an off-chain keeper called **Hermes** to manage complex logic and operations, including lending protocol monitoring and calculating optimal liquidity allocation across lending platforms. For now, there are **3 main operations** handled by Hermes: Yield Optimizer --------------- Hermes calculates the optimal liquidity allocation across lending platforms to generate the highest overall APY for the vault. The calculation requires key data from various lending platforms including deposit APY, utilization rate, and pool liquidity. This process repeats every few minutes, and if there’s a delta between the new allocation and the current one, a rebalance crank is sent to the vault to trigger deposits and withdrawals to/from lending platforms. Key Metrics Tracker ------------------- The tracker consistently monitors, tracks, and stores key data such as deposit APY and pool liquidity from lending platforms. This information is used for calculations and future references, and is also exposed to potential integrators for UI display or custom calculations. Risk Monitoring --------------- Hermes runs a risk monitoring service to track utilization rates and reserve levels of lending protocols, safeguarding user assets by withdrawing liquidity when thresholds are reached. For example, if a lending pool’s utilization rate exceeds 80%, Hermes triggers a full liquidity withdrawal and stops deposits for 12 hours. ### [​](https://docs.meteora.ag/overview/other-products/dynamic-vault/1-what-is-dynamic-vault#3-sdk-module-integration-apis) 3\. SDK Module - Integration APIs To facilitate easy integration for DApps and protocols like AMMs and wallets with our Dynamic Yield Layer, we’ve created a straightforward SDK and are building an entire library of pre-built modules and code samples for rapid app development and plug-and-play functionality. The liquidity in protocols can be deposited into or withdrawn from vaults directly via simple API calls. The vaults’ yield can be distributed back to the LPs of integrated protocols. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/overview/other-products/stake2earn/1-what-is-stake2earn) [What's Hermes?\ \ Next](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-1-what-is-hermes) On this page * [How does it work?](https://docs.meteora.ag/overview/other-products/dynamic-vault/1-what-is-dynamic-vault#how-does-it-work%3F) * [Core Components](https://docs.meteora.ag/overview/other-products/dynamic-vault/1-what-is-dynamic-vault#core-components) * [Core Components](https://docs.meteora.ag/overview/other-products/dynamic-vault/1-what-is-dynamic-vault#core-components-2) * [1\. Vault](https://docs.meteora.ag/overview/other-products/dynamic-vault/1-what-is-dynamic-vault#1-vault) * [2\. Keeper - Hermes](https://docs.meteora.ag/overview/other-products/dynamic-vault/1-what-is-dynamic-vault#2-keeper-hermes) * [3\. SDK Module - Integration APIs](https://docs.meteora.ag/overview/other-products/dynamic-vault/1-what-is-dynamic-vault#3-sdk-module-integration-apis) Assistant Responses are generated using AI and may contain mistakes. --- # Create a Stake2Earn v1 Pool with Alpha Vault - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Alpha Vault Launch Pool Create a Stake2Earn v1 Pool with Alpha Vault [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Stake2Earn Pools are DAMM v1 Pools that are launched with a Stake2Earn Vault. This page provides code examples to initialize and seed a Stake2Earn Pool together with an Alpha Vault. **Key Components:** * **DAMM v1 Pool**: A DAMM v1 Pool created with a fee scheduler and with initial liquidity perma-locked * **Stake2Earn Vault**: Stake-to-earn farming mechanism and vault where top stakers can earn a share of fees from the locked liquidity * **Stake2Earn Pool**: A Memecoin Pool with a Stake2Earn Vault * **Alpha Vault**: Anti-sniper tool that allows depositors to be the first to buy from the pool and be guaranteed a share of tokens at the same average price [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#getting-started) Getting Started -------------------------------------------------------------------------------------------------------------------------------------------------------------- * Dynamic AMM SDK: [https://github.com/MeteoraAg/damm-v1-sdk](https://github.com/MeteoraAg/damm-v1-sdk) * NPM: [https://www.npmjs.com/package/@meteora-ag/dynamic-amm-sdk](https://www.npmjs.com/package/@meteora-ag/dynamic-amm-sdk) * Stake2Earn Vault SDK: [https://github.com/MeteoraAg/stake-for-fee-sdk](https://github.com/MeteoraAg/stake-for-fee-sdk) * Alpha Vault SDK: [https://github.com/MeteoraAg/alpha-vault-sdk](https://github.com/MeteoraAg/alpha-vault-sdk) * Alpha Vault Launch Calculation template: Copy this [google sheet](https://docs.google.com/spreadsheets/d/1IZps6htpJJ2MAp-4KMzLP7LQ5JacNznJu7EEJTK9k9Y/edit?usp=sharing.) and adjust the numbers to help determine your preferred parameters * Devnet: [https://devnet.meteora.ag/](https://devnet.meteora.ag/) [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#api) API -------------------------------------------------------------------------------------------------------------------------------------- * **Mainnet API endpoint**: [https://stake-for-fee-api.meteora.ag/swagger-ui/](https://stake-for-fee-api.meteora.ag/swagger-ui/) * **API endpoint to get Stake2Earn vault info from pool address**: [https://stake-for-fee-api.meteora.ag/swagger-ui/#/vault/filter\_vaults](https://stake-for-fee-api.meteora.ag/swagger-ui/#/vault/filter_vaults) * **Devnet API endpoint**: [https://devnet.stake-for-fee-api.meteora.ag/swagger-ui/](https://devnet.stake-for-fee-api.meteora.ag/swagger-ui/) [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#dependencies) Dependencies -------------------------------------------------------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#install-dependencies) Install dependencies Copy Ask AI # NPM npm i @meteora-ag/dynamic-amm-sdk @solana/web3.js @solana/spl-token # YARN yarn add @meteora-ag/dynamic-amm-sdk @solana/web3.js @solana/spl-token ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#initialize-ammimpl-instance) Initialize AmmImpl instance Copy Ask AI import AmmImpl, { MAINNET_POOL } from '@meteora-ag/dynamic-amm-sdk'; import { Connection, Keypair, PublicKey } from '@solana/web3.js'; import { AnchorProvider, Wallet } from '@coral-xyz/anchor'; // Connection, Wallet, and AnchorProvider to interact with the network const mainnetConnection = new Connection('https://api.mainnet-beta.solana.com'); // Create single instance const constantProductPool = await AmmImpl.create(mainnetConnection, MAINNET_POOL.USDC_SOL); const stablePool = await AmmImpl.create(mainnetConnection, MAINNET_POOL.USDT_USDC); // Or with any other pool address, refer to the pool creation section below const pool = await AmmImpl.create(mainnetConnection, new PublicKey('...')); // If you need to create multiple, can consider using `createMultiple` const pools = [MAINNET_POOL.USDC_SOL, MAINNET_POOL.USDT_USDC]; const [constantProductPool, stablePool] = await AmmImpl.createMultiple(mainnetConnection, pools); [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#scripts) Scripts ---------------------------------------------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#1-choose-a-suitable-pool-and-fee-config) 1\. Choose a suitable Pool and Fee Config Before creating the pool, you need to choose a suitable pool and fee config. What fee parameters to choose depends on your project’s needs. **Key Requirements:** * Look at the pool config list and choose a suitable `pool_config_key` with your preferred fee parameters * If you want to create an Alpha Vault, you also need a `pool_config_key` mapped to a `vault_config_key` that meets your requirements * If none of the existing configs meet your requirements, reach out to Meteora for a custom pool config key #### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#public-pool-config-list) Public Pool Config List * **Pool config list**: [https://damm-api.meteora.ag/swagger-ui/#/pools/get\_all\_pool\_configs](https://damm-api.meteora.ag/swagger-ui/#/pools/get_all_pool_configs) * **Devnet API**: [https://damm-api.devnet.meteora.ag/swagger-ui/](https://damm-api.devnet.meteora.ag/swagger-ui/) * **API endpoint for fee curves**: [https://damm-api.meteora.ag/swagger-ui/#/fee\_config/get\_config\_associated\_fee\_configs](https://damm-api.meteora.ag/swagger-ui/#/fee_config/get_config_associated_fee_configs) #### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#default-pool-config-used-by-meteora-frontend) Default Pool Config used by Meteora Frontend By default, Meteora’s frontend uses this pool config key for Memecoin Pool creation: `FiENCCbPi3rFh5pW2AJ59HC53yM32eLaCjMKxRqanKFJ` **Note**: This config doesn’t allow creation of any Alpha Vault, therefore its `vault_config_key` field is `1111111...` #### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#custom-pool-config-and-fee-curve) Custom Pool Config and Fee Curve **Custom Pool Config Key**: Integrators such as launchpads may need their own unique custom pool config key for custom `pool_creator_authority` to prevent front-running. **Important Notes:** * New dedicated config keys can only be created by Meteora * The `pool_creator_authority` doesn’t work with program address - it needs to be a PDA or normal account * Custom fee curves require a dedicated config key from Meteora #### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#custom-fee-curve-for-a-specific-pool) Custom Fee Curve for a Specific Pool If required, Meteora can set a custom fee curve for a single, specific pool. This would override the fee curve used by the pool’s config key. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#2-create-the-memecoin-pool) 2\. Create the Memecoin Pool After selecting your preferred `pool_config_key`, reference this example in the Dynamic AMM SDK: [https://github.com/MeteoraAg/damm-v1-sdk/blob/main/ts-client/src/examples/create\_pool\_and\_lock\_liquidity.ts](https://github.com/MeteoraAg/damm-v1-sdk/blob/main/ts-client/src/examples/create_pool_and_lock_liquidity.ts) Update the example with your selected pool config and other parameters to create a Memecoin Pool. #### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#how-to-assign-fee-claiming-wallets) How to assign fee claiming wallets Refer to the `allocations` section in the example: [https://github.com/MeteoraAg/damm-v1-sdk/blob/main/ts-client/src/examples/create\_pool\_and\_lock\_liquidity.ts#L121](https://github.com/MeteoraAg/damm-v1-sdk/blob/main/ts-client/src/examples/create_pool_and_lock_liquidity.ts#L121) Find your Stake2Earn Vault public key address and allocate the percentage of fees from permanently locked liquidity that you intend to go to the Stake2Earn vault. #### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#how-to-find-the-stake2earn-vault-address) How to find the Stake2Earn Vault address Put your pool public key address in this example to derive the Stake2Earn Vault address before it’s created: [https://github.com/MeteoraAg/stake-for-fee-sdk/blob/3bae081b14c065b88abfbee39e86b6e91cd55a39/ts-client/src/stake-for-fee/helpers/pda.ts#L15](https://github.com/MeteoraAg/stake-for-fee-sdk/blob/3bae081b14c065b88abfbee39e86b6e91cd55a39/ts-client/src/stake-for-fee/helpers/pda.ts#L15) ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#3-create-the-stake2earn-vault) 3\. Create the Stake2Earn Vault After creating the Memecoin Pool and setting up fee allocation, use this example to create the Stake2Earn Vault: [https://github.com/MeteoraAg/stake-for-fee-sdk/blob/3bae081b14c065b88abfbee39e86b6e91cd55a39/ts-client/src/stake-for-fee/index.ts#L338](https://github.com/MeteoraAg/stake-for-fee-sdk/blob/3bae081b14c065b88abfbee39e86b6e91cd55a39/ts-client/src/stake-for-fee/index.ts#L338) ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#4-create-the-alpha-vault) 4\. Create the Alpha Vault Use this example to create the Alpha Vault: [https://github.com/MeteoraAg/alpha-vault-sdk/blob/f6a6d0e2113fd94c14d94403b08fe83ff40c4791/ts-client/src/alpha-vault/index.ts#L256](https://github.com/MeteoraAg/alpha-vault-sdk/blob/f6a6d0e2113fd94c14d94403b08fe83ff40c4791/ts-client/src/alpha-vault/index.ts#L256) Read the Alpha Vault SDK and code examples for more information. #### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#alpha-vault-with-whitelist) Alpha Vault with Whitelist For launches that want to restrict wallet addresses allowed to deposit into the Alpha Vault, specify the `whitelistMode` in the config: * **permissionless**: No whitelist, anyone can deposit * **permission\_with\_authority**: Only the Alpha Vault creator can create escrow accounts with max\_cap (suitable for ≤100 addresses) * **permission\_with\_merkle\_proof**: Only whitelisted wallets can deposit (requires CSV file of whitelisted addresses) [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#after-deployment) After deployment ---------------------------------------------------------------------------------------------------------------------------------------------------------------- To view pool on the UI, access the link below: For Dynamic AMM and Memecoin Pool: [https://app.meteora.ag/pools/\`POOL\_ADDRESS\`](https://app.meteora.ag/pools/%60POOL_ADDRESS%60) ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#when-can-you-withdraw-tokens-from-the-pool%3F) When can you withdraw tokens from the pool? **CustomizablePermissionless Dynamic AMM**: After pool activation point (trading starts) [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#important-notes) Important Notes -------------------------------------------------------------------------------------------------------------------------------------------------------------- * Configure your Stake2Earn staking rewards distribution start time approximately 48 hours after launch to allow more fee accumulation * Currently, only SOL or USDC is accepted as the quote token when initializing pools with Alpha Vault in permissionless setup * If using a multisig on the Meteora website, ensure it’s the SquadsX multisig (only supported type) * There must be a ~1 hour 5 minutes period between deposit close time and pool activation time **Timing Requirements:** * **Crank start point**: `activationPoint - 3600` (timestamp) or `activationPoint - 9000` (slot) * **Vault deposit close point**: `Crank start point - 5 min` (timestamp) or `Crank start point - 750` (slot) [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#configuration-details) Configuration Details -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- There are various config files in the config directory containing all configurations required to run the scripts. You also need to provide the keypair for the payer wallet in `keypair.json` file. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#general-configuration) General configuration * `rpcUrl`: Solana RPC URL to get data and send transactions * `keypairFilePath`: Keypair file path to send transactions * `dryRun`: Set to true to send transactions * `computeUnitPriceMicroLamports`: CU price in micro lamports unit (e.g., 100000) * `createBaseToken`: Configuration to create base token * `baseMint`: Base token address if the createBaseToken field is not set * `quoteSymbol`: Quote token symbol, only SOL or USDC is supported * `quoteMint`: Quote token mint for tokens other than SOL or USDC * `dynamicAmm`: Dynamic AMM pool configuration * `alphaVault`: FCFS or Pro-rata Alpha Vault configuration **Configuration constraints:** * `createBaseToken` and `baseMint` cannot be used together * `dynamicAmm` and `dlmm` cannot be used together ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#create-base-token-configuration) Create Base Token configuration * `mintBaseTokenAmount`: Base token amount to be minted ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#dynamic-amm-configuration) Dynamic AMM configuration * `baseAmount`: Base token amount * `quoteAmount`: Quote token amount * `tradeFeeNumerator`: Trade fee numerator (fee denominator is 100,000) * `activationType`: Activate pool trading based on slot or timestamp * `activationPoint`: Pool activation point (slot or timestamp value) * `hasAlphaVault`: Whether alpha vault is enabled for this pool ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#alpha-vault-configuration) Alpha Vault configuration * `poolType`: Dynamic or DLMM pool type * `alphaVaultType`: Alpha Vault type (fcfs or prorata) * `depositingPoint`: Slot or timestamp that allows deposit * `startVestingPoint`: Slot or timestamp that starts vesting * `endVestingPoint`: Slot or timestamp that ends vesting * `maxDepositCap`: Maximum deposit cap * `individualDepositingCap`: Individual deposit cap * `escrowFee`: Fee to create stake escrow account (charged in native SOL) * `whitelistMode`: permissionless, permission\_with\_merkle\_proof, or permission\_with\_authority ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#alpha-vault-pro-rata-configuration) Alpha Vault Pro-rata configuration * `depositingPoint`: Slot or timestamp that allows deposit * `startVestingPoint`: Slot or timestamp that starts vesting * `endVestingPoint`: Slot or timestamp that ends vesting * `maxBuyingCap`: Maximum buying cap * `escrowFee`: Fee to create stake escrow account * `whitelistMode`: permissionless, permission\_with\_merkle\_proof, or permission\_with\_authority ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#alpha-vault-key-components) Alpha Vault Key Components **Vault Types**: Supports both permissionless (without whitelist) and permissioned (with whitelist) Alpha Vaults **Whitelist Modes:** * Without whitelist: Permissionless * With whitelist: PermissionWithMerkleProof, PermissionWithAuthority **alphaVaultType (Vault Mode):** * Pro-rata * FCFS (First-Come, First-Served) **Individual Deposit Cap**: Global individual deposit cap without whitelist only possible on FCFS vault mode ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#create-stake2earn-vault-configuration) Create Stake2Earn Vault configuration * `topListLength`: Length of the top list * `unstakeLockDurationSecs`: Duration to wait before withdraw (from unstake action timestamp) * `secondsToFullUnlock`: Time required for locked claim fee to be fully dripped * `startFeeDistributeTimestamp`: When fee distribution starts (should be 48h after pool activation) [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#alpha-vault-typescript-sdk) Alpha Vault TypeScript SDK ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ After creating the Alpha Vault for your pool, check out the Alpha Vault SDK for different ways to interact with it, including depositing funds, cranking the vault to buy tokens, or claiming purchased tokens. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault) [Create a DAMM v1 Launch Pool\ \ Next](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool) On this page * [Getting Started](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#getting-started) * [API](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#api) * [Dependencies](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#dependencies) * [Install dependencies](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#install-dependencies) * [Initialize AmmImpl instance](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#initialize-ammimpl-instance) * [Scripts](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#scripts) * [1\. Choose a suitable Pool and Fee Config](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#1-choose-a-suitable-pool-and-fee-config) * [Public Pool Config List](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#public-pool-config-list) * [Default Pool Config used by Meteora Frontend](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#default-pool-config-used-by-meteora-frontend) * [Custom Pool Config and Fee Curve](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#custom-pool-config-and-fee-curve) * [Custom Fee Curve for a Specific Pool](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#custom-fee-curve-for-a-specific-pool) * [2\. Create the Memecoin Pool](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#2-create-the-memecoin-pool) * [How to assign fee claiming wallets](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#how-to-assign-fee-claiming-wallets) * [How to find the Stake2Earn Vault address](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#how-to-find-the-stake2earn-vault-address) * [3\. Create the Stake2Earn Vault](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#3-create-the-stake2earn-vault) * [4\. Create the Alpha Vault](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#4-create-the-alpha-vault) * [Alpha Vault with Whitelist](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#alpha-vault-with-whitelist) * [After deployment](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#after-deployment) * [When can you withdraw tokens from the pool?](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#when-can-you-withdraw-tokens-from-the-pool%3F) * [Important Notes](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#important-notes) * [Configuration Details](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#configuration-details) * [General configuration](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#general-configuration) * [Create Base Token configuration](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#create-base-token-configuration) * [Dynamic AMM configuration](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#dynamic-amm-configuration) * [Alpha Vault configuration](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#alpha-vault-configuration) * [Alpha Vault Pro-rata configuration](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#alpha-vault-pro-rata-configuration) * [Alpha Vault Key Components](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#alpha-vault-key-components) * [Create Stake2Earn Vault configuration](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#create-stake2earn-vault-configuration) * [Alpha Vault TypeScript SDK](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault#alpha-vault-typescript-sdk) Assistant Responses are generated using AI and may contain mistakes. --- # Terms of Service - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Terms of Service [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Meteora is a distributed set of specially-developed smart contracts (each, a “Smart Contract”) deployed on the Solana blockchain or such other compatible blockchain network, as the case may be (each, the “relevant Blockchain Network”) which allows any user to trade digital asset pairs directly in a peer-to-peer manner via Liquidity Pools (as defined herein). The Dynamic Liquidity Market Maker (DLMM) Smart Contracts underlying Meteora offer a variety of innovations to decentralised exchanges, for example high capital efficiency (supporting high volume trading with low liquidity requirements through the concentrating of tokens at or around the current market value), zero slippage (swap tokens with zero slippage or price impact within active bin), dynamic fees (liquidity providers earn dynamic swap fees during high market volatility to compensate for impermanent loss) and flexible liquidity (liquidity providers can build Liquidity Pools with flexible liquidity distributions according to their volatility strategies, e.g. single-sided liquidity with only one token). The Liquidity Pools and Meteora may be visualised on a user interface that the user can interact with, including but not limited to the website at [https://www.meteora.ag/](https://www.meteora.ag/) and each of their subdomains, or our mobile or web applications (the “Site”). The Smart Contracts and the Site are collectively referred to in these Terms as (the “App”). Using the App, users can interact with the underlying Smart Contracts to create Liquidity Pools, view their Liquidity Pools created or accessed, and interact with other users in Meteora ecosystem. The Company’s sole role is the deployment of the Smart Contracts, and accordingly any interaction with Liquidity Pools take place solely on the relevant Blockchain Network. It is important that you understand that smart contract protocols such as Meteora simply comprise a set of autonomous blockchain-based smart contracts deployed on the relevant Blockchain Network, operated directly by users calling functions on it (which allows them to interact with other users in a multi-party peer-to-peer manner). There is no further control by or interaction with the original entity which had deployed the smart contract (i.e. the Company), which entity solely functions as a provider of technical tools for users, and is not offering any sort of securities product or regulated service nor does it hold any user assets on custody. Any rewards earned by user interactions arise solely out of their involvement in the protocol by taking on the risk of interacting with other users and the ecosystem. Dynamic Labs Limited (the “Company”, “we”, “our” or “us”) is making the App available to you. Before you use the App, the Smart Contracts, or the Site, however, you will need to agree to these Terms of Use and any terms and conditions incorporated herein by reference (collectively, these “Terms”). PLEASE READ THESE TERMS CAREFULLY BEFORE USING THE APP, THE SMART CONTRACTS, OR THE SITE. THESE TERMS GOVERN YOUR USE OF THE APP, THE SMART CONTRACTS, AND THE SITE, UNLESS WE HAVE EXECUTED A SEPARATE WRITTEN AGREEMENT WITH YOU FOR THAT PURPOSE. WE ARE ONLY WILLING TO MAKE THE APP, THE SMART CONTRACTS, AND THE SITE AVAILABLE TO YOU IF YOU ACCEPT ALL OF THESE TERMS. BY USING THE APP, THE SMART CONTRACTS, THE SITE, OR ANY PART OF THEM, OR BY CLICKING “I ACCEPT” BELOW OR INDICATING YOUR ACCEPTANCE IN AN ADJOINING BOX, YOU ARE CONFIRMING THAT YOU UNDERSTAND AND AGREE TO BE BOUND BY ALL OF THESE TERMS. IF YOU ARE ACCEPTING THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY, YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO ACCEPT THESE TERMS ON THAT ENTITY’S BEHALF, IN WHICH CASE “YOU” WILL MEAN THAT ENTITY. IF YOU DO NOT HAVE SUCH AUTHORITY, OR IF YOU DO NOT ACCEPT ALL OF THESE TERMS, THEN WE ARE UNWILLING TO MAKE THE APP, THE SMART CONTRACTS, OR THE SITE AVAILABLE TO YOU. IF YOU DO NOT AGREE TO THESE TERMS, YOU MAY NOT ACCESS OR USE THE APP, THE SMART CONTRACTS, OR THE SITE. By clicking “I Accept” or otherwise indicating your Acceptance, you agree to be bound by these Terms and affirm that you are of legal age to enter into these Terms where you live and have the legal capacity to enter into these Terms. Without limiting the foregoing, by using the App, you acknowledge and understand that laws regarding digital assets, financial instruments, or investment products which may include digital assets, may vary from jurisdiction to jurisdiction, and it is your sole obligation to ensure that you fully comply with any law, regulation or directive, relevant to your jurisdiction with regard to the use of the App. For the avoidance of doubt, the ability to access the App does not necessarily mean that the App, or your activities through it, are legal under the laws, regulations or directives relevant to your jurisdiction. All of the App or the services made available through the App may not be available to all users, and we reserve the right to assess or reassess at any time your eligibility to use all or part of the App. The App does not constitute, and may not be used for the purposes of, an offer or solicitation to anyone in any jurisdiction in which such offer or solicitation is not authorised, or to any person to whom it is unlawful to make such an offer or solicitation. Supplemental terms and conditions or documents that may be posted on the App from time to time are hereby expressly incorporated herein by reference. We reserve the right, in our sole discretion, to make changes to the Terms from time to time. We will alert you of any changes by updating the “Last Updated” date of these Terms (on the first page hereof), and you waive any right to receive specific notice of each such change. It is your responsibility to periodically review these Terms to stay informed of updates. You will be subject to and will be deemed to have been made aware of and to have accepted, the changes in any revised Terms by your continued use of the Site, the App, and the Smart Contracts after the date such revised Terms are posted. * * * [​](https://docs.meteora.ag/legal/1-terms-of-service#table-of-contents) Table of Contents -------------------------------------------------------------------------------------------- 1. [Introduction](https://docs.meteora.ag/legal/1-terms-of-service#1-introduction) 2. [The App](https://docs.meteora.ag/legal/1-terms-of-service#2-the-app) 3. [Services](https://docs.meteora.ag/legal/1-terms-of-service#3-services) 4. [Fees and Payment](https://docs.meteora.ag/legal/1-terms-of-service#4-fees-and-payment) 5. [Intellectual Property and Content](https://docs.meteora.ag/legal/1-terms-of-service#5-intellectual-property-and-content) 6. [User Terms](https://docs.meteora.ag/legal/1-terms-of-service#6-user-terms) 7. [Risks Borne by Users](https://docs.meteora.ag/legal/1-terms-of-service#7-risks-borne-by-users) 8. [External Sites](https://docs.meteora.ag/legal/1-terms-of-service#8-external-sites) 9. [Disclaimers](https://docs.meteora.ag/legal/1-terms-of-service#9-disclaimers) 10. [Limitation of Liability](https://docs.meteora.ag/legal/1-terms-of-service#10-limitation-of-liability) 11. [Indemnity](https://docs.meteora.ag/legal/1-terms-of-service#11-indemnity) 12. [Privacy Policy](https://docs.meteora.ag/legal/1-terms-of-service#12-privacy-policy) 13. [Consent to Electronic Disclosures and Signatures](https://docs.meteora.ag/legal/1-terms-of-service#13-consent-to-electronic-disclosures-and-signatures) 14. [Governing Law and Dispute Resolution](https://docs.meteora.ag/legal/1-terms-of-service#14-governing-law-and-dispute-resolution) 15. [Notices](https://docs.meteora.ag/legal/1-terms-of-service#15-notices) 16. [Entire Agreement](https://docs.meteora.ag/legal/1-terms-of-service#16-entire-agreement) 17. [Force Majeure](https://docs.meteora.ag/legal/1-terms-of-service#17-force-majeure) 18. [Third Party Rights](https://docs.meteora.ag/legal/1-terms-of-service#18-third-party-rights) 19. [No Agency or Partnership](https://docs.meteora.ag/legal/1-terms-of-service#19-no-agency-or-partnership) 20. [Interpretation](https://docs.meteora.ag/legal/1-terms-of-service#20-interpretation) 21. [Assignment](https://docs.meteora.ag/legal/1-terms-of-service#21-assignment) 22. [Illegality](https://docs.meteora.ag/legal/1-terms-of-service#22-illegality) 23. [Waiver](https://docs.meteora.ag/legal/1-terms-of-service#23-waiver) 24. [Severability](https://docs.meteora.ag/legal/1-terms-of-service#24-severability) 25. [Survival](https://docs.meteora.ag/legal/1-terms-of-service#25-survival) 26. [English Language](https://docs.meteora.ag/legal/1-terms-of-service#26-english-language) * * * [​](https://docs.meteora.ag/legal/1-terms-of-service#1-introduction) 1\. Introduction ---------------------------------------------------------------------------------------- 1. To be eligible to use the App, the Smart Contracts, the Site and the Services (as defined below), you must be of legal age to enter into these Terms where you live and have the legal capacity to enter into these Terms. The App, the Smart Contracts, the Site and the Services is strictly NOT offered to persons or entities who reside in, are citizens of, are incorporated in, or have a registered office in any Restricted Territory, as defined below (any such person or entity from a Restricted Territory shall be a Restricted Person). If you are a Restricted Person, then do not attempt to access or use the App, the Smart Contracts, the Site or the Services. Use of a virtual private network (e.g., a VPN) or other means by Restricted Persons to access or use the App, the Smart Contracts, the Site or the Services is prohibited. **Restricted Territory** means the British Virgin Islands, the United States, China, Myanmar (Burma), Cote D’Ivoire (Ivory Coast), Cuba, Crimea and Sevastopol, Democratic Republic of Congo, Iran, Iraq, Libya, Mali, Nicaragua, Democratic People’s Republic of Korea (North Korea), Somalia, Sudan, Syria, Yemen, Zimbabwe, Russia, or any other state, country or region that is subject to sanctions enforced by the United States or the European Union. 2. The App, the Smart Contracts, the Site or the Services made available through the App (or any portion thereof) may not be available to all users, and we reserve the right to assess or reassess at any time your eligibility to use all or part of the App, the Smart Contracts, the Site or the Services. 3. The App, the Smart Contracts, the Site and the Services does not constitute, and may not be used for the purposes of, an offer or solicitation to anyone in any jurisdiction in which such offer or solicitation is not authorised, or to any person to whom it is unlawful to make such an offer or solicitation. 4. Without limiting the foregoing, by using the App, the Smart Contracts, the Site or the Services, you acknowledge and understand that laws regarding digital assets, cryptocurrency derivatives, financial instruments, or investment products which may include digital assets, may vary from jurisdiction to jurisdiction, and it is your sole obligation to ensure that you fully comply with any law, regulation or directive, relevant to your jurisdiction with regard to the use of the App, the Smart Contracts, the Site or the Services. For the avoidance of doubt, the ability to access the App, the Smart Contracts, the Site or the Services does not necessarily mean that same (or your activities through it) are legal under the laws, regulations or directives relevant to your jurisdiction. [​](https://docs.meteora.ag/legal/1-terms-of-service#2-the-app) 2\. The App ------------------------------------------------------------------------------ 1. To most easily access the App, you may first install a web browser (such as the Google Chrome web browser) and an electronic wallet compatible with the relevant Blockchain Network, such as the Phantom or Solflare electronic wallet. These electronic wallet services provide a visual representation allowing you to interact with the relevant Blockchain Network to purchase, store, and engage in transactions with various digital assets. You will not be able to engage in any transactions on the App other than through your selected electronic wallet service, or other browsers compatible with the relevant Blockchain Network. 2. Transactions that take place via the visual user interface on the App are confirmed via the relevant Blockchain Network. You understand that your public address on the relevant Blockchain Network will be made publicly visible whenever you engage in a transaction on the App. 3. The visual user interface provided on the Website facilitates your ability to access Meteora. The interface is distinct from the decentralised Meteora network. Meteora is public, permissionless, and runs on open-source self-executing software; while the interface itself merely enables you to initiate messages to Meteora in order to perform functions or access Services thereon. The interface is one of the means of accessing Meteora, but not the exclusive means of access. 4. Meteora is a non-custodial protocol, therefore the App does not hold or control your digital assets. Any digital assets which you may acquire through the usage of the App will be held and administered solely by you through your selected electronic wallet, and we shall have no access to or responsibility in regard to such electronic wallet or digital asset held therein. It is solely your responsibility to select the wallet service provider to use in connection with the App, and your use of such electronic wallet will be subject to the governing terms of use or privacy policy of the provider of such wallet. We neither own nor control your selected electronic wallet service, Google Chrome, any electronic wallet, the relevant Blockchain Network, or any other third party site, product, or service that you might access, visit, or use for the purpose of enabling you to use the various features of the App. We will not be liable for the acts or omissions of any such third parties, nor will we be liable for any damage that you may suffer as a result of your transactions or any other interaction with any such third parties. 5. The Company will not create any hosted wallet for you or otherwise custody digital assets on your behalf, and it is your sole responsibility to maintain the security of your selected electronic wallet. In the event that you lose access to your electronic wallet, private key(s), password(s), or other method(s) of securing your wallet, all digital assets held in such wallet may be irretrievable, and the Company will be unable to assist you in any way. You hereby irrevocably waive, release and discharge all claims, whether known or unknown to you, against the Company, its affiliates and their respective shareholders, members, directors, officers, employees, agents and representatives related to your use of any wallet software, associated loss of digital assets, transaction failures, or any other defects that arise in the course of your use of your electronic wallet, including any losses that may obtain as a result of any failure of any Smart Contracts, the Site or the App. 6. The Company reserves the right to modify, suspend or discontinue, temporarily or permanently, all or any part of the Site or the App with or without notice. You agree that the Company will not be liable to you or to any third party for any modification, suspension or discontinuance of all or any part of the Site or the App. 7. The publicly deployed Smart Contracts you interact with are experimental in nature and you should not utilise the Smart Contracts or Liquidity Pools for deployment of any substantial amount of digital assets. 8. We reserve the right to disable access to the App, the Site or the interface at any time in the event of any breach of the Terms, including without limitation, if we, in our sole discretion, believe that you, at any time, fail to satisfy the eligibility requirements set forth in the Terms. Further, we reserve the right to limit or restrict access to the App or the Site by any person or entity, or within any geographic area or legal jurisdiction, at any time and at our sole discretion. We will not be liable to you for any losses or damages you may suffer as a result of or in connection with the App or the Site being inaccessible to you at any time or for any reason. [​](https://docs.meteora.ag/legal/1-terms-of-service#3-services) 3\. Services -------------------------------------------------------------------------------- 1. The Company has deployed the Smart Contracts on the relevant Blockchain Network for users to utilise in accordance with these Terms. Users may directly call the functions of the Smart Contracts directly, or access them via the user interface provided by the App. 2. Meteora allows users to trade digital asset pairs directly in a peer-to-peer manner. Users will be able to act as market makers or liquidity providers for these transactions by staking/pooling their digital assets into decentralised liquidity pools (Liquidity Pools) to provide the necessary liquidity for transactions by other users. These digital assets may comprise various fungible cryptocurrencies in the market. 3. Liquidity Pools and the underlying digital asset pairings will be selected and created by liquidity providers, who allow other users to access these Liquidity Pools to conduct trades. Any party may trade and/or become a liquidity provider (LP) for a pool by depositing an equivalent value of each underlying token to the Liquidity Pool in return for pool tokens (LP tokens). All trades conducted via Meteora would be performed in a non-custodial manner and users remain in control of their digital assets. Through allocating different amounts of tokens at diverse price points, project teams are able to build their desired liquidity shape with the DLMM that best fits their liquidity provider (LP) goals. 4. All interactions between liquidity providers and traders on Meteora operate in a peer-to-peer manner. Liquidity providers and traders on Meteora enter into a direct contractual relationship via the autonomous Smart Contracts and/or other smart contracts deployed by various other third party networks, and therefore liquidity providers wholly assume all responsibility towards the user of the Liquidity Pools. There is no further control by or interaction with the Company (or the relevant affiliate) which had deployed the Smart Contract(s). The Company and its affiliates shall in no circumstances be construed as a party to said peer-to-peer direct contractual relationship, is not liable for performance of obligations thereunder, nor does it bear any financial or commercial risk or provide any warranties or assurances in connection with the same. 5. The App merely provides a visual user interface allowing users to interact with Liquidity Pools and to access liquidity provided by liquidity providers, and does not act as an agent for any of the users. Although the App is intended to display accurate and timely information regarding Liquidity Pools and possible swaps, the App or relevant tools/information may not always be entirely accurate, complete or current and may also include technical inaccuracies or typographical errors. The pricing information data provided through the App does not represent an offer, a solicitation of an offer, or any advice regarding, or recommendation to enter into, a transaction with the Company or the App. Accordingly, users should verify all information before relying on it, and all decisions based on information contained on the App or tools/information tools are at the sole responsibility of each user. Notwithstanding any of the other provisions in these Terms, any photographs, graphic illustrations, videos, models, charts, designs, or examples on the site are strictly for information purposes only and have no contractual value nor do they form the basis of any contract with the Company. 6. Neither the Company, the Site nor the App provides any digital asset exchange or portfolio/fund management services in connection with the Liquidity Pools. If you choose to engage in transactions with liquidity providers in Liquidity Pools or any other users, then such decisions and transactions and any consequences flowing therefrom are your sole responsibility. In no event shall the Company, its affiliates or their respective directors or employees be responsible or liable to you or anyone else, directly or indirectly, for any damage or loss arising from or relating to any interaction or continued interaction with Liquidity Pools, or reliance on any information provided on the Site or the App (including, without limitation, directly or indirectly resulting from errors in, omissions of or alterations to any such information). 7. THE APP SOLELY FUNCTIONS AS A VISUAL USER INTERFACE. IN NO CIRCUMSTANCES SHALL THE COMPANY, THE SMART CONTRACTS, THE SITE OR THE APP BE CONSTRUED AS A DIGITAL ASSET EXCHANGE, BROKER, DEALER, FUND MANAGER, FINANCIAL INSTITUTION, EXCHANGE, CUSTODIAN, ROBO-ADVISOR, INTERMEDIARY, OR CREDITOR. THE SITE DOES FACILITATE OR ARRANGE TRANSACTIONS BETWEEN BUYERS AND SELLERS, INCLUDING WITH RESPECT TO ANY TRANSACTIONS THAT OCCUR IN CONNECTION WITH A LIQUIDITY POOL, WHICH TRANSACTIONS OCCUR ON THE RELEVANT BLOCKCHAIN NETWORK. THE COMPANY IS NOT A COUNTERPARTY TO ANY TRANSACTION FACILITATED BY THE SMART CONTRACTS, THE SITE OR THE APP OR FOR ANY USER OF THE SITE. NEITHER THE SMART CONTRACTS, THE SITE OR THE APP PROVIDES FINANCIAL ADVISORY, LEGAL, REGULATORY, OR TAX SERVICES DIRECTLY, INDIRECTLY, IMPLICITLY, OR IN ANY OTHER MANNER, AND YOU SHOULD NOT CONSIDER ANY CONTENT CONTAINED IN THESE TERMS OR OTHERWISE POSTED ON THE SITE TO BE A SUBSTITUTE FOR PROFESSIONAL FINANCIAL, LEGAL, REGULATORY, TAX OR OTHER ADVICE. THE COMPANY DOES NOT SUPPORT OR ENDORSE ANY LIQUIDITY POOL CREATED BY ANY USER OF METEORA, AND EACH SUCH CREATOR IS AN INDEPENDENT AGENT WITH NO EMPLOYMENT OR OTHER CONTRACTUAL RELATIONSHIP WITH THE COMPANY. 8. The Company reserves the right to suspend or terminate access to the Site or the App by any creator of Liquidity Pools or user of Liquidity Pools for any reason whatsoever (including without limitation for a breach of these Terms). You agree that the Company will not be liable to you or to any third party for any suspension or termination of any user. 9. Access to the Smart Contracts, the App or the Site may become degraded or unavailable during times of significant volatility or volume. This could result in the inability to interact with third-party services for periods of time and may also lead to support response time delays. The Company cannot guarantee that the Smart Contracts, the App or the Site will be available without interruption and neither do we guarantee that requests to interact with third-party services will be successful. [​](https://docs.meteora.ag/legal/1-terms-of-service#4-fees-and-payment) 4\. Fees and Payment ------------------------------------------------------------------------------------------------ 1. If you elect to interact with Liquidity Pools, all transactions will be conducted solely through the relevant Blockchain Network. We will have no insight into or control over these payments or transactions, nor do we have the ability to reverse any transactions. With that in mind, we will have no liability to you or to any third party for any claims or damages that may arise as a result of any transactions that you engage in via the App, or using the Smart Contracts, or any other transactions that you conduct via the relevant Blockchain Network. 2. The relevant Blockchain Network typically requires the payment of a transaction fee (a “**Gas Fee**”) for every transaction that occurs on the relevant Blockchain Network. The Gas Fee funds the network of computers that run the decentralised network. This means that you will need to pay a Gas Fee for each transaction that occurs via the Smart Contracts. 3. You may be subject to certain additional fees and commissions, including fees imposed by creators of Liquidity Pools for accessing and utilising the Liquidity Pools as notified to you prior to engaging with any digital asset swap or liquidity provision. The Company also reserves the right to levy additional fees for access via the Smart Contracts, the Site or the App in the future. You agree to promptly pay all aforementioned fees and commissions. 4. Notwithstanding anything in these Terms to the contrary, you will be solely responsible to pay any and all sales, use, value-added and other taxes, duties, and assessments (except taxes on the Company’s net income) now or hereafter claimed or imposed by any governmental authority (collectively, “**Taxes**”) associated with your use of the App (including, without limitation, any Taxes that may become payable as the result of your ownership or transfer of digital assets or interaction with any Liquidity Pool, or relating to Meteora). [​](https://docs.meteora.ag/legal/1-terms-of-service#5-intellectual-property-and-content) 5\. Intellectual Property and Content ---------------------------------------------------------------------------------------------------------------------------------- 1. The Company owns the Site and the App. You acknowledge and agree that the Company (or, as applicable, its affiliates) owns all legal right, title and interest in and to all other elements of the site and the App, and all intellectual property rights therein (including, without limitation, all designs, systems, methods, information, computer code, software, services, website design, “look and feel”, organisation, compilation of the content, code, data and database, functionality, audio, video, text, photograph, graphics, copyright, trademarks (if any), and all other elements of the App (collectively, the “**Materials**”). You acknowledge that the Materials are protected by copyright, trade dress, patent, and trademark laws, international conventions, other relevant intellectual property and proprietary rights, and applicable laws. All Materials are the copyrighted property of The Company or its licensors, and all trademarks, service marks, and trade names associated with the App or otherwise contained in the Materials are proprietary to The Company or its licensors. Except as expressly set forth herein, your use of the App does not grant you ownership of or any other rights with respect to any content, code, data, or other Materials that you may access on or through the App. We reserve all rights in and to the Materials that are not expressly granted to you in these Terms. For the sake of clarity, you understand and agree: that (a) your interaction with Liquidity Pools or usage of the Smart Contracts, the Site or the App does not give you any rights or licenses in or to the Materials other than those expressly contained in these Terms; (b) you do not have the right to license, sell, rent, lease, transfer, assign, distribute, host, reproduce, distribute, or otherwise commercialise any elements of the Materials without our prior written consent in each case, which consent we may withhold in our sole and absolute discretion; (c) you shall not modify, make derivative works of, disassemble, reverse compile or reverse engineer any part of the Materials; and (d) you will not apply for, register, or otherwise use or attempt to use any of the Company’s trademarks or service marks, or any confusingly similar marks, anywhere in the world. 2. By interacting with Liquidity Pools, you are granted a limited, non-exclusive, non-transferable, revocable license to use the site and the App for your personal use. Neither these Terms nor your access to the Smart Contracts, the site and the App transfers to you or any third party any rights, title or interest in or to intellectual property rights in the Materials, except for the limited access rights expressly set forth in these Terms. The Company expressly reserves all rights not granted in these Terms. There are no implied licenses granted under these Terms. 3. By acceptance of these Terms, you agree and acknowledge that all information and content provided by you, including your username, your contact list, Liquidity Pools created or Liquidity Pools interacted with, any messages, posts, comments or user generated content (the “UGC”) in any communication channel (including without limitation Twitter, Discord or Telegram) shall be considered non-confidential and non-proprietary information. By providing such UGC, you specifically grant the Company a non-exclusive, irrevocable, transferable, sub-licensable, royalty-free, worldwide license to use, copy, duplicate store, present and publish all or any part of the UGC, and the Company shall be free to use such UGC in any manner or media whatsoever, on an unrestricted basis and without any attribution or royalties or other compensation to you, including, without limitation, within or outside the Site or the App, and in any digital or printed media. 4. You acknowledge that you shall be responsible for any UGC that you submit or transmit through the Site or the App, including your responsibility as to the legality, reliability, appropriateness, originality and copyright of any such information or material. Additionally, you represent and warrant that: (a) you own all right title and interest in any UGC provided by you, (b) such UGC does not violate any applicable laws, and (c) the posting of your UGC by us (in any manner or media whatsoever, on an unrestricted basis) does not (and will not) violate the privacy rights, publicity rights, copyright, contract rights or any other rights of any individual or make derogatory remarks regarding, defame or otherwise criticise any person or entity. You shall be solely liable for any damage resulting from any infringement or other violation of the copyright, trademarks or other proprietary rights of any individual or entity, and for any other harm or losses resulting from any UGC. 5. You acknowledge and agree that any questions, comments, suggestions, ideas, feedback or other information regarding the Smart Contracts, the Site and the App (“Feedback”) provided by you to us are non-confidential and should become our sole property. We should own exclusive rights, including all intellectual property rights, and should be entitled to the unrestricted use and dissemination of these Feedback to any lawful purpose, commercial, or otherwise, without acknowledgment or compensation for you. You hereby waive any moral rights to any such Feedback, and you hereby warrant that any such Feedback are original with you or that you have the right to submit such Feedback. You agree there should be no recourse against us for any alleged or actual infringement or misappropriation of any proprietary right in your Feedback. [​](https://docs.meteora.ag/legal/1-terms-of-service#6-user-terms) 6\. User Terms ------------------------------------------------------------------------------------ 1. You agree that you are responsible for your own conduct while accessing or using the App, and for any consequences thereof. You agree to use the App only for purposes that are legal, proper and in accordance with these Terms and any applicable laws or regulations, including without limitation you may not, and may not allow any third party to: (a) send, upload, distribute or disseminate any unlawful, defamatory, harassing, abusive, fraudulent, obscene, or otherwise objectionable content; (b) distribute viruses, worms, defects, Trojan horses, corrupted files, hoaxes, or any other items of a destructive or deceptive nature; (c) impersonate another person (via the use of an email address or otherwise); (d) upload, post, transmit or otherwise make available through the App any content that infringes the intellectual proprietary rights of any party; (e) use the App to violate the legal rights (such as rights of privacy and publicity) of others; (f) engage in, promote, or encourage illegal activity (including, without limitation, money laundering); (g) interfere with other users’ enjoyment of the App; (h) exploit the App for any unauthorised commercial purpose; (i) modify, adapt, translate, decompile, disassemble or reverse engineer any portion of the App; (j) attempt to bypass any measure of the Site designed to prevent or restrict access to the Site, or any portion of the Site or the App; (k) harass, intimidate, or threaten any of our employees or agents engaged in providing any portion of the Site or the App to you; (l) remove any copyright, trademark or other proprietary rights notices contained in or on the App, the Contents or any part of it; (m) reformat or frame any portion of the App; (n) display any content on the App that contains any hate-related or violent content or contains any other material, products or services that violate or encourage conduct that would violate any criminal laws, any other applicable laws, or any third party rights; (o) use any robot, spider, site search/retrieval application, or other device to retrieve or index any portion of the App or the content posted on the App, or to collect information about its users for any unauthorised purpose; (p) upload or transmit (or attempt to upload or to transmit) any material that acts as a passive or active information collection or transmission mechanism, including without limitation, clear graphics interchange formats (“gifs”), 1×1 pixels, web bugs, cookies, or other similar devices (sometimes referred to as “spyware” or “passive collection mechanisms” or “pcms”); (q) access or use the App by automated means or under false or fraudulent pretences; (r) access or use the App for the purpose of, directly or indirectly, creating or enabling a party to create a product or service that is competitive with any of our products or services; (s) use the Site, the App and the Smart Contracts to advertise or offer to sell goods and services; (t) conduct any activity that violates any applicable law, rule, or regulation concerning the integrity of trading markets, including (but not limited to) the manipulative tactics commonly known as spoofing, wash trading, cornering, accommodation trading, fictitious transactions, “money pass” (i.e. transactions without a net change in either party’s open positions but with a resulting profit to one party and a loss to the other party), front-running, or pre-arranged or non-competitive transactions, or transactions designed to mislead external parties, or (u) disparage, tarnish, or otherwise harm, in our opinion, us and/or the Site, the App, and the Smart Contracts. If you engage in any of the activities prohibited by this Section 6, we may, at our sole and absolute discretion, without notice to you, and without limiting any of our other rights or remedies at law or in equity, immediately suspend or terminate your access to the Site or the App and delete your UGC from the Site. 2. By using the Site, the App and the Smart Contracts, you represent and warrant that: (a) you have read and understood these Terms and all documentation on the App or the Site; (b) you have good and sufficient experience and understanding of the functionality, usage, storage, transmission mechanisms and other material characteristics of cryptographic tokens, token storage mechanisms (such as token wallets), blockchain technology, blockchain-like technology and blockchain-based software systems to understand these Terms and to appreciate the risks and implications of creating or interacting with Liquidity Pools; (c) you acknowledge and agree that we may impose eligibility criteria to access certain functionality in respect of Meteora which may require you to incur additional time and money costs; (d) you create and interact with Liquidity Pools for your own account and shall not do the same on behalf of any other entity or person; (e) your creation or interaction with Liquidity Pools complies with applicable law and regulation in your jurisdiction, and the law and regulation of any jurisdiction to which you may be subject (including, but not limited to legal capacity and any other threshold requirements for creating and interacting with Liquidity Pools, and interacting with other users of Meteora, any foreign exchange or regulatory restrictions applicable to creating and interacting with Liquidity Pools, and any governmental or other consents that may need to be obtained); (f) all information you submit will be true, accurate, current, and complete (if you provide any information that is untrue, inaccurate, not current, or incomplete, we have the right to refuse or terminate your current or future use of the Site and the App (or any portion thereof)); (g) you will maintain the accuracy of such information and promptly update such information as necessary; (h) you have the legal capacity and you agree to comply with these Terms; (i) you are not a minor in the jurisdiction in which you reside; (j) you will not use the Site, the App and the Smart Contracts for any illegal and unauthorised purpose; (k) you will not use the Site, the App and the Smart Contracts for any commercial purpose (save as approved by the Company in writing); (l) your use of the Site, the App and the Smart Contracts will not violate any applicable law or regulation; and (m) any funds or digital assets staked or deposited in Liquidity Pools are not derived from or related to any unlawful activities, including but not limited to money laundering or terrorist financing and all applicable statutes of all jurisdictions in which you are located, resident, organised or operating, and/or to which it may otherwise be subject and the rules and regulations thereunder (collectively, the “Compliance Regulations”), and you will not use the Smart Contracts, the Site or the App to finance, engage in, or otherwise support any unlawful activities or in a manner which aids or facilitates another party in the same. To the extent required by applicable laws and regulations, you shall fully comply with all Compliance Regulations. 3. We reserve the right to (but shall not be obliged to in any event to) conduct “Know Your Customer” and “Anti-Money Laundering” checks on you (including digital address or wallet screening) if deemed necessary by us (at our sole discretion) or such checks become required under applicable laws in any jurisdiction. Upon our request, you shall immediately provide us with information and documents that we, in our sole discretion, deem necessary or appropriate to conduct “Know Your Customer” and “Anti-Money Laundering” checks. Such documents may include, but are not limited to, passports, driver’s licenses, utility bills, photographs of associated individuals, government identification cards or sworn statements before notaries or other equivalent professionals. Notwithstanding anything herein, we may, in its sole discretion, refuse to provide access to the Site or the Site to you until such requested information is provided, or in the event that, based on information available to us, you are suspected of using the Smart Contracts, the Site or the App in connection with any money laundering, terrorism financing, or any other illegal activity. In addition, we shall be entitled to use any possible efforts for preventing money laundering, terrorism financing or any other illegal activity, including without limitation blocking of your access to the Smart Contracts, the App or the Site or providing your information to any regulatory authority. 4. You are responsible for complying with applicable laws (including tax laws) in connection with usage of the Smart Contracts, the Site, the App or interactions with Liquidity Pools. You agree that we are not responsible for determining whether or which laws may apply to said interactions. You are advised to consult your own lawyers regarding of the legality and implications of any such activities. You are solely responsible for reporting and paying any taxes arising from your usage of the Smart Contracts, the Site, the App or interactions with Liquidity Pools. [​](https://docs.meteora.ag/legal/1-terms-of-service#7-risks-borne-by-users) 7\. Risks Borne by Users -------------------------------------------------------------------------------------------------------- **IMPORTANT RISK NOTICE:** You acknowledge and agree that the Services, the Site and the App are currently in the initial development stages and there are a variety of unforeseeable risks with utilising the foregoing. In the worst scenario, this could lead to the loss of all or part of your digital assets interacting with the Services, the Site, the App or the Smart Contracts. **IF YOU DECIDE TO UTILISE SERVICES YOU EXPRESSLY ACKNOWLEDGE, ACCEPT AND ASSUME THE BELOW RISKS AND AGREE NOT TO HOLD THE COMPANY OR ANY OF THEIR AFFILIATES RESPONSIBLE FOR THE FOLLOWING RISKS:** 2. Using the App and interacting with Liquidity Pools carry financial risk. You acknowledge and agree that you are aware of such risks, including the following: (a) transactions relating to digital assets are very risky, and such digital assets are, by their nature, highly experimental, risky, volatile and generally irreversible. You should not make any transactional decision without first conducting your own research. You are solely and exclusively responsible for determining whether any Liquidity Pool, any transaction, or strategy, or any other product or service in connection with the same is appropriate or suitable for you based on your own objectives and personal and financial situation. You acknowledge and agree that you will access and use the Smart Contracts, the Site and the App and interact with Liquidity Pools at your own risk. 3. You represent that you have sufficient knowledge, market sophistication, professional advice and experience to make your own evaluation of the merits and risks of any interaction with Liquidity Pools and the underlying digital assets. You accept all consequences of participating in such interactions, including the risk that you may lose access to your digital assets indefinitely. All decisions to interact with Liquidity Pools are made solely by you. Notwithstanding anything in these Terms, the Company accepts no responsibility whatsoever for and will in no circumstances be liable to you in connection with any interaction with Liquidity Pools and the underlying digital assets. Under no circumstances will the operation of all or any portion of the Smart Contracts, the Site or the App be deemed to create a relationship that includes any management of any assets, or the provision or tendering of investment advice. 4. Digital assets are not legal tender, are not backed by the government, and are not subject to any “Deposit Insurance Scheme” or protections under any banking or securities laws. The Company is not a bank and does not offer any lending services, fiduciary services, or security broking services. 5. The prices of blockchain assets are extremely volatile. Fluctuations in the price of other digital assets could materially and adversely affect the value of your digital assets held in Liquidity Pools, which may also be subject to significant price volatility. We cannot guarantee that any users interacting with Liquidity Pools will not lose money. 6. Neither the Smart Contracts, Site, the App or Liquidity Pools hold in custody, store, send, or receive any of your digital assets. This is because your digital assets exist only by virtue of the ownership record maintained on the relevant Blockchain Network. Any transfer of digital assets occurs within the relevant Blockchain Network, and not on the Smart Contracts, Site, the App or Liquidity Pools. 7. Public blockchain-based transactions (including but not limited to transactions automatically executed by smart contracts) are generally considered irreversible when confirmed. Any transaction that will interact with smart contracts or be recorded on a public blockchain must be recorded with extreme caution. 8. All smart contracts (including the Smart Contracts) may contain security vulnerabilities, errors, failures, bugs or economic loopholes which may be exploited by third parties, causing you to suffer losses in connection with any digital assets re-deployed by Liquidity Pools. Interaction with these Smart Contracts are entirely at your own responsibility and liability, and the Company is not a party to the Smart Contracts. 9. No creator of Liquidity Pools will be able to guarantee the future performance of digital assets held in a Liquidity Pool, any specific level of performance, the success of any strategy or your overall results from interacting with Liquidity Pools. When reviewing the information, portfolio, performance, opinions of these creators, do not assume that such party is unbiased, independent or qualified to provide financial information or opinions. Past performance and risk scores have many inherent limitations and are not indicative of future results. No representation or guarantee is being made that any creator of Liquidity Pools will or is likely to achieve gains or losses similar to the past performance. The actual percentage gains or losses experienced by users will vary depending on many factors. 10. Hackers or other malicious groups or organisations may attempt to interfere with the Smart Contracts, the Site, the App or Liquidity Pools in a variety of ways, including, but not limited to, malware attacks, denial of service attacks, consensus-based attacks, Sybil attacks, smurfing and spoofing, which may result in losses incurred by you. Furthermore, because the relevant Blockchain Network comprises open-source software, there is the risk that the software underlying the Services may contain intentional or unintentional bugs or weaknesses that may negatively affect the Services or the Smart Contracts, or result in the loss of the user’s digital assets, or the loss of the user’s ability to access or control their digital assets. In the event of such a software bug or weakness, there may be no remedy, and users are not guaranteed any remedy, refund or compensation. 11. Further, when you interact with Liquidity Pools or trade on any blockchain network, you accept that there is the inherent risk of the transaction being vulnerable to automated software programs (MEV bots) deployed by third parties which operate within decentralized finance (DeFi) ecosystem and exploit blockchain mechanics such as transaction ordering and gas price bidding to gain an advantage over specific users, or automated software programs (sniper bots) which executes trades buys or front-runs orders in respect of digital assets as soon as they are available on centralised or decentralised exchanges, which may be deployed by bad actors in connection with market manipulation or insider trading activities. The Company cannot be responsibility for losses suffered due to any of the foregoing, which are inherent to transactions on open blockchain networks. 12. The regulatory status of digital assets, and distributed ledger technology is unclear or unsettled in many jurisdictions. While every effort has been taken to ensure that the Services, the Site, the App and the Smart Contracts are compliant with local laws, it is difficult to predict how or whether regulatory agencies may apply existing regulation with respect to the same. It is likewise difficult to predict how or whether legislatures or regulatory agencies may implement changes to law and regulation affecting distributed ledger technology and its applications, including the Services, the Site, the App or the Smart Contracts. Regulatory actions could negatively impact the Company in various ways, and thus the Services may not be available in certain areas. 13. The underlying smart contracts run on a variety of supported blockchain networks, using specially-developed smart contracts. Accordingly, upgrades to the relevant Blockchain Network, a hard fork in the relevant Blockchain Network, re-organisations of blockchain structure or blocks, or a change in how transactions are confirmed on the relevant Blockchain Network may have unintended, adverse effects on the smart contracts built thereon, including the Smart Contracts. 14. The Site, Services and Smart Contracts may rely on or utilise a variety of external third party services or software, including without limitation decentralised cloud storage services, analytics tools, oracles, hence therefore the Services may be adversely affected by any number of risks related to these third party services/software, which may be compromised in the event of security vulnerabilities, cyberattacks, malicious activity, or technical interruptions. [​](https://docs.meteora.ag/legal/1-terms-of-service#8-external-sites) 8\. External Sites -------------------------------------------------------------------------------------------- The Site or the App may include hyperlinks to other web sites or resources (collectively, “External Sites”), which are provided solely for your convenience. We have no control over any External Sites. You acknowledge and agree that we are not responsible for the availability of any External Sites, and that we do not endorse any advertising, products or other materials on or made available from any External Sites. Furthermore, you acknowledge and agree that we are not liable for any loss or damage which may be incurred as a result of the availability or unavailability of the External Sites, or as a result of any reliance placed by you upon the completeness, accuracy or existence of any advertising, products or other materials on, or made available from, any External Sites. [​](https://docs.meteora.ag/legal/1-terms-of-service#9-disclaimers) 9\. Disclaimers -------------------------------------------------------------------------------------- 1. YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR ACCESS TO AND USE OF THE SMART CONTRACTS, THE SITE, THE APP AND LIQUIDITY POOLS IS AT YOUR SOLE RISK, AND THAT THE APP IS PROVIDED “AS IS” AND “AS AVAILABLE” WITHOUT WARRANTIES OF ANY KIND, WHETHER EXPRESS OR IMPLIED. TO THE FULLEST EXTENT PERMISSIBLE PURSUANT TO APPLICABLE LAW, THE COMPANY, ITS SUBSIDIARIES, AFFILIATES, AND LICENSORS MAKE NO EXPRESS WARRANTIES AND HEREBY DISCLAIM ALL IMPLIED WARRANTIES REGARDING THE APP AND ANY PART OF IT (INCLUDING, WITHOUT LIMITATION, THE SMART CONTRACTS, THE SITE, THE APP, LIQUIDITY POOLS, OR ANY EXTERNAL WEBSITES), INCLUDING ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, CORRECTNESS, ACCURACY, OR RELIABILITY. WITHOUT LIMITING THE GENERALITY OF THE FOREGOING, THE COMPANY, ITS SUBSIDIARIES, AFFILIATES, AND LICENSORS DO NOT REPRESENT OR WARRANT TO YOU THAT: (A) YOUR ACCESS TO OR USE OF THE SMART CONTRACTS, THE SITE, THE APP AND LIQUIDITY POOLS WILL MEET YOUR REQUIREMENTS, (B) YOUR ACCESS TO OR USE OF THE SMART CONTRACTS, THE SITE, THE APP AND LIQUIDITY POOLS WILL BE UNINTERRUPTED, TIMELY, SECURE OR FREE FROM ERROR, (C) USAGE DATA PROVIDED THROUGH THE SMART CONTRACTS, THE SITE, THE APP AND LIQUIDITY POOLS WILL BE ACCURATE, (D) THE SMART CONTRACTS, THE SITE, THE APP AND LIQUIDITY POOLS, OR ANY CONTENT, SERVICES, OR FEATURES MADE AVAILABLE ON OR THROUGH THE SMART CONTRACTS, THE SITE, THE APP AND LIQUIDITY POOLS ARE FREE OF VIRUSES OR OTHER HARMFUL COMPONENTS, OR (E) THAT ANY DATA THAT YOU DISCLOSE WHEN YOU USE THE SMART CONTRACTS, THE SITE, THE APP AND LIQUIDITY POOLS WILL BE SECURE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES IN CONTRACTS WITH CONSUMERS, SO SOME OR ALL OF THE ABOVE EXCLUSIONS MAY NOT APPLY TO YOU. 2. YOU ACCEPT THE INHERENT SECURITY RISKS OF PROVIDING INFORMATION AND DEALING ONLINE OVER THE INTERNET, AND AGREE THAT THE COMPANY HAS NO LIABILITY OR RESPONSIBILITY FOR ANY BREACH OF SECURITY UNLESS IT IS DUE TO THE COMPANY’S WILFUL DEFAULT. 3. DIGITAL ASSETS ARE INTANGIBLE DIGITAL ASSETS THAT EXIST ONLY BY VIRTUE OF THE OWNERSHIP RECORD MAINTAINED IN THE RELEVANT BLOCKCHAIN NETWORK. ALL SMART CONTRACTS IN CONNECTION WITH METEORA ECOSYSTEM ARE DEPLOYED ON AND INTERACTIONS/TRANSACTIONS WITH THE SAME OCCUR ON THE DECENTRALISED LEDGER WITHIN THE RELEVANT BLOCKCHAIN NETWORK. WE HAVE NO CONTROL OVER AND MAKE NO GUARANTEES OR PROMISES WITH RESPECT TO SMART CONTRACTS. 4. THE COMPANY IS NOT RESPONSIBLE FOR LOSSES DUE TO BLOCKCHAINS OR ANY OTHER FEATURES OF THE RELEVANT BLOCKCHAIN NETWORK OR YOUR SELECTED ELECTRONIC WALLET SERVICE, INCLUDING BUT NOT LIMITED TO LATE REPORT BY DEVELOPERS OR REPRESENTATIVES (OR NO REPORT AT ALL) OF ANY ISSUES WITH THE BLOCKCHAIN SUPPORTING THE RELEVANT BLOCKCHAIN NETWORK, INCLUDING FORKS, TECHNICAL NODE ISSUES, OR ANY OTHER ISSUES HAVING FUND LOSSES AS A RESULT. [​](https://docs.meteora.ag/legal/1-terms-of-service#10-limitation-of-liability) 10\. Limitation of Liability ---------------------------------------------------------------------------------------------------------------- 1. YOU UNDERSTAND AND AGREE THAT WE, OUR SUBSIDIARIES, AFFILIATES, AND LICENSORS WILL NOT BE LIABLE TO YOU OR TO ANY THIRD PARTY FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR EXEMPLARY DAMAGES WHICH YOU MAY INCUR IN CONNECTION WITH THE SMART CONTRACTS, THE SITE, THE APP OR LIQUIDITY POOLS, HOWSOEVER CAUSED AND UNDER ANY THEORY OF LIABILITY, INCLUDING, WITHOUT LIMITATION, ANY LOSS OF PROFITS (WHETHER INCURRED DIRECTLY OR INDIRECTLY), LOSS OF GOODWILL OR BUSINESS REPUTATION, LOSS OF DATA, COST OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR ANY OTHER INTANGIBLE LOSS, EVEN IF WE HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 2. YOU AGREE THAT OUR TOTAL, AGGREGATE LIABILITY TO YOU FOR ANY AND ALL CLAIMS ARISING OUT OF OR RELATING TO THESE TERMS OR YOUR ACCESS TO OR USE OF (OR YOUR INABILITY TO ACCESS OR USE) ANY PORTION OF THE SMART CONTRACTS, THE SITE, THE APP OR LIQUIDITY POOLS, WHETHER IN CONTRACT, TORT, STRICT LIABILITY, OR ANY OTHER LEGAL THEORY, IS LIMITED TO THE LOWER OF (A) THE AMOUNTS YOU ACTUALLY PAID US UNDER THESE TERMS IN THE 12 MONTH PERIOD PRECEDING THE DATE THE CLAIM AROSE, OR (B) US$200. 3. YOU ACKNOWLEDGE AND AGREE THAT WE HAVE MADE THE SMART CONTRACTS, THE SITE, THE APP AND LIQUIDITY POOLS AVAILABLE TO YOU AND ENTERED INTO THESE TERMS IN RELIANCE UPON THE WARRANTY DISCLAIMERS AND LIMITATIONS OF LIABILITY SET FORTH HEREIN, WHICH REFLECT A REASONABLE AND FAIR ALLOCATION OF RISK BETWEEN THE PARTIES AND FORM AN ESSENTIAL BASIS OF THE BARGAIN BETWEEN US. WE WOULD NOT BE ABLE TO PROVIDE THE APP TO YOU WITHOUT THESE LIMITATIONS. 4. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, AND SOME JURISDICTIONS ALSO LIMIT DISCLAIMERS OR LIMITATIONS OF LIABILITY FOR PERSONAL INJURY FROM CONSUMER PRODUCTS, SO THE ABOVE LIMITATIONS MAY NOT APPLY TO PERSONAL INJURY CLAIMS. [​](https://docs.meteora.ag/legal/1-terms-of-service#11-indemnity) 11\. Indemnity ------------------------------------------------------------------------------------ You agree to hold harmless and indemnify the Company and its subsidiaries, affiliates, officers, agents, employees, advertisers, licensors, suppliers or partners from and against any claim, liability, loss, damage (actual and consequential) of any kind or nature, suit, judgment, litigation cost, and attorneys’ fees arising out of or in any way related to (a) your breach of these Terms, (b) your misuse of the Smart Contracts, the Site, the App or the Liquidity Pools, or (c) your violation of any applicable laws, rules or regulations in connection with your access to or use of the App. You agree that the Company will have control of the defence or settlement of any such claims. [​](https://docs.meteora.ag/legal/1-terms-of-service#12-privacy-policy) 12\. Privacy Policy ---------------------------------------------------------------------------------------------- 1. Our Privacy Policy describes the ways the Company collects, uses, stores and discloses your personal information, and is hereby incorporated by this reference into these Terms. You agree to the collection, use, storage, and disclosure of your data in accordance with the aforementioned Privacy Policy. 2. The Company will maintain certain data that you transmit to the Site and the App for the purpose of managing the performance of the Site and the App, as well as data relating to your use of the Site or the App. Although we perform regular routine backups of data, the Company is solely responsible for all data that you transmit or that release to any activity you have undertaken using the Site or the App. You agree that we shall have no liability to you for any loss or corruption of any such data, and you hereby waive any right of action against us arising from any such loss or corruption of such data. [​](https://docs.meteora.ag/legal/1-terms-of-service#13-consent-to-electronic-disclosures-and-signatures) 13\. Consent to Electronic Disclosures and Signatures ------------------------------------------------------------------------------------------------------------------------------------------------------------------ 1. Because the Company operates only on the Internet, it is necessary for you to consent to transact business with us online and electronically. As part of doing business with us, therefore, we also need you to consent to our providing you certain disclosures electronically via the Site. By agreeing to these Terms, you agree to receive electronically all documents, communications, notices, contracts, and agreements arising from or relating to your use of the Site and Services. 2. By accepting these Terms or contacting us in any manner, you expressly consent to be contacted by us, our agents, representatives, affiliates, or anyone calling on our behalf for any and all purposes, in any way, including notifications, messages and/or calls delivered using automated systems. Notwithstanding the aforementioned, any form of communication from the Company will be provided to you electronically through the Site or (if applicable) via email to the email address provided. If you require paper copies of any agreements or disclosures, you may print such documents desired. 3. Your consent to receive disclosures and transact business electronically, and our agreement to do so, applies to any transactions to which such disclosures relate, whether between you and the Company or a third party by and through the Services. Your consent will remain in effect for so long as you are a user and, if you are no longer a user, will continue until such a time as all disclosures relevant to Services received through the Site. 4. You may withdraw your consent to receive agreements or disclosures electronically by contacting us at [meteora\_support@meteora.ag](mailto:meteora_support@meteora.ag) . However, once you have withdrawn your consent you will not be able to access the Services or the Site. [​](https://docs.meteora.ag/legal/1-terms-of-service#14-governing-law-and-dispute-resolution) 14\. Governing Law and Dispute Resolution ------------------------------------------------------------------------------------------------------------------------------------------ 1. These Terms will be governed by and construed in accordance with the laws of the British Virgin Islands, without regard to conflict of law rules and principles (whether of the British Virgin Islands or any other jurisdiction) that would cause the application of the laws of any other jurisdiction. 2. All disputes arising out of or in connection with these Terms (including without limitation the enforceability of this Section 14 or any question regarding its existence, validity or termination, your access or use of the App, the Site, or the Smart Contracts, or to any products sold or distributed through the App, the Site, or the Smart Contracts) shall be referred to and finally resolved by arbitration administered by arbitration in accordance with the BVI IAC Arbitration Rules for the time being in force, which rules are deemed to be incorporated by reference in this Section 14. The place of arbitration shall be Road Town, Tortola, British Virgin Islands, unless the Parties agree otherwise. The number of arbitrators shall be one. The language to be used in the arbitral proceedings shall be English. The award of the arbitrator will be final and binding, and any judgment on the award rendered by the arbitrator may be entered in any court of competent jurisdiction. Each party will cover its own fees and costs associated with the arbitration proceedings. Notwithstanding the foregoing, the Company may seek and obtain injunctive relief in any jurisdiction in any court of competent jurisdiction, and you agree that these Terms are specifically enforceable by the Company through injunctive relief and other equitable remedies without proof of monetary damages. [​](https://docs.meteora.ag/legal/1-terms-of-service#15-notices) 15\. Notices -------------------------------------------------------------------------------- To give us notice under these Terms, the user must contact the Company by email at [meteora\_support@meteora.ag](mailto:meteora_support@meteora.ag) [​](https://docs.meteora.ag/legal/1-terms-of-service#16-entire-agreement) 16\. Entire Agreement -------------------------------------------------------------------------------------------------- These Terms constitute the entire legal agreement between you and the Company, govern your access to and use of the Smart Contracts, the Site, the App or the Liquidity Pools, and completely replace any prior or contemporaneous agreements between the parties related to your access to or use of the Smart Contracts, the Site, the App or the Liquidity Pools, whether oral or written. [​](https://docs.meteora.ag/legal/1-terms-of-service#17-force-majeure) 17\. Force Majeure -------------------------------------------------------------------------------------------- The Company shall not be liable for delays, failure in performance or interruption of service which result directly or indirectly from any cause or condition beyond its reasonable control, including but not limited to, significant market volatility, any delay or failure due to any act of God, act of civil or military authorities, act of terrorists, civil disturbance, war, strike or other labour dispute, fire, interruption in telecommunications or Internet services or network provider services, failure of equipment and/or software, other catastrophe or any other occurrence which is beyond its reasonable control, and shall not affect the validity and enforceability of any remaining provisions. [​](https://docs.meteora.ag/legal/1-terms-of-service#18-third-party-rights) 18\. Third Party Rights ------------------------------------------------------------------------------------------------------ There are no third party beneficiaries to these Terms. A person who is not a party under these Terms has no right under any applicable law to enforce or to enjoy the benefit of these Terms. [​](https://docs.meteora.ag/legal/1-terms-of-service#19-no-agency-or-partnership) 19\. No Agency or Partnership ------------------------------------------------------------------------------------------------------------------ Nothing in these Terms create any agency, partnership, joint venture or any similar relationship between the Company and you, nor cause the Company and you to be deemed acting in concert in any respect. [​](https://docs.meteora.ag/legal/1-terms-of-service#20-interpretation) 20\. Interpretation ---------------------------------------------------------------------------------------------- The language in these Terms will be interpreted as to its fair meaning, and not strictly for or against any party. [​](https://docs.meteora.ag/legal/1-terms-of-service#21-assignment) 21\. Assignment -------------------------------------------------------------------------------------- You may not assign any or your rights or obligations under these Terms, whether by operation of law or otherwise, without our prior written consent. Notwithstanding anything contained herein, we may assign our rights and obligations under these Terms in our sole discretion (without your consent) to an affiliate for any reason, including without limitation any assignment or novation in connection with a reincorporation to change the Company’s domicile. [​](https://docs.meteora.ag/legal/1-terms-of-service#22-illegality) 22\. Illegality -------------------------------------------------------------------------------------- Should any provision or part-provision of these Terms is or becomes invalid, illegal or unenforceable in any respect under any law of any jurisdiction, it shall be deemed modified to the minimum extent necessary to make it valid, legal and enforceable; if such modification is not possible, the relevant provision or part-provision shall be deemed deleted. Any modification to or deletion of a provision or part-provision pursuant to this Section 22 shall not affect or impair the validity and enforceability of the rest of these Terms, nor the validity and enforceability of such provision or part-provision under the law of any other jurisdiction. [​](https://docs.meteora.ag/legal/1-terms-of-service#23-waiver) 23\. Waiver ------------------------------------------------------------------------------ Our failure to enforce any provision of these Terms will not be deemed a waiver of such provision, nor of the right to enforce such provision. [​](https://docs.meteora.ag/legal/1-terms-of-service#24-severability) 24\. Severability ------------------------------------------------------------------------------------------ If any provision of these Terms shall be determined to be invalid or unenforceable under any rule, law, or regulation of any local, state, or federal government agency, such provision will be changed and interpreted to accomplish the objectives of the provision to the greatest extent possible under any applicable law and the validity or enforceability of any other provision of these Terms shall not be affected. If such construction is not possible, the invalid or unenforceable portion will be severed from these Terms but the rest of these Terms will remain in full force and effect. [​](https://docs.meteora.ag/legal/1-terms-of-service#25-survival) 25\. Survival ---------------------------------------------------------------------------------- The following provisions of these Terms shall survive termination of your use or access to the Site: Sections 5, 9, 10, 11, 14, and any other provision that by its terms survives termination of your use or access to the Site. [​](https://docs.meteora.ag/legal/1-terms-of-service#26-english-language) 26\. English Language -------------------------------------------------------------------------------------------------- Notwithstanding any other provision of these Terms, any translation of these Terms is provided for your convenience. The meanings of terms, conditions, and representations herein are subject to their definitions and interpretations in the English language. In the event of conflict or ambiguity between the English language version and translated versions of these terms, the English language version shall prevail. You acknowledge that you have read and understood the English language version of these Terms. Was this page helpful? YesNo [Stake2Earn Terms of Service\ \ Next](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service) On this page * [Table of Contents](https://docs.meteora.ag/legal/1-terms-of-service#table-of-contents) * [1\. Introduction](https://docs.meteora.ag/legal/1-terms-of-service#1-introduction) * [2\. The App](https://docs.meteora.ag/legal/1-terms-of-service#2-the-app) * [3\. Services](https://docs.meteora.ag/legal/1-terms-of-service#3-services) * [4\. Fees and Payment](https://docs.meteora.ag/legal/1-terms-of-service#4-fees-and-payment) * [5\. Intellectual Property and Content](https://docs.meteora.ag/legal/1-terms-of-service#5-intellectual-property-and-content) * [6\. User Terms](https://docs.meteora.ag/legal/1-terms-of-service#6-user-terms) * [7\. Risks Borne by Users](https://docs.meteora.ag/legal/1-terms-of-service#7-risks-borne-by-users) * [8\. External Sites](https://docs.meteora.ag/legal/1-terms-of-service#8-external-sites) * [9\. Disclaimers](https://docs.meteora.ag/legal/1-terms-of-service#9-disclaimers) * [10\. Limitation of Liability](https://docs.meteora.ag/legal/1-terms-of-service#10-limitation-of-liability) * [11\. Indemnity](https://docs.meteora.ag/legal/1-terms-of-service#11-indemnity) * [12\. Privacy Policy](https://docs.meteora.ag/legal/1-terms-of-service#12-privacy-policy) * [13\. Consent to Electronic Disclosures and Signatures](https://docs.meteora.ag/legal/1-terms-of-service#13-consent-to-electronic-disclosures-and-signatures) * [14\. Governing Law and Dispute Resolution](https://docs.meteora.ag/legal/1-terms-of-service#14-governing-law-and-dispute-resolution) * [15\. Notices](https://docs.meteora.ag/legal/1-terms-of-service#15-notices) * [16\. Entire Agreement](https://docs.meteora.ag/legal/1-terms-of-service#16-entire-agreement) * [17\. Force Majeure](https://docs.meteora.ag/legal/1-terms-of-service#17-force-majeure) * [18\. Third Party Rights](https://docs.meteora.ag/legal/1-terms-of-service#18-third-party-rights) * [19\. No Agency or Partnership](https://docs.meteora.ag/legal/1-terms-of-service#19-no-agency-or-partnership) * [20\. Interpretation](https://docs.meteora.ag/legal/1-terms-of-service#20-interpretation) * [21\. Assignment](https://docs.meteora.ag/legal/1-terms-of-service#21-assignment) * [22\. Illegality](https://docs.meteora.ag/legal/1-terms-of-service#22-illegality) * [23\. Waiver](https://docs.meteora.ag/legal/1-terms-of-service#23-waiver) * [24\. Severability](https://docs.meteora.ag/legal/1-terms-of-service#24-severability) * [25\. Survival](https://docs.meteora.ag/legal/1-terms-of-service#25-survival) * [26\. English Language](https://docs.meteora.ag/legal/1-terms-of-service#26-english-language) Assistant Responses are generated using AI and may contain mistakes. --- # Rust Integration - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Rust SDK Rust Integration [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) The `rust-client` provides a convenient way to interact with the DAMM v2 program and get swap quotes. Before you begin, here are some important resources: * **Program ID (Mainnet & Devnet):** `24Uqj9JCLxUeoC3hGfh5W3s9FM9uCHDS2SG3LYwBpyTi` * **Rust SDK:** [Dynamic Vault](https://github.com/MeteoraAg/vault-sdk/tree/main/rust-client) [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#add-mercurial-vault-to-dependencies) Add mercurial-vault to dependencies ============================================================================================================================================================================== If you are using rust, you can include the mercurial-vault link in your Cargo.toml file under “dependencies”. Copy Ask AI mercurial-vault = { version="0.4.2", features= ["cpi", "mainnet"] } You can access all the main functions after you’ve added the mercurial-vault dependency to your code. [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#access-vault-information-through-vault-state) Access Vault information through Vault State ================================================================================================================================================================================================ [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#find-the-vault-pubkey-based-on-the-token-mint-usdc%2C-usdt%2C-or-sol) Find the vault pubkey based on the token\_mint (USDC, USDT, or SOL) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Copy Ask AI let (vault, _vault_bump) = Pubkey::find_program_address( &[b"vault".as_ref(), token_mint.as_ref(), mercurial_vault::get_base_key().as_ref()], &mercurial_vault::id(), ); [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#get-the-vault-state-using-the-vault-pubkey) Get the vault\_state using the vault pubkey --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Copy Ask AI let vault_state: mercurial_vault::state::Vault = program_client.account(vault)?; Once you have the vault state, you can retrieve key vault information: [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#total-unlocked-amount-in-vault) Total unlocked amount in vault -------------------------------------------------------------------------------------------------------------------------------------------------------------------- Get the total amount of tokens that are available for withdrawal. The vault will lock the yield claimed initially and release them over a pre-defined period of time. Copy Ask AI // Total unlocked amount in the vault available for withdrawal // current_time is current Solana node timestamp total_unlocked_amount = vault_data.get_unlocked_amount(current_time) [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#total-reserve-in-the-vault) Total reserve in the vault ------------------------------------------------------------------------------------------------------------------------------------------------------------ We currently keep 10% of the total deposits in the vault to support swaps and immediate withdrawals. Copy Ask AI // Get the vault reserve value // Get the token vault data let token_data: anchor_spl::token::TokenAccount = program_client.account(vault_data.token_vault)?; vault_reserves = token_data.amount //vault reserve value [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#total-lp-supply-for-the-vault) Total LP supply for the vault ------------------------------------------------------------------------------------------------------------------------------------------------------------------ Retrieve the total LP token amount in the vault. Copy Ask AI // Get total total LP supply let token_mint: anchor_spl::token::Mint = program_client.account(vault_data.lp_mint)?; total_lp_supply = token_mint.supply [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#vault-virtual-price-calculation) Vault virtual price calculation ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- Get the current virtual price for the vault. Copy Ask AI // Calculate vault virtual price using unlocked amount and lp supply virtual_price = total_unlocked_amount / total_lp_supply [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#to-deposit-liquidity-into-the-vault) To deposit liquidity into the vault ============================================================================================================================================================================== [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#retrieve-the-vault%2C-token-vault%2C-lp-mint%2C-user-token-and-user-lp-values) Retrieve the vault, token\_vault, lp\_mint, user\_token and user\_lp values ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Copy Ask AI // Retrieve the value for vault // You can use the one of our supported token_mints (you can find the token_mint values in the "Constants" section let (vault, _vault_bump) = Pubkey::find_program_address( &[b"vault".as_ref(), token_mint.as_ref(), mercurial_vault::get_base_key().as_ref()], &mercurial_vault::id(), ); // Retrieve the value of token_vault let (token_vault, _token_vault_bump) = Pubkey::find_program_address( &[b"token_vault".as_ref(), vault.as_ref()], &program_client.id(), ); //Retrieve the value of vault_state to get the lp_mint value let vault_state: mercurial_vault::state::Vault = program_client.account(vault)?; let lp_mint = vault_state.lp_mint; // Retrieve user_token and user_lp values using the get_or_create_ata fn let user_token = get_or_create_ata(program_client, token_mint, program_client.payer())?; let user_lp = get_or_create_ata(program_client, lp_mint, program_client.payer())?; [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#execute-the-instruction-to-deposit-liquidity-into-the-pool) Execute the instruction to deposit liquidity into the pool ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Copy Ask AI let builder = program_client .request() .accounts(mercurial_vault::accounts::DepositWithdrawLiquidity { vault, token_vault, lp_mint, user_token, user_lp, user: program_client.payer(), token_program: spl_token::id(), }) .args(mercurial_vault::instruction::Deposit { token_amount, // total amount of tokens to be deposited minimum_lp_token_amount: 0, }); let signature = builder.send()?; [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#withdraw-liquidity-from-pool) Withdraw liquidity from pool ================================================================================================================================================================ [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#retrieve-the-vault%2C-token-vault%2C-lp-mint%2C-user-token-and-user-lp-values-2) Retrieve the vault, token\_vault, lp\_mint, user\_token and user\_lp values ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Copy Ask AI // Retrieve the vault let (vault, _vault_bump) = Pubkey::find_program_address( &[b"vault".as_ref(), token_mint.as_ref(), mercurial_vault::get_base_key().as_ref()], &mercurial_vault::id(), ); // Retrieve the vault of token_vault let (token_vault, _token_vault_bump) = Pubkey::find_program_address( &[b"token_vault".as_ref(), vault.as_ref()], &program_client.id(), ); //Retrieve the value of vault_state to get the lp_mint value let vault_state: mercurial_vault::state::Vault = program_client.account(vault)?; let lp_mint = vault_state.lp_mint; // Retrieve user_token and user_lp values using the get_or_create_ata fn let user_token = get_or_create_ata(program_client, token_mint, program_client.payer())?; let user_lp = get_or_create_ata(program_client, lp_mint, program_client.payer())?; [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#execute-the-instruction-to-withdraw-liquidity-from-pool) Execute the instruction to withdraw liquidity from pool ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Copy Ask AI let builder = program_client .request() .accounts(mercurial_vault::accounts::DepositWithdrawLiquidity { vault, token_vault, lp_mint, user_token, user_lp, user: program_client.payer(), token_program: spl_token::id(), }) .args(mercurial_vault::instruction::Withdraw { unmint_amount, //total amount of LP tokens to withdraw min_out_amount: 0, }); let signature = builder.send()?; [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#withdraw-direct-from-lending-platforms) Withdraw direct from Lending Platforms ==================================================================================================================================================================================== If you are integrating the vaults directly onto your platform, you can use this function to withdraw funds directly from a selected lending platform. [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#you-can-retrieve-the-list-of-pubkeys-of-the-lending-platform-pools-integrated-with-the-vault) You can retrieve the list of pubkeys of the lending platform pools integrated with the vault ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Copy Ask AI // Get the vault pubkey using the token_mint of the vault let (vault, _) = Pubkey::find_program_address( &[b"vault".as_ref(), token_mint.as_ref(), mercurial_vault::get_base_key().as_ref()], &mercurial_vault::id(), ); // Retrieve the vault state let vault_data: mercurial_vault::state::Vault = program_client.account(vault)?; // Iterate through all the lending platform pools integrated with the vault for (i, &strategy_pubkey) in vault_data.strategies.iter().enumerate(){ // get strategy pubkey println!("{}", strategy_pubkey); } [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#call-the-function-to-withdraw-funds-from-the-selected-strategy-pool) Call the function to withdraw funds from the selected strategy pool ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Copy Ask AI // Get the strategy_state using the strategy_pubkey let strategy_state: mercurial_vault::state::Strategy = program_client.account(strategy_pubkey)?; // Call the fn to withdraw funds directly from the strategy let strategy_handler = get_strategy_handler(strategy_state.strategy_type); strategy_handler.withdraw_directly_from_strategy( &program_client, strategy, token_mint, base, unmint_amount, )? Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/3-vault-quickstart) [Dynamic Vault CPI Examples\ \ Next](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/cpi/1-cpi-examples) On this page * [Add mercurial-vault to dependencies](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#add-mercurial-vault-to-dependencies) * [Access Vault information through Vault State](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#access-vault-information-through-vault-state) * [Find the vault pubkey based on the token\_mint (USDC, USDT, or SOL)](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#find-the-vault-pubkey-based-on-the-token-mint-usdc%2C-usdt%2C-or-sol) * [Get the vault\_state using the vault pubkey](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#get-the-vault-state-using-the-vault-pubkey) * [Total unlocked amount in vault](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#total-unlocked-amount-in-vault) * [Total reserve in the vault](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#total-reserve-in-the-vault) * [Total LP supply for the vault](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#total-lp-supply-for-the-vault) * [Vault virtual price calculation](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#vault-virtual-price-calculation) * [To deposit liquidity into the vault](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#to-deposit-liquidity-into-the-vault) * [Retrieve the vault, token\_vault, lp\_mint, user\_token and user\_lp values](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#retrieve-the-vault%2C-token-vault%2C-lp-mint%2C-user-token-and-user-lp-values) * [Execute the instruction to deposit liquidity into the pool](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#execute-the-instruction-to-deposit-liquidity-into-the-pool) * [Withdraw liquidity from pool](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#withdraw-liquidity-from-pool) * [Retrieve the vault, token\_vault, lp\_mint, user\_token and user\_lp values](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#retrieve-the-vault%2C-token-vault%2C-lp-mint%2C-user-token-and-user-lp-values-2) * [Execute the instruction to withdraw liquidity from pool](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#execute-the-instruction-to-withdraw-liquidity-from-pool) * [Withdraw direct from Lending Platforms](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#withdraw-direct-from-lending-platforms) * [You can retrieve the list of pubkeys of the lending platform pools integrated with the vault](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#you-can-retrieve-the-list-of-pubkeys-of-the-lending-platform-pools-integrated-with-the-vault) * [Call the function to withdraw funds from the selected strategy pool](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration#call-the-function-to-withdraw-funds-from-the-selected-strategy-pool) Assistant Responses are generated using AI and may contain mistakes. --- # Stake2Earn Terms of Service - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Stake2Earn Terms of Service [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) M3M3 is a distributed set of specially-developed smart contracts (each, a “Smart Contract”) deployed on the Solana blockchain or such other compatible blockchain network, as the case may be (each, the “relevant Blockchain Network”) which allows any user additional tools to interact with automated market maker protocols. The M3M3 Smart Contracts innovate on established protocols such as “Meteora” to provide additional tooling for creators of token projects, for example allowing them to create and customise parameters for specialised “memecoin” liquidity pools, or create staking pools (“Vaults”) which represent a customised software package launched by creators of token projects. M3M3 may be visualised on a user interface that the user can interact with, including but not limited to the website at [https://app.meteora.ag/pools#stake2earnpools](https://app.meteora.ag/pools#stake2earnpools) and each of their subdomains, or our mobile or web applications (the “Site”). The Smart Contracts and the Site are collectively referred to in these Terms as (the “App”). Using the App, users can interact with the underlying Smart Contracts to create Vaults, view their Vaults created or accessed, and interact with other users in M3M3 ecosystem. The Company’s sole role is the deployment of the Smart Contracts, and accordingly any interaction with Vaults take place solely on the relevant Blockchain Network. It is important that you understand that smart contract protocols such as M3M3 simply comprise a set of autonomous blockchain-based smart contracts deployed on the relevant Blockchain Network, operated directly by users calling functions on it (which allows them to interact with other users in a multi-party peer-to-peer manner). There is no further control by or interaction with the original entity which had deployed the smart contract (i.e. the Company), which entity solely functions as a provider of technical tools for users, and is not offering any sort of securities product or regulated service nor does it hold any user assets on custody. Any rewards earned by user interactions arise solely out of their involvement in the protocol by taking on the risk of interacting with other users (in particular, creators launching token projects) and the ecosystem. Dynamic Labs Limited (the “Company”, “we”, “our” or “us”) is making the App available to you. Before you use the App, the Smart Contracts, or the Site, however, you will need to agree to these Terms of Use and any terms and conditions incorporated herein by reference (collectively, these “Terms”). PLEASE READ THESE TERMS CAREFULLY BEFORE USING THE APP, THE SMART CONTRACTS, OR THE SITE. THESE TERMS GOVERN YOUR USE OF THE APP, THE SMART CONTRACTS, AND THE SITE, UNLESS WE HAVE EXECUTED A SEPARATE WRITTEN AGREEMENT WITH YOU FOR THAT PURPOSE. WE ARE ONLY WILLING TO MAKE THE APP, THE SMART CONTRACTS, AND THE SITE AVAILABLE TO YOU IF YOU ACCEPT ALL OF THESE TERMS. BY USING THE APP, THE SMART CONTRACTS, THE SITE, OR ANY PART OF THEM, OR BY CLICKING “I ACCEPT” BELOW OR INDICATING YOUR ACCEPTANCE IN AN ADJOINING BOX, YOU ARE CONFIRMING THAT YOU UNDERSTAND AND AGREE TO BE BOUND BY ALL OF THESE TERMS. IF YOU ARE ACCEPTING THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY, YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO ACCEPT THESE TERMS ON THAT ENTITY’S BEHALF, IN WHICH CASE “YOU” WILL MEAN THAT ENTITY. IF YOU DO NOT HAVE SUCH AUTHORITY, OR IF YOU DO NOT ACCEPT ALL OF THESE TERMS, THEN WE ARE UNWILLING TO MAKE THE APP, THE SMART CONTRACTS, OR THE SITE AVAILABLE TO YOU. IF YOU DO NOT AGREE TO THESE TERMS, YOU MAY NOT ACCESS OR USE THE APP, THE SMART CONTRACTS, OR THE SITE. By clicking “I Accept” or otherwise indicating your Acceptance, you agree to be bound by these Terms and affirm that you are of legal age to enter into these Terms where you live and have the legal capacity to enter into these Terms. Without limiting the foregoing, by using the App, you acknowledge and understand that laws regarding digital assets, financial instruments, or investment products which may include digital assets, may vary from jurisdiction to jurisdiction, and it is your sole obligation to ensure that you fully comply with any law, regulation or directive, relevant to your jurisdiction with regard to the use of the App. For the avoidance of doubt, the ability to access the App does not necessarily mean that the App, or your activities through it, are legal under the laws, regulations or directives relevant to your jurisdiction. All of the App or the services made available through the App may not be available to all users, and we reserve the right to assess or reassess at any time your eligibility to use all or part of the App. The App does not constitute, and may not be used for the purposes of, an offer or solicitation to anyone in any jurisdiction in which such offer or solicitation is not authorised, or to any person to whom it is unlawful to make such an offer or solicitation. Supplemental terms and conditions or documents that may be posted on the App from time to time are hereby expressly incorporated herein by reference. We reserve the right, in our sole discretion, to make changes to the Terms from time to time. We will alert you of any changes by updating the “Last Updated” date of these Terms (on the first page hereof), and you waive any right to receive specific notice of each such change. It is your responsibility to periodically review these Terms to stay informed of updates. You will be subject to and will be deemed to have been made aware of and to have accepted, the changes in any revised Terms by your continued use of the Site, the App, and the Smart Contracts after the date such revised Terms are posted. * * * [​](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#table-of-contents) Table of Contents ------------------------------------------------------------------------------------------------------- 1. [Introduction](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#1-introduction) 2. [The App](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#2-the-app) 3. [Services](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#3-services) 4. [Fees and Payment](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#4-fees-and-payment) 5. [Intellectual Property and Content](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#5-intellectual-property-and-content) 6. [User Terms](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#6-user-terms) 7. [Risks Borne by Users](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#7-risks-borne-by-users) 8. [External Sites](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#8-external-sites) 9. [Disclaimers](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#9-disclaimers) 10. [Limitation of Liability](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#10-limitation-of-liability) 11. [Indemnity](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#11-indemnity) 12. [Privacy Policy](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#12-privacy-policy) 13. [Consent to Electronic Disclosures and Signatures](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#13-consent-to-electronic-disclosures-and-signatures) 14. [Governing Law and Dispute Resolution](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#14-governing-law-and-dispute-resolution) 15. [Notices](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#15-notices) 16. [Entire Agreement](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#16-entire-agreement) 17. [Force Majeure](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#17-force-majeure) 18. [Third Party Rights](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#18-third-party-rights) 19. [No Agency or Partnership](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#19-no-agency-or-partnership) 20. [Interpretation](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#20-interpretation) 21. [Assignment](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#21-assignment) 22. [Illegality](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#22-illegality) 23. [Waiver](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#23-waiver) 24. [Severability](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#24-severability) 25. [Survival](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#25-survival) 26. [English Language](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#26-english-language) * * * [​](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#1-introduction) 1\. Introduction --------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#1-1-eligibility-and-restricted-territories) 1.1 Eligibility and Restricted Territories To be eligible to use the App, the Smart Contracts, the Site and the Services (as defined below), you must be of legal age to enter into these Terms where you live and have the legal capacity to enter into these Terms. The App, the Smart Contracts, the Site and the Services is strictly NOT offered to persons or entities who reside in, are citizens of, are incorporated in, or have a registered office in any Restricted Territory, as defined below (any such person or entity from a Restricted Territory shall be a Restricted Person). If you are a Restricted Person, then do not attempt to access or use the App, the Smart Contracts, the Site or the Services. Use of a virtual private network (e.g., a VPN) or other means by Restricted Persons to access or use the App, the Smart Contracts, the Site or the Services is prohibited. **Restricted Territory** means the British Virgin Islands, the United States, China, Myanmar (Burma), Cote D’Ivoire (Ivory Coast), Cuba, Crimea and Sevastopol, Democratic Republic of Congo, Iran, Iraq, Libya, Mali, Nicaragua, Democratic People’s Republic of Korea (North Korea), Somalia, Sudan, Syria, Yemen, Zimbabwe, Russia, or any other state, country or region that is subject to sanctions enforced by the United States or the European Union. ### [​](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#1-2-availability-of-services) 1.2 Availability of Services The App, the Smart Contracts, the Site or the Services made available through the App (or any portion thereof) may not be available to all users, and we reserve the right to assess or reassess at any time your eligibility to use all or part of the App, the Smart Contracts, the Site or the Services. ### [​](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#1-3-no-offer-or-solicitation) 1.3 No Offer or Solicitation The App, the Smart Contracts, the Site and the Services does not constitute, and may not be used for the purposes of, an offer or solicitation to anyone in any jurisdiction in which such offer or solicitation is not authorised, or to any person to whom it is unlawful to make such an offer or solicitation. ### [​](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#1-4-jurisdictional-compliance) 1.4 Jurisdictional Compliance Without limiting the foregoing, by using the App, the Smart Contracts, the Site or the Services, you acknowledge and understand that laws regarding digital assets, cryptocurrency derivatives, financial instruments, or investment products which may include digital assets, may vary from jurisdiction to jurisdiction, and it is your sole obligation to ensure that you fully comply with any law, regulation or directive, relevant to your jurisdiction with regard to the use of the App, the Smart Contracts, the Site or the Services. For the avoidance of doubt, the ability to access the App, the Smart Contracts, the Site or the Services does not necessarily mean that same (or your activities through it) are legal under the laws, regulations or directives relevant to your jurisdiction. [​](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#2-the-app) 2\. The App ----------------------------------------------------------------------------------------- 2.1. To most easily access the App, you may first install a web browser (such as the Google Chrome web browser) and an electronic wallet compatible with the relevant Blockchain Network (such as the Phantom or Solflare electronic wallet). These electronic wallet services provide a visual representation allowing you to interact with the relevant Blockchain Network to purchase, store, and engage in transactions with various digital assets. You will not be able to engage in any transactions on the App other than through your selected electronic wallet service, or other browsers compatible with the relevant Blockchain Network. 2.2. Transactions that take place via the visual user interface on the App are confirmed via the relevant Blockchain Network. You understand that your public address on the relevant Blockchain Network will be made publicly visible whenever you engage in a transaction on the App. 2.3. The visual user interface provided on the Website facilitates your ability to access M3M3. The interface is distinct from the decentralised M3M3 software network. M3M3 is public, permissionless, and runs on open-source self-executing software; while the interface itself merely enables you to initiate messages to M3M3 in order to perform functions or access Services thereon. The interface is one of the means of accessing M3M3, but not the exclusive means of access. 2.4. M3M3 is a non-custodial protocol, therefore the App does not hold or control your digital assets. Any digital assets which you may acquire through the usage of the App will be held and administered solely by you through your selected electronic wallet, and we shall have no access to or responsibility in regard to such electronic wallet or digital asset held therein. It is solely your responsibility to select the wallet service provider to use in connection with the App, and your use of such electronic wallet will be subject to the governing terms of use or privacy policy of the provider of such wallet. We neither own nor control your selected electronic wallet service, Google Chrome, any electronic wallet, the relevant Blockchain Network, or any other third party site, product, or service that you might access, visit, or use for the purpose of enabling you to use the various features of the App. We will not be liable for the acts or omissions of any such third parties, nor will we be liable for any damage that you may suffer as a result of your transactions or any other interaction with any such third parties. 2.5. The Company will not create any hosted wallet for you or otherwise custody digital assets on your behalf, and it is your sole responsibility to maintain the security of your selected electronic wallet. In the event that you lose access to your electronic wallet, private key(s), password(s), or other method(s) of securing your wallet, all digital assets held in such wallet may be irretrievable, and the Company will be unable to assist you in any way. You hereby irrevocably waive, release and discharge all claims, whether known or unknown to you, against the Company, its affiliates and their respective shareholders, members, directors, officers, employees, agents and representatives related to your use of any wallet software, associated loss of digital assets, transaction failures, or any other defects that arise in the course of your use of your electronic wallet, including any losses that may obtain as a result of any failure of any Smart Contracts, the Site or the App. 2.6. The Company reserves the right to modify, suspend or discontinue, temporarily or permanently, all or any part of the Site or the App with or without notice. You agree that the Company will not be liable to you or to any third party for any modification, suspension or discontinuance of all or any part of the Site or the App. 2.7. The publicly deployed Smart Contracts you interact with are experimental in nature and you should not utilise the Smart Contracts or Vaults for deployment of any substantial amount of digital assets. 2.8. We reserve the right to disable access to the App, the Site or the interface at any time in the event of any breach of the Terms, including without limitation, if we, in our sole discretion, believe that you, at any time, fail to satisfy the eligibility requirements set forth in the Terms. Further, we reserve the right to limit or restrict access to the App or the Site by any person or entity, or within any geographic area or legal jurisdiction, at any time and at our sole discretion. We will not be liable to you for any losses or damages you may suffer as a result of or in connection with the App or the Site being inaccessible to you at any time or for any reason. [​](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#3-services) 3\. Services ------------------------------------------------------------------------------------------- 3.1. The Company has deployed the Smart Contracts on the relevant Blockchain Network for users to utilise in accordance with these Terms. Users may directly call the functions of the Smart Contracts directly, or access them via the user interface provided by the App. 3.2. The M3M3 Smart Contracts innovate on established protocols such as “Meteora” to provide additional tooling for creators of token projects. For example, M3M3 allows project team to create and customise parameters for specialised “memecoin” liquidity pools or create staking Vaults in order to potentially share trading fees on that project’s native tokens with stakers. The SDK would allow third party projects and launchpads to easily integrate M3M3 functionality into their projects and launchpads. 3.3. Once the pools and/or Vaults are created, projects and users will be able to self-administer their digital holdings based on parameters set by the project or user. All interactions between creator teams launching projects and users on M3M3 operate in a peer-to-peer manner; these parties enter into a direct contractual relationship via the autonomous Smart Contracts and/or other smart contracts deployed by various other third party networks, and therefore creators wholly assume all responsibility towards the participating user in their project, pool or Vault. There is no further control by or interaction with the Company (or the relevant affiliate) which had deployed the Smart Contract(s). The Company and its affiliates shall in no circumstances be construed as a party to said peer-to-peer direct contractual relationship, is not liable for performance of obligations thereunder, nor does it bear any financial or commercial risk or provide any warranties or assurances in connection with the same. 3.4. The App merely provides a visual user interface allowing users to interact with Vaults and to interact with third party project teams, and does not act as an agent for any user or project. Although the App is intended to display accurate and timely information regarding Vaults and possible swaps, the App or relevant tools/information may not always be entirely accurate, complete or current and may also include technical inaccuracies or typographical errors. The pricing information data provided through the App does not represent an offer, a solicitation of an offer, or any advice regarding, or recommendation to enter into, a transaction with the Company or the App. Accordingly, users should verify all information before relying on it, and all decisions based on information contained on the App or tools/information tools are at the sole responsibility of each user. Notwithstanding any of the other provisions in these Terms, any photographs, graphic illustrations, videos, models, charts, designs, or examples on the site are strictly for information purposes only and have no contractual value nor do they form the basis of any contract with the Company. 3.5. Neither the Company, the Site nor the App provides any digital asset exchange or portfolio/fund management services in connection with the Vaults. If you choose to engage in transactions with Vaults or any other users, then such decisions and transactions and any consequences flowing therefrom are your sole responsibility. In no event shall the Company, its affiliates or their respective directors or employees be responsible or liable to you or anyone else, directly or indirectly, for any damage or loss arising from or relating to any interaction or continued interaction with Vaults, or reliance on any information provided on the Site or the App (including, without limitation, directly or indirectly resulting from errors in, omissions of or alterations to any such information). 3.6. THE APP SOLELY FUNCTIONS AS A VISUAL USER INTERFACE. IN NO CIRCUMSTANCES SHALL THE COMPANY, THE SMART CONTRACTS, THE SITE OR THE APP BE CONSTRUED AS A DIGITAL ASSET EXCHANGE, BROKER, DEALER, FUND MANAGER, FINANCIAL INSTITUTION, EXCHANGE, CUSTODIAN, ROBO-ADVISOR, INTERMEDIARY, OR CREDITOR. THE SITE DOES FACILITATE OR ARRANGE TRANSACTIONS BETWEEN BUYERS AND SELLERS, INCLUDING WITH RESPECT TO ANY TRANSACTIONS THAT OCCUR IN CONNECTION WITH ANY VAULT, WHICH TRANSACTIONS OCCUR ON THE RELEVANT BLOCKCHAIN NETWORK. THE COMPANY IS NOT A COUNTERPARTY TO ANY TRANSACTION FACILITATED BY THE SMART CONTRACTS, THE SITE OR THE APP OR FOR ANY USER OF THE SITE. NEITHER THE SMART CONTRACTS, THE SITE OR THE APP PROVIDES FINANCIAL ADVISORY, LEGAL, REGULATORY, OR TAX SERVICES DIRECTLY, INDIRECTLY, IMPLICITLY, OR IN ANY OTHER MANNER, AND YOU SHOULD NOT CONSIDER ANY CONTENT CONTAINED IN THESE TERMS OR OTHERWISE POSTED ON THE SITE TO BE A SUBSTITUTE FOR PROFESSIONAL FINANCIAL, LEGAL, REGULATORY, TAX OR OTHER ADVICE. THE COMPANY DOES NOT SUPPORT OR ENDORSE ANY VAUL OR POOL CREATED BY ANY USER OF M3M3, AND EACH SUCH CREATOR IS AN INDEPENDENT AGENT WITH NO EMPLOYMENT OR OTHER CONTRACTUAL RELATIONSHIP WITH THE COMPANY. 3.7. The Company reserves the right to suspend or terminate access to the Site or the App by any creator of Vaults or user of Vaults for any reason whatsoever (including without limitation for a breach of these Terms). You agree that the Company will not be liable to you or to any third party for any suspension or termination of any user. 3.8. Access to the Smart Contracts, the App or the Site may become degraded or unavailable during times of significant volatility or volume. This could result in the inability to interact with third-party services for periods of time and may also lead to support response time delays. The Company cannot guarantee that the Smart Contracts, the App or the Site will be available without interruption and neither do we guarantee that requests to interact with third-party services will be successful. [​](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#4-fees-and-payment) 4\. Fees and Payment ----------------------------------------------------------------------------------------------------------- 4.1. If you elect to interact with Vaults, all transactions will be conducted solely through the relevant Blockchain Network. We will have no insight into or control over these payments or transactions, nor do we have the ability to reverse any transactions. With that in mind, we will have no liability to you or to any third party for any claims or damages that may arise as a result of any transactions that you engage in via the App, or using the Smart Contracts, or any other transactions that you conduct via the relevant Blockchain Network. 4.2. The relevant Blockchain Network typically requires the payment of a transaction fee (a “**Transaction Fee**”) for every transaction that occurs on the relevant Blockchain Network. The Transaction Fee funds the network of computers that run the decentralised network. This means that you will need to pay a Transaction Fee for each transaction that occurs via the Smart Contracts. For example, every Solana transaction requires a base fee (SOL) to compensate validators for processing the transaction. An optional prioritization fee is also available to increase the probability that the transaction is processed by the current leader (validator). 4.3. You may be subject to certain additional fees and commissions, including fees imposed by creators of Vaults for accessing and utilising the Vaults as notified to you prior to engaging with any pool or Vault. The Company also reserves the right to levy additional fees for access via the Smart Contracts, the Site or the App in the future. You agree to promptly pay all aforementioned fees and commissions.\[A1\] 4.4. Notwithstanding anything in these Terms to the contrary, you will be solely responsible to pay any and all sales, use, value-added and other taxes, duties, and assessments (except taxes on the Company’s net income) now or hereafter claimed or imposed by any governmental authority (collectively, “**Taxes**”) associated with your use of the App (including, without limitation, any Taxes that may become payable as the result of your ownership or transfer of digital assets or interaction with any Vault, or relating to M3M3). [​](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#5-intellectual-property-and-content) 5\. Intellectual Property and Content --------------------------------------------------------------------------------------------------------------------------------------------- 5.1. The Company owns the Site and the App. You acknowledge and agree that the Company (or, as applicable, its affiliates) owns all legal right, title and interest in and to all other elements of the site and the App, and all intellectual property rights therein (including, without limitation, all designs, systems, methods, information, computer code, software, services, website design, “look and feel”, organisation, compilation of the content, code, data and database, functionality, audio, video, text, photograph, graphics, copyright, trademarks (if any), and all other elements of the App (collectively, the “**Materials**”). You acknowledge that the Materials are protected by copyright, trade dress, patent, and trademark laws, international conventions, other relevant intellectual property and proprietary rights, and applicable laws. All Materials are the copyrighted property of The Company or its licensors, and all trademarks, service marks, and trade names associated with the App or otherwise contained in the Materials are proprietary to The Company or its licensors. Except as expressly set forth herein, your use of the App does not grant you ownership of or any other rights with respect to any content, code, data, or other Materials that you may access on or through the App. We reserve all rights in and to the Materials that are not expressly granted to you in these Terms. For the sake of clarity, you understand and agree: that (a) your interaction with Vaults or usage of the Smart Contracts, the Site or the App does not give you any rights or licenses in or to the Materials other than those expressly contained in these Terms; (b) you do not have the right to license, sell, rent, lease, transfer, assign, distribute, host, reproduce, distribute, or otherwise commercialise any elements of the Materials without our prior written consent in each case, which consent we may withhold in our sole and absolute discretion; (c) you shall not modify, make derivative works of, disassemble, reverse compile or reverse engineer any part of the Materials; and (d) you will not apply for, register, or otherwise use or attempt to use any of the Company’s trademarks or service marks, or any confusingly similar marks, anywhere in the world. 5.2. By interacting with Vaults, you are granted a limited, non-exclusive, non-transferable, revocable license to use the site and the App for your personal use. Neither these Terms nor your access to the Smart Contracts, the site and the App transfers to you or any third party any rights, title or interest in or to intellectual property rights in the Materials, except for the limited access rights expressly set forth in these Terms. The Company expressly reserves all rights not granted in these Terms. There are no implied licenses granted under these Terms. 5.3. By acceptance of these Terms, you agree and acknowledge that all information and content provided by you, including your username, your contact list, Vaults created or Vaults interacted with, any messages, posts, comments or user generated content (the “**UGC**”) in any communication channel (including without limitation Twitter, Discord or Telegram) shall be considered non-confidential and non-proprietary information. By providing such UGC, you specifically grant the Company a non-exclusive, irrevocable, transferable, sub-licensable, royalty-free, worldwide license to use, copy, duplicate store, present and publish all or any part of the UGC, and the Company shall be free to use such UGC in any manner or media whatsoever, on an unrestricted basis and without any attribution or royalties or other compensation to you, including, without limitation, within or outside the Site or the App, and in any digital or printed media. 5.4. You acknowledge that you shall be responsible for any UGC that you submit or transmit through the Site or the App, including your responsibility as to the legality, reliability, appropriateness, originality and copyright of any such information or material. Additionally, you represent and warrant that: (a) you own all right title and interest in any UGC provided by you, (b) such UGC does not violate any applicable laws, and (c) the posting of your UGC by us (in any manner or media whatsoever, on an unrestricted basis) does not (and will not) violate the privacy rights, publicity rights, copyright, contract rights or any other rights of any individual or make derogatory remarks regarding, defame or otherwise criticise any person or entity. You shall be solely liable for any damage resulting from any infringement or other violation of the copyright, trademarks or other proprietary rights of any individual or entity, and for any other harm or losses resulting from any UGC.\[A2\] 5.5. You acknowledge and agree that any questions, comments, suggestions, ideas, feedback or other information regarding the Smart Contracts, the Site and the App (“Feedback”) provided by you to us are non-confidential and should become our sole property. We should own exclusive rights, including all intellectual property rights, and should be entitled to the unrestricted use and dissemination of these Feedback to any lawful purpose, commercial, or otherwise, without acknowledgment or compensation for you. You hereby waive any moral rights to any such Feedback, and you hereby warrant that any such Feedback are original with you or that you have the right to submit such Feedback. You agree there should be no recourse against us for any alleged or actual infringement or misappropriation of any proprietary right in your Feedback. [​](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#6-user-terms) 6\. User Terms ----------------------------------------------------------------------------------------------- 6.1. You agree that you are responsible for your own conduct while accessing or using the App, and for any consequences thereof. You agree to use the App only for purposes that are legal, proper and in accordance with these Terms and any applicable laws or regulations, including without limitation you may not, and may not allow any third party to: (a) send, upload, distribute or disseminate any unlawful, defamatory, harassing, abusive, fraudulent, obscene, or otherwise objectionable content; (b) distribute viruses, worms, defects, Trojan horses, corrupted files, hoaxes, or any other items of a destructive or deceptive nature; (c) impersonate another person (via the use of an email address or otherwise); (d) upload, post, transmit or otherwise make available through the App any content that infringes the intellectual proprietary rights of any party; (e) use the App to violate the legal rights (such as rights of privacy and publicity) of others; (f) engage in, promote, or encourage illegal activity (including, without limitation, money laundering); (g) interfere with other users’ enjoyment of the App; (h) exploit the App for any unauthorised commercial purpose; (i) modify, adapt, translate, decompile, disassemble or reverse engineer any portion of the App; (j) attempt to bypass any measure of the Site designed to prevent or restrict access to the Site, or any portion of the Site or the App; (k) harass, intimidate, or threaten any of our employees or agents engaged in providing any portion of the Site or the App to you; (l) remove any copyright, trademark or other proprietary rights notices contained in or on the App, the Contents or any part of it; (m) reformat or frame any portion of the App; (n) display any content on the App that contains any hate-related or violent content or contains any other material, products or services that violate or encourage conduct that would violate any criminal laws, any other applicable laws, or any third party rights; (o) use any robot, spider, site search/retrieval application, or other device to retrieve or index any portion of the App or the content posted on the App, or to collect information about its users for any unauthorised purpose; (p) upload or transmit (or attempt to upload or to transmit) any material that acts as a passive or active information collection or transmission mechanism, including without limitation, clear graphics interchange formats (“gifs”), 1×1 pixels, web bugs, cookies, or other similar devices (sometimes referred to as “spyware” or “passive collection mechanisms” or “pcms”); (q) access or use the App by automated means or under false or fraudulent pretences; (r) access or use the App for the purpose of, directly or indirectly, creating or enabling a party to create a product or service that is competitive with any of our products or services; (s) use the Site, the App and the Smart Contracts to advertise or offer to sell goods and services; (t) conduct any activity that violates any applicable law, rule, or regulation concerning the integrity of trading markets, including (but not limited to) the manipulative tactics commonly known as spoofing, wash trading, cornering, accommodation trading, fictitious transactions, “money pass” (i.e. transactions without a net change in either party’s open positions but with a resulting profit to one party and a loss to the other party), front-running, or pre-arranged or non-competitive transactions, or transactions designed to mislead external parties, or (u) disparage, tarnish, or otherwise harm, in our opinion, us and/or the Site, the App, and the Smart Contracts. If you engage in any of the activities prohibited by this Section 6, we may, at our sole and absolute discretion, without notice to you, and without limiting any of our other rights or remedies at law or in equity, immediately suspend or terminate your access to the Site or the App and delete your UGC from the Site. 6.2. By using the Site, the App and the Smart Contracts, you represent and warrant that: (a) you have read and understood these Terms and all documentation on the App or the Site; (b) you have good and sufficient experience and understanding of the functionality, usage, storage, transmission mechanisms and other material characteristics of cryptographic tokens, token storage mechanisms (such as token wallets), blockchain technology, blockchain-like technology and blockchain-based software systems to understand these Terms and to appreciate the risks and implications of creating or interacting with Vaults; (c) you acknowledge and agree that we may impose eligibility criteria to access certain functionality in respect of M3M3 which may require you to incur additional time and money costs; (d) you create and interact with Vaults for your own account and shall not do the same on behalf of any other entity or person; (e) your creation or interaction with Vaults complies with applicable law and regulation in your jurisdiction, and the law and regulation of any jurisdiction to which you may be subject (including, but not limited to legal capacity and any other threshold requirements for creating and interacting with Vaults, and interacting with other users of M3M3, any foreign exchange or regulatory restrictions applicable to creating and interacting with Vaults, and any governmental or other consents that may need to be obtained); (f) all information you submit will be true, accurate, current, and complete (if you provide any information that is untrue, inaccurate, not current, or incomplete, we have the right to refuse or terminate your current or future use of the Site and the App (or any portion thereof)); (g) you will maintain the accuracy of such information and promptly update such information as necessary; (h) you have the legal capacity and you agree to comply with these Terms; (i) you are not a minor in the jurisdiction in which you reside; (j) you will not use the Site, the App and the Smart Contracts for any illegal and unauthorised purpose; (k) you will not use the Site, the App and the Smart Contracts for any commercial purpose (save as approved by the Company in writing); (l) your use of the Site, the App and the Smart Contracts will not violate any applicable law or regulation; and (m) any funds or digital assets staked or deposited in Vaults are not derived from or related to any unlawful activities, including but not limited to money laundering or terrorist financing and all applicable statutes of all jurisdictions in which you are located, resident, organised or operating, and/or to which it may otherwise be subject and the rules and regulations thereunder (collectively, the “Compliance Regulations”), and you will not use the Smart Contracts, the Site or the App to finance, engage in, or otherwise support any unlawful activities or in a manner which aids or facilitates another party in the same. To the extent required by applicable laws and regulations, you shall fully comply with all Compliance Regulations. 6.3. We reserve the right to (but shall not be obliged to in any event to) conduct “Know Your Customer” and “Anti-Money Laundering” checks on you (including digital address or wallet screening) if deemed necessary by us (at our sole discretion) or such checks become required under applicable laws in any jurisdiction. Upon our request, you shall immediately provide us with information and documents that we, in our sole discretion, deem necessary or appropriate to conduct “Know Your Customer” and “Anti-Money Laundering” checks. Such documents may include, but are not limited to, passports, driver’s licenses, utility bills, photographs of associated individuals, government identification cards or sworn statements before notaries or other equivalent professionals. Notwithstanding anything herein, we may, in its sole discretion, refuse to provide access to the Site or the Site to you until such requested information is provided, or in the event that, based on information available to us, you are suspected of using the Smart Contracts, the Site or the App in connection with any money laundering, terrorism financing, or any other illegal activity. In addition, we shall be entitled to use any possible efforts for preventing money laundering, terrorism financing or any other illegal activity, including without limitation blocking of your access to the Smart Contracts, the App or the Site or providing your information to any regulatory authority. 6.4. You are responsible for complying with applicable laws (including tax laws) in connection with usage of the Smart Contracts, the Site, the App or interactions with Vaults. You agree that we are not responsible for determining whether or which laws may apply to said interactions. You are advised to consult your own lawyers regarding of the legality and implications of any such activities. You are solely responsible for reporting and paying any taxes arising from your usage of the Smart Contracts, the Site, the App or interactions with Vaults. [​](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#7-risks-borne-by-users) 7\. Risks Borne by Users ------------------------------------------------------------------------------------------------------------------- **IMPORTANT RISK NOTICE:** You acknowledge and agree that the Services, the Site and the App are currently in the initial development stages and there are a variety of unforeseeable risks with utilising the foregoing. In the worst scenario, this could lead to the loss of all or part of your digital assets interacting with the Services, the Site, the App or the Smart Contracts. **IF YOU DECIDE TO UTILISE SERVICES YOU EXPRESSLY ACKNOWLEDGE, ACCEPT AND ASSUME THE BELOW RISKS AND AGREE NOT TO HOLD THE COMPANY OR ANY OF THEIR AFFILIATES RESPONSIBLE FOR THE FOLLOWING RISKS:** 7.1. Using the App and interacting with Vaults carry financial risk. You acknowledge and agree that you are aware of such risks, including the following: (a) transactions relating to digital assets are very risky, and such digital assets are, by their nature, highly experimental, risky, volatile and generally irreversible. You should not make any transactional decision without first conducting your own research. You are solely and exclusively responsible for determining whether any Vault, any transaction, or strategy, or any other product or service in connection with the same is appropriate or suitable for you based on your own objectives and personal and financial situation. You acknowledge and agree that you will access and use the Smart Contracts, the Site and the App and interact with Vaults at your own risk. 7.2. You represent that you have sufficient knowledge, market sophistication, professional advice and experience to make your own evaluation of the merits and risks of any interaction with Vaults and the underlying digital assets. You accept all consequences of participating in such interactions, including the risk that you may lose access to your digital assets indefinitely. All decisions to interact with Vaults are made solely by you. Notwithstanding anything in these Terms, the Company accepts no responsibility whatsoever for and will in no circumstances be liable to you in connection with any interaction with Vaults and the underlying digital assets. Under no circumstances will the operation of all or any portion of the Smart Contracts, the Site or the App be deemed to create a relationship that includes any management of any assets, or the provision or tendering of investment advice. 7.3. Digital assets are not legal tender, are not backed by the government, and are not subject to any “Deposit Insurance Scheme” or protections under any banking or securities laws. The Company is not a bank and does not offer any lending services, fiduciary services, or security broking services. 7.4. The prices of blockchain assets are extremely volatile. Fluctuations in the price of other digital assets could materially and adversely affect the value of your digital assets held in Vaults, which may also be subject to significant price volatility. We cannot guarantee that any users interacting with Vaults will not lose money. 7.5. Neither the Smart Contracts, Site, the App or Vaults hold in custody, store, send, or receive any of your digital assets. This is because your digital assets exist only by virtue of the ownership record maintained on the relevant Blockchain Network. Any transfer of digital assets occurs within the relevant Blockchain Network, and not on the Smart Contracts, Site, the App or Vaults. 7.6. Public blockchain-based transactions (including but not limited to transactions automatically executed by smart contracts) are generally considered irreversible when confirmed. Any transaction that will interact with smart contracts or be recorded on a public blockchain must be recorded with extreme caution. 7.7. All smart contracts (including the Smart Contracts) may contain security vulnerabilities, errors, failures, bugs or economic loopholes which may be exploited by third parties, causing you to suffer losses in connection with any digital assets re-deployed by Vaults. Interaction with these Smart Contracts are entirely at your own responsibility and liability, and the Company is not a party to the Smart Contracts. 7.8. No creator of any Vault will be able to guarantee the future performance of digital assets held in a Vault, any specific level of performance, the success of any strategy or your overall results from interacting with any Vaults. When reviewing the information, portfolio, performance, opinions of these creators, do not assume that such party is unbiased, independent or qualified to provide financial information or opinions. Past performance and risk scores have many inherent limitations and are not indicative of future results. No representation or guarantee is being made that any creator of Vaults will or is likely to achieve gains or losses similar to the past performance. The actual percentage gains or losses experienced by users will vary depending on many factors. 7.9. Hackers or other malicious groups or organisations may attempt to interfere with the Smart Contracts, the Site, the App or Vaults in a variety of ways, including, but not limited to, malware attacks, denial of service attacks, consensus-based attacks, Sybil attacks, smurfing and spoofing, which may result in losses incurred by you. Furthermore, because the relevant Blockchain Network comprises open-source software, there is the risk that the software underlying the Services may contain intentional or unintentional bugs or weaknesses that may negatively affect the Services or the Smart Contracts, or result in the loss of the user’s digital assets, or the loss of the user’s ability to access or control their digital assets. In the event of such a software bug or weakness, there may be no remedy, and users are not guaranteed any remedy, refund or compensation. 7.10. Further, when you interact with Vaults or trade on any blockchain network, you accept that there is the inherent risk of the transaction being vulnerable to automated software programs (MEV bots) deployed by third parties which operate within decentralized finance (DeFi) ecosystem and exploit blockchain mechanics such as transaction ordering and transaction fee/gas price bidding to gain an advantage over specific users, or automated software programs (sniper bots) which executes trades buys or front-runs orders in respect of digital assets as soon as they are available on centralised or decentralised exchanges, which may be deployed by bad actors in connection with market manipulation or insider trading activities. The Company cannot be responsibility for losses suffered due to any of the foregoing, which are inherent to transactions on open blockchain networks. 7.11. The regulatory status of digital assets, and distributed ledger technology is unclear or unsettled in many jurisdictions. While every effort has been taken to ensure that the Services, the Site, the App and the Smart Contracts are compliant with local laws, it is difficult to predict how or whether regulatory agencies may apply existing regulation with respect to the same. It is likewise difficult to predict how or whether legislatures or regulatory agencies may implement changes to law and regulation affecting distributed ledger technology and its applications, including the Services, the Site, the App or the Smart Contracts. Regulatory actions could negatively impact the Company in various ways, and thus the Services may not be available in certain areas. 7.12. The underlying smart contracts run on a variety of supported blockchain networks, using specially-developed smart contracts. Accordingly, upgrades to the relevant Blockchain Network, a hard fork in the relevant Blockchain Network, re-organisations of blockchain structure or blocks, or a change in how transactions are confirmed on the relevant Blockchain Network may have unintended, adverse effects on the smart contracts built thereon, including the Smart Contracts. 7.13. The Site, Services and Smart Contracts may rely on or utilise a variety of external third party services or software, including without limitation decentralised cloud storage services, analytics tools, oracles, hence therefore the Services may be adversely affected by any number of risks related to these third party services/software, which may be compromised in the event of security vulnerabilities, cyberattacks, malicious activity, or technical interruptions. [​](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#8-external-sites) 8\. External Sites ------------------------------------------------------------------------------------------------------- The Site or the App may include hyperlinks to other web sites or resources (collectively, “External Sites”), which are provided solely for your convenience. We have no control over any External Sites. You acknowledge and agree that we are not responsible for the availability of any External Sites, and that we do not endorse any advertising, products or other materials on or made available from any External Sites. Furthermore, you acknowledge and agree that we are not liable for any loss or damage which may be incurred as a result of the availability or unavailability of the External Sites, or as a result of any reliance placed by you upon the completeness, accuracy or existence of any advertising, products or other materials on, or made available from, any External Sites. [​](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#9-disclaimers) 9\. Disclaimers ------------------------------------------------------------------------------------------------- 9.1. YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR ACCESS TO AND USE OF THE SMART CONTRACTS, THE SITE, THE APP AND VAULTS IS AT YOUR SOLE RISK, AND THAT THE APP IS PROVIDED “AS IS” AND “AS AVAILABLE” WITHOUT WARRANTIES OF ANY KIND, WHETHER EXPRESS OR IMPLIED. TO THE FULLEST EXTENT PERMISSIBLE PURSUANT TO APPLICABLE LAW, THE COMPANY, ITS SUBSIDIARIES, AFFILIATES, AND LICENSORS MAKE NO EXPRESS WARRANTIES AND HEREBY DISCLAIM ALL IMPLIED WARRANTIES REGARDING THE APP AND ANY PART OF IT (INCLUDING, WITHOUT LIMITATION, THE SMART CONTRACTS, THE SITE, THE APP, VAULTS, OR ANY EXTERNAL WEBSITES), INCLUDING ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, CORRECTNESS, ACCURACY, OR RELIABILITY. WITHOUT LIMITING THE GENERALITY OF THE FOREGOING, THE COMPANY, ITS SUBSIDIARIES, AFFILIATES, AND LICENSORS DO NOT REPRESENT OR WARRANT TO YOU THAT: (A) YOUR ACCESS TO OR USE OF THE SMART CONTRACTS, THE SITE, THE APP AND VAULTS WILL MEET YOUR REQUIREMENTS, (B) YOUR ACCESS TO OR USE OF THE SMART CONTRACTS, THE SITE, THE APP AND VAULTS WILL BE UNINTERRUPTED, TIMELY, SECURE OR FREE FROM ERROR, (C) USAGE DATA PROVIDED THROUGH THE SMART CONTRACTS, THE SITE, THE APP AND VAULTS WILL BE ACCURATE, (D) THE SMART CONTRACTS, THE SITE, THE APP AND VAULTS, OR ANY CONTENT, SERVICES, OR FEATURES MADE AVAILABLE ON OR THROUGH THE SMART CONTRACTS, THE SITE, THE APP AND VAULTS ARE FREE OF VIRUSES OR OTHER HARMFUL COMPONENTS, OR (E) THAT ANY DATA THAT YOU DISCLOSE WHEN YOU USE THE SMART CONTRACTS, THE SITE, THE APP AND VAULTS WILL BE SECURE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES IN CONTRACTS WITH CONSUMERS, SO SOME OR ALL OF THE ABOVE EXCLUSIONS MAY NOT APPLY TO YOU. 9.2. YOU ACCEPT THE INHERENT SECURITY RISKS OF PROVIDING INFORMATION AND DEALING ONLINE OVER THE INTERNET, AND AGREE THAT THE COMPANY HAS NO LIABILITY OR RESPONSIBILITY FOR ANY BREACH OF SECURITY UNLESS IT IS DUE TO THE COMPANY’S WILFUL DEFAULT. 9.3. DIGITAL ASSETS ARE INTANGIBLE DIGITAL ASSETS THAT EXIST ONLY BY VIRTUE OF THE OWNERSHIP RECORD MAINTAINED IN THE RELEVANT BLOCKCHAIN NETWORK. ALL SMART CONTRACTS IN CONNECTION WITH M3M3 ECOSYSTEM ARE DEPLOYED ON AND INTERACTIONS/TRANSACTIONS WITH THE SAME OCCUR ON THE DECENTRALISED LEDGER WITHIN THE RELEVANT BLOCKCHAIN NETWORK. WE HAVE NO CONTROL OVER AND MAKE NO GUARANTEES OR PROMISES WITH RESPECT TO SMART CONTRACTS. 9.4. THE COMPANY IS NOT RESPONSIBLE FOR LOSSES DUE TO BLOCKCHAINS OR ANY OTHER FEATURES OF THE RELEVANT BLOCKCHAIN NETWORK OR YOUR SELECTED ELECTRONIC WALLET SERVICE, INCLUDING BUT NOT LIMITED TO LATE REPORT BY DEVELOPERS OR REPRESENTATIVES (OR NO REPORT AT ALL) OF ANY ISSUES WITH THE BLOCKCHAIN SUPPORTING THE RELEVANT BLOCKCHAIN NETWORK, INCLUDING FORKS, TECHNICAL NODE ISSUES, OR ANY OTHER ISSUES HAVING FUND LOSSES AS A RESULT. [​](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#10-limitation-of-liability) 10\. Limitation of Liability --------------------------------------------------------------------------------------------------------------------------- 10.1. YOU UNDERSTAND AND AGREE THAT WE, OUR SUBSIDIARIES, AFFILIATES, AND LICENSORS WILL NOT BE LIABLE TO YOU OR TO ANY THIRD PARTY FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR EXEMPLARY DAMAGES WHICH YOU MAY INCUR IN CONNECTION WITH THE SMART CONTRACTS, THE SITE, THE APP OR VAULTS, HOWSOEVER CAUSED AND UNDER ANY THEORY OF LIABILITY, INCLUDING, WITHOUT LIMITATION, ANY LOSS OF PROFITS (WHETHER INCURRED DIRECTLY OR INDIRECTLY), LOSS OF GOODWILL OR BUSINESS REPUTATION, LOSS OF DATA, COST OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR ANY OTHER INTANGIBLE LOSS, EVEN IF WE HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 10.2. YOU AGREE THAT OUR TOTAL, AGGREGATE LIABILITY TO YOU FOR ANY AND ALL CLAIMS ARISING OUT OF OR RELATING TO THESE TERMS OR YOUR ACCESS TO OR USE OF (OR YOUR INABILITY TO ACCESS OR USE) ANY PORTION OF THE SMART CONTRACTS, THE SITE, THE APP OR VAULTS, WHETHER IN CONTRACT, TORT, STRICT LIABILITY, OR ANY OTHER LEGAL THEORY, IS LIMITED TO THE LOWER OF (A) THE AMOUNTS YOU ACTUALLY PAID US UNDER THESE TERMS IN THE 12 MONTH PERIOD PRECEDING THE DATE THE CLAIM AROSE, OR (B) US$200. 10.3. YOU ACKNOWLEDGE AND AGREE THAT WE HAVE MADE THE SMART CONTRACTS, THE SITE, THE APP AND VAULTS AVAILABLE TO YOU AND ENTERED INTO THESE TERMS IN RELIANCE UPON THE WARRANTY DISCLAIMERS AND LIMITATIONS OF LIABILITY SET FORTH HEREIN, WHICH REFLECT A REASONABLE AND FAIR ALLOCATION OF RISK BETWEEN THE PARTIES AND FORM AN ESSENTIAL BASIS OF THE BARGAIN BETWEEN US. WE WOULD NOT BE ABLE TO PROVIDE THE APP TO YOU WITHOUT THESE LIMITATIONS. 10.4. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, AND SOME JURISDICTIONS ALSO LIMIT DISCLAIMERS OR LIMITATIONS OF LIABILITY FOR PERSONAL INJURY FROM CONSUMER PRODUCTS, SO THE ABOVE LIMITATIONS MAY NOT APPLY TO PERSONAL INJURY CLAIMS. [​](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#11-indemnity) 11\. Indemnity ----------------------------------------------------------------------------------------------- You agree to hold harmless and indemnify the Company and its subsidiaries, affiliates, officers, agents, employees, advertisers, licensors, suppliers or partners from and against any claim, liability, loss, damage (actual and consequential) of any kind or nature, suit, judgment, litigation cost, and attorneys’ fees arising out of or in any way related to (a) your breach of these Terms, (b) your misuse of the Smart Contracts, the Site, the App or the Vaults, or (c) your violation of any applicable laws, rules or regulations in connection with your access to or use of the App. You agree that the Company will have control of the defence or settlement of any such claims. [​](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#12-privacy-policy) 12\. Privacy Policy --------------------------------------------------------------------------------------------------------- 12.1. Our Privacy Policy describes the ways the Company collects, uses, stores and discloses your personal information, and is hereby incorporated by this reference into these Terms. You agree to the collection, use, storage, and disclosure of your data in accordance with the aforementioned Privacy Policy. 12.2. The Company will maintain certain data that you transmit to the Site and the App for the purpose of managing the performance of the Site and the App, as well as data relating to your use of the Site or the App. Although we perform regular routine backups of data, the Company is solely responsible for all data that you transmit or that release to any activity you have undertaken using the Site or the App. You agree that we shall have no liability to you for any loss or corruption of any such data, and you hereby waive any right of action against us arising from any such loss or corruption of such data. [​](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#13-consent-to-electronic-disclosures-and-signatures) 13\. Consent to Electronic Disclosures and Signatures ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 13.1. Because the Company operates only on the Internet, it is necessary for you to consent to transact business with us online and electronically. As part of doing business with us, therefore, we also need you to consent to our providing you certain disclosures electronically via the Site. By agreeing to these Terms, you agree to receive electronically all documents, communications, notices, contracts, and agreements arising from or relating to your use of the Site and Services. 13.2. By accepting these Terms or contacting us in any manner, you expressly consent to be contacted by us, our agents, representatives, affiliates, or anyone calling on our behalf for any and all purposes, in any way, including notifications, messages and/or calls delivered using automated systems. Notwithstanding the aforementioned, any form of communication from the Company will be provided to you electronically through the Site or (if applicable) via email to the email address provided. If you require paper copies of any agreements or disclosures, you may print such documents desired. 13.3. Your consent to receive disclosures and transact business electronically, and our agreement to do so, applies to any transactions to which such disclosures relate, whether between you and the Company or a third party by and through the Services. Your consent will remain in effect for so long as you are a user and, if you are no longer a user, will continue until such a time as all disclosures relevant to Services received through the Site. 13.4. You may withdraw your consent to receive agreements or disclosures electronically by contacting us at [meteora\_support@meteora.ag](mailto:meteora_support@meteora.ag) . However, once you have withdrawn your consent you will not be able to access the Services or the Site. [​](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#14-governing-law-and-dispute-resolution) 14\. Governing Law and Dispute Resolution ----------------------------------------------------------------------------------------------------------------------------------------------------- 14.1. These Terms will be governed by and construed in accordance with the laws of the British Virgin Islands, without regard to conflict of law rules and principles (whether of the British Virgin Islands or any other jurisdiction) that would cause the application of the laws of any other jurisdiction. 14.2. All disputes arising out of or in connection with these Terms (including without limitation the enforceability of this Section 14 or any question regarding its existence, validity or termination, your access or use of the App, the Site, or the Smart Contracts, or to any products sold or distributed through the App, the Site, or the Smart Contracts) shall be referred to and finally resolved by arbitration administered by arbitration in accordance with the BVI IAC Arbitration Rules for the time being in force, which rules are deemed to be incorporated by reference in this Section 14. The place of arbitration shall be Road Town, Tortola, British Virgin Islands, unless the Parties agree otherwise. The number of arbitrators shall be one. The language to be used in the arbitral proceedings shall be English. The award of the arbitrator will be final and binding, and any judgment on the award rendered by the arbitrator may be entered in any court of competent jurisdiction. Each party will cover its own fees and costs associated with the arbitration proceedings. Notwithstanding the foregoing, the Company may seek and obtain injunctive relief in any jurisdiction in any court of competent jurisdiction, and you agree that these Terms are specifically enforceable by the Company through injunctive relief and other equitable remedies without proof of monetary damages. [​](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#15-notices) 15\. Notices ------------------------------------------------------------------------------------------- To give us notice under these Terms, the user must contact the Company by email at **[meteora\_support@meteora.ag](mailto:meteora_support@meteora.ag) ** [​](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#16-entire-agreement) 16\. Entire Agreement ------------------------------------------------------------------------------------------------------------- These Terms constitute the entire legal agreement between you and the Company, govern your access to and use of the Smart Contracts, the Site, the App or the Vaults, and completely replace any prior or contemporaneous agreements between the parties related to your access to or use of the Smart Contracts, the Site, the App or the Vaults, whether oral or written. [​](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#17-force-majeure) 17\. Force Majeure ------------------------------------------------------------------------------------------------------- The Company shall not be liable for delays, failure in performance or interruption of service which result directly or indirectly from any cause or condition beyond its reasonable control, including but not limited to, significant market volatility, any delay or failure due to any act of God, act of civil or military authorities, act of terrorists, civil disturbance, war, strike or other labour dispute, fire, interruption in telecommunications or Internet services or network provider services, failure of equipment and/or software, other catastrophe or any other occurrence which is beyond its reasonable control, and shall not affect the validity and enforceability of any remaining provisions. [​](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#18-third-party-rights) 18\. Third Party Rights ----------------------------------------------------------------------------------------------------------------- There are no third party beneficiaries to these Terms. A person who is not a party under these Terms has no right under any applicable law to enforce or to enjoy the benefit of these Terms. [​](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#19-no-agency-or-partnership) 19\. No Agency or Partnership ----------------------------------------------------------------------------------------------------------------------------- Nothing in these Terms create any agency, partnership, joint venture or any similar relationship between the Company and you, nor cause the Company and you to be deemed acting in concert in any respect. [​](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#20-interpretation) 20\. Interpretation --------------------------------------------------------------------------------------------------------- The language in these Terms will be interpreted as to its fair meaning, and not strictly for or against any party. [​](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#21-assignment) 21\. Assignment ------------------------------------------------------------------------------------------------- You may not assign any or your rights or obligations under these Terms, whether by operation of law or otherwise, without our prior written consent. Notwithstanding anything contained herein, we may assign our rights and obligations under these Terms in our sole discretion (without your consent) to an affiliate for any reason, including without limitation any assignment or novation in connection with a reincorporation to change the Company’s domicile. [​](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#22-illegality) 22\. Illegality ------------------------------------------------------------------------------------------------- Should any provision or part-provision of these Terms is or becomes invalid, illegal or unenforceable in any respect under any law of any jurisdiction, it shall be deemed modified to the minimum extent necessary to make it valid, legal and enforceable; if such modification is not possible, the relevant provision or part-provision shall be deemed deleted. Any modification to or deletion of a provision or part-provision pursuant to this Section 22 shall not affect or impair the validity and enforceability of the rest of these Terms, nor the validity and enforceability of such provision or part-provision under the law of any other jurisdiction. [​](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#23-waiver) 23\. Waiver ----------------------------------------------------------------------------------------- Our failure to enforce any provision of these Terms will not be deemed a waiver of such provision, nor of the right to enforce such provision. [​](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#24-severability) 24\. Severability ----------------------------------------------------------------------------------------------------- If any provision of these Terms shall be determined to be invalid or unenforceable under any rule, law, or regulation of any local, state, or federal government agency, such provision will be changed and interpreted to accomplish the objectives of the provision to the greatest extent possible under any applicable law and the validity or enforceability of any other provision of these Terms shall not be affected. If such construction is not possible, the invalid or unenforceable portion will be severed from these Terms but the rest of these Terms will remain in full force and effect. [​](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#25-survival) 25\. Survival --------------------------------------------------------------------------------------------- The following provisions of these Terms shall survive termination of your use or access to the Site: Sections 5, 9, 10, 11, 14, and any other provision that by its terms survives termination of your use or access to the Site. [​](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#26-english-language) 26\. English Language ------------------------------------------------------------------------------------------------------------- Notwithstanding any other provision of these Terms, any translation of these Terms is provided for your convenience. The meanings of terms, conditions, and representations herein are subject to their definitions and interpretations in the English language. In the event of conflict or ambiguity between the English language version and translated versions of these terms, the English language version shall prevail. You acknowledge that you have read and understood the English language version of these Terms. Was this page helpful? YesNo [Previous\ \ Terms of Service](https://docs.meteora.ag/legal/1-terms-of-service) On this page * [Table of Contents](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#table-of-contents) * [1\. Introduction](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#1-introduction) * [1.1 Eligibility and Restricted Territories](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#1-1-eligibility-and-restricted-territories) * [1.2 Availability of Services](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#1-2-availability-of-services) * [1.3 No Offer or Solicitation](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#1-3-no-offer-or-solicitation) * [1.4 Jurisdictional Compliance](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#1-4-jurisdictional-compliance) * [2\. The App](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#2-the-app) * [3\. Services](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#3-services) * [4\. Fees and Payment](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#4-fees-and-payment) * [5\. Intellectual Property and Content](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#5-intellectual-property-and-content) * [6\. User Terms](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#6-user-terms) * [7\. Risks Borne by Users](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#7-risks-borne-by-users) * [8\. External Sites](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#8-external-sites) * [9\. Disclaimers](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#9-disclaimers) * [10\. Limitation of Liability](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#10-limitation-of-liability) * [11\. Indemnity](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#11-indemnity) * [12\. Privacy Policy](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#12-privacy-policy) * [13\. Consent to Electronic Disclosures and Signatures](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#13-consent-to-electronic-disclosures-and-signatures) * [14\. Governing Law and Dispute Resolution](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#14-governing-law-and-dispute-resolution) * [15\. Notices](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#15-notices) * [16\. Entire Agreement](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#16-entire-agreement) * [17\. Force Majeure](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#17-force-majeure) * [18\. Third Party Rights](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#18-third-party-rights) * [19\. No Agency or Partnership](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#19-no-agency-or-partnership) * [20\. Interpretation](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#20-interpretation) * [21\. Assignment](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#21-assignment) * [22\. Illegality](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#22-illegality) * [23\. Waiver](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#23-waiver) * [24\. Severability](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#24-severability) * [25\. Survival](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#25-survival) * [26\. English Language](https://docs.meteora.ag/legal/2-stake2earn-terms-of-service#26-english-language) Assistant Responses are generated using AI and may contain mistakes. --- # Create a DLMM Launch Pool with Alpha Vault - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Alpha Vault Launch Pool Create a DLMM Launch Pool with Alpha Vault [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) DLMM Launch Pool is a special pool type designed for new token launches. It is based on DLMM and comes fundamentally equipped with a feature set that makes it optimal for bootstrapping liquidity for new tokens and making the tokens accessible on Jupiter and other trading integrations. DLMM Launch Pools can also be created with an Alpha Vault as part of the token launch process. This is optional. Alpha Vault is a new anti-bot tool to guard against sniper bots and allow genuine supporters to be the first to buy tokens at launch. Below we provide the steps to use Bun to configure and run sample scripts to conveniently set up a DLMM Launch Pool with Alpha Vault on your own. [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#getting-started) Getting Started ----------------------------------------------------------------------------------------------------------------------------------------------------- * Clone repo: [https://github.com/MeteoraAg/meteora-pool-setup](https://github.com/MeteoraAg/meteora-pool-setup) * Config list to reference: [https://github.com/MeteoraAg/meteora-pool-setup/tree/main/config](https://github.com/MeteoraAg/meteora-pool-setup/tree/main/config) * Readme: [https://github.com/MeteoraAg/meteora-pool-setup/blob/main/README.md](https://github.com/MeteoraAg/meteora-pool-setup/blob/main/README.md) * DLMM SDK on github: [https://github.com/MeteoraAg/dlmm-sdk](https://github.com/MeteoraAg/dlmm-sdk) * DLMM API endpoints: [https://dlmm-api.meteora.ag/swagger-ui/#/](https://dlmm-api.meteora.ag/swagger-ui/#/) * Alpha Vault SDK: [https://docs.meteora.ag/alpha-vault/alpha-vault-typescript-sdk](https://docs.meteora.ag/alpha-vault/alpha-vault-typescript-sdk) * Devnet: [https://devnet.meteora.ag/](https://devnet.meteora.ag/) [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#dependencies) Dependencies ----------------------------------------------------------------------------------------------------------------------------------------------- Install Bun: You’ll also need bun to run the scripts. Install it via bun installation. Then install the dependencies by running the command `bun install` [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#scripts) Scripts ------------------------------------------------------------------------------------------------------------------------------------- The following code examples can be used to initialize and seed a DLMM liquidity pool on Meteora using a customizable permissionless liquidity bin pair (LB pair). It allows you to configure parameters for the pool, including fees, pricing, curvature, and activation conditions, before executing initialization and seeding commands. We also have code examples for interacting with the Alpha Vault program. Use these examples to create and manage vaults, handle deposits and withdrawals, manage permissioned and permissionless vault configurations, and interact with escrow accounts. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#create-dlmm-launch-pool) Create DLMM Launch Pool Clone repo: [https://github.com/MeteoraAg/meteora-pool-setup](https://github.com/MeteoraAg/meteora-pool-setup) Select an example config to reference and change the parameters inside according to your needs: [https://github.com/MeteoraAg/meteora-pool-setup/tree/main/config](https://github.com/MeteoraAg/meteora-pool-setup/tree/main/config) Run the script with the config file which is updated with your preferred parameters. For example, run: Copy Ask AI bun run src/create_pool.ts --config ./config/create_dlmm_pool.json Replace `./config/create_dlmm_pool.json` with the path to your config file, after you have set your config parameters. **Important Notes:** * The max bin step you can set for a DLMM pool is 400 bin step. * When creating a DLMM pool, there are 3 roles in position that you can config: * **Position Owner**: Wallet that owns the liquidity * **Operator**: Wallet that can deposit and withdraw tokens on behalf of the Position Owner * **Fee Owner**: Wallet that gets the fees from that position * During the initialization of the DLMM pool, pool creator needs to have at least 1 lamport worth of the base token in the wallet to prove ownership. * If you plan to use a multisig on the Meteora website, please make sure it is the SquadsX multisig, as that is the only type supported on Meteora website. Otherwise, you can’t manage liquidity through the website. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#seed-liquidity) Seed liquidity There are two different strategy options when it comes to seeding liquidity in a DLMM Launch Pool. #### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#seed-liquidity-using-ilm-curve-distribution-strategy) Seed liquidity using ilm curve distribution strategy This is the standard type of token launch liquidity distribution used by past LFG projects such as JUP, WEN, CLOUD etc. You can first use this ilm curve tool to determine the suitable parameters for your launch. Reference this config file [https://github.com/MeteoraAg/meteora-pool-setup/blob/main/config/seed\_liquidity\_lfg.json](https://github.com/MeteoraAg/meteora-pool-setup/blob/main/config/seed_liquidity_lfg.json) and set your preferred parameters. Run the script with the config file which is set with your preferred parameters. For example, run: Copy Ask AI bun run src/seed_liquidity_lfg.ts --config ./config/seed_liquidity_lfg.json Replace `./config/seed_liquidity_lfg.json` with the path to your config file, after you have set your config parameters. #### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#seed-liquidity-using-single-bin-strategy) Seed liquidity using single bin strategy This is a unique token launch strategy where all liquidity is allocated into a single bin. Reference this config file [https://github.com/MeteoraAg/meteora-pool-setup/blob/main/config/seed\_liquidity\_single\_bin.json](https://github.com/MeteoraAg/meteora-pool-setup/blob/main/config/seed_liquidity_single_bin.json) and set your preferred parameters. Run the script with the config file which is set with your preferred parameters. For example, run: Copy Ask AI bun run src/seed_liquidity_single_bin.ts --config ./config/seed_liquidity_single_bin.json Replace `./config/seed_liquidity_single_bin.json` with the path to your config file, after you have set your config parameters. **Important Notes:** * When seeding liquidity using the endpoint, both Operator and Position Owner need to have base tokens to prove ownership. If the Position Owner doesn’t have any base tokens, then the Operator will need to send 1 lamport worth of the base token to Position Owner. But the script will check if Position Owner has tokens and if not, it will bundle a transfer instruction to send 1 lamport worth of the base token from the Operator to the Position Owner. * In the code example, `lock_release_point` refers to the time the liquidity position can be withdrawn. If it is set to zero, it means the position can be withdrawn immediately after trading starts. * If you plan to use a multisig on the Meteora website, please make sure it is the SquadsX multisig, as that is the only type supported on Meteora website. Otherwise, you can’t manage liquidity through the website. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#set-dlmm-launch-pool-status) Set DLMM Launch Pool status You are able to disable the pool prior to pool activation time (before trading starts) and enable it later before or after pool activation time. After pool activation time, once enabled the pool cannot be disabled by you again. Reference this config file [https://github.com/MeteoraAg/meteora-pool-setup/blob/main/config/set\_dlmm\_pool\_status.json](https://github.com/MeteoraAg/meteora-pool-setup/blob/main/config/set_dlmm_pool_status.json) and set your preferred parameters. Run the script with the config file which is set with your preferred parameters. For example, run: Copy Ask AI bun run src/set_dlmm_pool_status.ts --config ./config/set_dlmm_pool_status.json Replace `./config/set_dlmm_pool_status.json` with the path to your config file, after you have set your config parameters. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#create-alpha-vault) Create Alpha Vault #### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#dlmm-launch-pool-with-alpha-vault-pro-rata-mode) DLMM Launch Pool with Alpha Vault Pro Rata mode Reference this example config: [https://github.com/MeteoraAg/meteora-pool-setup/blob/main/config/create\_dlmm\_pool\_with\_prorata\_alpha\_vault.json](https://github.com/MeteoraAg/meteora-pool-setup/blob/main/config/create_dlmm_pool_with_prorata_alpha_vault.json) Change the parameters in the config according to your needs. Run the config after it has been updated with your parameters: Copy Ask AI bun run src/create_alpha_vault.ts --config ./config/create_dlmm_pool_with_prorata_alpha_vault.json #### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#dlmm-launch-pool-with-alpha-vault-fcfs-first-come-first-served-mode) DLMM Launch Pool with Alpha Vault FCFS (First Come First Served) mode Reference this example config: [https://github.com/MeteoraAg/meteora-pool-setup/blob/main/config/create\_dlmm\_pool\_with\_fcfs\_alpha\_vault.json](https://github.com/MeteoraAg/meteora-pool-setup/blob/main/config/create_dlmm_pool_with_fcfs_alpha_vault.json) Change the parameters in the config according to your needs. Run the config after it has been updated with your parameters: Copy Ask AI bun run src/create_alpha_vault.ts --config ./config/create_dlmm_pool_with_fcfs_alpha_vault.json #### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#dlmm-launch-pool-with-alpha-vault-pro-rata-mode-with-whitelist) DLMM Launch Pool with Alpha Vault Pro Rata mode (with Whitelist) Reference this example config: [https://github.com/MeteoraAg/meteora-pool-setup/blob/main/config/create\_dlmm\_pool\_with\_prorata\_alpha\_vault.json](https://github.com/MeteoraAg/meteora-pool-setup/blob/main/config/create_dlmm_pool_with_prorata_alpha_vault.json) Change the parameters in the config according to your needs. Use: Copy Ask AI "whitelistMode": "permissioned_with_authority" "whitelistFilepath": "./config/whitelist_wallet.csv" Replace `./config/whitelist_wallet.csv` with your csv file containing your list of whitelisted addresses. Run the config after it has been updated with your parameters: Copy Ask AI bun run src/create_alpha_vault.ts --config ./config/create_dlmm_pool_with_prorata_alpha_vault.json #### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#alpha-vault-with-whitelist) Alpha Vault with Whitelist For some launches, the project may want to restrict which wallet addresses are allowed to deposit funds into the Alpha Vault, so in the config file used in the script to create the Alpha Vault, the whitelistMode needs to be specified. * **permissionless**: No whitelist, anyone can deposit into the Alpha Vault * **permission\_with\_authority**: In this mode, only the Alpha Vault creator can create escrow account with max\_cap. This allows the creator to use a permissioned (with whitelist) setup without having to use the merkle tree. Creator needs to pay SOL rent for each escrow account for the whitelisted wallets, so this Alpha Vault whitelist mode is suitable for scenarios where there are very few whitelisted addresses `(e.g. =<100)`. If they need to support a lot more whitelisted addresses, they should still use the merkle tree (PermissionWithMerkleProof whitelist mode). * **permission\_with\_merkle\_proof**: In this mode, only wallets that are whitelisted can deposit into the Alpha Vault. Csv file containing the list of whitelisted wallets needs to be provided by the project to Meteora, for the Merkle proof to be hosted by Meteora and shown on the UI. Alpha Vault deposits should not open until the Merkle proof is hosted by Meteora. **Important Notes:** * If you do not want to use Alpha Vault, skip this step. * Currently, only SOL or USDC is accepted as the quote token when initializing a Dynamic AMM or DLMM Pool with Alpha Vault in a permissionless setup. Since the Alpha Vault can’t tell what the quote token would be, the quote token is limited to SOL or USDC. However, any quote token can be used if you use a config key that doesn’t have Alpha Vault. * There must be a ~1 hour 5 minutes period between the deposit close time and the pool activation time. * **Crank start point (time when vault buys tokens from the pool):** * Timestamp-based Crank start point = activationPoint - 3600 * Slot-based Crank start point = activationPoint - 9000 * **Vault deposit close point (time when vault deposits close):** * Timestamp-based Vault, Deposit close point = Crank start point - 5 min * Slot-based Vault, Deposit close point = Crank start point - 750 ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#after-deployment) After deployment To view pool on the UI, access the link below For DLMM pool: [https://app.meteora.ag/dlmm/\[POOL\_ADDRESS](https://app.meteora.ag/dlmm/%5BPOOL_ADDRESS)\ \] ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#when-can-you-withdraw-tokens-from-the-pool-to-the-position-owner%3F) When can you withdraw tokens from the pool to the position owner? CustomizablePermissionless DLMM: After pool activation point (trading starts) [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#other-configuration-details) Other Configuration Details ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- There are various config files that can be found in the config directory. It contains all the configurations required to run the scripts. We also need to provide the keypair for the payer wallet in `keypair.json` file. DLMM Pool can also lock liquidity, so the lock\_release\_point can be set to some indefinite time then it ‘unlocks’ ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#general-configuration) General configuration * `rpcUrl`: Solana RPC URL to get data and send transactions. * `keypairFilePath`: Keypair file path to send transactions. * `dryRun`: Set to true to send transactions. * `computeUnitPriceMicroLamports`: CU price in micro lamports unit. For example: 100000. * `createBaseToken`: Configuration to create base token. * `baseMint`: Base token address if the createBaseToken field is not set. * `quoteSymbol`: Quote token symbol, only SOL or USDC is supported. * `quoteMint`: Quote token mint, in case the user wants to create a DLMM launch pool with a token other than SOL or USDC. * `dlmm`: DLMM pool configuration. **Some configuration constraints:** * `createBaseToken` and `baseMint` cannot be used together. * `dynamicAmm` and `dlmm` cannot be used together. **Create Base Token configuration:** * `mintBaseTokenAmount`: Base token amount to be minted. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#dlmm-configuration) DLMM configuration * `binStep`: DLMM pool bin step. * `feeBps`: Fee bps for DLMM pool. * `initialPrice`: Initial pool price. * `activationType`: To activate pool trading based on slot or timestamp. * `activationPoint`: To activate pool trading at a point, either slot valut or timestamp value based on activationType. * `priceRounding`: Should be up or down. * `hasAlphaVault`: Whether alpha vault is enabled or not for this pool. * `creatorPoolOnOffControl`: Allow creator to turn on/off pool control. When using the endpoint instruction initializeCustomizablePermissionlessLbPair the purpose is for creating a launch pool for the token for the first time, so only one DLMM pool is meant to be created for that token pair. If you are using that instruction to create a new DLMM pool with the same base and quote tokens, but with different parameters, the transaction will fail. Pool creator must have at least 1 lamport worth of the base token in the wallet to prove ownership. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#alpha-vault-configuration) Alpha Vault configuration * `poolType`: dynamic or dlmm pool type. * `alphaVaultType`: Alpha Vault type, could be fcfs or prorata * `depositingPoint`: Absolute value that, the slot or timestamp that allows deposit depend on the pool activation type. * `startVestingPoint`: Absolute value, the slot or timestamp that start vesting depend on the pool activation type. If no vesting is required, you should put this as 1 sec after the pool’s activationPoint * `endVestingPoint`: Absolute value, the slot or timestamp that end vesting depend on the pool activation type. If no vesting is required, this should be the same as startVestingPoint * `maxDepositCap`: Maximum deposit cap. * `individualDepositingCap`: Individual deposit cap. * `escrowFee`: Fee to create stake escrow account. If this fee is added, it will be a one-time fee charged when users create a stake escrow account. This acts as a tax and makes it prohibitively expensive for users to attempt to use multiple wallets to bypass the individual deposit cap. It’s charged in native SOL (non-wrapped version) and will be sent to the Meteora treasury. * `whitelistMode`: permissionless or permission\_with\_merkle\_proof or permission\_with\_authority. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#alpha-vault-pro-rata-configuration) Alpha Vault Pro rata configuration * `depositingPoint`: Absolute value that, the slot or timestamp that allows deposit depend on the pool activation type. * `startVestingPoint`: Absolute value, the slot or timestamp that start vesting depend on the pool activation type. If no vesting is required, you should put this as 1 sec after the pool’s activationPoint * `endVestingPoint`: Absolute value, the slot or timestamp that end vesting depend on the pool activation type. If no vesting is required, this should be the same as startVestingPoint * `maxBuyingCap`: Maximum buying cap. * `escrowFee`: Fee to create stake escrow account. If this fee is added, it will be a one-time fee charged when users create a stake escrow account. This acts as a tax and makes it prohibitively expensive for users to attempt to use multiple wallets to bypass the individual deposit cap. It’s charged in native SOL (non-wrapped version) and will be sent to the Meteora treasury. * `whitelistMode`: permissionless or permission\_with\_merkle\_proof or permission\_with\_authority. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#alpha-vault-key-components) Alpha Vault Key Components **Vault Types:** Supports both permissionless (without whitelist) and permissioned (with whitelist) Alpha Vaults. **Whitelist Modes:** Without whitelist: * Permissionless With whitelist: * PermissionWithMerkleProof * PermissionWithAuthority **alphaVaultType (Vault Mode):** * Pro-rata * FCFS (First-Come, First-Served) **Individual Deposit Cap:** * Global individual deposit cap without whitelist only possible on FCFS vault mode, not possible on Pro rata vault mode. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#alpha-vault-typescript-sdk) Alpha Vault TypeScript SDK After creating the Alpha Vault for your pool, check out the Alpha Vault SDK for different ways to interact with it. For example, depositing funds into the Alpha Vault, cranking the Alpha Vault to buy tokens from the pool, or claiming purchased tokens from the Alpha Vault. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#for-testing-bun-scripts) For Testing Bun Scripts First, run the localnet Copy Ask AI bun run start-test-validator Then run the test: Copy Ask AI bun test [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#other-alpha-vault-considerations) Other Alpha Vault Considerations --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#what-is-the-general-process-if-you-want-to-use-a-launch-pool-with-alpha-vault%2C-then-later-use-the-usdc-or-sol-funds-raised-from-the-launch-pool-to-redeploy-the-liquidity-to-another-new-pool%3F) What is the general process if you want to use a Launch Pool with Alpha Vault, then later use the USDC or SOL funds raised from the Launch Pool to redeploy the liquidity to another new pool? When setting up the Launch Pool with Alpha Vault, the token deployer should set token claim unlock from Alpha Vault to be sometime after pool activation time (after pool starts trading). The token deployer must set enough buffer time after pool activation to withdraw liquidity from the Launch Pool first to redeploy to another pool, BEFORE users can claim tokens from the Alpha Vault. **Optional:** Once the Launch Pool and Alpha Vault are set up, Meteora can help the team disable the Launch Pool from trading. This is a special requirement if you want the Launch Pool to be used only by the Alpha Vault to buy tokens for depositors, but not for public trading by everyone else. It is important to note that you should NOT allow users to claim tokens from the Alpha Vault before the token starts trading anywhere. For the Alpha Vault, the startVestingPoint needs to be at least 1 sec after PoolActivationPoint. This would mean tokens unlock for claiming right after or some time after the pool starts trading. If you allow users to claim tokens (via Alpha Vault or any airdrops) before the official token trading time, users can use the tokens to create a secondary market immediately and skew your initial token price, negatively impacting your launch. After the Launch Pool activation time, liquidity can be withdrawn from the Launch Pool and redeployed to another pool (e.g. DAMM v2 or another DLMM) that starts trading immediately or with another activation time. If the second pool has another activation time, it should be set earlier than the token claim unlock time from the Alpha Vault. Once the second pool activates for trading, the token is tradable for everyone, and users can start claiming from the Alpha Vault, depending on when you configured vesting to start. [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#for-testing-bun-scripts-2) For Testing Bun Scripts ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- First, run the localnet: Copy Ask AI bun run start-test-validator Then run the test: Copy Ask AI bun test Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/launch-pools/dlmm/2-create-a-dlmm-launch-pool) [Create a DAMM v1 Launch Pool with Alpha Vault\ \ Next](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault) On this page * [Getting Started](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#getting-started) * [Dependencies](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#dependencies) * [Scripts](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#scripts) * [Create DLMM Launch Pool](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#create-dlmm-launch-pool) * [Seed liquidity](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#seed-liquidity) * [Seed liquidity using ilm curve distribution strategy](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#seed-liquidity-using-ilm-curve-distribution-strategy) * [Seed liquidity using single bin strategy](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#seed-liquidity-using-single-bin-strategy) * [Set DLMM Launch Pool status](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#set-dlmm-launch-pool-status) * [Create Alpha Vault](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#create-alpha-vault) * [DLMM Launch Pool with Alpha Vault Pro Rata mode](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#dlmm-launch-pool-with-alpha-vault-pro-rata-mode) * [DLMM Launch Pool with Alpha Vault FCFS (First Come First Served) mode](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#dlmm-launch-pool-with-alpha-vault-fcfs-first-come-first-served-mode) * [DLMM Launch Pool with Alpha Vault Pro Rata mode (with Whitelist)](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#dlmm-launch-pool-with-alpha-vault-pro-rata-mode-with-whitelist) * [Alpha Vault with Whitelist](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#alpha-vault-with-whitelist) * [After deployment](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#after-deployment) * [When can you withdraw tokens from the pool to the position owner?](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#when-can-you-withdraw-tokens-from-the-pool-to-the-position-owner%3F) * [Other Configuration Details](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#other-configuration-details) * [General configuration](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#general-configuration) * [DLMM configuration](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#dlmm-configuration) * [Alpha Vault configuration](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#alpha-vault-configuration) * [Alpha Vault Pro rata configuration](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#alpha-vault-pro-rata-configuration) * [Alpha Vault Key Components](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#alpha-vault-key-components) * [Alpha Vault TypeScript SDK](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#alpha-vault-typescript-sdk) * [For Testing Bun Scripts](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#for-testing-bun-scripts) * [Other Alpha Vault Considerations](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#other-alpha-vault-considerations) * [What is the general process if you want to use a Launch Pool with Alpha Vault, then later use the USDC or SOL funds raised from the Launch Pool to redeploy the liquidity to another new pool?](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#what-is-the-general-process-if-you-want-to-use-a-launch-pool-with-alpha-vault%2C-then-later-use-the-usdc-or-sol-funds-raised-from-the-launch-pool-to-redeploy-the-liquidity-to-another-new-pool%3F) * [For Testing Bun Scripts](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault#for-testing-bun-scripts-2) Assistant Responses are generated using AI and may contain mistakes. --- # What's Hermes? - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Hermes What's Hermes? [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Hermes - Our keeper program monitors the APY for each lending protocol every 1 hour, and sends rebalance cranks to re-distribute liquidity in the different platforms. There are factors that affect allocation in a platform: APY --- The annual percentage yield offered by each lending protocol. Total Deposit ------------- The total amount of assets currently deposited in the platform. Deposit Limit ------------- The maximum amount of assets that can be deposited into the platform. Pool Utilization Rates ---------------------- The ratio of borrowed assets to total assets in the pool, indicating how much of the pool is being used. Pool Reserve Levels ------------------- The amount of liquidity available in the pool’s reserves. Rebalance cranks are sent every few minutes, so user will get yield just after few minutes depositing in vault Keeper can only deposit in predefined strategies, and cannot claim tokens. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/overview/other-products/dynamic-vault/1-what-is-dynamic-vault) [Algorithm to Find Optimal Yield Allocations\ \ Next](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-2-algorithm-to-find-optimal-yield-allocations) Assistant Responses are generated using AI and may contain mistakes. --- # What's DLMM? - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DLMM What's DLMM? [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) DLMM is designed with features that provide more flexibility for liquidity providers (LPs) and help LPs earn as much fees as possible with their capital. DLMM was inspired by Trader Joe’s Liquidity Book and in our implementation, we organize the liquidity of an asset pair into discrete price bins. Token reserves deposited in a liquidity bin are made available for exchange at the price defined for that particular bin. Swaps that happen within the price bin itself would not suffer from slippage. The market for the asset pair is established by aggregating all the discrete liquidity bins. DLMM LPs earn fees for liquidity provision, dynamic fees during market volatility, and Liquidity Mining (LM) rewards where available. DLMM is also the fundamental system behind the **DLMM Launch Pool**. DLMM Launch Pool is a pool type designed for new token launches. It comes fundamentally equipped with a feature set that makes it optimal for bootstrapping liquidity for new tokens and making the tokens accessible on Jupiter and other trading integrations. [​](https://docs.meteora.ag/overview/products/dlmm/1-what-is-dlmm#features) Features ======================================================================================= High Capital Efficiency ----------------------- Higher capital efficiency and fees for LPs. DLMM can support high volume trading with low liquidity requirements through the concentrating of tokens at or around the current market value. Higher trading volume and fees due to zero slippage within each active bin that greatly reduces price impact. Flexible Volatility Strategy ---------------------------- Greater flexibility and control for LPs when it comes to efficient liquidity distribution. LPs can build flexible liquidity distributions according to their volatility strategies. Capture Higher Fees ------------------- Unlocks more opportunities to capture higher fees based on market conditions and LP objectives / risk profile. LPs can also provide single-sided liquidity with only one token, unlike typical AMMs. Dynamic Fees ------------ Fees that increase or decrease depending on how volatile the market is, which in turn help offset losses that LPs may experience in volatile markets and enhance LP profitability. [​](https://docs.meteora.ag/overview/products/dlmm/1-what-is-dlmm#how-does-it-work%3F) How does it work? =========================================================================================================== Users can select token pairs that they wish to provide liquidity for. For each token pair, they can choose a liquidity shape that best suits their strategies. [​](https://docs.meteora.ag/overview/products/dlmm/1-what-is-dlmm#liquidity-shapes) Liquidity Shapes ------------------------------------------------------------------------------------------------------- Spot ---- Provides a uniform distribution that is versatile and risk adjusted, suitable for any type of market and conditions. Curve ----- Ideal for a concentrated approach that aims to maximise efficiency while minimizing impact of volatility. Bid-ask ------- An inverse Curve distribution, typically deployed single sided for a DCA in or out strategy. It can be used to capture volatility in a stable or pegged pair. Take note that it is **important for LPs to closely monitor their positions** and adjust accordingly to market conditions to manage the risk of impermanent loss. Unlike our Dynamic AMM pools, the DLMM is not connected to our Dynamic Vaults for lending yield. All liquidity is solely used for trading. [​](https://docs.meteora.ag/overview/products/dlmm/1-what-is-dlmm#dynamic-fees) Dynamic Fees =============================================================================================== Dynamic Fees acts as a form of surge pricing based on market fluctuations and volatility. [​](https://docs.meteora.ag/overview/products/dlmm/1-what-is-dlmm#how-do-dynamic-fees-work%3F) How do Dynamic Fees work? --------------------------------------------------------------------------------------------------------------------------- Since demand for tokens and price volatility are often the highest at launch, Dynamic Fee would also be high. This both mitigates against aggressive sniper bot purchases while capturing more fees for the token creator and LPs in the pool. The total swap fee consists of two components: a base fee and a variable fee. The base fee is configured by the pool creator and determined by the base factor and bin step. The variable fee is calculated based on real-time price volatility and is affected by swap frequencies and the number of bins crossed during a swap. These fees are calculated and distributed on a per-bin basis, ensuring fair distribution to LPs in each bin that is crossed. LPs can claim these fees whenever they are available. All DLMM Launch Pools have Dynamic Fees enabled by default. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/overview/home) [DLMM Concepts\ \ Next](https://docs.meteora.ag/overview/products/dlmm/2-dlmm-concepts) On this page * [Features](https://docs.meteora.ag/overview/products/dlmm/1-what-is-dlmm#features) * [How does it work?](https://docs.meteora.ag/overview/products/dlmm/1-what-is-dlmm#how-does-it-work%3F) * [Liquidity Shapes](https://docs.meteora.ag/overview/products/dlmm/1-what-is-dlmm#liquidity-shapes) * [Dynamic Fees](https://docs.meteora.ag/overview/products/dlmm/1-what-is-dlmm#dynamic-fees) * [How do Dynamic Fees work?](https://docs.meteora.ag/overview/products/dlmm/1-what-is-dlmm#how-do-dynamic-fees-work%3F) Assistant Responses are generated using AI and may contain mistakes. --- # Algorithm to Find Optimal Yield Allocations - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Hermes Algorithm to Find Optimal Yield Allocations [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Hermes is our off-chain yield optimizer (keeper) program, designed to dynamically allocate liquidity across lending platforms for optimal yield while managing risk. Below, we break down its algorithmic approach and the rationale behind each step. * * * [​](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-2-algorithm-to-find-optimal-yield-allocations#how-hermes-optimizes-yield) How Hermes Optimizes Yield =========================================================================================================================================================================== [​](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-2-algorithm-to-find-optimal-yield-allocations#key-factors-affecting-apr) Key Factors Affecting APR ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Amount Borrowed --------------- Higher utilization (more borrowed) increases APR for depositors. Amount Deposited ---------------- More deposits dilute the APR, as interest is shared among more depositors. Interest Rate Model ------------------- Each platform’s model determines how APR changes with utilization. * * * [​](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-2-algorithm-to-find-optimal-yield-allocations#step-by-step%3A-optimal-allocation-algorithm) Step-by-Step: Optimal Allocation Algorithm ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1 1\. Divide Liquidity into Portions Liquidity is split into small portions (e.g., 100+), configurable by admin. 2 2\. Simulate Deposits Across Platforms For each portion, simulate depositing it into every lending platform and calculate the resulting APR. 3 3\. Select Highest APR Assign the portion to the platform offering the highest simulated APR. 4 4\. Update Simulated Allocations Update the simulated allocation and repeat until all liquidity is distributed. 5 5\. Compare to Previous Allocation If the new allocation differs from the previous by more than 0.1%, trigger a rebalance. * * * [​](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-2-algorithm-to-find-optimal-yield-allocations#pseudocode) Pseudocode ------------------------------------------------------------------------------------------------------------------------------------------- Copy Ask AI #Off chain simulation portion ← x #x is minimally 100, set by admin deposit_amount ← vault.total_amount / portion last_allocation[] ← current allocation of vault.total_amount in each lending platform allocation[] ← track allocation after simulation to each lending platform FOR each portion FOR each platform Simulate deposit_amount to platform APR[platform] ← APR of platform after simulated deposit ENDFOR highest_APR_platform ← Select platform with the highest APR in APR[platform] allocation[highest_APR_platform] ← deposit_amount + allocation[highest_APR_platform] Update deposit_amount to platform ENDFOR #On Chain Rebalance crank IF diff(allocation[], last_allocation[]) > 0.1% THEN Send rebalance crank to allocate funds according to allocation[] ENDIF Was this page helpful? YesNo [Previous](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-1-what-is-hermes) [Rebalance Crank\ \ Next](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-3-rebalance-crank) On this page * [How Hermes Optimizes Yield](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-2-algorithm-to-find-optimal-yield-allocations#how-hermes-optimizes-yield) * [Key Factors Affecting APR](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-2-algorithm-to-find-optimal-yield-allocations#key-factors-affecting-apr) * [Step-by-Step: Optimal Allocation Algorithm](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-2-algorithm-to-find-optimal-yield-allocations#step-by-step%3A-optimal-allocation-algorithm) * [Pseudocode](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-2-algorithm-to-find-optimal-yield-allocations#pseudocode) Assistant Responses are generated using AI and may contain mistakes. --- # Strategies and Use Cases - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DLMM Strategies and Use Cases [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Through allocating different amounts of tokens at diverse price points, we are able to build a desired liquidity shape (volatility strategy) with the DLMM that best fits our LP goals. Spot ---- Provides a uniform distribution of liquidity that is flexible and suitable for any type of market and conditions. It is the most straightforward volatility strategy to deploy for new LPs who want to rebalance their position less frequently. This is similar to setting a CLMM price range. Curve ----- Ideal for a concentrated approach that aims to maximize capital efficiency by allocating capital mostly in the middle of your price range. This is great for stables or pairs where the price does not change very often. Bid-Ask ------- Bid-Ask is an inverse Curve distribution, where most of your capital is allocated towards both ends of the range. This strategy can be used to capture bigger volatility swings away from the current price. Bid-Ask is more complex than Spot and may require more frequent rebalancing to be effective, but has a high potential for fee capture during situations where prices fluctuate wildly around the current price. Bid-Ask can also be deployed single sided for a DCA in or out strategy. [​](https://docs.meteora.ag/overview/products/dlmm/3-strategies-and-use-cases#basic-strategies) Basic Strategies =================================================================================================================== | Strategy | Advantages | Disadvantages | Considerations | | --- | --- | --- | --- | | **Curve**

![Curve](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/overview/products/dlmm/curve.png) | • Capital-efficient deployment of liquidity

• Ideal for calm markets | Increased risk of impermanent loss | To achieve optimal effectiveness, it’s necessary to consistently rebalance based on the current price. | | **Bid-Ask**

![Bid-Ask](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/overview/products/dlmm/bid-ask.png) | • Captures market volatility

• Great for DCA in/out of positions | Riskier than other positions | Requires rebalancing to remain efficient | | **Spot-Concentrated**
Liquidity equally deposited between 1-3 bins

![Spot-Concentrated](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/overview/products/dlmm/spot-concentrated.png) | • Ideal for Stablecoin pairs

• Maximises assets efficiency | Highest risk of Impermanent Loss when price leaves the bin range | If used in volatile pairs for capturing greatest amount of fees, make sure to monitor very closely as this strategy has highest risk of Impermanent Loss. | | **Spot-Spread**
Liquidity equally deposited between 20-30 bins

![Spot-Spread](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/overview/products/dlmm/spot-spread.png) | • Very capital-efficient strategy

• Expect to stay in range for small intra-day volatility | High risk of Impermanent loss | Make sure to monitor position at least on a daily basis. | | **Spot-Wide**
Liquidity equally deposited between 50 bins

![Spot-Wide](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/overview/products/dlmm/spot-wide.png) | • Lower risk of impermanent loss

• Ideal for LPs who do not wish to regularly monitor price action | Reduced capital efficiency since capital is spread over a larger range | Although capital-efficiency is lower than the other shapes above, in general, it is still better than x\*y=k exchanges | [​](https://docs.meteora.ag/overview/products/dlmm/3-strategies-and-use-cases#advanced-strategies) Advanced Strategies ========================================================================================================================= * Ranged Limit Orders * DCA while earning * Sell/Buy Walls * Gradual Ladder Orders * De-peg Bets [​](https://docs.meteora.ag/overview/products/dlmm/3-strategies-and-use-cases#what-is-bin-step%3F) What is Bin Step? ======================================================================================================================= Each bin represents a single price point, and the difference between 2 consecutive bins is the bin step. Bin steps are calculated based on the basis points set by the pool creator. Bin step is similar to tick size and a higher size means a larger jump from one price to the next. For example, if the current price for SOL/USDC is $20 per SOL and the bin step is 25 basis points (0.25%), then the consecutive bins would be 20 x 1.0025 = 20.05, 20.05 \* 1.0025 = 20.10 and so on. Smaller Bin Step ---------------- Allows you to capture more volume, but your max price range per position is smaller. A general rule of thumb is smaller steps for stable pairs and larger steps for more volatile pairs. Larger Bin Step --------------- Allows you to set a wider price range per position, but at the cost of less volume, since there’s a less continuous price range (harder for liquidity to be picked up for swaps). Important for highly volatile pairs where price swings can be huge. For highly volatile pairs, larger bin steps could also mean less errors, since with smaller bin steps a trade may jump between different binArrays frequently. Note: Currently the max # of bins per position is 69, so a larger bin step can be used if you need to widen your range for a single position. [​](https://docs.meteora.ag/overview/products/dlmm/3-strategies-and-use-cases#how-is-bin-step-related-to-base-fee%3F) How is Bin Step related to Base Fee? ============================================================================================================================================================= Base Fee is the minimum fee charged per swap. * Lower fee gets more volume but higher fee earns more per volume. * Generally if you want a higher base fee, the higher the bin step. * But a lower base fee than other DEXes might give more flexibility for dynamic fees to optimize for volume or fees given the market volatility. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/overview/products/dlmm/2-dlmm-concepts) [DLMM Fee Calculation\ \ Next](https://docs.meteora.ag/overview/products/dlmm/4-dlmm-fee-calculation) On this page * [Basic Strategies](https://docs.meteora.ag/overview/products/dlmm/3-strategies-and-use-cases#basic-strategies) * [Advanced Strategies](https://docs.meteora.ag/overview/products/dlmm/3-strategies-and-use-cases#advanced-strategies) * [What is Bin Step?](https://docs.meteora.ag/overview/products/dlmm/3-strategies-and-use-cases#what-is-bin-step%3F) * [How is Bin Step related to Base Fee?](https://docs.meteora.ag/overview/products/dlmm/3-strategies-and-use-cases#how-is-bin-step-related-to-base-fee%3F) Assistant Responses are generated using AI and may contain mistakes. --- # What's DBC? - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DBC What's DBC? [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Dynamic Bonding Curve (DBC) program is a permissionless launch pool protocol that allows any partners to spin up a launchpad that enables their users to launch tokens with customizable virtual curves directly on their platform. With direct integration into Jupiter and other trading platforms, traders can trade these tokens immediately across all trading terminals. ![DBC Total Curve](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/overview/products/dbc/dbc-total-token-supply.png) [​](https://docs.meteora.ag/overview/products/dbc/1-what-is-dbc#what%E2%80%99s-a-dynamic-bonding-curve%3F) What’s a Dynamic Bonding Curve? ============================================================================================================================================= A Dynamic Bonding Curve is a **Universal Curve** — an up to 16-point customizable curve system that revolutionizes how liquidity providers can design their strategies. This curve is fully customizable for any launchpad to craft their own unique bonding curve. Each curve point in the Dynamic Bonding Curve is a constant product curve that can be configured to control the token’s price action. ![DBC Universal Curve](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/overview/products/dbc/dbc-universal-curve.png) [​](https://docs.meteora.ag/overview/products/dbc/1-what-is-dbc#the-problem-with-traditional-amms) The Problem with Traditional AMMs --------------------------------------------------------------------------------------------------------------------------------------- Traditional AMMs have been constrained by rigid curve designs: * **Capital Inefficiency**: Uniswap V2’s constant product spreads liquidity equally across all prices, leaving most capital unused * **One-Size-Fits-All**: Current AMMs force all LPs in a pool to follow the same curve design * **Limited Flexibility**: Even concentrated liquidity solutions force LPs into predefined ranges [​](https://docs.meteora.ag/overview/products/dbc/1-what-is-dbc#how-universal-curve-solves-this) How Universal Curve Solves This ----------------------------------------------------------------------------------------------------------------------------------- Universal Curve enables unprecedented flexibility through: 16-Point Customization ---------------------- LPs can define up to 16 points along their desired curve, with constant product formula providing smooth transitions between points. Infinite Range Capability ------------------------- Unlike range-based solutions, Universal Curve allows LPs to provide liquidity from 0 to infinity while concentrating capital exactly where needed. Multiple Strategies in One Pool ------------------------------- Different LPs can use different curve strategies within the same pool — StableSwap efficiency, constant product flexibility, or custom combinations. Recreate Any AMM Design ----------------------- Universal Curve can replicate Uniswap V2, Curve StableSwap, or create entirely custom strategies tailored to specific needs. This innovation allows every LP to optimize their individual strategy while contributing to shared pool efficiency — marking the end of the one-size-fits-all AMM era. [​](https://docs.meteora.ag/overview/products/dbc/1-what-is-dbc#how-does-it-work%3F) How does it work? ========================================================================================================= 1 Partner creates a unique config key Partners (launchpads) create a unique configuration key that includes all settings that covers from the Dynamic Bonding Curve creation to the migration of the liquidity to the actual DAMM pool. 2 Creators create DBC token pools Creators (token pool creators) can create a Dynamic Bonding Curve token pool using the partner’s config key. This will mint a new token. You cannot create a DBC token pool with an existing token. 3 Trading platforms can swap Trading platforms and trading bots (e.g., Jupiter, Axiom, Photon, etc.) can **immediately** swap with the Dynamic Bonding Curve pool. 4 DBC reaches minimum quote threshold When the DBC pool reaches a pre-defined minimum quote threshold (specified in the config key), no one can swap with that pool anymore and that pool is prepared for migration. 5 Meteora auto migrator service creates a DAMM pool Meteora’s auto migrator keeper service then migrates the DBC pool by sending a crank to create a new Meteora Dynamic AMM v1 or v2 pool 6 LP tokens or NFTs are locked or claimed by partner or creator Upon migration, depending on the pool’s config key, LP tokens or NFTs are either locked or claimable by the partner or creator. This is specified in the `creator_lp_percentage`, `partner_lp_percentage`, `creator_locked_lp_percentage` and `partner_locked_lp_percentage` fields. [​](https://docs.meteora.ag/overview/products/dbc/1-what-is-dbc#key-benefits) Key Benefits ============================================================================================= Customizable Launch Pools ------------------------- Launch partners can configure their launch pools with customizable quote tokens (e.g., SOL, USDC, JUP), unique bonding curves for token graduation, flexible fee structures, and more. Seamless Token Creation ----------------------- Users can easily create tokens and launch pools using partner-defined configurations directly from the partner’s UI. Instant Trading Integration --------------------------- Trading platforms and bots can immediately access and trade these tokens through our direct integrations with Jupiter and other platforms. Graduation to AMMs & Fee Claiming --------------------------------- Tokens can graduate to supported AMMs (currently Meteora DAMM v1 and v2) based on partner settings. Launchers can claim fees from locked LP tokens. Full End-to-End API Support --------------------------- Comprehensive Charting, Trading and Transactions API support enables easy integration for launch partners, trading platforms, and bots. [​](https://docs.meteora.ag/overview/products/dbc/1-what-is-dbc#anti-sniper-features) Anti-Sniper Features ============================================================================================================= Fee Scheduler ------------- Timestamp-based fees, such as high fees at launch that decrease over time, help deter snipers and protect the pool during the most volatile periods. Rate Limiter ------------ Amount-based fees that increases with a higher amount per swap, to deter snipers from sniping large amounts of tokens, while protecting smaller retail traders. [​](https://docs.meteora.ag/overview/products/dbc/1-what-is-dbc#other-features) Other Features ================================================================================================= Multiple Quote Token Support ---------------------------- Supports SOL, USDC, JUP, and other quote tokens for maximum flexibility. SPL Token & Token2022 Support ----------------------------- Compatible with both SPL Token and Token2022 standards for broad token compatibility. Flexible Fee Collection Modes ----------------------------- Choose to collect fees only in the quote token or keep a percentage of all fees generated on the Dynamic Bonding Curve. Customizable Liquidity Distribution ----------------------------------- Configure up to 16 price ranges with different liquidity curves for advanced pool customization. [​](https://docs.meteora.ag/overview/products/dbc/1-what-is-dbc#customizable-fees) Customizable Fees ======================================================================================================= The Dynamic Bonding Curve (DBC) virtual pool collects a trading fee on every trade (buy or sell). * **Protocol Fee:** A portion of each trading fee is allocated to the DBC protocol (Fixed 20% of the trading fee). * **Referral Fee:** Swap hosts (such as Jupiter, Photon, or trading bots) can include a referral account in the swap transaction to receive a referral fee, which is taken from the protocol fee (Fixed 20% of the protocol fee). * **Fee Sharing in the Bonding Curve:** The remaining trading fee is distributed to the launch partner (Fixed 80% of the trading fee). This fee can be fee shared between the partner and the token creator. * **Fee Distribution After Migration:** Once a token has graduated, the LP tokens are locked for both the partner and the token creator. The ratio of locked LP tokens is determined by the partner’s configuration. Both the partner and the token creator can claim fees from these locked LP tokens on Meteora DAMM v1 or DAMM v2. [​](https://docs.meteora.ag/overview/products/dbc/1-what-is-dbc#migration) Migration ======================================================================================= ### [​](https://docs.meteora.ag/overview/products/dbc/1-what-is-dbc#automatic-migration) Automatic Migration If the DBC pool reaches a pre-defined quote token or price threshold, the liquidity is automatically migrated to a DAMM v1 pool or DAMM v2 Pool on Meteora. We run 2 auto migrator keepers to migrate DBC pools. These 2 keepers have strict migration quote threshold requirements. Keeper addresses that we are running: 1. [CQdrEsYAxRqkwmpycuTwnMKggr3cr9fqY8Qma4J9TudY](https://solscan.io/account/CQdrEsYAxRqkwmpycuTwnMKggr3cr9fqY8Qma4J9TudY) * `pool_config.migration_quote_threshold` requirements: * 10 SOL * 750 USDC * 1500 JUP 2. [DeQ8dPv6ReZNQ45NfiWwS5CchWpB2BVq1QMyNV8L2uSW](https://solscan.io/account/DeQ8dPv6ReZNQ45NfiWwS5CchWpB2BVq1QMyNV8L2uSW) * `pool_config.migration_quote_threshold` requirements: * \>= 750 USD (`quote_mint` token) The Migration Keepers only runs on Mainnet. ### [​](https://docs.meteora.ag/overview/products/dbc/1-what-is-dbc#manual-migration) Manual Migration We have built a [manual migration user interface](https://migrator.meteora.ag/) for launchpads building on DBC to easily test the migration process. The Manual Migrator supports both Mainnet and Devnet. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/overview/products/damm-v2/2-pool-fees-calculation) [DBC Config Key\ \ Next](https://docs.meteora.ag/overview/products/dbc/2-dbc-config-key) On this page * [What’s a Dynamic Bonding Curve?](https://docs.meteora.ag/overview/products/dbc/1-what-is-dbc#what%E2%80%99s-a-dynamic-bonding-curve%3F) * [The Problem with Traditional AMMs](https://docs.meteora.ag/overview/products/dbc/1-what-is-dbc#the-problem-with-traditional-amms) * [How Universal Curve Solves This](https://docs.meteora.ag/overview/products/dbc/1-what-is-dbc#how-universal-curve-solves-this) * [How does it work?](https://docs.meteora.ag/overview/products/dbc/1-what-is-dbc#how-does-it-work%3F) * [Key Benefits](https://docs.meteora.ag/overview/products/dbc/1-what-is-dbc#key-benefits) * [Anti-Sniper Features](https://docs.meteora.ag/overview/products/dbc/1-what-is-dbc#anti-sniper-features) * [Other Features](https://docs.meteora.ag/overview/products/dbc/1-what-is-dbc#other-features) * [Customizable Fees](https://docs.meteora.ag/overview/products/dbc/1-what-is-dbc#customizable-fees) * [Migration](https://docs.meteora.ag/overview/products/dbc/1-what-is-dbc#migration) * [Automatic Migration](https://docs.meteora.ag/overview/products/dbc/1-what-is-dbc#automatic-migration) * [Manual Migration](https://docs.meteora.ag/overview/products/dbc/1-what-is-dbc#manual-migration) Assistant Responses are generated using AI and may contain mistakes. --- # What's DAMM v1? - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DAMM v1 What's DAMM v1? [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Meteora’s Dynamic AMM Pools are similar to constant product pools that support token prices from 0 to infinity. LPs on Dynamic AMM Pools earn both swap fees and yield from lending platforms. The price of your token in a Dynamic AMM (Volatile) Pool is based on the formula: x∗y\=kx\*y = k x∗y\=k * x and y are the quantities of the two tokens in the pool (e.g. MET and USDC). * k is a constant. As trades occur, the product of the amounts of the two tokens must remain the same. * If someone buys MET with USDC from your pool, the amount of MET in your pool decreases, and the amount of USDC increases. The DAMM v1 Pool adjusts the price based on the new token balances in the pool. [​](https://docs.meteora.ag/overview/products/damm-v1/1-what-is-damm-v1#earn-additional-yield-by-utilizing-lending-sources) Earn additional yield by utilizing lending sources ================================================================================================================================================================================= DAMM v1 Pools have a unique yield infrastructure where pools are built on top of the capital allocation layer. To the user, DAMM v1 Pools look similar to standard AMMs that uses the proven SPL-token swap. But underneath the hood, assets in the pools will be deposited directly into the Dynamic Vaults in the yield layer and USDC/SOL/USDT tokens get dynamically allocated to external lending protocols to generate yield and rewards, reducing the reliance on liquidity mining to attract liquidity. Overreliance on liquidity mining to attract LPs is unsustainable and can cause issues such as token inflation and short-term liquidity when LPs lose interest after the rewards end. Our Dynamic AMM Pools avoid this through effective capital allocation mechanisms of the idle assets to earn yield for the LPs. This allows LPs to receive yield from a few different places — the lending interest, the liquidity mining rewards collected from the platforms, the AMM trading fees, and Meteora liquidity mining rewards (when available). [​](https://docs.meteora.ag/overview/products/damm-v1/1-what-is-damm-v1#permanently-lock-liquidity-and-claim-fees-from-locked-liquidity) Permanently lock liquidity and claim fees from locked liquidity =========================================================================================================================================================================================================== Moreover, LPs can choose to permanently lock their liquidity on Dynamic AMM Pool to raise community confidence, while continuing to earn and claim fees from this locked liquidity. This helps to create a more sustainable and long-term liquidity provision for the ecosystem that prioritizes value creation and attracts committed LPs. To cater to memecoin launches, Memecoin Pools (a subset of Dynamic AMM Pools) have a dynamic fee, which ranges from 0.15%-15% and is set by the protocol. This fee may be changed by the protocol over time to optimize for different launches and market conditions. Memecoin Pool LPs also earn lending yield from the locked SOL and USDC liquidity in the pool. **Additional info:** Compare between DLMM, DAMM v1, and DAMM v2 [here](https://docs.google.com/spreadsheets/d/1-W2KE2PT18lmWKF6kB-7aolUBk2e5QvETL3D7g3F_VE/edit?usp=sharing) . Was this page helpful? YesNo [Previous](https://docs.meteora.ag/overview/products/dlmm/5-dlmm-farming-rewards) [LP Fee and APY Calculation\ \ Next](https://docs.meteora.ag/overview/products/damm-v1/2-lp-fee-and-apy-calculation) On this page * [Earn additional yield by utilizing lending sources](https://docs.meteora.ag/overview/products/damm-v1/1-what-is-damm-v1#earn-additional-yield-by-utilizing-lending-sources) * [Permanently lock liquidity and claim fees from locked liquidity](https://docs.meteora.ag/overview/products/damm-v1/1-what-is-damm-v1#permanently-lock-liquidity-and-claim-fees-from-locked-liquidity) Assistant Responses are generated using AI and may contain mistakes. --- # Stable Pools - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DAMM v1 Stable Pools [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [​](https://docs.meteora.ag/overview/products/damm-v1/3-stable-pools#how-do-damm-v1-stable-pools-work%3F) How do DAMM v1 Stable Pools work? ============================================================================================================================================== Meteora’s Dynamic AMM Stable Pools are AMMs utilizing the stable curve that support token prices from 0 to infinity. Stable Pools are suitable if both of your tokens are stable coins i.e. USDC-USDT, USDS-USDC. Using a Stable Pool helps ensure that the liquidity ratio between the token pair remains at 1:1. Stable Pools also share similar benefits with the volatile Dynamic AMM Pools. For example, Stable Pools compose on top of [Dynamic Vaults](https://docs.meteora.ag/overview/other-products/dynamic-vault/1-what-is-dynamic-vault) lending aggregator that rebalances funds (e.g. USDC/USDT/SOL) every minute across various external lending protocols e.g. Kamino, Save (Solend), and Marginfi to optimize yield and reduce risk. This added yield helps drive sustainable liquidity, as it is attractive for LPs to contribute liquidity in the pool even if trading fees are lower than usual or there is a lack of LM rewards. * Dynamic Stable Pools are concentrated, so they capture a lot more trading volume and fees. * Dynamic Stable Pools earn from lending the idle liquidity out to external lending protocols. * Dynamic Stable Pools do not require active LP management. You can set and forget it. Dynamic Stable Pools have the Stable tag on the UI. [​](https://docs.meteora.ag/overview/products/damm-v1/3-stable-pools#what-is-amp-in-a-damm-v1-stable-pool%3F) What is AMP in a DAMM v1 Stable Pool? ====================================================================================================================================================== The AMP (amplification) factor controls how concentrated the liquidity is in the stable pool, which relates to how far the ratio of 1:1 the assets will go before it starts to charge more for trades that further unbalance the ratio and charge less for trades that move the ratio of assets back to 1:1. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/overview/products/damm-v1/2-lp-fee-and-apy-calculation) [LST Pools\ \ Next](https://docs.meteora.ag/overview/products/damm-v1/4-lst-pools) On this page * [How do DAMM v1 Stable Pools work?](https://docs.meteora.ag/overview/products/damm-v1/3-stable-pools#how-do-damm-v1-stable-pools-work%3F) * [What is AMP in a DAMM v1 Stable Pool?](https://docs.meteora.ag/overview/products/damm-v1/3-stable-pools#what-is-amp-in-a-damm-v1-stable-pool%3F) Assistant Responses are generated using AI and may contain mistakes. --- # LST Pools - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DAMM v1 LST Pools [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) With Dynamic LST Pools, we aim to greatly enhance the options for both LST creators, liquidity providers, and users to grow liquidity and promote the adoption of liquid staking tokens on Solana. Growing LST adoption has the potential to solve some of the major blockers in Solana DeFi. There is ~$9.5B worth of capital (383M SOL) in directly staked SOL with less than 3% in LSTs. Growing LST adoption would help unlock that capital and put it to work in Solana DeFi dramatically increasing liquidity, volume, and the number of tradable assets. [​](https://docs.meteora.ag/overview/products/damm-v1/4-lst-pools#what-are-damm-v1-lst-pools%3F) What are DAMM v1 LST pools? =============================================================================================================================== The price of LSTs is constantly increasing with respect to the staked token as staking rewards get distributed every epoch. This price increase leads to impermanent loss (IL) for LPs in any xSOL/SOL pool. Our Dynamic LST pools are stable and mitigate IL from this price increase by continually tracking the price of an xSOL token directly from the LST’s on-chain program. By avoiding the use of price oracles, we remove a dependency and a potential exploit vector. [​](https://docs.meteora.ag/overview/products/damm-v1/4-lst-pools#how-does-it-work%3F) How does it work? =========================================================================================================== For liquidity providers (LPs), this means you can deposit and withdraw at any time without having to worry about IL or whether the APY you are earning is enough to offset the IL. Additionally, our Dynamic LST Pools utilize the stable curve AMM model in order to concentrate the liquidity to offer low-slippage trades and increase the volume capture from swap aggregators like Jupiter. LPs benefit from the increased volume with better revenue from fees. And unlike concentrated liquidity automated market makers (CLMMs), an LP does not have to constantly manage their liquidity positions. A major problem for growing liquidity for any token is an overreliance on farming rewards. Often times it means having to utilize aggressive token emissions or maintain farming rewards over a longer period of time to maintain a certain level of liquidity. You generally see this if trading fees cannot support the liquidity depth in an AMM pool. Our Dynamic LST Pools utilize Meteora’s Dynamic Vaults to provide a more sustainable way to grow and retain liquidity by lending out the idle capital in the pool to earn an additional yield. This allows LPs to continuously earn lending yield even when trading volume dips or farming rewards end. [​](https://docs.meteora.ag/overview/products/damm-v1/4-lst-pools#so-what-does-this-mean-for-liquid-staking-protocols%3F) So what does this mean for liquid staking protocols? ================================================================================================================================================================================= Our Dynamic LST Pools powered by [Dynamic Vaults](https://docs.meteora.ag/overview/other-products/dynamic-vault/1-what-is-dynamic-vault) offer a more sustainable way to grow liquidity for your LST. You are less reliant on farming rewards to grow your liquidity and LPs are less likely to leave when your farming rewards end. Additionally, you’ll be able to support a deeper liquidity depth than your volume/fees may currently allow. This can be crucially important in the early days when you are looking to build up the trading volumes for your LST. We’ve been working hard to support our partners Marinade Finance, Jito Labs, and SolBlaze in helping them achieve their specific goals for their LST pools and will be providing that same level of support for any project that wants to launch a Dynamic LST Pool with us. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/overview/products/damm-v1/3-stable-pools) [Pools with Farms\ \ Next](https://docs.meteora.ag/overview/products/damm-v1/5-pools-with-farms) On this page * [What are DAMM v1 LST pools?](https://docs.meteora.ag/overview/products/damm-v1/4-lst-pools#what-are-damm-v1-lst-pools%3F) * [How does it work?](https://docs.meteora.ag/overview/products/damm-v1/4-lst-pools#how-does-it-work%3F) * [So what does this mean for liquid staking protocols?](https://docs.meteora.ag/overview/products/damm-v1/4-lst-pools#so-what-does-this-mean-for-liquid-staking-protocols%3F) Assistant Responses are generated using AI and may contain mistakes. --- # Pools with Farms - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DAMM v1 Pools with Farms [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Our farming program for Dynamic AMM (DAMM v1) Pools allows Liquidity Providers, who deposit in Meteora pools, to stake LP token to earn rewards. Rewards come from partners with a maximum of 2 reward tokens for a farming pool. There can be multiple farming pools for a Meteora pool. Farmers should notice on APR and Expiration before staking LP token to a farming pool. Here are steps to integrate with the farming program: Stake ----- Deposit into a Meteora pool to receive LP tokens, which represent your share in the pool. Then, stake your LP tokens in a farming pool to start earning rewards. Claim ----- If you have staked LP tokens in a farming pool, you can claim up to two different reward tokens provided by the pool at any time. Unstake ------- To withdraw from a Meteora pool, first unstake your LP tokens from the farming pool. Once unstaked, you can withdraw your liquidity from the Meteora pool as usual. [​](https://docs.meteora.ag/overview/products/damm-v1/5-pools-with-farms#how-do-i-create-a-new-farm%3F) How do I create a new farm? ====================================================================================================================================== Farms are permissioned. You can ⁠[🎫|open-a-ticket](https://discord.com/channels/841152225564950528/1200395730758668318) and the team can help create one for you. We need the following info: 1. Link to the pool you want to create a farm for 2. Token mint address for the reward token you want to give. You can specify up to two types of tokens (optional). 3. Duration the farm will run. We recommend 4 weeks. Whenever you add rewards it resets the farm duration. So for a 4 week farm, if you upload rewards at week 2, it will reset and distribute whatever rewards in the farm for 4 more weeks. 4. A wallet address for us to whitelist. This wallet will be able to load the farming rewards into a Dynamic AMM Farm, using our farm admin dashboard (link will be given to you). 5. Once rewards are added into the farm, they cannot be removed. Sometimes, at the end of the farm period, there could be spare rewards remaining due to 0 LP stakers in the farm during the farm period. These remaining rewards can be linearly distributed again if you extend the farm period. [​](https://docs.meteora.ag/overview/products/damm-v1/5-pools-with-farms#for-dynamic-amm-farms) **For Dynamic AMM Farms** ---------------------------------------------------------------------------------------------------------------------------- * You can load rewards on your own using the farm admin dashboard that we will provide or via the [farming ts-sdk](https://github.com/MeteoraAg/reward-pool) . [​](https://docs.meteora.ag/overview/products/damm-v1/5-pools-with-farms#for-dlmm-farms) **For DLMM farms** -------------------------------------------------------------------------------------------------------------- * Meteora has to load the farming rewards on your behalf, so you have to send the rewards to us first. * Then create the pool, add liquidity, and we can load the farming rewards. * For now, not possible to start the farm at the exact same time as the pool. * For more info on how rewards are distributed on DLMM farms, please read this page on [DLMM Farming Rewards](https://docs.meteora.ag/overview/products/dlmm/5-dlmm-farming-rewards) . Was this page helpful? YesNo [Previous](https://docs.meteora.ag/overview/products/damm-v1/4-lst-pools) [Additional Yield From Dynamic Vaults\ \ Next](https://docs.meteora.ag/overview/products/damm-v1/6-additional-yield-from-dynamic-vaults) On this page * [How do I create a new farm?](https://docs.meteora.ag/overview/products/damm-v1/5-pools-with-farms#how-do-i-create-a-new-farm%3F) * [For Dynamic AMM Farms](https://docs.meteora.ag/overview/products/damm-v1/5-pools-with-farms#for-dynamic-amm-farms) * [For DLMM farms](https://docs.meteora.ag/overview/products/damm-v1/5-pools-with-farms#for-dlmm-farms) Assistant Responses are generated using AI and may contain mistakes. --- # DLMM Concepts - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DLMM DLMM Concepts [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [​](https://docs.meteora.ag/overview/products/dlmm/2-dlmm-concepts#concentrated-liquidity) Concentrated Liquidity ==================================================================================================================== With DLMM, LPs can provide liquidity within a specified price range, also known as concentrated liquidity. This is especially useful for token pairs where trades happen within a tight range, such as USDC/USDT where trades usually happen around $0.99 - $1.01. Often, liquidity outside of this range is untouched and LPs do not earn fees. By concentrating all liquidity within the price range of $0.99 - $1.01, LPs will be able to optimize their trading fees earned. All bins except for the active one contain just one type of token (X or Y) because they have been depleted or waiting to be used. Only the active bin earns trading fees. [​](https://docs.meteora.ag/overview/products/dlmm/2-dlmm-concepts#dlmm-bin-structure) DLMM Bin Structure ============================================================================================================ [​](https://docs.meteora.ag/overview/products/dlmm/2-dlmm-concepts#bin-price) Bin Price ------------------------------------------------------------------------------------------ Liquidity is distributed across discrete bins with a fixed width and fixed price. Within each bin, liquidity can be exchanged at a fixed price using the formula X+Y\=kX + Y = kX+Y\=k within each bin. Basically, you add X tokens and take out Y tokens (or vice versa), until there is only one type of token left. Each bin represents a single price point, and the difference between 2 consecutive bins is the **bin step**. Bin steps are calculated based on the basis points set by the pool creator. **Example:** Taking SOL/USDC, if the current price is $20 and the bin step is 25 basis points (0.25%), then the consecutive bins would be: * Bin 1: $20.00 * Bin 2: $20.00 × 1.0025 = $20.05 * Bin 3: $20.05 × 1.0025 = $20.10 * And so on… Liquidity pools are identified by their tuple of pooled assets: **(Token X, Token Y, Bin Step S)** [​](https://docs.meteora.ag/overview/products/dlmm/2-dlmm-concepts#bin-liquidity) Bin Liquidity -------------------------------------------------------------------------------------------------- Liquidity in each bin is calculated using the constant sum price variant: P⋅x+y\=LP \\cdot x + y = L P⋅x+y\=L Where: * **x** = quantity of token X * **y** = quantity of token Y * **L** = amount of liquidity in the bin * **P = Δy/Δx** = price constant unique to each pool **P** is defined as the rate of change of Y reserves per change in X reserves, and represents the price constant unique to each pool. ![Bin Liquidity](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/overview/products/dlmm/bin-liquidity.png) [​](https://docs.meteora.ag/overview/products/dlmm/2-dlmm-concepts#bin-composition) Bin Composition ------------------------------------------------------------------------------------------------------ **Key Points:** * All bins except for the active one contain just one type of token (X or Y) because they have been depleted or are waiting to be used * Only the active bin earns trading fees * **P** represents the slope of the line and remains consistently uniform within every bin In contrast to the constant product formula that you might be familiar with from other AMMs, the price is independent of the reserve amounts of both X and Y. In constant product AMMs, this relationship is calculated by y\=P/xy = P/xy\=P/x. Since the composition of reserves (x and y) are independent of both price and liquidity, an additional variable is used to describe the reserves available in the bin. This variable, **composition factor c**, is the percentage of bin liquidity composed of token Y: c\=yLc = \\frac{y}{L} c\=Ly​ From this equation, we can derive x and y: y\=c⋅Ly = c \\cdot L y\=c⋅L x\=LP⋅(1−c)x = \\frac{L}{P} \\cdot (1 - c) x\=PL​⋅(1−c) [​](https://docs.meteora.ag/overview/products/dlmm/2-dlmm-concepts#market-aggregation) Market Aggregation ============================================================================================================ The constant sum curve intercepts both the x and y axes, meaning that the reserves of X or Y token can be depleted. When this happens, the current price moves to the next bin either on the left or right. [​](https://docs.meteora.ag/overview/products/dlmm/2-dlmm-concepts#active-price-bin) Active Price Bin -------------------------------------------------------------------------------------------------------- The **active price bin** is defined as the bin that contains reserves of both X and Y tokens. **Important:** There can only be one active bin at any point in time. * All bins to the **left** of the active bin contain only **token Y** * All bins to the **right** of the active bin contain only **token X** ![Market Aggregation](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/overview/products/dlmm/market-aggregation.png) [​](https://docs.meteora.ag/overview/products/dlmm/2-dlmm-concepts#practical-example) Practical Example ---------------------------------------------------------------------------------------------------------- Consider a SOL/USDC pool where: * Asset Y = USDC * Asset X = SOL * Price P = amount of USDC per SOL If we define the $100 SOL bin as the active bin: * All bins to the left contain only USDC * All bins to the right contain only SOL * When there is significant demand for SOL, the active bin shifts to the right as the SOL reserves in the $100 bin get exhausted Was this page helpful? YesNo [Previous](https://docs.meteora.ag/overview/products/dlmm/1-what-is-dlmm) [Strategies and Use Cases\ \ Next](https://docs.meteora.ag/overview/products/dlmm/3-strategies-and-use-cases) On this page * [Concentrated Liquidity](https://docs.meteora.ag/overview/products/dlmm/2-dlmm-concepts#concentrated-liquidity) * [DLMM Bin Structure](https://docs.meteora.ag/overview/products/dlmm/2-dlmm-concepts#dlmm-bin-structure) * [Bin Price](https://docs.meteora.ag/overview/products/dlmm/2-dlmm-concepts#bin-price) * [Bin Liquidity](https://docs.meteora.ag/overview/products/dlmm/2-dlmm-concepts#bin-liquidity) * [Bin Composition](https://docs.meteora.ag/overview/products/dlmm/2-dlmm-concepts#bin-composition) * [Market Aggregation](https://docs.meteora.ag/overview/products/dlmm/2-dlmm-concepts#market-aggregation) * [Active Price Bin](https://docs.meteora.ag/overview/products/dlmm/2-dlmm-concepts#active-price-bin) * [Practical Example](https://docs.meteora.ag/overview/products/dlmm/2-dlmm-concepts#practical-example) Assistant Responses are generated using AI and may contain mistakes. --- # DLMM Farming Rewards - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DLMM DLMM Farming Rewards [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) DLMM farming rewards work differently from farms for Dynamic Pools. There are no LP tokens to stake into a farm. You start earning DLMM farming rewards once you deposit liquidity in a price range that covers the active bin. [​](https://docs.meteora.ag/overview/products/dlmm/5-dlmm-farming-rewards#how-are-rewards-distributed%3F) How are rewards distributed? ========================================================================================================================================= Rewards are distributed to the liquidity position in the active bin. But if swaps cause the price to move to a different active bin, rewards are distributed equally between bins crossed. For example, during a swap, active price moves from A -> C, but B is also within the range of active liquidity for the LP. Rewards will be equally distributed to the bins crossed for price points A, B, C. Your share of rewards: The proportion of rewards you get as an LP is based on your share of the liquidity position in the active bin and the bins crossed during swaps. The greater your share, the more rewards you get. Basically, only your liquidity that earns fees will earn farming rewards, so you won’t get any rewards if your position is out of range and not active. No rewards will be distributed to the bin if it has 0 liquidity. [​](https://docs.meteora.ag/overview/products/dlmm/5-dlmm-farming-rewards#is-the-rate-of-reward-distribution-linear%3F) Is the rate of reward distribution linear? ===================================================================================================================================================================== Yes, rewards are distributed at a fixed rate per second. For example, if there are 50,000 USDC in total farm rewards over 4 weeks (~28 days), rewards are distributed at 0.020667 USDC per second. This is distributed to positions in the active bin and in bins crossed when the active bin changes. [​](https://docs.meteora.ag/overview/products/dlmm/5-dlmm-farming-rewards#what-happens-if-there-is-no-active-liquidity%3F) What happens if there is no active liquidity? =========================================================================================================================================================================== If there’s no liquidity in the active bin, rewards will accumulate and not be distributed. Using the same example above (50,000 USDC in total rewards at 0.020667 USDC per second), if there’s no active liquidity for 10 days, total undistributed farming rewards will be ~17,856.288 USDC. [​](https://docs.meteora.ag/overview/products/dlmm/5-dlmm-farming-rewards#how-are-rewards-paid-out%3F) How are rewards paid out? =================================================================================================================================== You’d have to claim farming rewards manually. [​](https://docs.meteora.ag/overview/products/dlmm/5-dlmm-farming-rewards#do-the-rewards-compound%3F) Do the rewards compound? ================================================================================================================================= No, rewards are not compounded. [​](https://docs.meteora.ag/overview/products/dlmm/5-dlmm-farming-rewards#example) Example --------------------------------------------------------------------------------------------- Let’s walk through a step-by-step example of how DLMM farming rewards are distributed. **Total Rewards:** 50,000 USDC over 4 weeks (~28 days) **Daily Rewards:** 1,785.71 USDC per day **Reward Rate:** 0.020667 USDC per second **Starting Active Bin:** 0 * * * ### [​](https://docs.meteora.ag/overview/products/dlmm/5-dlmm-farming-rewards#timeline) **Timeline** | Time | Event | Bin 0 Supply | Bin 1 Supply | Notes | | --- | --- | --- | --- | --- | | 00:00 | **Position A** deposits **70** in bin 0 | 70 | 0 | | | 00:05 | **Position B** deposits **30** in bin 0
**Position C** deposits **100** in bin 1 | 100 | 100 | | | 00:10 | **Swap:** Active bin moves to bin 1 | 100 | 100 | Rewards are split
between bins 0 and 1 | * * * ### [​](https://docs.meteora.ag/overview/products/dlmm/5-dlmm-farming-rewards#reward-calculations) **Reward Calculations** #### [​](https://docs.meteora.ag/overview/products/dlmm/5-dlmm-farming-rewards#from-00%3A00-to-00%3A05-5-seconds) **From 00:00 to 00:05 (5 seconds)** * **Accumulated Reward:** `0.020667 USDC/sec * 5 sec = 0.103335 USDC` * **Who earns?** Only **Position A** (bin 0) * **Distribution:** * Position A: **0.103335 USDC** #### [​](https://docs.meteora.ag/overview/products/dlmm/5-dlmm-farming-rewards#from-00%3A05-to-00%3A10-5-seconds) **From 00:05 to 00:10 (5 seconds)** * **Accumulated Reward:** `0.020667 USDC/sec * 5 sec = 0.103335 USDC` * **Who earns?** Rewards are split equally between bins 0 and 1 (since the active bin moves during a swap) * **Reward per bin:** `0.103335 USDC / 2 = 0.0516675 USDC` per bin * **Bin 0 (Positions A & B):** * Position A: `0.0516675 * 70 / 100 = 0.03616725 USDC` * Position B: `0.0516675 * 30 / 100 = 0.01550025 USDC` * **Bin 1 (Position C):** * Position C: `0.0516675 * 100 / 100 = 0.0516675 USDC` * * * ### [​](https://docs.meteora.ag/overview/products/dlmm/5-dlmm-farming-rewards#summary) **Summary** | Position | 00:00 → 00:05 | 00:05 → 00:10 | **Total Reward** | | --- | --- | --- | --- | | **A** | 0.103335 | 0.03616725 | 0.13950225 | | **B** | — | 0.01550025 | 0.01550025 | | **C** | — | 0.0516675 | 0.0516675 | * * * **Key Points:** * Only active liquidity earns rewards. * When the active bin changes, rewards are split equally among all bins crossed, and then distributed proportionally to liquidity in each bin. * If a bin has no liquidity, it receives no rewards. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/overview/products/dlmm/4-dlmm-fee-calculation) [What's DAMM v1?Meteora's Dynamic Automated Market Maker v1 (DAMM v1) is a constant product AMM program integrated with Dynamic Vaults.\ \ Next](https://docs.meteora.ag/overview/products/damm-v1/1-what-is-damm-v1) On this page * [How are rewards distributed?](https://docs.meteora.ag/overview/products/dlmm/5-dlmm-farming-rewards#how-are-rewards-distributed%3F) * [Is the rate of reward distribution linear?](https://docs.meteora.ag/overview/products/dlmm/5-dlmm-farming-rewards#is-the-rate-of-reward-distribution-linear%3F) * [What happens if there is no active liquidity?](https://docs.meteora.ag/overview/products/dlmm/5-dlmm-farming-rewards#what-happens-if-there-is-no-active-liquidity%3F) * [How are rewards paid out?](https://docs.meteora.ag/overview/products/dlmm/5-dlmm-farming-rewards#how-are-rewards-paid-out%3F) * [Do the rewards compound?](https://docs.meteora.ag/overview/products/dlmm/5-dlmm-farming-rewards#do-the-rewards-compound%3F) * [Example](https://docs.meteora.ag/overview/products/dlmm/5-dlmm-farming-rewards#example) * [Timeline](https://docs.meteora.ag/overview/products/dlmm/5-dlmm-farming-rewards#timeline) * [Reward Calculations](https://docs.meteora.ag/overview/products/dlmm/5-dlmm-farming-rewards#reward-calculations) * [From 00:00 to 00:05 (5 seconds)](https://docs.meteora.ag/overview/products/dlmm/5-dlmm-farming-rewards#from-00%3A00-to-00%3A05-5-seconds) * [From 00:05 to 00:10 (5 seconds)](https://docs.meteora.ag/overview/products/dlmm/5-dlmm-farming-rewards#from-00%3A05-to-00%3A10-5-seconds) * [Summary](https://docs.meteora.ag/overview/products/dlmm/5-dlmm-farming-rewards#summary) Assistant Responses are generated using AI and may contain mistakes. --- # Create a DAMM v1 Launch Pool with Alpha Vault - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Alpha Vault Launch Pool Create a DAMM v1 Launch Pool with Alpha Vault [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Dynamic AMM Launch Pool is a special pool type designed for new token launches with a fixed fee percentage. It is based on Dynamic AMM v1 and comes fundamentally equipped with a feature set that makes it optimal for bootstrapping liquidity for new tokens and making the tokens accessible on Jupiter and other trading integrations. Dynamic AMM Launch Pools can also be created with an Alpha Vault as part of the token launch process. This is optional. Below we provide the steps to use Bun to configure and run sample scripts to conveniently set up a Dynamic AMM Launch Pool with Alpha Vault on your own. [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#getting-started) Getting Started -------------------------------------------------------------------------------------------------------------------------------------------------------- * Clone repo: [https://github.com/MeteoraAg/meteora-pool-setup](https://github.com/MeteoraAg/meteora-pool-setup) * Config list to reference: [https://github.com/MeteoraAg/meteora-pool-setup/tree/main/config](https://github.com/MeteoraAg/meteora-pool-setup/tree/main/config) * Readme: [https://github.com/MeteoraAg/meteora-pool-setup/blob/main/README.md](https://github.com/MeteoraAg/meteora-pool-setup/blob/main/README.md) * Alpha Vault SDK: [https://docs.meteora.ag/alpha-vault/alpha-vault-typescript-sdk](https://docs.meteora.ag/alpha-vault/alpha-vault-typescript-sdk) * Alpha Vault Launch Calculation template: Copy this google sheet and adjust the numbers to help determine your preferred parameters. * Devnet: [https://devnet.meteora.ag/](https://devnet.meteora.ag/) [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#dependencies) Dependencies -------------------------------------------------------------------------------------------------------------------------------------------------- Install Bun: You’ll also need bun to run the scripts. Install it via bun installation. Then install the dependencies by running the command `bun install` [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#scripts) Scripts ---------------------------------------------------------------------------------------------------------------------------------------- The following code examples can be used to initialize and seed a Dynamic AMM liquidity pool with an Alpha Vault on Meteora. Use these examples to create and manage vaults, handle deposits and withdrawals, manage permissioned and permissionless vault configurations, and interact with escrow accounts. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#1-create-dynamic-amm-pool-with-alpha-vault) 1\. Create Dynamic AMM Pool with Alpha Vault #### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#1-1-dynamic-amm-pool-with-alpha-vault-pro-rata-mode) 1.1 Dynamic AMM Pool with Alpha Vault Pro Rata mode Reference this example config: [https://github.com/MeteoraAg/meteora-pool-setup/blob/main/config/create\_dynamic\_amm\_pool\_with\_prorata\_alpha\_vault.json](https://github.com/MeteoraAg/meteora-pool-setup/blob/main/config/create_dynamic_amm_pool_with_prorata_alpha_vault.json) Change the parameters in the config according to your needs. Run the config after it has been updated with your parameters: Copy Ask AI bun run src/create_alpha_vault.ts --config ./config/create_dynamic_amm_pool_with_prorata_alpha_vault.json #### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#1-2-dynamic-amm-pool-with-alpha-vault-fcfs-first-come-first-served-mode) 1.2 Dynamic AMM Pool with Alpha Vault FCFS (First Come First Served) mode Reference this example config: [https://github.com/MeteoraAg/meteora-pool-setup/blob/main/config/create\_dynamic\_amm\_pool\_with\_fcfs\_alpha\_vault.json](https://github.com/MeteoraAg/meteora-pool-setup/blob/main/config/create_dynamic_amm_pool_with_fcfs_alpha_vault.json) Change the parameters in the config according to your needs. Run the config after it has been updated with your parameters: Copy Ask AI bun run src/create_alpha_vault.ts --config ./config/create_dynamic_amm_pool_with_fcfs_alpha_vault.json #### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#1-3-dynamic-amm-pool-with-alpha-vault-permissioned-with-authority-whitelist) 1.3 Dynamic AMM Pool with Alpha Vault (Permissioned with authority whitelist) Reference this example config: [https://github.com/MeteoraAg/meteora-pool-setup/blob/main/config/create\_dynamic\_amm\_pool\_with\_permissioned\_authority\_vault.json](https://github.com/MeteoraAg/meteora-pool-setup/blob/main/config/create_dynamic_amm_pool_with_permissioned_authority_vault.json) Change the parameters in the config according to your needs. Run the config after it has been updated with your parameters: Copy Ask AI bun run src/create_alpha_vault.ts --config ./config/create_dynamic_amm_pool_with_permissioned_authority_vault.json ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#2-alpha-vault-with-whitelist) 2\. Alpha Vault with Whitelist For some launches, the project may want to restrict which wallet addresses are allowed to deposit funds into the Alpha Vault, so in the config file used in the script to create the Alpha Vault, the whitelistMode needs to be specified. #### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#whitelist-modes) Whitelist Modes * **permissionless**: No whitelist, anyone can deposit into the Alpha Vault * **permission\_with\_authority**: In this mode, only the Alpha Vault creator can create escrow account with max\_cap. This allows the creator to use a permissioned (with whitelist) setup without having to use the merkle tree. Creator needs to pay SOL rent for each escrow account for the whitelisted wallets, so this Alpha Vault whitelist mode is suitable for scenarios where there are very few whitelisted addresses (e.g. ≤100). If they need to support a lot more whitelisted addresses, they should still use the merkle tree (PermissionWithMerkleProof whitelist mode). * **permission\_with\_merkle\_proof**: In this mode, only wallets that are whitelisted can deposit into the Alpha Vault. CSV file containing the list of whitelisted wallets needs to be provided by the project to Meteora, for the Merkle proof to be hosted by Meteora and shown on the UI. Alpha Vault deposits should not open until the Merkle proof is hosted by Meteora. **Important Notes:** * If you do not want to use Alpha Vault, you can just Create a Dynamic AMM Pool. * Currently, only SOL or USDC is accepted as the quote token when initializing a Dynamic AMM or DLMM Pool with Alpha Vault in a permissionless setup. Since the Alpha Vault can’t tell what the quote token would be, the quote token is limited to SOL or USDC. However, any quote token can be used if you use a config key that doesn’t have Alpha Vault. * If you plan to use a multisig on the Meteora website, please make sure it is the SquadsX multisig, as that is the only type supported on Meteora website. Otherwise, you can’t manage liquidity through the website. * There must be a ~1 hour 5 minutes period between the deposit close time and the pool activation time. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#3-timing-configuration) 3\. Timing Configuration **Crank start point (time when vault buys tokens from the pool):** * Timestamp-based Crank start point = activationPoint - 3600 * Slot-based Crank start point = activationPoint - 9000 **Vault deposit close point (time when vault deposits close):** * Timestamp-based Vault, Deposit close point = Crank start point - 5 min * Slot-based Vault, Deposit close point = Crank start point - 750 ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#after-deployment) After deployment To view pool on the UI, access the link below For Dynamic AMM pool: [https://app.meteora.ag/pools/\`POOL\_ADDRESS\`](https://app.meteora.ag/pools/%60POOL_ADDRESS%60) ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#when-can-you-withdraw-tokens-from-the-pool%3F) When can you withdraw tokens from the pool? CustomizablePermissionless Dynamic AMM: After pool activation point (trading starts) [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#other-configuration-details) Other Configuration Details -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- There are various config files that can be found in the config directory. It contains all the configurations required to run the scripts. We also need to provide the keypair for the payer wallet in keypair.json file. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#general-configuration) General configuration * `rpcUrl`: Solana RPC URL to get data and send transactions. * `keypairFilePath`: Keypair file path to send transactions. * `dryRun`: Set to true to send transactions. * `computeUnitPriceMicroLamports`: CU price in micro lamports unit. For example: 100000. * `createBaseToken`: Configuration to create base token. * `baseMint`: Base token address if the createBaseToken field is not set. * `quoteSymbol`: Quote token symbol, only SOL or USDC is supported. * `quoteMint`: Quote token mint, in case the user wants to create a DLMM launch pool with a token other than SOL or USDC. * `dynamicAmm`: Dynamic AMM pool configuration. * `alphaVault`: FCFS or Prorata Alpha Vault configuration. **Some configuration constraints:** * `createBaseToken` and `baseMint` cannot be used together. * `dynamicAmm` and `dlmm` cannot be used together. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#create-base-token-configuration) Create Base Token configuration * `mintBaseTokenAmount`: Base token amount to be minted. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#dynamic-amm-configuration) Dynamic AMM configuration * `baseAmount`: Base token amount. * `quoteAmount`: Quote token amount. * `tradeFeeNumerator`: Trade fee numerator, with fee denominator is set to 100\_000. * `activationType`: To activate pool trading based on slot or timestamp. * `activationPoint`: To activate pool trading at a point, either slot value or timestamp value based on activationType. * `hasAlphaVault`: Whether alpha vault is enabled or not for this pool. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#alpha-vault-configuration) Alpha Vault configuration * `poolType`: dynamic or dlmm pool type. * `alphaVaultType`: Alpha Vault type, could be fcfs or prorata * `depositingPoint`: Absolute value that, the slot or timestamp that allows deposit depend on the pool activation type. * `startVestingPoint`: Absolute value, the slot or timestamp that start vesting depend on the pool activation type. If no vesting is required, you should put this as 1 sec after the pool’s activationPoint * `endVestingPoint`: Absolute value, the slot or timestamp that end vesting depend on the pool activation type. If no vesting is required, this should be the same as startVestingPoint * `maxDepositCap`: Maximum deposit cap. * `individualDepositingCap`: Individual deposit cap. * `escrowFee`: Fee to create stake escrow account. If this fee is added, it will be a one-time fee charged when users create a stake escrow account. This acts as a tax and makes it prohibitively expensive for users to attempt to use multiple wallets to bypass the individual deposit cap. It’s charged in native SOL (non-wrapped version) and will be sent to the Meteora treasury. * `whitelistMode`: permissionless or permission\_with\_merkle\_proof or permission\_with\_authority. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#alpha-vault-prorata-configuration) Alpha Vault Prorata configuration * `depositingPoint`: Absolute value that, the slot or timestamp that allows deposit depend on the pool activation type. * `startVestingPoint`: Absolute value, the slot or timestamp that start vesting depend on the pool activation type. If no vesting is required, you should put this as 1 sec after the pool’s activationPoint * `endVestingPoint`: Absolute value, the slot or timestamp that end vesting depend on the pool activation type. If no vesting is required, this should be the same as startVestingPoint * `maxBuyingCap`: Maximum buying cap. * `escrowFee`: Fee to create stake escrow account. If this fee is added, it will be a one-time fee charged when users create a stake escrow account. This acts as a tax and makes it prohibitively expensive for users to attempt to use multiple wallets to bypass the individual deposit cap. It’s charged in native SOL (non-wrapped version) and will be sent to the Meteora treasury. * `whitelistMode`: permissionless or permission\_with\_merkle\_proof or permission\_with\_authority. [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#alpha-vault-key-components) Alpha Vault Key Components ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#vault-types) Vault Types Supports both permissionless (without whitelist) and permissioned (with whitelist) Alpha Vaults. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#whitelist-modes-2) Whitelist Modes **Without whitelist:** * Permissionless **With whitelist:** * PermissionWithMerkleProof * PermissionWithAuthority ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#alphavaulttype-vault-mode) alphaVaultType (Vault Mode) * **Pro-rata** * **FCFS (First-Come, First-Served)** ### [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#individual-deposit-cap) Individual Deposit Cap Global individual deposit cap without whitelist only possible on FCFS vault mode, not possible on Pro rata vault mode. [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#alpha-vault-typescript-sdk) Alpha Vault TypeScript SDK ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ After creating the Alpha Vault for your pool, check out the Alpha Vault SDK for different ways to interact with it. For example, depositing funds into the Alpha Vault, cranking the Alpha Vault to buy tokens from the pool, or claiming purchased tokens from the Alpha Vault. [​](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#for-testing-bun-scripts) For Testing Bun Scripts ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ First, run the localnet: Copy Ask AI bun run start-test-validator Then run the test: Copy Ask AI bun test Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/1-create-a-dlmm-launch-pool-with-alpha-vault) [Create a Stake2Earn v1 Pool with Alpha Vault\ \ Next](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/3-create-a-stake2earn-v1-launch-pool-with-alpha-vault) On this page * [Getting Started](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#getting-started) * [Dependencies](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#dependencies) * [Scripts](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#scripts) * [1\. Create Dynamic AMM Pool with Alpha Vault](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#1-create-dynamic-amm-pool-with-alpha-vault) * [1.1 Dynamic AMM Pool with Alpha Vault Pro Rata mode](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#1-1-dynamic-amm-pool-with-alpha-vault-pro-rata-mode) * [1.2 Dynamic AMM Pool with Alpha Vault FCFS (First Come First Served) mode](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#1-2-dynamic-amm-pool-with-alpha-vault-fcfs-first-come-first-served-mode) * [1.3 Dynamic AMM Pool with Alpha Vault (Permissioned with authority whitelist)](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#1-3-dynamic-amm-pool-with-alpha-vault-permissioned-with-authority-whitelist) * [2\. Alpha Vault with Whitelist](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#2-alpha-vault-with-whitelist) * [Whitelist Modes](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#whitelist-modes) * [3\. Timing Configuration](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#3-timing-configuration) * [After deployment](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#after-deployment) * [When can you withdraw tokens from the pool?](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#when-can-you-withdraw-tokens-from-the-pool%3F) * [Other Configuration Details](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#other-configuration-details) * [General configuration](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#general-configuration) * [Create Base Token configuration](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#create-base-token-configuration) * [Dynamic AMM configuration](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#dynamic-amm-configuration) * [Alpha Vault configuration](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#alpha-vault-configuration) * [Alpha Vault Prorata configuration](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#alpha-vault-prorata-configuration) * [Alpha Vault Key Components](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#alpha-vault-key-components) * [Vault Types](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#vault-types) * [Whitelist Modes](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#whitelist-modes-2) * [alphaVaultType (Vault Mode)](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#alphavaulttype-vault-mode) * [Individual Deposit Cap](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#individual-deposit-cap) * [Alpha Vault TypeScript SDK](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#alpha-vault-typescript-sdk) * [For Testing Bun Scripts](https://docs.meteora.ag/developer-guide/launch-pools/alpha-vault/2-create-a-damm-v1-launch-pool-with-alpha-vault#for-testing-bun-scripts) Assistant Responses are generated using AI and may contain mistakes. --- # LP Fee and APY Calculation - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DAMM v1 LP Fee and APY Calculation [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) In order to enhance transparency for our LPs concerning the APY associated with their deposited assets, we compute and display various information, for example: Liquidity Provider Fee, Protocol Fee, 365d Yield/TVL, and LM rewards APR. [​](https://docs.meteora.ag/overview/products/damm-v1/2-lp-fee-and-apy-calculation#liquidity-provider-fee) Liquidity Provider Fee ==================================================================================================================================== The amount of fees charged on each trade that goes to liquidity providers (LPs). [​](https://docs.meteora.ag/overview/products/damm-v1/2-lp-fee-and-apy-calculation#protocol-fee) Protocol Fee ================================================================================================================ The amount of fees charged on each trade that goes to the protocol. Protocol Fee is a % of the LP Fee. For our initial testing phase, Protocol Fee has been set as 20% of the LP Fee, for all volatile Dynamic AMM Pools. [​](https://docs.meteora.ag/overview/products/damm-v1/2-lp-fee-and-apy-calculation#base-apy) Base APY ======================================================================================================== The base APY offered is subject to variation and is based on the prevailing trading activity and yield obtained from lending platforms. The calculation of APY is contingent on the increase in virtual price over a specific time period. base APY\=((Virtual Price 2Virtual Price 1)1 yearTimeframe−1)×100\\text{base APY} = \\left(\\left(\\frac{\\text{Virtual Price 2}}{\\text{Virtual Price 1}}\\right)^{\\frac{1 \\text{ year}}{\\text{Timeframe}}} - 1\\right) \\times 100 base APY\=((Virtual Price 1Virtual Price 2​)Timeframe1 year​−1)×100 Where: * **Virtual Price 2**: Latest Virtual Price value * **Virtual Price 1**: Previous Virtual Price value in the last 24 Hours * **Timeframe**: Time difference between Virtual Price 1 and Virtual Price 2 (in seconds) > **Note**: The Virtual Price represents the value of your pool share and is determined by dividing the pool’s total value by the number of LP tokens (VP = pool\_value / LP token). The pool’s value rises as a result of a swap fee being charged on each trade or when assets deposited in lending pools generate lending yield. This increase in pool value corresponds to a rise in the Virtual Price. [​](https://docs.meteora.ag/overview/products/damm-v1/2-lp-fee-and-apy-calculation#365d-yield%2Ftvl) 365d Yield/TVL ====================================================================================================================== The ratio of the aggregate swap fees accrued over a 1-year period to the total liquidity available in the pool represents the efficiency metric that informs LPs which pool generates the most trading fees. This data empowers LPs with valuable insights into pool performance. 1 year fee/TVL\=24 hour fee×365Total Liquidity of pool\\text{1 year fee/TVL} = \\frac{\\text{24 hour fee} \\times 365}{\\text{Total Liquidity of pool}} 1 year fee/TVL\=Total Liquidity of pool24 hour fee×365​ Where: * 24 hour fee: Swap fee generated in the last 24 hour in $ * Total Liquidity of pool: Total value of the assets stored in the AMM pool in $ [​](https://docs.meteora.ag/overview/products/damm-v1/2-lp-fee-and-apy-calculation#liquidity-mining-lm-apr) Liquidity Mining (LM) APR ======================================================================================================================================== This refers to the APR that is calculated based on the rewards provided by the team or partner protocols through Liquidity Mining (LM), such as ABR, LDO rewards, etc. LM APR\=((1+Farm Reward per dayFarm TVL)365−1)×100\\text{LM APR} = \\left(\\left(1 + \\frac{\\text{Farm Reward per day}}{\\text{Farm TVL}}\\right)^{365} - 1\\right) \\times 100 LM APR\=((1+Farm TVLFarm Reward per day​)365−1)×100 Where: * **Farm reward per day**: Token reward per day × token reward USD rate * **Farm TVL**: (Pool LP staked / Pool LP supply) × Pool TVL * **Pool TVL**: Pool token A × token A USD rate + Pool token B × token B USD rate Was this page helpful? YesNo [Previous](https://docs.meteora.ag/overview/products/damm-v1/1-what-is-damm-v1) [Stable Pools\ \ Next](https://docs.meteora.ag/overview/products/damm-v1/3-stable-pools) On this page * [Liquidity Provider Fee](https://docs.meteora.ag/overview/products/damm-v1/2-lp-fee-and-apy-calculation#liquidity-provider-fee) * [Protocol Fee](https://docs.meteora.ag/overview/products/damm-v1/2-lp-fee-and-apy-calculation#protocol-fee) * [Base APY](https://docs.meteora.ag/overview/products/damm-v1/2-lp-fee-and-apy-calculation#base-apy) * [365d Yield/TVL](https://docs.meteora.ag/overview/products/damm-v1/2-lp-fee-and-apy-calculation#365d-yield%2Ftvl) * [Liquidity Mining (LM) APR](https://docs.meteora.ag/overview/products/damm-v1/2-lp-fee-and-apy-calculation#liquidity-mining-lm-apr) Assistant Responses are generated using AI and may contain mistakes. --- # Vault Quickstart - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Typescript SDK Vault Quickstart [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/3-vault-quickstart#quick-start-guide) Quick Start Guide ================================================================================================================================================ This is a devnet quickstart guide. [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/3-vault-quickstart#1-install-dynamic-vault-dependencies) 1\. Install Dynamic Vault Dependencies ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Copy Ask AI npm i @meteora-ag/vault-sdk @project-serum/anchor @solana/web3.js @solana/spl-token @solana/spl-token-registry [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/3-vault-quickstart#2-import-the-needed-libraries) 2\. Import the needed libraries -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Copy Ask AI import { StaticTokenListResolutionStrategy, TokenInfo } from "@solana/spl-token-registry"; import VaultImpl from '@meteora-ag/vault-sdk'; import { BN } from 'bn.js'; [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/3-vault-quickstart#3-set-up-the-connection%2C-wallet-and-provider-necessary-to-interact-with-the-network) 3\. Set up the connection, wallet and provider necessary to interact with the network ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Set up the devnet connection: Copy Ask AI const devnetConnection = new Connection('https://api.devnet.solana.com/', { commitment: 'confirmed' }); [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/3-vault-quickstart#4-airdrop-sol-into-the-devnet-wallet) 4\. Airdrop SOL into the devnet wallet ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- As this demo will be done using a devnet wallet, we can use the Solana airdrop function to deposit some initial SOL into the wallet. Define the SOL airdrop function as shown below. We have already included this function in the util.ts file for easy access and use: Copy Ask AI const airDropSol = async (connection: Connection, publicKey: PublicKey, amount = 1 * LAMPORTS_PER_SOL) => { try { const airdropSignature = await connection.requestAirdrop( publicKey, amount, ); const latestBlockHash = await connection.getLatestBlockhash(); await connection.confirmTransaction({ blockhash: latestBlockHash.blockhash, lastValidBlockHeight: latestBlockHash.lastValidBlockHeight, signature: airdropSignature, }); } catch (error) { console.error(error); throw error; } }; To trigger the airdrop to your devnet wallet, simply call the function with devnetConnection and your mockWallet public key as input parameters: Copy Ask AI // Airdrop to devnet wallet await airDropSol(devnetConnection, mockWallet.publicKey); [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/3-vault-quickstart#5-initialize-the-vault) 5\. Initialize the Vault ------------------------------------------------------------------------------------------------------------------------------------------------------------ Retrieve the token info required to initialize the vault instance. We use the SOL token as an example here: Copy Ask AI // Retrieve the token info for the vault (example: SOL) const tokenMap = new StaticTokenListResolutionStrategy().resolve(); const SOL_TOKEN_INFO = tokenMap.find(token => token.symbol === 'SOL') as TokenInfo; Set up the vault instance using the connection and the token info: Copy Ask AI // Getting a Vault Implementation instance (SOL) const vault: VaultImpl = await VaultImpl.create( devnetConnection, SOL_TOKEN_INFO, { cluster: 'devnet' } ); If you are an affiliate partner, you have to pass in an additional parameter - affiliateId when setting up the vault instance. The affiliateId is the partner wallet address that was used to set up the affiliate relationship with the Meteora Dynamic Yield layer: Copy Ask AI // Getting a Vault Implementation instance (SOL) const vaultImpl: VaultImpl = await VaultImpl.create( devnetConnection, SOL_TOKEN_INFO, { cluster: 'devnet', // Replace with your own Partner ID! affiliateId: new PublicKey('7236FoaWTXJyzbfFPZcrzg3tBpPhGiTgXsGWvjwrYfiF') } ); [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/3-vault-quickstart#6-get-key-data-from-the-vault-instance) 6\. Get key data from the vault instance -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Retrieve on-chain data from the vault and off-chain APY data from API. Key info includes total amount currently unlocked for user withdrawals, virtual price and the various strategies connected to the vault. The code for this can be found in getVaultDetails.ts: Copy Ask AI // Get on-chain data from the vault and off-chain data from the api export const getVaultDetails = async (vaultImpl: VaultImpl) => { //Get the total unlocked amount in vault that is withdrawable by users const vaultUnlockedAmount = (await vaultImpl.getWithdrawableAmount()).toNumber(); //Calculate virtual price using the vault's unlocked amount and lp supply const virtualPrice = (vaultUnlockedAmount / vaultImpl.lpSupply.toNumber()) || 0; // Get the off-chain data from API const URL = KEEPER_URL['devnet']; const vaultStateAPI: VaultStateAPI = await (await fetch(`${URL}/vault_state/${SOL_TOKEN_INFO.address}`)).json(); const totalAllocation = vaultStateAPI.strategies.reduce((acc, item) => acc + item.liquidity, vaultStateAPI.token_amount) return { lpSupply: (await vaultImpl.getVaultSupply()).toString(), withdrawableAmount: vaultUnlockedAmount, virtualPrice, usd_rate: vaultStateAPI.usd_rate, closest_apy: vaultStateAPI.closest_apy, // 1 hour average APY average_apy: vaultStateAPI.average_apy, // 24 hour average APY long_apy: vaultStateAPI.long_apy, // 7 day average APY earned_amount: vaultStateAPI.earned_amount, // total fees earned by vault virtual_price: vaultStateAPI.virtual_price, total_amount: vaultStateAPI.total_amount, total_amount_with_profit: vaultStateAPI.total_amount_with_profit, token_amount: vaultStateAPI.token_amount, fee_amount: vaultStateAPI.fee_amount, lp_supply: vaultStateAPI.lp_supply, strategyAllocation: vaultStateAPI.strategies .map(item => ({ name: item.strategy_name, liquidity: item.liquidity, allocation: ((item.liquidity / totalAllocation) * 100).toFixed(0), maxAllocation: item.max_allocation, })) .concat({ name: 'Vault Reserves', liquidity: vaultStateAPI.token_amount, allocation: ((vaultStateAPI.token_amount / totalAllocation) * 100).toFixed(0), maxAllocation: 0, }) .sort((a, b) => b.liquidity - a.liquidity), } } You can trigger the function and get the vault details via the following: Copy Ask AI const vaultDetails = await getVaultDetails(vault); console.log(vaultDetails); [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/3-vault-quickstart#7-to-deposit-tokens-into-the-vault) 7\. To deposit tokens into the vault ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ The steps below will allow you to deposit tokens into the vault by specifying the source wallet and the amount you want to deposit: Copy Ask AI // Deposits into the vault const depositAmount = 0.1; const depositTx = await vault.deposit(mockWallet.publicKey, new BN(depositAmount * 10 ** SOL_TOKEN_INFO.decimals)); // 0.1 SOL const depositResult = await provider.sendAndConfirm(depositTx); [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/3-vault-quickstart#8-to-withdraw-tokens-from-the-vault) 8\. To withdraw tokens from the vault -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- The steps below will allow you to withdraw tokens from the vault by specifying the destination wallet and the amount you want to withdraw from the vault: Copy Ask AI // Withdraw from the vault const withdrawAmount = 0.05; const withdrawTx = await vault.withdraw(mockWallet.publicKey, new BN(withdrawAmount * 10 ** SOL_TOKEN_INFO.decimals)); // 0.05 SOL const withdrawResult = await provider.sendAndConfirm(withdrawTx); // Transaction hash [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/3-vault-quickstart#9-retrieve-affiliate-partner-info-only-if-you-are-set-up-as-an-affiliate-partner) 9\. Retrieve affiliate partner info (only if you are set up as an affiliate partner) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- If you are an affiliate partner, you can retrieve information about the partner account: Copy Ask AI const partnerInfo = await vaultImpl.getAffiliateInfo(); console.log('Result:', { 'publicKey': mockWallet.publicKey.toString(), 'balance': (await vaultImpl.getUserBalance(mockWallet.publicKey)).toString(), 'Partner Token': partnerInfo.partnerToken.toString(), 'Vault': partnerInfo.vault.toString(), 'Total Fee': partnerInfo.totalFee.toString(), 'Fee Ratio': partnerInfo.feeRatio.toString(), 'Cumulative Fee': partnerInfo.cummulativeFee.toString(), }) Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions) [Rust IntegrationDynamic Vault\ \ Next](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/rust-sdk/1-rust-integration) On this page * [Quick Start Guide](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/3-vault-quickstart#quick-start-guide) * [1\. Install Dynamic Vault Dependencies](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/3-vault-quickstart#1-install-dynamic-vault-dependencies) * [2\. Import the needed libraries](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/3-vault-quickstart#2-import-the-needed-libraries) * [3\. Set up the connection, wallet and provider necessary to interact with the network](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/3-vault-quickstart#3-set-up-the-connection%2C-wallet-and-provider-necessary-to-interact-with-the-network) * [4\. Airdrop SOL into the devnet wallet](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/3-vault-quickstart#4-airdrop-sol-into-the-devnet-wallet) * [5\. Initialize the Vault](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/3-vault-quickstart#5-initialize-the-vault) * [6\. Get key data from the vault instance](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/3-vault-quickstart#6-get-key-data-from-the-vault-instance) * [7\. To deposit tokens into the vault](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/3-vault-quickstart#7-to-deposit-tokens-into-the-vault) * [8\. To withdraw tokens from the vault](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/3-vault-quickstart#8-to-withdraw-tokens-from-the-vault) * [9\. Retrieve affiliate partner info (only if you are set up as an affiliate partner)](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/3-vault-quickstart#9-retrieve-affiliate-partner-info-only-if-you-are-set-up-as-an-affiliate-partner) Assistant Responses are generated using AI and may contain mistakes. --- # Meteora Lock SDK Functions - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Typescript SDK Meteora Lock SDK Functions [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [​](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/2-meteora-lock-sdk-functions#core-functions) Core Functions --------------------------------------------------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/2-meteora-lock-sdk-functions#createvestingescrowv2) createVestingEscrowV2 Creates a vesting escrow. This function is a v2 function of `createVestingEscrow`. **Function** Copy Ask AI async createVestingEscrowV2(createVestingEscrowV2Params: CreateVestingEscrowParams): Promise **Parameters** Copy Ask AI interface CreateVestingEscrowParams { base: PublicKey; // The base address sender: PublicKey; // The sender address isSenderMultiSig: boolean; // Whether the sender is a multi-sig account payer: PublicKey; // The payer address tokenMint: PublicKey; // The token mint address vestingStartTime: BN; // The vesting start time cliffTime: BN; // The cliff time frequency: BN; // The frequency cliffUnlockAmount: BN; // The cliff unlock amount amountPerPeriod: BN; // The amount per period numberOfPeriod: BN; // The number of period recipient: PublicKey; // The recipient address updateRecipientMode: number; // The update recipient mode cancelMode: number; // The cancel mode tokenProgram: PublicKey; // The token program address } **Returns** A transaction that can be signed and sent to the network. **Example** Copy Ask AI const base = Keypair.generate(); const currentBlockTime = await getCurrentBlockTime(program.provider.connection); const cliffTime = new BN(currentBlockTime).add(new BN(5)); const transaction = await client.createVestingEscrowV2({ base: new PublicKey("base1234567890abcdefghijklmnopqrstuvwxyz"), sender: new PublicKey("sender1234567890abcdefghijklmnopqrstuvwxyz"), isSenderMultiSig: false, payer: new PublicKey("payer1234567890abcdefghijklmnopqrstuvwxyz"), tokenMint: new PublicKey("tokenMint1234567890abcdefghijklmnopqrstuvwxyz"), vestingStartTime: new BN(0), cliffTime, frequency: new BN(1), cliffUnlockAmount: new BN(100000), amountPerPeriod: new BN(50000), numberOfPeriod: new BN(2), recipient: new PublicKey("recipient1234567890abcdefghijklmnopqrstuvwxyz"), updateRecipientMode: UpdateRecipientMode.NONE, cancelMode: CancelMode.RECIPIENT_ONLY, tokenProgram: TOKEN_PROGRAM_ID, }); **Notes** * The `payer` and `feeVault` is required to sign the transaction. * `UserShare` is an array of objects with `address` and `share`. * Minimum: At least 2 users must be included * Maximum: No more than 5 users can be included * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/2-meteora-lock-sdk-functions#claimv2) claimV2 Claims the maximum amount from the vesting escrow. **Function** Copy Ask AI async claimV2(claimV2Params: ClaimParams): Promise **Parameters** Copy Ask AI interface ClaimParams { escrow: PublicKey; // The escrow address recipient: PublicKey; // The recipient address maxAmount: BN; // The maximum amount to claim payer: PublicKey; // The payer address } **Returns** A transaction that can be signed and sent to the network. **Example** Copy Ask AI const transaction = await client.claimV2({ escrow: new PublicKey("escrow1234567890abcdefghijklmnopqrstuvwxyz"), recipient: new PublicKey("recipient1234567890abcdefghijklmnopqrstuvwxyz"), maxAmount: new BN(1000000000000000000), payer: new PublicKey("payer1234567890abcdefghijklmnopqrstuvwxyz"), }); **Notes** * The `payer` and `recipient` is required to sign the transaction. * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/2-meteora-lock-sdk-functions#createvestingescrowmetadata) createVestingEscrowMetadata Creates a vesting escrow metadata. **Function** Copy Ask AI async createVestingEscrowMetadata(createVestingEscrowMetadataParams: CreateVestingEscrowMetadataParams): Promise **Parameters** Copy Ask AI interface ClaimParams { escrow: PublicKey; // The escrow address name: string; // The name of the vesting escrow description: string; // The description of the vesting escrow creatorEmail: string; // The email of the creator recipientEmail: string; // The email of the recipient creator: PublicKey; // The creator address payer: PublicKey; // The payer address } **Returns** A transaction that can be signed and sent to the network. **Example** Copy Ask AI const transaction = await client.claimV2({ escrow: new PublicKey("escrow1234567890abcdefghijklmnopqrstuvwxyz"), name: "Test Vesting Escrow", description: "This is a test vesting escrow", creatorEmail: "test@test.com", recipientEmail: "test@test.com", creator: new PublicKey("creator1234567890abcdefghijklmnopqrstuvwxyz"), payer: new PublicKey("payer1234567890abcdefghijklmnopqrstuvwxyz"), }); **Notes** * The `payer` and `creator` is required to sign the transaction. * * * [​](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/2-meteora-lock-sdk-functions#state-functions) State Functions ----------------------------------------------------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/2-meteora-lock-sdk-functions#getrootescrow) getRootEscrow Gets the root escrow. **Function** Copy Ask AI async getRootEscrow(rootEscrow: PublicKey): Promise **Parameters** Copy Ask AI rootEscrow: PublicKey; **Returns** A root escrow. **Example** Copy Ask AI const rootEscrow = await client.getRootEscrow( new PublicKey("rootEscrow1234567890abcdefghijklmnopqrstuvwxyz") ); **Notes** * Returns a `RootEscrow` object. * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/2-meteora-lock-sdk-functions#getescrow) getEscrow Gets the vesting escrow. Copy Ask AI async getEscrow(escrow: PublicKey): Promise **Parameters** Copy Ask AI escrow: PublicKey; **Returns** A vesting escrow. **Example** Copy Ask AI const escrow = await client.getEscrow( new PublicKey("escrow1234567890abcdefghijklmnopqrstuvwxyz") ); **Notes** * Returns a `Escrow` object. * * * [​](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/2-meteora-lock-sdk-functions#helper-functions) Helper Functions ------------------------------------------------------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/2-meteora-lock-sdk-functions#deriveescrow) deriveEscrow Derives the escrow address. **Function** Copy Ask AI async deriveEscrow(base: PublicKey): Promise **Parameters** Copy Ask AI base: PublicKey; **Returns** A escrow address. **Example** Copy Ask AI const escrow = await client.deriveEscrow( new PublicKey("base1234567890abcdefghijklmnopqrstuvwxyz") ); **Notes** * Returns an `Escrow` PDA. * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/2-meteora-lock-sdk-functions#deriveescrowmetadata) deriveEscrowMetadata Derives the escrow metadata address. **Function** Copy Ask AI async deriveEscrowMetadata(escrow: PublicKey): Promise **Parameters** Copy Ask AI escrow: PublicKey; **Returns** A escrow metadata address. **Example** Copy Ask AI const escrowMetadata = await client.deriveEscrowMetadata( new PublicKey("base1234567890abcdefghijklmnopqrstuvwxyz") ); **Notes** * Returns an `EscrowMetadata` PDA. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/1-getting-started) [Introduction\ \ Next](https://docs.meteora.ag/developer-guide/integrations/dynamic-fee-sharing/1-introduction) On this page * [Core Functions](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/2-meteora-lock-sdk-functions#core-functions) * [createVestingEscrowV2](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/2-meteora-lock-sdk-functions#createvestingescrowv2) * [claimV2](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/2-meteora-lock-sdk-functions#claimv2) * [createVestingEscrowMetadata](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/2-meteora-lock-sdk-functions#createvestingescrowmetadata) * [State Functions](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/2-meteora-lock-sdk-functions#state-functions) * [getRootEscrow](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/2-meteora-lock-sdk-functions#getrootescrow) * [getEscrow](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/2-meteora-lock-sdk-functions#getescrow) * [Helper Functions](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/2-meteora-lock-sdk-functions#helper-functions) * [deriveEscrow](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/2-meteora-lock-sdk-functions#deriveescrow) * [deriveEscrowMetadata](https://docs.meteora.ag/developer-guide/integrations/meteora-lock/typescript-sdk/2-meteora-lock-sdk-functions#deriveescrowmetadata) Assistant Responses are generated using AI and may contain mistakes. --- # Additional Yield From Dynamic Vaults - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DAMM v1 Additional Yield From Dynamic Vaults [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [​](https://docs.meteora.ag/overview/products/damm-v1/6-additional-yield-from-dynamic-vaults#what-are-dynamic-vaults%3F) What are Dynamic Vaults? ==================================================================================================================================================== [Dynamic Vaults](https://docs.meteora.ag/overview/other-products/dynamic-vault/1-what-is-dynamic-vault) operate as a lending aggregator that allocates capital across multiple lending protocols on Solana. We utilize an off-chain keeper called [Hermes](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-1-what-is-hermes) which constantly monitors all lending pools every minute and rebalances allocations to optimize yields and reduce risk. While there is risk in lending, our Dynamic Vaults [mitigate that risk](https://docs.meteora.ag/overview/other-products/dynamic-vault/4-risk-management) by constantly monitoring lending pool utilization rates and automatically withdrawing funds whenever risk thresholds are hit. Additionally, only a maximum of 30% is ever allocated to any single protocol. And our Dynamic Vaults have already been battle-tested with several real-life events: The USDC depeg in early March and the USDH exploit late last year. In both cases, Hermes was able to automatically detect and withdraw all funds safely. [​](https://docs.meteora.ag/overview/products/damm-v1/6-additional-yield-from-dynamic-vaults#additional-yield) Additional Yield ================================================================================================================================== For DAMM v1 Pools paired with USDC/SOL/USDT, a portion of unused USDC/SOL/USDT liquidity gets dynamically loaned out to external lending platforms (e.g. Kamino, Marginfi, Save (Solend)) to generate extra yield for LPs, via our Dynamic Vaults. This benefit applies to all Dynamic AMM Pools on Meteora that have USDC/SOL/USDT in the pair. * As such, a portion of USDC/SOL/USDT liquidity may be utilized in external lending platforms, while the rest remain in the Dynamic Vault Reserve to support sudden withdrawals by LPs. This can be viewed in the “Shared Vault Balance” of the pool account. * In an event where LPs have a liquidity position that is much larger than what is in the Dynamic Vault Reserve, and want to immediately withdraw all liquidity (that has USDC/SOL/USDT), they can withdraw liquidity in smaller sizes a few times or reach out to the team. * Yield earned from Dynamic Vaults is shown on the Dynamic AMM Pool UI as “24h Yield”. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/overview/products/damm-v1/5-pools-with-farms) [What's DAMM v2?Meteora's Dynamic Automated Market Maker v2 (DAMM v2) gives liquidity providers access to a constant-product AMM pool with precise liquidity concentration all in real time.\ \ Next](https://docs.meteora.ag/overview/products/damm-v2/1-what-is-damm-v2) On this page * [What are Dynamic Vaults?](https://docs.meteora.ag/overview/products/damm-v1/6-additional-yield-from-dynamic-vaults#what-are-dynamic-vaults%3F) * [Additional Yield](https://docs.meteora.ag/overview/products/damm-v1/6-additional-yield-from-dynamic-vaults#additional-yield) Assistant Responses are generated using AI and may contain mistakes. --- # DAMM v1 - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Audits DAMM v1 [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [​](https://docs.meteora.ag/resources/audits/2-damm-v1#offside-labs) Offside Labs ==================================================================================== ### [​](https://docs.meteora.ag/resources/audits/2-damm-v1#latest) Latest [Download Offside Labs Audit\ ---------------------------\ \ Download the Offside Labs audit report.](https://drive.google.com/uc?export=download&id=1jnU08lTPLA3XRio_2H6ZwKg9ItxUoCK-) ### [​](https://docs.meteora.ag/resources/audits/2-damm-v1#previous) Previous [Download Offside Labs Audit \[1\]\ ---------------------------------\ \ Download the Offside Labs \[1\] audit report.](https://drive.google.com/uc?export=download&id=1mBh2oDshmWxbxhGYCHKdw06KoZYgzgZh) [​](https://docs.meteora.ag/resources/audits/2-damm-v1#halborn) Halborn ========================================================================== [Download Halborn Audit\ ----------------------\ \ Download the Halborn audit report.](https://drive.google.com/uc?export=download&id=1YXNKC9lBA4ydgY9ccHWdWRQ2qHv8XMkJ) [​](https://docs.meteora.ag/resources/audits/2-damm-v1#oak) Oak ================================================================== [Download Oak Audit\ ------------------\ \ Download the Oak audit report.](https://drive.google.com/uc?export=download&id=1fa1a7b8HlDH9uFFCSrgMgZiUxd-tP71z) Was this page helpful? YesNo [Previous](https://docs.meteora.ag/resources/audits/1-dlmm) [DAMM v2\ \ Next](https://docs.meteora.ag/resources/audits/3-damm-v2) On this page * [Offside Labs](https://docs.meteora.ag/resources/audits/2-damm-v1#offside-labs) * [Latest](https://docs.meteora.ag/resources/audits/2-damm-v1#latest) * [Previous](https://docs.meteora.ag/resources/audits/2-damm-v1#previous) * [Halborn](https://docs.meteora.ag/resources/audits/2-damm-v1#halborn) * [Oak](https://docs.meteora.ag/resources/audits/2-damm-v1#oak) Assistant Responses are generated using AI and may contain mistakes. --- # DLMM - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Audits DLMM [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [​](https://docs.meteora.ag/resources/audits/1-dlmm#offside-labs) Offside Labs ================================================================================= ### [​](https://docs.meteora.ag/resources/audits/1-dlmm#latest) Latest [Download Offside Labs Audit\ ---------------------------\ \ Download the Offside Labs audit report.](https://drive.google.com/uc?export=download&id=1PJBsQKJoJ4PwGhWN6g5DoV7Gz0MZSkCT) ### [​](https://docs.meteora.ag/resources/audits/1-dlmm#previous) Previous [Download Offside Labs Audit \[1\]\ ---------------------------------\ \ Download the Offside Labs \[1\] audit report.](https://drive.google.com/uc?export=download&id=1bQyxugFKaWiMhejfhNaBTJcWxybQWQgy) [Download Offside Labs Audit \[2\]\ ---------------------------------\ \ Download the Offside Labs \[2\] audit report.](https://drive.google.com/uc?export=download&id=15lbr6RwqoNp2iN3er__jiu3iKACRZeqO) [​](https://docs.meteora.ag/resources/audits/1-dlmm#ottersec) OtterSec ========================================================================= ### [​](https://docs.meteora.ag/resources/audits/1-dlmm#latest-2) Latest [Download OtterSec Audit\ -----------------------\ \ Download the OtterSec audit report.](https://drive.google.com/uc?export=download&id=1hWCDNU13dfeXxiyowkBeAzslZBRI68Ca) ### [​](https://docs.meteora.ag/resources/audits/1-dlmm#previous-2) Previous [Download OtterSec Audit \[1\]\ -----------------------------\ \ Download the OtterSec \[1\] audit report.](https://drive.google.com/uc?export=download&id=1ahm0NN4Pj9zvjxoZ6GKSS020W7CZudxs) [​](https://docs.meteora.ag/resources/audits/1-dlmm#sec3) Sec3 ================================================================= ### [​](https://docs.meteora.ag/resources/audits/1-dlmm#latest-3) Latest [Download Sec3 Audit\ -------------------\ \ Download the Sec3 audit report.](https://drive.google.com/uc?export=download&id=1LWcc-DeE8mo0TscXY6A7Ac0RPpqto4Ik) Was this page helpful? YesNo [Previous](https://docs.meteora.ag/resources/miscellaneous/1-brand-kit) [DAMM v1\ \ Next](https://docs.meteora.ag/resources/audits/2-damm-v1) On this page * [Offside Labs](https://docs.meteora.ag/resources/audits/1-dlmm#offside-labs) * [Latest](https://docs.meteora.ag/resources/audits/1-dlmm#latest) * [Previous](https://docs.meteora.ag/resources/audits/1-dlmm#previous) * [OtterSec](https://docs.meteora.ag/resources/audits/1-dlmm#ottersec) * [Latest](https://docs.meteora.ag/resources/audits/1-dlmm#latest-2) * [Previous](https://docs.meteora.ag/resources/audits/1-dlmm#previous-2) * [Sec3](https://docs.meteora.ag/resources/audits/1-dlmm#sec3) * [Latest](https://docs.meteora.ag/resources/audits/1-dlmm#latest-3) Assistant Responses are generated using AI and may contain mistakes. --- # DAMM v2 - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Audits DAMM v2 [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [​](https://docs.meteora.ag/resources/audits/3-damm-v2#offside-labs) Offside Labs ==================================================================================== [Download Offside Labs Audit\ ---------------------------\ \ Download the Offside Labs audit report.](https://drive.google.com/uc?export=download&id=1Z5DsqWXQFU2CGSMUomyfOggVNxHV_ad1) [​](https://docs.meteora.ag/resources/audits/3-damm-v2#ottersec) OtterSec ============================================================================ [Download OtterSec Audit\ -----------------------\ \ Download the OtterSec audit report.](https://drive.google.com/uc?export=download&id=1yoUuiusKF2zv0el1EDzmpZ0WwIj02gxj) Was this page helpful? YesNo [Previous](https://docs.meteora.ag/resources/audits/2-damm-v1) [DBC\ \ Next](https://docs.meteora.ag/resources/audits/4-dbc) On this page * [Offside Labs](https://docs.meteora.ag/resources/audits/3-damm-v2#offside-labs) * [OtterSec](https://docs.meteora.ag/resources/audits/3-damm-v2#ottersec) Assistant Responses are generated using AI and may contain mistakes. --- # Pool Fees Calculation - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DAMM v2 Pool Fees Calculation [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) DAMM v2 LPs earn a swap fee from traders when they perform a swap. The fees can be collected in two ways: * Quote only * Quote + Base DAMM v2 fees are not compounded into the pool liquidity. [​](https://docs.meteora.ag/overview/products/damm-v2/2-pool-fees-calculation#total-trading-fee) Total Trading Fee ===================================================================================================================== The total swap fee (fsf\_sfs​) will have two components: 1. **A base fee** (fbf\_bfb​) 2. **A variable fee** (fvf\_vfv​) The **total swap fee** is calculated as: fs\=fb+fvf\_s = f\_b + f\_v fs​\=fb​+fv​ The variable fee (fvf\_vfv​) is a function of real-time price volatility. The fee rate will be applied to the swap amount in each liquidity bin and distributed proportionally to the LPs in that bin. LPs can claim these fees whenever they are available. [​](https://docs.meteora.ag/overview/products/damm-v2/2-pool-fees-calculation#base-fee) Base Fee --------------------------------------------------------------------------------------------------- The base fee of a pool can be configured by the pool creator in the following ways: * **Fixed Base Fee**: A fixed fee that is applied to the swap amount. * **Fee Scheduler**: A fee decay mechanism that decays the fee from a high starting fee to an ending fixed base fee over a period of time. The ending fee will be the fixed base fee of the pool after the fee scheduler is finished. * **Rate Limiter**: _Coming Soon_ You can only choose one of the three options for the base fee. ### [​](https://docs.meteora.ag/overview/products/damm-v2/2-pool-fees-calculation#fixed-base-fee) Fixed Base Fee Fixed base fee is a fixed fee that is applied to the swap amount. The fee can range from 0.01% to 50%. It is specified in the config key used for the pool creation. ### [​](https://docs.meteora.ag/overview/products/damm-v2/2-pool-fees-calculation#fee-scheduler) Fee Scheduler Fee scheduler is a fee decay mechanism that decays the fee from a high starting fee to an ending base fee over time. The fee math calculation for the scheduler can be found [here](https://docs.meteora.ag/anti-sniper-suite/fee-scheduler/2-fee-scheduler-math) . [​](https://docs.meteora.ag/overview/products/damm-v2/2-pool-fees-calculation#dynamic-fee-variable-fee) Dynamic Fee (Variable Fee) ------------------------------------------------------------------------------------------------------------------------------------- The variable fee is the core of the dynamic fee mechanism. It increases with market volatility. fv\=(va×s)2×C/100000000000f\_v = (v\_a \\times s)^2 \\times C / 100000000000 fv​\=(va​×s)2×C/100000000000 where: * **Volatility Accumulator** (vav\_ava​): A measure of recent price volatility * **Bin Step** (sss): A parameter that defines the price granularity for measuring volatility * **Variable Fee Control** (CCC): A parameter to control the magnitude of the variable fee ### [​](https://docs.meteora.ag/overview/products/damm-v2/2-pool-fees-calculation#volatility-accumulator) Volatility Accumulator The Volatility Accumulator tracks price movements. It’s updated with every swap. va\=min⁡(vmax,vr+Δp×10000)v\_a = \\min(v\_{max}, v\_r + \\Delta p \\times 10000) va​\=min(vmax​,vr​+Δp×10000) where: * **Max Volatility Accumulator** (vmaxv\_{max}vmax​): A cap on the volatility measure to prevent fees from becoming excessively high * **Volatility Reference** (vrv\_rvr​): A decayed value of the volatility accumulator * **Price Change** (Δp\\Delta pΔp): The price change since the last reference update, measured in “bins” #### [​](https://docs.meteora.ag/overview/products/damm-v2/2-pool-fees-calculation#price-change) Price Change The price change is calculated based on the change in the square root of the price. Δp\=(pc/pr−1)/s×2\\Delta p = (\\sqrt{p\_c / p\_r} - 1) / s \\times 2 Δp\=(pc​/pr​​−1)/s×2 where pcp\_cpc​ is current price and prp\_rpr​ is reference price. #### [​](https://docs.meteora.ag/overview/products/damm-v2/2-pool-fees-calculation#volatility-reference) Volatility Reference To ensure that the dynamic fee reflects recent volatility, the Volatility Reference decays over time. vr\=va×R/10000v\_r = v\_a \\times R / 10000 vr​\=va​×R/10000 The decay mechanism is based on the time elapsed since the last significant trade: * If elapsed time < filter period: No change. This ignores very high-frequency trades. * If filter period ≤ elapsed time < decay period: The volatility reference is reduced. * If elapsed time ≥ decay period: The volatility reference is reset to 0. This happens if there are no significant trades for an extended period. [​](https://docs.meteora.ag/overview/products/damm-v2/2-pool-fees-calculation#max-dynamic-fee-on-damm-v2) Max Dynamic Fee on DAMM v2 ======================================================================================================================================= Currently, the max dynamic fee on DAMM v2 is less than or equals to 20% of the Base Fee. **Example:** * Base Fee = 1% * Dynamic Fee = 0.2% * Total Trading/LP Fee = 1.2% Was this page helpful? YesNo [Previous](https://docs.meteora.ag/overview/products/damm-v2/1-what-is-damm-v2) [What's DBC?Dynamic Bonding Curve (DBC) is a universal virtual curve that allows you to create tokens with unique price dynamics.\ \ Next](https://docs.meteora.ag/overview/products/dbc/1-what-is-dbc) On this page * [Total Trading Fee](https://docs.meteora.ag/overview/products/damm-v2/2-pool-fees-calculation#total-trading-fee) * [Base Fee](https://docs.meteora.ag/overview/products/damm-v2/2-pool-fees-calculation#base-fee) * [Fixed Base Fee](https://docs.meteora.ag/overview/products/damm-v2/2-pool-fees-calculation#fixed-base-fee) * [Fee Scheduler](https://docs.meteora.ag/overview/products/damm-v2/2-pool-fees-calculation#fee-scheduler) * [Dynamic Fee (Variable Fee)](https://docs.meteora.ag/overview/products/damm-v2/2-pool-fees-calculation#dynamic-fee-variable-fee) * [Volatility Accumulator](https://docs.meteora.ag/overview/products/damm-v2/2-pool-fees-calculation#volatility-accumulator) * [Price Change](https://docs.meteora.ag/overview/products/damm-v2/2-pool-fees-calculation#price-change) * [Volatility Reference](https://docs.meteora.ag/overview/products/damm-v2/2-pool-fees-calculation#volatility-reference) * [Max Dynamic Fee on DAMM v2](https://docs.meteora.ag/overview/products/damm-v2/2-pool-fees-calculation#max-dynamic-fee-on-damm-v2) Assistant Responses are generated using AI and may contain mistakes. --- # DBC - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Audits DBC [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [​](https://docs.meteora.ag/resources/audits/4-dbc#offside-labs) Offside Labs ================================================================================ [Download Offside Labs Audit\ ---------------------------\ \ Download the Offside Labs audit report.](https://drive.google.com/uc?export=download&id=1gCtTHEf6izp2OXDBxuWOESy8GIiisbsn) [​](https://docs.meteora.ag/resources/audits/4-dbc#ottersec) OtterSec ======================================================================== [Download OtterSec Audit\ -----------------------\ \ Download the OtterSec audit report.](https://drive.google.com/uc?export=download&id=1ymW_D49RCT2V7Z3VOmgbILwwAZcz8NwX) [​](https://docs.meteora.ag/resources/audits/4-dbc#zenith) Zenith ==================================================================== [Download Zenith Audit\ ---------------------\ \ Download the Zenith audit report.](https://drive.google.com/uc?export=download&id=19KYOPDvcanAGIXSUa-GaW_JjDHVTpbmt) Was this page helpful? YesNo [Previous](https://docs.meteora.ag/resources/audits/3-damm-v2) [Alpha Vault\ \ Next](https://docs.meteora.ag/resources/audits/5-alpha-vault) On this page * [Offside Labs](https://docs.meteora.ag/resources/audits/4-dbc#offside-labs) * [OtterSec](https://docs.meteora.ag/resources/audits/4-dbc#ottersec) * [Zenith](https://docs.meteora.ag/resources/audits/4-dbc#zenith) Assistant Responses are generated using AI and may contain mistakes. --- # Alpha Vault - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Audits Alpha Vault [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [​](https://docs.meteora.ag/resources/audits/5-alpha-vault#offside-labs) Offside Labs ======================================================================================== ### [​](https://docs.meteora.ag/resources/audits/5-alpha-vault#latest) Latest [Download Offside Labs Audit\ ---------------------------\ \ Download the Offside Labs audit report.](https://drive.google.com/uc?export=download&id=10fOAfVbRgQh1M9FuXxEHF6MkBaXnrhNF) ### [​](https://docs.meteora.ag/resources/audits/5-alpha-vault#previous) Previous [Download Offside Labs Audit \[1\]\ ---------------------------------\ \ Download the Offside Labs \[1\] audit report.](https://drive.google.com/uc?export=download&id=1GQzHNWPdj9uUQ_6DO2mjftKVYcSBgj1T) [Download Offside Labs Audit \[2\]\ ---------------------------------\ \ Download the Offside Labs \[2\] audit report.](https://drive.google.com/uc?export=download&id=1sz5zzIzaTm4SCRqcnx3lDQPs2DIz-QFv) Was this page helpful? YesNo [Previous](https://docs.meteora.ag/resources/audits/4-dbc) [Dynamic Vault\ \ Next](https://docs.meteora.ag/resources/audits/6-dynamic-vault) On this page * [Offside Labs](https://docs.meteora.ag/resources/audits/5-alpha-vault#offside-labs) * [Latest](https://docs.meteora.ag/resources/audits/5-alpha-vault#latest) * [Previous](https://docs.meteora.ag/resources/audits/5-alpha-vault#previous) Assistant Responses are generated using AI and may contain mistakes. --- # Rebalance Crank - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Hermes Rebalance Crank [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) When an operator submits a `deposit_strategy` or `withdraw_strategy` transaction, we call this the **rebalance crank**. ![Rebalance Crank](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/overview/other-products/dynamic-vault/rebalance-crank.png) We define the state variables **before** the rebalance as: * `vault.total_amount`: t1t\_1t1​ * `token_vault.amount`: a1a\_1a1​ * `strategy.current_liquidity`: c1c\_1c1​ And the state variables **after** the rebalance as: * `vault.total_amount`: t2t\_2t2​ * `token_vault.amount`: a2a\_2a2​ * `strategy.current_liquidity`: c2c\_2c2​ The vault calculates the total accrued interest (profit) after rebalance as: profit\=(c2+a2)−(c1+a1)\\text{profit} = (c\_2 + a\_2) - (c\_1 + a\_1) profit\=(c2​+a2​)−(c1​+a1​) Then, the vault updates the total amount: t2\=t1+profitt\_2 = t\_1 + \\text{profit} t2​\=t1​+profit Or, equivalently: t2\=t1+(c2+a2)−(c1+a1)t\_2 = t\_1 + (c\_2 + a\_2) - (c\_1 + a\_1) t2​\=t1​+(c2​+a2​)−(c1​+a1​) The immediate release of profit generated to the LPs can result in opportunities for a sandwich attack, as seen in the scenario below: ![Sandwich Attack Scenario](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/overview/other-products/dynamic-vault/sandwich-attack-scenario.png) An attacker is able to time their deposit before a rebalance and withdraw immediately after a rebalance in order to get the max profit. In the example above, the attacker is able to earn 10 tokens as a reward by executing the sandwich attack. [​](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-3-rebalance-crank#sandwich-attack-prevention) Sandwich Attack Prevention =============================================================================================================================================== To prevent sandwich attacks, the system does **not** distribute 100% of the yield generated by lending platforms to LPs immediately after each rebalance. Instead, the yield is “dripped” (released gradually) to LPs over a pre-determined period. [​](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-3-rebalance-crank#key-state-variables) Key State Variables --------------------------------------------------------------------------------------------------------------------------------- * **`total_amount`**: The total liquidity in the vault (vault balance + all strategy balances). * **`last_updated_locked_profit`**: The total profit that is currently locked, updated at every rebalance. * **`last_report`**: The timestamp of the last rebalance. * **`locked_profit_degradation`**: The rate at which locked profit is released, expressed as a percentage per second (e.g., 0.1% of locked profits released per second). * * * [​](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-3-rebalance-crank#how-yield-unlocking-works) How Yield Unlocking Works ============================================================================================================================================= When a user adds or removes liquidity, the system uses the **unlocked amount** (not the full `vault.total_amount`) to calculate how many LP tokens to mint or burn. This is done via the `get_unlock_amount` function. [​](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-3-rebalance-crank#calculation-steps) Calculation Steps ----------------------------------------------------------------------------------------------------------------------------- 1. **Calculate Duration Since Last Rebalance:** duration\=currentTime−lastReport\\text{duration} = \\text{currentTime} - \\text{lastReport} duration\=currentTime−lastReport 2. **Calculate Locked Fund Ratio:** lockedFundRatio\=1−(duration×lockedProfitDegradation)\\text{lockedFundRatio} = 1 - (\\text{duration} \\times \\text{lockedProfitDegradation}) lockedFundRatio\=1−(duration×lockedProfitDegradation) 3. **Calculate Unlocked Amount:** unlockedAmount\=totalAmount−(lastUpdatedLockedProfit×lockedFundRatio)\\text{unlockedAmount} = \\text{totalAmount} - (\\text{lastUpdatedLockedProfit} \\times \\text{lockedFundRatio}) unlockedAmount\=totalAmount−(lastUpdatedLockedProfit×lockedFundRatio) * * * **In summary:** Only the unlocked portion of profits is available to LPs at any given time, mitigating the risk of sandwich attacks by preventing instant profit extraction after a rebalance. [​](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-3-rebalance-crank#example%3A-drip-duration-5-minutes) Example: Drip duration ~ 5 minutes --------------------------------------------------------------------------------------------------------------------------------------------------------------- ![Drip Duration Example](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/overview/other-products/dynamic-vault/drip-duration-example.png) As seen in the example above, the rebalancing at t = 2 mins will gain a total of 100 token as yield from the lending platforms. However, as we are using the unlocked amount value to calculate the withdrawal amount, the attacker will not get any of the yield gained if he were to withdraw his tokens immediately after rebalancing. He will also only gain a fraction of the total yield if he withdraws within the next few minutes. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-2-algorithm-to-find-optimal-yield-allocations) [Operation Fee Calculation\ \ Next](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-4-operation-fee-calculation) On this page * [Sandwich Attack Prevention](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-3-rebalance-crank#sandwich-attack-prevention) * [Key State Variables](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-3-rebalance-crank#key-state-variables) * [How Yield Unlocking Works](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-3-rebalance-crank#how-yield-unlocking-works) * [Calculation Steps](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-3-rebalance-crank#calculation-steps) * [Example: Drip duration ~ 5 minutes](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-3-rebalance-crank#example%3A-drip-duration-5-minutes) Assistant Responses are generated using AI and may contain mistakes. --- # Trading Fees Calculation - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DBC Trading Fees Calculation [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) DBC Pools earn a trading fee from traders when they perform a swap. The fees can be collected in two ways: * Quote only * Quote + Base DBC fees can be fee shared between the launchpad partner and the token pool creator. [​](https://docs.meteora.ag/overview/products/dbc/3-trading-fees-calculation#total-trading-fee) Total Trading Fee ==================================================================================================================== The total swap fee (fsf\_sfs​) will have two components: 1. **A base fee** (fbf\_bfb​) 2. **A variable fee** (fvf\_vfv​) The **total swap fee** is calculated as: fs\=fb+fvf\_s = f\_b + f\_v fs​\=fb​+fv​ The variable fee (fvf\_vfv​) is a function of real-time price volatility. The fee rate will be applied to the swap amount in each liquidity bin and distributed proportionally to the LPs in that bin. LPs can claim these fees whenever they are available. [​](https://docs.meteora.ag/overview/products/dbc/3-trading-fees-calculation#base-fee) Base Fee -------------------------------------------------------------------------------------------------- The base fee of a pool can be configured by the pool creator in the following ways: * **Fixed Base Fee**: A fixed fee that is applied to the swap amount. * **Fee Scheduler**: A fee decay mechanism that decays the fee from a high starting fee to an ending fixed base fee over a period of time. The ending fee will be the fixed base fee of the pool after the fee scheduler is finished. * **Rate Limiter**: A fee slope mechanism that starts at a fixed base fee and increases the fee depending on the buy amount. The fee after the rate limiter is finished will be the fixed base fee of the pool. You can only choose one of the three options for the base fee. ### [​](https://docs.meteora.ag/overview/products/dbc/3-trading-fees-calculation#fixed-base-fee) Fixed Base Fee Fixed base fee is a fixed fee that is applied to the swap amount. The fee can range from 0.01% to 50%. It is specified in the config key used for the pool creation. ### [​](https://docs.meteora.ag/overview/products/dbc/3-trading-fees-calculation#fee-scheduler) Fee Scheduler Fee scheduler is a fee decay mechanism that decays the fee from starting fee to an ending base fee over a period of time. The fee math calculation for the scheduler can be found [here](https://docs.meteora.ag/anti-sniper-suite/fee-scheduler/2-fee-scheduler-math) . ### [​](https://docs.meteora.ag/overview/products/dbc/3-trading-fees-calculation#rate-limiter) Rate Limiter Rate limiter is a fee slope mechanism that starts at a fixed base fee and increases the fee depending on the buy amount The fee math calculation for the rate limiter can be found [here](https://docs.meteora.ag/anti-sniper-suite/rate-limiter/2-rate-limiter-math) . [​](https://docs.meteora.ag/overview/products/dbc/3-trading-fees-calculation#dynamic-fee-variable-fee) Dynamic Fee (Variable Fee) ------------------------------------------------------------------------------------------------------------------------------------ The variable fee is the core of the dynamic fee mechanism. It increases with market volatility. fv\=(va×s)2×C/100000000000f\_v = (v\_a \\times s)^2 \\times C / 100000000000 fv​\=(va​×s)2×C/100000000000 where: * **Volatility Accumulator** (vav\_ava​): A measure of recent price volatility * **Bin Step** (sss): A parameter that defines the price granularity for measuring volatility * **Variable Fee Control** (CCC): A parameter to control the magnitude of the variable fee ### [​](https://docs.meteora.ag/overview/products/dbc/3-trading-fees-calculation#volatility-accumulator) Volatility Accumulator The Volatility Accumulator tracks price movements. It’s updated with every swap. va\=min⁡(vmax,vr+Δp×10000)v\_a = \\min(v\_{max}, v\_r + \\Delta p \\times 10000) va​\=min(vmax​,vr​+Δp×10000) where: * **Max Volatility Accumulator** (vmaxv\_{max}vmax​): A cap on the volatility measure to prevent fees from becoming excessively high * **Volatility Reference** (vrv\_rvr​): A decayed value of the volatility accumulator * **Price Change** (Δp\\Delta pΔp): The price change since the last reference update, measured in “bins” #### [​](https://docs.meteora.ag/overview/products/dbc/3-trading-fees-calculation#price-change) Price Change The price change is calculated based on the change in the square root of the price. Δp\=(pc/pr−1)/s×2\\Delta p = (\\sqrt{p\_c / p\_r} - 1) / s \\times 2 Δp\=(pc​/pr​​−1)/s×2 where pcp\_cpc​ is current price and prp\_rpr​ is reference price. #### [​](https://docs.meteora.ag/overview/products/dbc/3-trading-fees-calculation#volatility-decay) Volatility Decay To ensure that the dynamic fee reflects recent volatility, the Volatility Reference decays over time. vr\=va×R/10000v\_r = v\_a \\times R / 10000 vr​\=va​×R/10000 The decay mechanism is based on the time elapsed since the last significant trade: * If elapsed time < filter period: No change. This ignores very high-frequency trades. * If filter period ≤ elapsed time < decay period: The volatility reference is reduced. * If elapsed time ≥ decay period: The volatility reference is reset to 0. This happens if there are no significant trades for an extended period. [​](https://docs.meteora.ag/overview/products/dbc/3-trading-fees-calculation#max-dynamic-fee-on-dbc-for-typescript-sdk-build-curve-functions) Max Dynamic Fee on DBC for Typescript SDK Build Curve functions ================================================================================================================================================================================================================ If you use any of the `buildCurve` helper functions in the DBC Typescript SDK, the max dynamic fee on DBC when toggled `true` is less than or equals to 20% of the Base Fee. Example: * Base Fee = 1% * Dynamic Fee = 0.2% * Total Trading/LP Fee = 1.2% Was this page helpful? YesNo [Previous](https://docs.meteora.ag/overview/products/dbc/2-dbc-config-key) [Alpha Vault\ \ Next](https://docs.meteora.ag/overview/other-products/alpha-vault/Alpha-Vault) On this page * [Total Trading Fee](https://docs.meteora.ag/overview/products/dbc/3-trading-fees-calculation#total-trading-fee) * [Base Fee](https://docs.meteora.ag/overview/products/dbc/3-trading-fees-calculation#base-fee) * [Fixed Base Fee](https://docs.meteora.ag/overview/products/dbc/3-trading-fees-calculation#fixed-base-fee) * [Fee Scheduler](https://docs.meteora.ag/overview/products/dbc/3-trading-fees-calculation#fee-scheduler) * [Rate Limiter](https://docs.meteora.ag/overview/products/dbc/3-trading-fees-calculation#rate-limiter) * [Dynamic Fee (Variable Fee)](https://docs.meteora.ag/overview/products/dbc/3-trading-fees-calculation#dynamic-fee-variable-fee) * [Volatility Accumulator](https://docs.meteora.ag/overview/products/dbc/3-trading-fees-calculation#volatility-accumulator) * [Price Change](https://docs.meteora.ag/overview/products/dbc/3-trading-fees-calculation#price-change) * [Volatility Decay](https://docs.meteora.ag/overview/products/dbc/3-trading-fees-calculation#volatility-decay) * [Max Dynamic Fee on DBC for Typescript SDK Build Curve functions](https://docs.meteora.ag/overview/products/dbc/3-trading-fees-calculation#max-dynamic-fee-on-dbc-for-typescript-sdk-build-curve-functions) Assistant Responses are generated using AI and may contain mistakes. --- # Meteora Lock - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Audits Meteora Lock [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [​](https://docs.meteora.ag/resources/audits/8-meteora-lock#ottersec-labs) OtterSec Labs =========================================================================================== [Download OtterSec Labs Audit\ ----------------------------\ \ Download the OtterSec Labs audit report.](https://drive.google.com/uc?export=download&id=1FyYG-hqozUcTBukCPlqtom54OD4VGzRX) [​](https://docs.meteora.ag/resources/audits/8-meteora-lock#sec3) Sec3 ========================================================================= [Download Sec3 Audit\ -------------------\ \ Download the Sec3 audit report.](https://drive.google.com/uc?export=download&id=14WRTVdaapJKbxCZEs2ppOd1wpV7dRbqc) Was this page helpful? YesNo [Previous\ \ Stake2Earn](https://docs.meteora.ag/resources/audits/7-stake2earn) On this page * [OtterSec Labs](https://docs.meteora.ag/resources/audits/8-meteora-lock#ottersec-labs) * [Sec3](https://docs.meteora.ag/resources/audits/8-meteora-lock#sec3) Assistant Responses are generated using AI and may contain mistakes. --- # Stake2Earn - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Audits Stake2Earn [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [​](https://docs.meteora.ag/resources/audits/7-stake2earn#offside-labs) Offside Labs ======================================================================================= [Download Offside Labs Audit\ ---------------------------\ \ Download the Offside Labs audit report.](https://drive.google.com/uc?export=download&id=1uht3C4UDh088CSIPNhZT3R1lzTk1-Ihc) Was this page helpful? YesNo [Previous](https://docs.meteora.ag/resources/audits/6-dynamic-vault) [Meteora Lock\ \ Next](https://docs.meteora.ag/resources/audits/8-meteora-lock) On this page * [Offside Labs](https://docs.meteora.ag/resources/audits/7-stake2earn#offside-labs) Assistant Responses are generated using AI and may contain mistakes. --- # Dynamic Vault - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Audits Dynamic Vault [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [​](https://docs.meteora.ag/resources/audits/6-dynamic-vault#offside-labs) Offside Labs ========================================================================================== [Download Offside Labs Audit\ ---------------------------\ \ Download the Offside Labs audit report.](https://drive.google.com/uc?export=download&id=1pX96nWAda9FUehLRIf4GrZ2Ud_OmLA5F) [​](https://docs.meteora.ag/resources/audits/6-dynamic-vault#quantstamp) Quantstamp ====================================================================================== [Download Quantstamp Audit\ -------------------------\ \ Download the Quantstamp audit report.](https://drive.google.com/uc?export=download&id=1OhrJjTwJHcoWdF6kRvv5v7wn7TVc7Mtv) [​](https://docs.meteora.ag/resources/audits/6-dynamic-vault#halborn) Halborn ================================================================================ [Download Halborn Audit\ ----------------------\ \ Download the Halborn audit report.](https://drive.google.com/uc?export=download&id=1rZj93LQCjon5F--zoUtFYgFEvbM85Hk0) Was this page helpful? YesNo [Previous](https://docs.meteora.ag/resources/audits/5-alpha-vault) [Stake2Earn\ \ Next](https://docs.meteora.ag/resources/audits/7-stake2earn) On this page * [Offside Labs](https://docs.meteora.ag/resources/audits/6-dynamic-vault#offside-labs) * [Quantstamp](https://docs.meteora.ag/resources/audits/6-dynamic-vault#quantstamp) * [Halborn](https://docs.meteora.ag/resources/audits/6-dynamic-vault#halborn) Assistant Responses are generated using AI and may contain mistakes. --- # Brand Kit - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Miscellaneous Brand Kit [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Download Brand Kit\ ------------------\ \ Download the complete Meteora brand kit including logos, colors, and brand guidelines.](https://drive.google.com/uc?export=download&id=1TWsVSYXez0PO5mF_ew-VODppdX2j_DFl) Was this page helpful? YesNo [Previous](https://docs.meteora.ag/resources/community/2-dashboards) [DLMM\ \ Next](https://docs.meteora.ag/resources/audits/1-dlmm) Assistant Responses are generated using AI and may contain mistakes. --- # Dashboards - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Community Dashboards [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [![tokleo-banner](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/resources/community/dashboards/tokleo-banner.png)\ \ Tokleo built by @KalindroDB\ ---------------------------\ \ Tokleo is a real-time analytics platform that provides enhanced tracking and insights for Meteora pools using comprehensive on-chain data. Created as a community hobby project, it helps users identify the best performing pools through customizable visualizations and automated data refreshing every 5 minutes.](https://tokleo.com/) [![lookerstudio-banner](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/resources/community/dashboards/lookerstudio-banner.png)\ \ Looker Studio built by @foxtroteth\ ----------------------------------\ \ Looker Studio is a tool that allows you to track all all Meteora pools stats in one place. It provides a comprehensive overview of all pools, including performance metrics and analytics, helping you make informed decisions about your liquidity provisioning strategies.](https://linktr.ee/dlmmbyfoxy) [![hanyon-analytics-banner](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/resources/community/dashboards/hanyon-analytics-banner.png)\ \ Hanyon Analytics built by @jayowtrades\ --------------------------------------\ \ Hanyon Analytics is a data-driven platform born from a passion for analytics and storytelling in the DeFi space. The platform launches with two powerful tools specifically designed for the Meteora community: DAMMv2 User Analytics for tracking personal performance and monitoring top wallets, and the Top DAMMv2 Wallet Finder for discovering the most profitable wallets to copy or follow.](https://hanyon.app/) [![damm-v2-searcher-banner](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/resources/community/dashboards/damm-v2-searcher-banner.png)\ \ DAMM v2 Searcher built by @gm365\ --------------------------------\ \ DAMM v2 Searcher is a specialized search engine designed to eliminate the endless scrolling through Meteora’s DAMM V2 pools by using smart analytics to identify high-yield liquidity opportunities. The platform automatically filters pools based on strict criteria (minimum 10TVL,createdwithin2days,510 TVL, created within 2 days, 5%+ Fee/TVL ratio, and over 10TVL,createdwithin2days,55 in 24h fees) to surface hidden gems with exceptional earning potential.](https://damm.dlmm.me/) [![damm-v2-analytics-banner](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/resources/community/dashboards/damm-v2-analytics-banner.png)\ \ DAMM v2 Analytics built by @gm365\ ---------------------------------\ \ DAMM v2 Analytics is a Dune dashboard that provides a comprehensive overview of Meteora’s DAMM v2 pools.](https://dune.com/gm365/damm) [![dbc-analytics-banner](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/resources/community/dashboards/dbc-analytics-banner.png)\ \ DBC Analytics built by @0xsandeshk\ ----------------------------------\ \ DBC Analytics is a Flipside dashboard that provides a comprehensive overview of Meteora’s DBC pools.](https://flipsidecrypto.xyz/Sandesh/meteora-damm-v2-pSF1Jz) [![meteorology-banner](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/resources/community/dashboards/meteorology-banner.png)\ \ Meteorology built by @adovrn\ ----------------------------\ \ Meteorology AI Agent is a web-based onboarding assistant designed to help novice liquidity providers navigate the Meteora ecosystem. The platform operates in two intelligent modes: Chart-to-Strategy analysis that converts price chart screenshots into specific DLMM configurations (including range, bin-step, fee tier, and strategy recommendations), and Docs Q&A that answers questions about Meteora, DLMM, AMM, and liquidity-providing risks using advanced retrieval-augmented generation.](https://meteorology.chat/) Was this page helpful? YesNo [Previous](https://docs.meteora.ag/resources/community/1-tools) [Brand Kit\ \ Next](https://docs.meteora.ag/resources/miscellaneous/1-brand-kit) Assistant Responses are generated using AI and may contain mistakes. --- # Tools - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Community Tools [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Meteora’s ecosystem features a diverse collection of community-built tools that enhance the DeFi experience on Solana. These tools range from automated liquidity management platforms to analytics dashboards that provide real-time performance tracking. [![metengine-banner](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/resources/community/tools/metengine-banner.jpeg)\ \ MetEngine\ ---------\ \ MetEngine lets you create and manage DLMM (Dynamic Liquidity Market Making) and DAMM positions on Meteora - instantly, from Telegram, Web App, and Farcaster MiniApp. You can LP with one click, mirror top-performing wallets and monitor everything in real time.](https://www.metengine.xyz/) [![cleopetra-banner](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/resources/community/tools/cleopetra-banner.jpeg)\ \ Cleopetra\ ---------\ \ Cleopetra is a seamless platform for liquidity provisioning on Solana DEXes, directly from Telegram. Enter a token, pick an LP strategy of your choice and create the position — the agent finds optimal pools and auto-rebalance positions when needed to maximise fees and reduce impermanent loss.](https://docs.cleopetra.fun/welcome) [![rocketscan-banner](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/resources/community/tools/rocketscan-banner.png)\ \ Rocketscan\ ----------\ \ Rocket Scan gives you the edge in the memecoin market with lightning-fast updates and real-time momentum tracking. Discover tokens early for DAMM V2 Pools and find the best entry points when trading in the trenches.](https://rocketscan.fun/) [![metlex-banner](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/resources/community/tools/metlex-banner.png)\ \ Metlex\ ------\ \ Metlex is a specialized web dashboard for Meteora DLMM liquidity providers. It helps LPs monitor, analyze, and optimize their positions with features including PnL tracking, pool safety analysis, and top pair discovery across multiple DEXs. Built specifically for DLMM strategies, Metlex provides the essential tools needed to maximize liquidity provision returns.](https://www.metlex.io/) [![dlmm-profit-analysis-banner](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/resources/community/tools/dlmm-profit-analysis-banner.png)\ \ DLMM Profit Analysis By Geeklad\ -------------------------------\ \ DLMM Profiler is a tool that allows you to analyze the performance of your DLMM positions on Meteora.](https://geeklad.github.io/meteora-profit-analysis/) [![ultralp-banner](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/resources/community/tools/ultralp-banner.jpeg)\ \ Ultra LP\ --------\ \ Ultra LP is a tool that gives you real-time analytics and P&L for all DLMM positions. As the LP Copilot on Meteora, you can track all your LP positions on Meteora with real-time and historical performance.](https://www.ultralp.com/) [![liquidnova-banner](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/resources/community/tools/liquidnova-banner.jpeg)\ \ Liquid Nova\ -----------\ \ Liquid Nova is an intelligent liquidity management platform that automates how you provide and manage liquidity in Meteora. Instead of constantly creating positions, monitoring prices, manually adjusting positions, and claiming fees, Liquid Nova executes your precise instructions automatically.](https://liquidnova.app/) [![unifai-banner](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/resources/community/tools/unifai-banner.jpeg)\ \ UnifAI Network\ --------------\ \ UnifAI Network is a platform that enables AI agents to autonomously discover and use tools at runtime. It provides a unified API for agents to dynamically find services, execute tasks, and operate independently while maintaining security through client-side data control. The platform works with any LLM that supports function calling, allowing agents to adapt their capabilities on-demand rather than being limited to pre-configured tools.](https://unifai.network/) Was this page helpful? YesNo [Dashboards\ \ Next](https://docs.meteora.ag/resources/community/2-dashboards) Assistant Responses are generated using AI and may contain mistakes. --- # Operation Fee Calculation - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Hermes Operation Fee Calculation [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) When an operator submits a `deposit_strategy` or `withdraw_strategy` transaction (i.e., when assets are rebalanced between lending protocols), we call this the **rebalance crank**. A fee is collected to the [fee\_vault](https://solscan.io/account/9kZeN47U2dubGbbzMrzzoRAUvpuxVLRcjW9XiFpYjUo4#splTransfers) every time the operator sends a rebalance crank. This fee is paid in vault LP SPL tokens and can be seen at the fee\_vault address. Currently, we charge **5% of profit** as the operation (performance) fee. * * * [​](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-4-operation-fee-calculation#variables) Variables ======================================================================================================================= **Before rebalance:** * `vault.total_amount`: t1t\_1t1​ * `lp_mint.total_supply`: p1p\_1p1​ * **Virtual price** (value of LP token): v1\=t1/p1v\_1 = t\_1 / p\_1v1​\=t1​/p1​ **After rebalance:** * `vault.total_amount`: t2t\_2t2​ * `lp_mint.total_supply`: p1p\_1p1​ * **Virtual price**: v2\=t2/p1v\_2 = t\_2 / p\_1v2​\=t2​/p1​ * * * [​](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-4-operation-fee-calculation#fee-calculation) Fee Calculation =================================================================================================================================== We charge an operation fee: fee\=0.05×(t2−t1)fee = 0.05 \\times (t\_2 - t\_1) fee\=0.05×(t2​−t1​) * * * [​](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-4-operation-fee-calculation#adjusting-virtual-price-after-fee) Adjusting Virtual Price After Fee ======================================================================================================================================================================= After deducting the fee, the virtual price becomes: v21\=(t2−fee)/p1v\_{21} = (t\_2 - fee) / p\_1 v21​\=(t2​−fee)/p1​ However, the vault does **not** send tokens directly to the treasury token account (since it may not have enough liquidity). Instead, the vault **mints additional LP tokens** for the fee\_vault. Let δ\\deltaδ be the number of new LP tokens minted for the fee. The new virtual price is: v22\=t2/(p1+δ)v\_{22} = t\_2 / (p\_1 + \\delta) v22​\=t2​/(p1​+δ) We want the virtual price after fee to remain the same, so set v21\=v22v\_{21} = v\_{22}v21​\=v22​: (t2−fee)/p1\=t2/(p1+δ)(t\_2 - fee) / p\_1 = t\_2 / (p\_1 + \\delta) (t2​−fee)/p1​\=t2​/(p1​+δ) * * * [​](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-4-operation-fee-calculation#solving-for) Solving for δ\\deltaδ ===================================================================================================================================== Rearranging the equation above, we get: δ\=(p1×fee)/(t2−fee)\\delta = (p\_1 \\times fee) / (t\_2 - fee) δ\=(p1​×fee)/(t2​−fee) Or, substituting fee\=0.05×(t2−t1)fee = 0.05 \\times (t\_2 - t\_1)fee\=0.05×(t2​−t1​): δ\=(p1×0.05×(t2−t1))/(t2−0.05×(t2−t1))\\delta = (p\_1 \\times 0.05 \\times (t\_2 - t\_1)) / (t\_2 - 0.05 \\times (t\_2 - t\_1)) δ\=(p1​×0.05×(t2​−t1​))/(t2​−0.05×(t2​−t1​)) Which simplifies to: δ\=(p1×0.05×(t2−t1))/(0.95×t2+0.05×t1)\\delta = (p\_1 \\times 0.05 \\times (t\_2 - t\_1)) / (0.95 \\times t\_2 + 0.05 \\times t\_1) δ\=(p1​×0.05×(t2​−t1​))/(0.95×t2​+0.05×t1​) * * * **Summary:** * The operation fee is 5% of the profit from each rebalance crank. * The fee is paid by minting new LP tokens to the fee\_vault, not by transferring underlying assets. * The number of LP tokens minted is calculated to ensure the virtual price for LP holders remains consistent after the fee is taken. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-3-rebalance-crank) [Design Goals\ \ Next](https://docs.meteora.ag/overview/other-products/dynamic-vault/3-design-goals) On this page * [Variables](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-4-operation-fee-calculation#variables) * [Fee Calculation](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-4-operation-fee-calculation#fee-calculation) * [Adjusting Virtual Price After Fee](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-4-operation-fee-calculation#adjusting-virtual-price-after-fee) * [Solving for](https://docs.meteora.ag/overview/other-products/dynamic-vault/2-4-operation-fee-calculation#solving-for) Assistant Responses are generated using AI and may contain mistakes. --- # Create a Stake2Earn v1 Launch Pool - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DAMM v1 Launch Pool Create a Stake2Earn v1 Launch Pool [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Stake2Earn Pool is a DAMM v1 Pool that is launched with a Stake2Earn Vault. This page provides the code examples and steps to create a Stake2Earn Pool. **DAMM v1 Pool:** A DAMM v1 Pool created with a fee scheduler and with initial liquidity perma-locked. **Stake2Earn Vault:** Stake-to-earn farming mechanism and vault where top stakers can earn a share of fees from the locked liquidity. **Stake2Earn Pool:** A Memecoin Pool with a Stake2Earn Vault. [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#getting-started) Getting Started ----------------------------------------------------------------------------------------------------------------------------------------- **For Creating a Memecoin Pool with Fee Scheduler - Using TypeScript SDK:** * DAMM v1 SDK: [https://github.com/MeteoraAg/damm-v1-sdk](https://github.com/MeteoraAg/damm-v1-sdk) * Stake2Earn Vault SDK: [https://github.com/MeteoraAg/stake-for-fee-sdk](https://github.com/MeteoraAg/stake-for-fee-sdk) * DAMM v1 Program ID: `Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB` * Stake2Earn Vault Program ID: `FEESngU3neckdwib9X3KWqdL7Mjmqk9XNp3uh5JbP4KP` * Devnet: [https://damm-api.devnet.meteora.ag/swagger-ui/](https://damm-api.devnet.meteora.ag/swagger-ui/) **For Creating a Stake2Earn Vault - Using Bun Scripts:** * Clone repo: [https://github.com/MeteoraAg/meteora-pool-setup](https://github.com/MeteoraAg/meteora-pool-setup) * Config list to reference: [https://github.com/MeteoraAg/meteora-pool-setup/tree/main/config](https://github.com/MeteoraAg/meteora-pool-setup/tree/main/config) * Readme: [https://github.com/MeteoraAg/meteora-pool-setup/blob/main/README.md](https://github.com/MeteoraAg/meteora-pool-setup/blob/main/README.md) [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#api) API ----------------------------------------------------------------------------------------------------------------- * **DAMM v1 API endpoints:** [https://damm-api.meteora.ag/swagger-ui/](https://damm-api.meteora.ag/swagger-ui/) * **Stake2Earn Mainnet API endpoint:** [https://stake-for-fee-api.meteora.ag/swagger-ui/](https://stake-for-fee-api.meteora.ag/swagger-ui/) * **API endpoint to get Stake2Earn vault info from pool address:** [https://stake-for-fee-api.meteora.ag/swagger-ui/#/vault/filter\_vaults](https://stake-for-fee-api.meteora.ag/swagger-ui/#/vault/filter_vaults) * **Stake2Earn Devnet API endpoint:** [https://devnet.stake-for-fee-api.meteora.ag/swagger-ui/](https://devnet.stake-for-fee-api.meteora.ag/swagger-ui/) [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#dependencies) Dependencies ----------------------------------------------------------------------------------------------------------------------------------- Install Bun: You’ll also need bun to run the scripts. Install it via bun installation. Then install the dependencies by running the command `bun install` [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#scripts) Scripts ------------------------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#1-install-dependencies-and-initialize-ammimpl-instance) 1\. Install dependencies and initialize AmmImpl instance DAMM v1 SDK: [https://github.com/MeteoraAg/damm-v1-sdk](https://github.com/MeteoraAg/damm-v1-sdk) #### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#1-1-install-dependencies) 1.1 Install dependencies Copy Ask AI # NPM npm i @meteora-ag/dynamic-amm-sdk @solana/web3.js @solana/spl-token # YARN yarn add @meteora-ag/dynamic-amm-sdk @solana/web3.js @solana/spl-token # Or, use any package manager of your choice. #### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#1-2-initialize-ammimpl-instance) 1.2 Initialize AmmImpl instance Copy Ask AI import AmmImpl, { MAINNET_POOL } from '@meteora-ag/dynamic-amm-sdk'; import { Connection, Keypair, PublicKey } from '@solana/web3.js'; // Connection, Wallet, and AnchorProvider to interact with the network const mainnetConnection = new Connection('https://api.mainnet-beta.solana.com'); // Create single instance const constantProductPool = await AmmImpl.create(mainnetConnection, MAINNET_POOL.USDC_SOL); const stablePool = await AmmImpl.create(mainnetConnection, MAINNET_POOL.USDT_USDC); // Or with any other pool address, refer to the pool creation section below const pool = await AmmImpl.create(mainnetConnection, new PublicKey('...')); // If you need to create multiple, can consider using `createMultiple` const pools = [MAINNET_POOL.USDC_SOL, MAINNET_POOL.USDT_USDC]; const [constantProductPool, stablePool] = await AmmImpl.createMultiple(mainnetConnection, pools); ### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#2-fee-schedule-setup%3A-choose-a-suitable-pool-and-fee-config) 2\. Fee Schedule Setup: Choose a suitable Pool and Fee Config What fee parameters to choose depends on your project’s needs. You will need to look at the pool config list and choose a suitable pool\_config\_key with your preferred fee parameters. If you want to create an Alpha Vault along with your new pool, you also need to find a pool\_config\_key that is mapped to a vault\_config\_key that meets your requirements. If none of the pool\_config\_key in the list meet your requirements, please reach out to Meteora for a custom pool config key. #### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#2-1-public-pool-config-list) 2.1 Public Pool Config List * **Pool config list:** [https://damm-api.meteora.ag/swagger-ui/#/pools/get\_all\_pool\_configs](https://damm-api.meteora.ag/swagger-ui/#/pools/get_all_pool_configs) * **Devnet API:** [https://damm-api.devnet.meteora.ag/swagger-ui/](https://damm-api.devnet.meteora.ag/swagger-ui/) You can also get the list of config keys from devnet API * **API endpoint to return the associated fee curve for each existing config:** [https://damm-api.meteora.ag/swagger-ui/#/fee\_config/get\_config\_associated\_fee\_configs](https://damm-api.meteora.ag/swagger-ui/#/fee_config/get_config_associated_fee_configs) Using this endpoint, integrators can input the config pubkey, and it will return an array of fee update timings for the config, if there’s any. Integrators may choose a pool\_config\_key with a fee curve that suits your integration. If there is no existing config in the list that fits your project’s requirement, a new config needs to be created. Only the Meteora team can create a new config to add it to the preset pool config list. #### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#2-2-default-pool-config-used-by-meteora-frontend) 2.2 Default Pool Config used by Meteora Frontend By default, Meteora’s frontend is currently using this pool config key for Memecoin Pool creation: `FiENCCbPi3rFh5pW2AJ59HC53yM32eLaCjMKxRqanKFJ` For the `FiENCCbPi3rFh5pW2AJ59HC53yM32eLaCjMKxRqanKFJ` pool config, it doesn’t allow creation of any Alpha Vault, therefore its field vault\_config\_key is `1111111...` #### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#2-3-new-custom-pool-config-and-fee-curve-for-integrators-%2F-launchpads) 2.3 New Custom Pool Config and Fee Curve for Integrators / Launchpads **Custom Pool Config Key:** Integrators such as launchpads or other partners may need to use their own unique custom pool config key, if they want custom pool\_creator\_authority to prevent front-running of the token launch pool. New dedicated config keys can only be created by Meteora. Please reach out to us if this is required. The pool\_creator\_authority doesn’t work with program address. It’s not a program whitelist, it needs to be a PDA (program derived address) or normal account. **Custom Fee Curve:** If you are an integrator, Meteora can also apply a custom fee curve/schedule for your pools, but we will need to create a dedicated config key for your team, where pool\_creator\_authority is linked to your signer wallet for pool creation. You would need to send us your signer wallet that would be used to deploy the pools. Even with a dedicated config key for your team, Meteora would need to customize the fee curve/schedule for you. You can’t do it on your own. Custom Pool Config and Fee Curve is used by integrators such as Moonshot by DEX Screener. #### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#2-4-custom-fee-curve-for-a-specific-pool) 2.4 Custom Fee Curve for a Specific Pool If required, Meteora can set a custom fee curve for a single, specific pool. This would override the fee curve used by the pool’s config key, doesn’t matter which config key is used. For more information about setting Pool and Fee Config for Memecoin Pools, please read here. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#3-create-a-memecoin-pool-with-stake2earn-vault) 3\. Create a Memecoin Pool with Stake2Earn Vault **Important Reminder:** You are recommended to configure your Stake2Earn staking rewards distribution start time (fee claim start time) to be approximately 48 hours after launch. This allows more time for total fee rewards to accumulate from trading activity in the memecoin pool. A bigger total fee reward would help make your Stake2Earn Vault look more appealing to potential stakers. #### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#3-1-using-typescript-sdk) 3.1 Using TypeScript SDK After you have selected your preferred pool config key, use this example to create a Memecoin Pool with Stake2Earn Vault: [https://github.com/MeteoraAg/stake-for-fee-sdk/blob/main/ts-client/src/examples/index.ts](https://github.com/MeteoraAg/stake-for-fee-sdk/blob/main/ts-client/src/examples/index.ts) This code example includes the steps to: * Mint a token * Create dynamic vault and pool * Create Stake2Earn Vault * Lock user’s LP to Stake2Earn Vault Copy Ask AI import AmmImpl from "@mercurial-finance/dynamic-amm-sdk"; import { NATIVE_MINT } from "@solana/spl-token"; import { Connection, Keypair, PublicKey } from "@solana/web3.js"; import BN from "bn.js"; import { StakeForFee } from "../stake-for-fee"; import { DEFAULT_KEYPAIR_PATH, DEVNET_URL, handleSendTransaction, initializeMintAndMint, loadKeypairFromFile, } from "./utils"; import { createFeeVault, createPool, lockLiquidityToFeeVault } from "./actions"; import { U64_MAX } from "../stake-for-fee/constants"; const connection = new Connection(DEVNET_URL); const poolConfigKey = new PublicKey( "BdfD7rrTZEWmf8UbEBPVpvM3wUqyrR8swjAy5SNT8gJ2" ); const mintADecimal = 9; const mintANativeAmountMultiplier = 10 ** mintADecimal; const mintAmount = 10_000; const stakeFarmAmount = 1_000; async function createPoolAndInteractWithFeeVaultExample() { const keypair = loadKeypairFromFile(DEFAULT_KEYPAIR_PATH); console.log(`Wallet ${keypair.publicKey} connected`); const amountAToMint = BigInt(mintAmount) * BigInt(mintANativeAmountMultiplier); const amountAToDeposit = BigInt(mintAmount - stakeFarmAmount) * BigInt(mintANativeAmountMultiplier); // 1,000 reserve to stake const amountB = BigInt(1_000_000); console.log("Create mint A"); const mintA = await initializeMintAndMint( connection, keypair, keypair, mintADecimal, amountAToMint ); console.log("1. Create dynamic vaults and pool"); const poolKey = await createPool( keypair, mintA, NATIVE_MINT, new BN(amountAToDeposit.toString()), new BN(amountB.toString()), poolConfigKey ); const pool = await AmmImpl.create(connection, poolKey); console.log("2. Create fee vault"); const currentSlot = await connection.getSlot("confirmed"); const currentOnchainTimestamp = await connection.getBlockTime(currentSlot); // Number of top stakers const topListLength = 10; // Number of seconds to withdraw unstaked token const unstakeLockDuration = new BN(3600 * 24); // Number of seconds for the swap fee fully dripped to stakers const secondsToFullUnlock = new BN(3600 * 24 * 7); // Timestamp to start fee distribution / drip to stakers const startFeeDistributeTimestamp = new BN(currentOnchainTimestamp + 10); // delay 10 seconds to be able to claim await createFeeVault( poolKey, pool.poolState.tokenAMint, keypair, topListLength, unstakeLockDuration, secondsToFullUnlock, startFeeDistributeTimestamp ); console.log("3. Lock user LP for fee vault"); await lockLiquidityToFeeVault(poolKey, pool, keypair, 10_000); // 10_000 means 100% of LP is being lock console.log("4. Connect to the fee vault"); const feeVault = await StakeForFee.create(connection, poolKey); console.log("5. Stake amount"); const stakeAmount = new BN( (BigInt(stakeFarmAmount) * BigInt(mintANativeAmountMultiplier)).toString() ); // 1,000 stake token (make sure you have enough balance in your wallet) const stakeTx = await feeVault.stake(stakeAmount, keypair.publicKey); const stakeSignature = await handleSendTransaction( connection, stakeTx, keypair ); console.log("Stake Signature", stakeSignature); console.log("6. Get stake balance"); await feeVault.refreshStates(); const userEscrow = await feeVault.getUserStakeAndClaimBalance( keypair.publicKey ); const stakeBalance = userEscrow.stakeEscrow.stakeAmount.toNumber() / 10 ** feeVault.accountStates.tokenAMint.decimals; console.log("Stake Balance", stakeBalance); const claimableFeeA = (userEscrow.unclaimFee.feeA.toNumber() || 0) / 10 ** feeVault.accountStates.tokenAMint.decimals; console.log("Claimable Fee A", claimableFeeA); const claimableFeeB = (userEscrow.unclaimFee.feeB.toNumber() || 0) / 10 ** feeVault.accountStates.tokenBMint.decimals; console.log("Claimable Fee B", claimableFeeB); console.log("7. Claim fee"); const claimFeeTx = await feeVault.claimFee( keypair.publicKey, new BN(U64_MAX) ); for (const [index, tx] of claimFeeTx.entries()) { const signature = await handleSendTransaction(connection, tx, keypair); console.log(`Claim Fee Signature ${index + 1}`, signature); } console.log("8. Unstake"); const unstakeKeyPair = new Keypair(); const unstakeTx = await feeVault.unstake( userEscrow.stakeEscrow.stakeAmount, unstakeKeyPair.publicKey, keypair.publicKey ); const unstakeSignature = await handleSendTransaction(connection, unstakeTx, [\ unstakeKeyPair,\ keypair,\ ]); console.log("Unstake Signature", unstakeSignature); console.log("9. Cancel unstaked"); const cancelUnstake = await feeVault.cancelUnstake( unstakeKeyPair.publicKey, keypair.publicKey ); const cancelUnstakeSignature = await handleSendTransaction( connection, cancelUnstake, keypair ); console.log("Cancel Unstake Signature", cancelUnstakeSignature); // ⚠️ This only works after unstake period is over console.log("10. Withdraw unstake"); const withdrawUnstake = await feeVault.withdraw( unstakeKeyPair.publicKey, keypair.publicKey ); const withdrawUnstakeSignature = await handleSendTransaction( connection, withdrawUnstake, keypair ); console.log("Withdraw Unstake Signature", withdrawUnstakeSignature); } createPoolAndInteractWithFeeVaultExample() .then(() => console.log("Done")) .catch(console.error); #### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#3-2-using-bun-scripts) 3.2 Using Bun Scripts Alternatively, the following bun script examples can be used to initialize a Stake2Earn Vault for the Memecoin Pool you created on Meteora. First, make sure you create the token mint and the Memecoin Pool. After that, you need to lock the liquidity, before creating the Stake2Earn Vault for the Memecoin Pool. The addresses in the allocations should contain the feeFarm (Stake2Earn Vault) address. Clone repo: [https://github.com/MeteoraAg/meteora-pool-setup](https://github.com/MeteoraAg/meteora-pool-setup) Select an example config from the list to reference and change the parameters inside according to your needs: [https://github.com/MeteoraAg/meteora-pool-setup/tree/main/config](https://github.com/MeteoraAg/meteora-pool-setup/tree/main/config) Run the script with the config file which is set with your preferred parameters ##### Lock Liquidity Copy Ask AI bun run src/lock_liquidity_for_m3m3.ts --config ./config/create_m3m3_farm.json ##### Create the Stake2Earn Vault Copy Ask AI bun run src/create_m3m3_farm.ts --config ./config/create_m3m3_farm.json [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#important-considerations) Important Considerations ----------------------------------------------------------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#stake2earn-staking-rewards-distribution-start-time) Stake2Earn staking rewards distribution start time You are recommended to configure your Stake2Earn staking rewards distribution start time (fee claim start time) to be approximately 48 hours after launch. This allows more time for total fee rewards to accumulate from trading activity in the memecoin pool. A bigger total fee reward would help make your Stake2Earn Vault look more appealing to potential stakers. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#difference-between-locking-liquidity-via-stake2earn-vs-directly-locking-liquidity-in-the-memecoin-pool) Difference between locking liquidity via Stake2Earn vs directly locking liquidity in the Memecoin Pool User lock and Stake2Earn lock use the same lock mechanism on a Dynamic AMM / Memecoin Pool. But users and Stake2Earn vaults have their own personal lock escrow account for the pool. When a user permanently locks liquidity directly on the Memecoin Pool page, the user is locking the LP token to their own personal escrow account for the pool. Fees from this locked liquidity go to the user’s wallet. However, when a user locks via the Stake2Earn creation process, the user is locking the LP to their unique Stake2Earn Vault stake escrow account. Therefore, fees from this locked liquidity go to the Stake2Earn Vault, which then distributes fees to the top stakers. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#how-to-find-the-stake2earn-vault-address-and-a-user-wallet%E2%80%99s-unique-personal-stake-escrow-address%3F) How to find the Stake2Earn vault address and a user wallet’s unique personal Stake Escrow address? Use a wallet simulator (e.g. Sherlock extension) and paste the user’s wallet address. Try to stake or unstake tokens in a Stake2Earn Vault. Click “Open explorer” and on the explorer page search for Vault and/or Stake Escrow fields to find the respective addresses. [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#other-considerations) Other Considerations --------------------------------------------------------------------------------------------------------------------------------------------------- If you plan to use a multisig on the Meteora website, please make sure it is the SquadsX multisig, as that is the only type supported on Meteora website. Otherwise, you can’t manage liquidity through the website. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/1-create-a-damm-v1-launch-pool) [Create a DAMM v2 Launch Pool\ \ Next](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool) On this page * [Getting Started](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#getting-started) * [API](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#api) * [Dependencies](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#dependencies) * [Scripts](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#scripts) * [1\. Install dependencies and initialize AmmImpl instance](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#1-install-dependencies-and-initialize-ammimpl-instance) * [1.1 Install dependencies](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#1-1-install-dependencies) * [1.2 Initialize AmmImpl instance](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#1-2-initialize-ammimpl-instance) * [2\. Fee Schedule Setup: Choose a suitable Pool and Fee Config](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#2-fee-schedule-setup%3A-choose-a-suitable-pool-and-fee-config) * [2.1 Public Pool Config List](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#2-1-public-pool-config-list) * [2.2 Default Pool Config used by Meteora Frontend](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#2-2-default-pool-config-used-by-meteora-frontend) * [2.3 New Custom Pool Config and Fee Curve for Integrators / Launchpads](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#2-3-new-custom-pool-config-and-fee-curve-for-integrators-%2F-launchpads) * [2.4 Custom Fee Curve for a Specific Pool](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#2-4-custom-fee-curve-for-a-specific-pool) * [3\. Create a Memecoin Pool with Stake2Earn Vault](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#3-create-a-memecoin-pool-with-stake2earn-vault) * [3.1 Using TypeScript SDK](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#3-1-using-typescript-sdk) * [3.2 Using Bun Scripts](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#3-2-using-bun-scripts) * [Important Considerations](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#important-considerations) * [Stake2Earn staking rewards distribution start time](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#stake2earn-staking-rewards-distribution-start-time) * [Difference between locking liquidity via Stake2Earn vs directly locking liquidity in the Memecoin Pool](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#difference-between-locking-liquidity-via-stake2earn-vs-directly-locking-liquidity-in-the-memecoin-pool) * [How to find the Stake2Earn vault address and a user wallet’s unique personal Stake Escrow address?](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#how-to-find-the-stake2earn-vault-address-and-a-user-wallet%E2%80%99s-unique-personal-stake-escrow-address%3F) * [Other Considerations](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool#other-considerations) Assistant Responses are generated using AI and may contain mistakes. --- # Create a DAMM v2 Launch Pool - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DAMM v2 Launch Pool Create a DAMM v2 Launch Pool [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) Dynamic AMM v2 (DAMM v2) is a brand new constant-product AMM program for liquidity pools, with a set of features to optimize transaction fees and provide greater flexibility for liquidity providers, launchpads, and token launches. DAMM v2 Launch Pools can also be created with an Alpha Vault as part of the token launch process. This is optional. Below we provide the steps to use Bun to configure and run sample scripts to conveniently set up a DAMM v2 Launch Pool on your own. [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#getting-started) Getting Started ----------------------------------------------------------------------------------------------------------------------------------- * Clone repo: [https://github.com/MeteoraAg/meteora-pool-setup](https://github.com/MeteoraAg/meteora-pool-setup) * Config list to reference: [https://github.com/MeteoraAg/meteora-pool-setup/tree/main/config](https://github.com/MeteoraAg/meteora-pool-setup/tree/main/config) * Readme: [https://github.com/MeteoraAg/meteora-pool-setup/blob/main/README.md](https://github.com/MeteoraAg/meteora-pool-setup/blob/main/README.md) * SDK: [https://github.com/MeteoraAg/damm-v2-sdk](https://github.com/MeteoraAg/damm-v2-sdk) * Program id: cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#dependencies) Dependencies ----------------------------------------------------------------------------------------------------------------------------- Install Bun: You’ll also need bun to run the scripts. Install it via bun installation. Then install the dependencies by running the command `bun install` [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#scripts) Scripts ------------------------------------------------------------------------------------------------------------------- The following code examples can be used to initialize and seed a DAMM v2 pool on Meteora. It allows you to configure parameters for the pool, including fees, pricing, and activation conditions, before executing initialization and seeding commands. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#1-create-customizable-damm-v2-pool) 1\. Create customizable DAMM v2 pool Clone repo: [https://github.com/MeteoraAg/meteora-pool-setup](https://github.com/MeteoraAg/meteora-pool-setup) Select an example config to reference and change the parameters inside according to your needs: [https://github.com/MeteoraAg/meteora-pool-setup/blob/main/config/create\_damm\_v2\_customize\_pool\_default\_dynamic\_fee.json](https://github.com/MeteoraAg/meteora-pool-setup/blob/main/config/create_damm_v2_customize_pool_default_dynamic_fee.json) Run the script with the config file which is updated with your preferred parameters. For example, run: Copy Ask AI bun run src/create_damm_v2_customizable_pool.ts --config ./config/create_damm_v2_customize_pool.json Replace `./config/create_damm_v2_customize_pool.json` with the path to your config file, after you have set your config parameters. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#after-deployment) After deployment To view pool on the UI, access the link below For DAMM v2 pool: [https://app.meteora.ag/pools/\`POOL\_ADDRESS\`](https://app.meteora.ag/pools/%60POOL_ADDRESS%60) [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#configuration-details) Configuration Details ----------------------------------------------------------------------------------------------------------------------------------------------- There are various config files that can be found in the config directory. It contains all the configurations required to run the scripts. We also need to provide the keypair for the payer wallet in keypair.json file. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#general-configuration) General configuration * `rpcUrl`: Solana RPC URL to get data and send transactions. * `keypairFilePath`: Keypair file path to send transactions. * `dryRun`: Set to false to send transactions. * `computeUnitPriceMicroLamports`: CU price in micro lamports unit. For example: 100000. * `createBaseToken`: Configuration to create base token. * `baseMint`: Base token address if the createBaseToken field is not set. * `quoteSymbol`: Quote token symbol, only SOL or USDC is supported. * `quoteMint`: Quote token mint, in case the user wants to create a DLMM launch pool with a token other than SOL or USDC. * `dynamicAmm`: Dynamic AMM pool configuration. * `dynamicAmmV2`: Dynamic AMM V2 pool configuration. * `dlmm`: DLMM pool configuration. * `alphaVault`: Fcfs or Prorata Alpha Vault configuration. **Some configuration constraints:** * `createBaseToken` and `baseMint` cannot be used together. * `dynamicAmm` and `dlmm` cannot be used together. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#create-base-token-configuration) Create Base Token configuration * `mintBaseTokenAmount`: Base token amount to be minted. * `baseDecimals`: Base token decimal. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#dynamic-amm-v2-configuration) Dynamic AMM v2 configuration * `baseAmount`: Base token amount. * `quoteAmount`: Quote token amount (Nullable value) * `initPrice`: Initial price for the pool * `maxPrice`: Max price range setup (null to use default) * `poolFees`: * `maxBaseFeeBps`: Starting fee in basis points (e.g., 25 = 0.25%). It is base fee if scheduler is not set. * `minBaseFeeBps`: Target fee after reduction periods. Should be equal maxBaseFeeBps when fee scheduler is not used. * `numberOfPeriod`: Number of periods for fee reduction schedule * `totalDuration`: Total duration of the fee schedule (in slots or seconds based on activation type). totalDuration == 0 if the FeeScheduler not be set up. * `feeSchedulerMode`: Fee scheduler mode (0 = linear, 1 = exponential) * `useDynamicFee`: Whether to use dynamic fee calculation based on price volatility (true/false) * `dynamicFeeConfig`: Configuration when useDynamicFee is true if not provide will use as default params in scripts * `filterPeriod`: Period for filtering price updates * `decayPeriod`: Period for decaying volatility accumulator * `reductionFactor`: Factor for reducing the volatility impact * `variableFeeControl`: Parameter controlling the variable fee response * `maxVolatilityAccumulator`: Maximum value for the volatility accumulator * `collectFeeMode`: Fee collection mode (0 = base + quote, 1 = only quote) * `activationType`: To activate pool trading base on slot or timestamp. * `activationPoint`: To activate pool trading at a point, either slot value or timestamp value base on activationType. * `hasAlphaVault`: Whether alpha vault is enabled or not for this pool. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#alpha-vault-configuration) Alpha Vault configuration * `poolType`: dynamic or dlmm pool type. * `alphaVaultType`: Alpha Vault type, could be fcfs or prorata * `depositingPoint`: Absolute value that, the slot or timestamp that allows deposit depend on the pool activation type. * `startVestingPoint`: Absolute value, the slot or timestamp that start vesting depend on the pool activation type. * `endVestingPoint`: Absolute value, the slot or timestamp that end vesting depend on the pool activation type. * `maxDepositCap`: Maximum deposit cap. * `individualDepositingCap`: Individual deposit cap. * `escrowFee`: Fee to create stake escrow account. * `whitelistMode`: permissionless or permission\_with\_merkle\_proof or permission\_with\_authority. ### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#pro-rata-configuration) Pro rata configuration * `depositingPoint`: Absolute value that, the slot or timestamp that allows deposit depend on the pool activation type. * `startVestingPoint`: Absolute value, the slot or timestamp that start vesting depend on the pool activation type. * `endVestingPoint`: Absolute value, the slot or timestamp that end vesting depend on the pool activation type. * `maxBuyingCap`: Maximum buying cap. * `escrowFee`: Fee to create stake escrow account. * `whitelistMode`: permissionless or permission\_with\_merkle\_proof or permission\_with\_authority. [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#technical-faq) Technical FAQ ------------------------------------------------------------------------------------------------------------------------------- Please read this section for additional technical considerations and troubleshooting. * * * [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#alternative%3A-using-typescript-sdk-to-create-a-damm-v2-pool) Alternative: Using TypeScript SDK to create a DAMM v2 Pool --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#getting-started-2) Getting Started The TypeScript SDK provides a set of tools and methods to interact with the Meteora Dynamic CP-AMM (DAMM v2) program. * Program Repo on Github: [https://github.com/MeteoraAg/cp-amm](https://github.com/MeteoraAg/cp-amm) * TypeScript SDK on Github: [https://github.com/MeteoraAg/cp-amm-sdk/tree/main](https://github.com/MeteoraAg/cp-amm-sdk/tree/main) * Program ID (mainnet-beta): cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG * Program ID (devnet): cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG Below you can find the main functions for creating a new pool: * `createPool` * `createCustomPool` * `createCustomPoolWithDynamicConfig` * `createPosition` * `addLiquidity` ### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#1-install-dependencies-and-initialize-instance) 1\. Install dependencies and initialize instance #### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#1-1-install) 1.1 Install Copy Ask AI pnpm install @meteora-ag/cp-amm-sdk # or yarn add @meteora-ag/cp-amm-sdk #### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#1-2-initialization) 1.2 Initialization Copy Ask AI import { Connection } from "@solana/web3.js"; import { CpAmm } from "@meteora-ag/cp-amm-sdk"; // Initialize a connection to the Solana network const connection = new Connection("https://api.mainnet-beta.solana.com"); // Create a new instance of the CpAmm SDK const cpAmm = new CpAmm(connection); #### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#1-3-test) 1.3 Test Copy Ask AI pnpm install pnpm test #### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#1-4-faucets) 1.4 Faucets [https://faucet.raccoons.dev/](https://faucet.raccoons.dev/) ### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#2-core-functions-and-use-cases) 2\. Core Functions and Use Cases #### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#createpool) createPool Creates a new standard pool according to a predefined configuration. **Function** Copy Ask AI async createPool(params: CreatePoolParams): TxBuilder **Parameters** Copy Ask AI interface CreatePoolParams { payer: PublicKey; // The wallet paying for the transaction creator: PublicKey; // The creator of the pool config: PublicKey; // The configuration account for the pool positionNft: PublicKey; // The mint for the initial position NFT tokenAMint: PublicKey; // The mint address for token A tokenBMint: PublicKey; // The mint address for token B activationPoint: BN; // 0: slot, 1: timestamp tokenAAmount: BN; // Initial amount of token A to deposit tokenBAmount: BN; // Initial amount of token B to deposit minSqrtPrice: BN; // Minimum sqrt price (typically MIN_SQRT_PRICE) maxSqrtPrice: BN; // Maximum sqrt price (typically MAX_SQRT_PRICE) tokenADecimal: number; // Decimal places for token A tokenBDecimal: number; // Decimal places for token B tokenAProgram: PublicKey; // Token program for token A tokenBProgram: PublicKey; // Token program for token B } **Returns** A transaction builder (TxBuilder) that can be used to build, sign, and send the transaction. **Example** Copy Ask AI const createPoolTx = await cpAmm.createPool({ payer: wallet.publicKey, creator: wallet.publicKey, config: configAddress, positionNft: positionNftMint, tokenAMint: usdcMint, tokenBMint: solMint, activationPoint: new BN(Date.now()), tokenAAmount: new BN(1_000_000_000), // 1,000 USDC with 6 decimals tokenBAmount: new BN(5_000_000_000), // 5 SOL with 9 decimals minSqrtPrice: MIN_SQRT_PRICE, maxSqrtPrice: MAX_SQRT_PRICE, tokenADecimal: 6, tokenBDecimal: 9, tokenAProgram: TOKEN_PROGRAM_ID, tokenBProgram: TOKEN_PROGRAM_ID }); const tx = await createPoolTx.transaction(); const signature = await wallet.sendTransaction(tx, connection); **Notes** * Both token amounts must be greater than zero * If using native SOL, it will be automatically wrapped to wSOL * The config parameter should be a valid configuration account * Pool creation automatically creates an initial position * To set your Pool and Fee Config, please read the instructions in Setting Pool and Fee Config for DAMM v2 #### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#createcustompool) createCustomPool Creates a customizable pool with specific fee parameters, reward settings, and activation conditions. **Function** Copy Ask AI async createCustomPool(params: InitializeCustomizeablePoolParams): Promise<{ tx: Transaction; pool: PublicKey; position: PublicKey; }> **Parameters** Copy Ask AI interface InitializeCustomizeablePoolParams { payer: PublicKey; // The wallet paying for the transaction creator: PublicKey; // The creator of the pool positionNft: PublicKey; // The mint for the initial position NFT tokenAMint: PublicKey; // The mint address for token A tokenBMint: PublicKey; // The mint address for token B tokenAAmount: BN; // Initial amount of token A to deposit tokenBAmount: BN; // Initial amount of token B to deposit minSqrtPrice: BN; // Minimum sqrt price maxSqrtPrice: BN; // Maximum sqrt price tokenADecimal: number; // Decimal places for token A tokenBDecimal: number; // Decimal places for token B poolFees: PoolFees; // Fee configuration hasAlphaVault: boolean; // Whether the pool has an alpha vault collectFeeMode: number; // How fees are collected (0: normal, 1: alpha) activationPoint: BN; // The slot or timestamp for activation activationType: number; // 0: slot, 1: timestamp tokenAProgram: PublicKey; // Token program for token A tokenBProgram: PublicKey; // Token program for token B } interface PoolFees { baseFee: { feeSchedulerMode: number; // 0: Linear, 1: Exponential cliffFeeNumerator: number; numberOfPeriod: number; reductionFactor: number; periodFrequency: number; }; partnerFee?: { partnerAddress: PublicKey; partnerFeeNumerator: number; }; dynamicFee?: { initialized: boolean; volatilityAccumulator?: number; binStep?: number; variableFeeControl?: { maxFeeNumerator: number; minFeeNumerator: number; volatilityThreshold: number; feeDamper: number; }; }; } **Returns** An object containing: * `tx`: The transaction to sign and send * `pool`: The public key of the created pool * `position`: The public key of the initial position **Example** Copy Ask AI const poolFees = { baseFee: { feeSchedulerMode: 0, // 0: Linear, 1: Exponential cliffFeeNumerator: 1_000_000, numberOfPeriod: 0, reductionFactor: 0, periodFrequency: 0 }, partnerFee: { partnerAddress: partnerWallet.publicKey, partnerFeeNumerator: 1000, }, dynamicFee: { initialized: false } }; const { tx, pool, position } = await cpAmm.createCustomPool({ payer: wallet.publicKey, creator: wallet.publicKey, positionNft: positionNftMint, tokenAMint: usdcMint, tokenBMint: btcMint, tokenAAmount: new BN(5_000_000_000), tokenBAmount: new BN(20_000_000), minSqrtPrice: MIN_SQRT_PRICE, maxSqrtPrice: MAX_SQRT_PRICE, tokenADecimal: 6, tokenBDecimal: 8, poolFees, hasAlphaVault: false, collectFeeMode: 0, // 0: BothToken, 1: onlyB activationPoint: new BN(Date.now()), activationType: 1, // 0: slot, 1: timestamp tokenAProgram: TOKEN_PROGRAM_ID, tokenBProgram: TOKEN_PROGRAM_ID }); const signature = await wallet.sendTransaction(tx, connection); **Notes** * Use this function instead of createPool when you need custom fee structures * Dynamic fees can adjust based on market volatility * Partner fees allow a portion of trading fees to be directed to a specific account * Alpha vault is an advanced feature for protocol-owned liquidity #### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#createcustompoolwithdynamicconfig) createCustomPoolWithDynamicConfig Creates a customizable pool with dynamic configuration, allowing for specific fee parameters with specified pool creator authority. **Function** Copy Ask AI async createCustomPoolWithDynamicConfig(params: InitializeCustomizeablePoolWithDynamicConfigParams): Promise<{ tx: Transaction; pool: PublicKey; position: PublicKey; }> **Parameters** Copy Ask AI interface InitializeCustomizeablePoolWithDynamicConfigParams { payer: PublicKey; // The wallet paying for the transaction creator: PublicKey; // The creator of the pool positionNft: PublicKey; // The mint for the initial position NFT tokenAMint: PublicKey; // The mint address for token A tokenBMint: PublicKey; // The mint address for token B tokenAAmount: BN; // Initial amount of token A to deposit tokenBAmount: BN; // Initial amount of token B to deposit sqrtMinPrice: BN; // Minimum sqrt price sqrtMaxPrice: BN; // Maximum sqrt price initSqrtPrice: BN; // Initial sqrt price in Q64 format liquidityDelta: BN; // Initial liquidity in Q64 format poolFees: PoolFeesParams; // Fee configuration hasAlphaVault: boolean; // Whether the pool has an alpha vault collectFeeMode: number; // How fees are collected (0: normal, 1: alpha) activationPoint: BN | null; // The slot or timestamp for activation (null for immediate) activationType: number; // 0: slot, 1: timestamp tokenAProgram: PublicKey; // Token program for token A tokenBProgram: PublicKey; // Token program for token B config: PublicKey; // dynamic config account poolCreatorAuthority: PublicKey; // Authority allowed to create pools with this config } **Returns** An object containing: * `tx`: The transaction to sign and send * `pool`: The public key of the created pool * `position`: The public key of the initial position **Example** Copy Ask AI // First, prepare the pool creation parameters const tokenAAmount = new BN(5_000_000_000); const tokenBAmount = new BN(20_000_000); const sqrtPrice = getSqrtPriceFromPrice("172", tokenADecimal, tokenBDecimal); const sqrtMinPrice = getSqrtPriceFromPrice("4", tokenADecimal, tokenBDecimal); const sqrtMaxPrice = getSqrtPriceFromPrice("400", tokenADecimal, tokenBDecimal); const { initSqrtPrice, liquidityDelta } = cpAmm.getLiquidityDelta({ maxAmountTokenA: tokenAAmount, maxAmountTokenB: tokenBAmount, sqrtMaxPrice, sqrtMinPrice, sqrtPrice, }); const baseFeeParams = getBaseFeeParams(25, 25, FeeSchedulerMode.Linear, 0, 0); // base fee: 0.25% const dynamicFeeParams = getDynamicFeeParams(25); // max dynamic fee 0.25% const poolFees: PoolFeesParams = { baseFee: baseFeeParams, protocolFeePercent: 20, partnerFeePercent: 0, referralFeePercent: 20, dynamicFee: dynamicFeeParams, }; const { tx, pool, position } = await cpAmm.createCustomPoolWithDynamicConfig({ payer: wallet.publicKey, creator: wallet.publicKey, config: dynamicConfigAddress, poolCreatorAuthority: poolCreatorAuth.publicKey, positionNft: positionNftMint, tokenAMint: usdcMint, tokenBMint: btcMint, tokenAAmount, tokenBAmount, sqrtMinPrice, sqrtMaxPrice, initSqrtPrice, liquidityDelta, poolFees, hasAlphaVault: false, collectFeeMode: 0, // 0: Both tokens, 1: Only token B activationPoint: null, activationType: 1, // 0: slot, 1: timestamp tokenAProgram: TOKEN_PROGRAM_ID, tokenBProgram: TOKEN_PROGRAM_ID, }); #### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#createposition) createPosition Creates a new position in an existing pool. **Function** Copy Ask AI async createPosition(params: CreatePositionParams): TxBuilder **Parameters** Copy Ask AI interface CreatePositionParams { owner: PublicKey; // The owner of the position payer: PublicKey; // The wallet paying for the transaction pool: PublicKey; // The pool to create a position in positionNft: PublicKey; // The mint for the position NFT } **Returns** A transaction builder (TxBuilder) that can be used to build, sign, and send the transaction. **Example** Copy Ask AI const createPositionTx = await cpAmm.createPosition({ owner: wallet.publicKey, payer: wallet.publicKey, pool: poolAddress, positionNft: positionNftMint }); const tx = await createPositionTx.transaction(); const signature = await wallet.sendTransaction(tx, connection); **Notes** * The positionNft should be a new mint that doesn’t already have a position * Creating a position doesn’t automatically add liquidity * After creating a position, use addLiquidity to provide tokens #### [​](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#addliquidity) addLiquidity Adds liquidity to an existing position. **Function** Copy Ask AI async addLiquidity(params: AddLiquidityParams): TxBuilder **Parameters** Copy Ask AI interface AddLiquidityParams { owner: PublicKey; // The owner of the position pool: PublicKey; // The pool address position: PublicKey; // The position address positionNftMint: PublicKey; // The position NFT mint liquidityDeltaQ64: BN; // The amount of liquidity to add in Q64 format maxAmountTokenA: BN; // Maximum amount of token A to use maxAmountTokenB: BN; // Maximum amount of token B to use tokenAAmountThreshold: BN; // Minimum acceptable token A amount (slippage protection) tokenBAmountThreshold: BN; // Minimum acceptable token B amount (slippage protection) tokenAMint: PublicKey; // The mint of token A tokenBMint: PublicKey; // The mint of token B tokenAVault: PublicKey; // The pool's token A vault tokenBVault: PublicKey; // The pool's token B vault tokenAProgram: PublicKey; // Token program for token A tokenBProgram: PublicKey; // Token program for token B } **Returns** A transaction builder (TxBuilder) that can be used to build, sign, and send the transaction. **Example** Copy Ask AI // Calculate liquidity delta first const liquidityDelta = await cpAmm.getLiquidityDelta({ maxAmountTokenA: new BN(1_000_000_000), // 1,000 USDC maxAmountTokenB: new BN(5_000_000_000), // 5 SOL sqrtPrice: poolState.sqrtPrice, sqrtMinPrice: MIN_SQRT_PRICE, sqrtMaxPrice: MAX_SQRT_PRICE }); // Add liquidity const addLiquidityTx = await cpAmm.addLiquidity({ owner: wallet.publicKey, pool: poolAddress, position: positionAddress, positionNftMint: positionNftMint, liquidityDeltaQ64: liquidityDelta, maxAmountTokenA: new BN(1_000_000_000), maxAmountTokenB: new BN(5_000_000_000), tokenAAmountThreshold: new BN(0), tokenBAmountThreshold: new BN(0), tokenAMint: poolState.tokenAMint, tokenBMint: poolState.tokenBMint, tokenAVault: poolState.tokenAVault, tokenBVault: poolState.tokenBVault, tokenAProgram: TOKEN_PROGRAM_ID, tokenBProgram: TOKEN_PROGRAM_ID }); const tx = await addLiquidityTx.transaction(); const signature = await wallet.sendTransaction(tx, connection); **Notes** * Calculate the liquidity delta first using getLiquidityDelta * The SDK handles wrapping/unwrapping of SOL automatically * Token accounts are created automatically if they don’t exist * Set appropriate thresholds to protect against slippage Was this page helpful? YesNo [Previous\ \ Create a Stake2Earn v1 Launch Pool](https://docs.meteora.ag/developer-guide/launch-pools/damm-v1/2-create-a-stake2earn-v1-launch-pool) On this page * [Getting Started](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#getting-started) * [Dependencies](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#dependencies) * [Scripts](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#scripts) * [1\. Create customizable DAMM v2 pool](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#1-create-customizable-damm-v2-pool) * [After deployment](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#after-deployment) * [Configuration Details](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#configuration-details) * [General configuration](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#general-configuration) * [Create Base Token configuration](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#create-base-token-configuration) * [Dynamic AMM v2 configuration](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#dynamic-amm-v2-configuration) * [Alpha Vault configuration](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#alpha-vault-configuration) * [Pro rata configuration](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#pro-rata-configuration) * [Technical FAQ](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#technical-faq) * [Alternative: Using TypeScript SDK to create a DAMM v2 Pool](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#alternative%3A-using-typescript-sdk-to-create-a-damm-v2-pool) * [Getting Started](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#getting-started-2) * [1\. Install dependencies and initialize instance](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#1-install-dependencies-and-initialize-instance) * [1.1 Install](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#1-1-install) * [1.2 Initialization](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#1-2-initialization) * [1.3 Test](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#1-3-test) * [1.4 Faucets](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#1-4-faucets) * [2\. Core Functions and Use Cases](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#2-core-functions-and-use-cases) * [createPool](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#createpool) * [createCustomPool](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#createcustompool) * [createCustomPoolWithDynamicConfig](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#createcustompoolwithdynamicconfig) * [createPosition](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#createposition) * [addLiquidity](https://docs.meteora.ag/developer-guide/launch-pools/damm-v2/1-create-a-damm-v2-launch-pool#addliquidity) Assistant Responses are generated using AI and may contain mistakes. --- # Stake2Earn Integration - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Typescript SDK Stake2Earn Integration [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) This guide provides instructions on how to integrate DAMM v1 pools with Stake2Earn. [​](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#prerequisites) Prerequisites =========================================================================================================================================== Before you begin, here are some important resources: * **Program ID (Mainnet & Devnet):** `FEESngU3neckdwib9X3KWqdL7Mjmqk9XNp3uh5JbP4KP` * **TypeScript SDK Repository:** [@meteora-ag/m3m3](https://github.com/MeteoraAg/stake-for-fee-sdk) [​](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#install-dependencies) Install Dependencies ========================================================================================================================================================= Copy Ask AI npm i @meteora-ag/m3m3 @coral-xyz/anchor @solana/web3.js @solana/spl-token @solana/spl-token-registry [​](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#initialize-stakeforfee-instance) Initialize StakeForFee Instance =============================================================================================================================================================================== Copy Ask AI import StakeForFee from "@meteora-ag/m3m3"; import { PublicKey } from "@solana/web3.js"; import { Wallet, AnchorProvider } from "@project-serum/anchor"; // Connection, Wallet, and AnchorProvider to interact with the network const mainnetConnection = new Connection("https://api.mainnet-beta.solana.com"); const mockWallet = new Wallet(new Keypair()); const provider = new AnchorProvider(mainnetConnection, mockWallet, { commitment: "confirmed", }); // Alternatively, to use Solana Wallet Adapter const poolAddress = new PublicKey( "G2MRSjNjCbFUmMf32Z1aXYhy6pc1ihLyYg6orKedyjJG" ); const m3m3 = await StakeForFee.create(connection, poolAddress); [​](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#code-examples-to-interact-with-stakeforfee) Code Examples to Interact with StakeForFee ===================================================================================================================================================================================================== In the following code, feeFarm refers to the Stake2Earn Vault. [​](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#stake) Stake --------------------------------------------------------------------------------------------------------------------------- Copy Ask AI const stakeAmount = new BN( 1_000 * 10 ** feeFarm.accountStates.tokenAMint.decimals ); // 1,000 stake token (make sure you have enough balance in your wallet) const stakeTx = await feeFarm.stake(stakeAmount, mockWallet.publicKey); const stakeTxHash = await provider.sendAndConfirm(stakeTx); // Transaction hash [​](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#get-stake-balance-and-claimable-balance) Get Stake Balance and Claimable Balance ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Copy Ask AI await feeFarm.refreshStates(); // make sure to refresh states to get the latest data const userEscrow = await feeFarm.getUserStakeAndClaimBalance( mockWallet.publicKey ); const stakeBalance = userStakeEscrow.stakeEscrow.stakeAmount.toNumber() / 10 ** feeFarm.accountStates.tokenAMint.decimals; const claimableFeeA = fromLamports( userStakeEscrow.unclaimFee.feeA || 0, feeFarm.accountStates.tokenAMint.decimals ); const claimableFeeB = fromLamports( userStakeEscrow.unclaimFee.feeB || 0, feeFarm.accountStates.tokenBMint.decimals ); [​](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#claim-fee) Claim Fee ----------------------------------------------------------------------------------------------------------------------------------- Copy Ask AI const claimFeeTx = await feeVault.claimFee( mockWallet.publicKey, new BN(U64_MAX) ); // second param is max amount, so usually we just put max number BN.js can support const claimfeeTxHash = await provider.sendAndConfirm(claimFeeTx); // Transaction hash [​](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#unstake) Unstake ------------------------------------------------------------------------------------------------------------------------------- Copy Ask AI const unstakeKeyPair = new Keypair(); const unstakeTx = await feeVault.unstake( userEscrow.stakeEscrow.stakeAmount, unstakeKeyPair.publicKey, mockWallet.publicKey ); unstakeTx.partialSign(unstakeKeyPair); // Make sure to partial sign unstakeKeypair const unstakeTxHash = await provider.sendAndConfirm(unstakeTx); // Transaction hash [​](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#get-unstake-period-seconds) Get Unstake Period (Seconds) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- Copy Ask AI const unstakePeriodInSeconds = feeFarm.accountStates.feeVault.configuration.unstakeLockDuration.toNumber(); [​](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#cancel-unstake) Cancel Unstake --------------------------------------------------------------------------------------------------------------------------------------------- Copy Ask AI const cancelUnstakeTx = await feeFarm.cancelUnstake( unstakeKeyPair.publicKey, mockWallet.publicKey ); const cancelUnstakeTxHash = await provider.sendAndConfirm(cancelUnstakeTx); [​](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#withdraw) Withdraw --------------------------------------------------------------------------------------------------------------------------------- Copy Ask AI const withdrawTx = await feeFarm.withdraw( unstakeKeyPair.publicKey, mockWallet.publicKey ); const withdrawTxHash = await provider.sendAndConfirm(withdrawTx); [​](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#how-to-create-a-damm-v1-with-stake2earn-vault) How to Create a DAMM v1 with Stake2Earn Vault =========================================================================================================================================================================================================== You are recommended to configure your Stake2Earn staking rewards distribution start time (fee claim start time) to be approximately 48 hours after launch. This allows more time for total fee rewards to accumulate from trading activity in the memecoin pool. A bigger total fee reward would help make your Stake2Earn Vault look more appealing to potential stakers. [​](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#typescript-code-example) TypeScript Code Example =============================================================================================================================================================== Use this example to create a DAMM v1 with Stake2Earn Vault: [https://github.com/MeteoraAg/stake-for-fee-sdk/blob/main/ts-client/src/examples/index.ts](https://github.com/MeteoraAg/stake-for-fee-sdk/blob/main/ts-client/src/examples/index.ts) This code example includes the steps to: * Mint a token * Create dynamic vault and pool * Create Stake2Earn Vault * Lock user’s LP to Stake2Earn Vault Copy Ask AI import AmmImpl from "@meteora-ag/dynamic-amm-sdk"; import { NATIVE_MINT } from "@solana/spl-token"; import { Connection, Keypair, PublicKey } from "@solana/web3.js"; import BN from "bn.js"; import { StakeForFee } from "../stake-for-fee"; import { DEFAULT_KEYPAIR_PATH, DEVNET_URL, handleSendTransaction, initializeMintAndMint, loadKeypairFromFile, } from "./utils"; import { createFeeVault, createPool, lockLiquidityToFeeVault } from "./actions"; import { U64_MAX } from "../stake-for-fee/constants"; const connection = new Connection(DEVNET_URL); const poolConfigKey = new PublicKey( "BdfD7rrTZEWmf8UbEBPVpvM3wUqyrR8swjAy5SNT8gJ2" ); const mintADecimal = 9; const mintANativeAmountMultiplier = 10 ** mintADecimal; const mintAmount = 10_000; const stakeFarmAmount = 1_000; async function createPoolAndInteractWithFeeVaultExample() { const keypair = loadKeypairFromFile(DEFAULT_KEYPAIR_PATH); console.log(`Wallet ${keypair.publicKey} connected`); const amountAToMint = BigInt(mintAmount) * BigInt(mintANativeAmountMultiplier); const amountAToDeposit = BigInt(mintAmount - stakeFarmAmount) * BigInt(mintANativeAmountMultiplier); // 1,000 reserve to stake const amountB = BigInt(1_000_000); console.log("Create mint A"); const mintA = await initializeMintAndMint( connection, keypair, keypair, mintADecimal, amountAToMint ); console.log("1. Create dynamic vaults and pool"); const poolKey = await createPool( keypair, mintA, NATIVE_MINT, new BN(amountAToDeposit.toString()), new BN(amountB.toString()), poolConfigKey ); const pool = await AmmImpl.create(connection, poolKey); console.log("2. Create fee vault"); const currentSlot = await connection.getSlot("confirmed"); const currentOnchainTimestamp = await connection.getBlockTime(currentSlot); // Number of top stakers const topListLength = 10; // Number of seconds to withdraw unstaked token const unstakeLockDuration = new BN(3600 * 24); // Number of seconds for the swap fee fully dripped to stakers const secondsToFullUnlock = new BN(3600 * 24 * 7); // Timestamp to start fee distribution / drip to stakers const startFeeDistributeTimestamp = new BN(currentOnchainTimestamp + 10); // delay 10 seconds to be able to claim await createFeeVault( poolKey, pool.poolState.tokenAMint, keypair, topListLength, unstakeLockDuration, secondsToFullUnlock, startFeeDistributeTimestamp ); console.log("3. Lock user LP for fee vault"); await lockLiquidityToFeeVault(poolKey, pool, keypair, 10_000); // 10_000 means 100% of LP is being lock console.log("4. Connect to the fee vault"); const feeVault = await StakeForFee.create(connection, poolKey); console.log("5. Stake amount"); const stakeAmount = new BN( (BigInt(stakeFarmAmount) * BigInt(mintANativeAmountMultiplier)).toString() ); // 1,000 stake token (make sure you have enough balance in your wallet) const stakeTx = await feeVault.stake(stakeAmount, keypair.publicKey); const stakeSignature = await handleSendTransaction( connection, stakeTx, keypair ); console.log("Stake Signature", stakeSignature); console.log("6. Get stake balance"); await feeVault.refreshStates(); const userEscrow = await feeVault.getUserStakeAndClaimBalance( keypair.publicKey ); const stakeBalance = userEscrow.stakeEscrow.stakeAmount.toNumber() / 10 ** feeVault.accountStates.tokenAMint.decimals; console.log("Stake Balance", stakeBalance); const claimableFeeA = (userEscrow.unclaimFee.feeA.toNumber() || 0) / 10 ** feeVault.accountStates.tokenAMint.decimals; console.log("Claimable Fee A", claimableFeeA); const claimableFeeB = (userEscrow.unclaimFee.feeB.toNumber() || 0) / 10 ** feeVault.accountStates.tokenBMint.decimals; console.log("Claimable Fee B", claimableFeeB); console.log("7. Claim fee"); const claimFeeTx = await feeVault.claimFee( keypair.publicKey, new BN(U64_MAX) ); for (const [index, tx] of claimFeeTx.entries()) { const signature = await handleSendTransaction(connection, tx, keypair); console.log(`Claim Fee Signature ${index + 1}`, signature); } console.log("8. Unstake"); const unstakeKeyPair = new Keypair(); const unstakeTx = await feeVault.unstake( userEscrow.stakeEscrow.stakeAmount, unstakeKeyPair.publicKey, keypair.publicKey ); const unstakeSignature = await handleSendTransaction(connection, unstakeTx, [\ unstakeKeyPair,\ keypair,\ ]); console.log("Unstake Signature", unstakeSignature); console.log("9. Cancel unstaked"); const cancelUnstake = await feeVault.cancelUnstake( unstakeKeyPair.publicKey, keypair.publicKey ); const cancelUnstakeSignature = await handleSendTransaction( connection, cancelUnstake, keypair ); console.log("Cancel Unstake Signature", cancelUnstakeSignature); // ⚠️ This only works after unstake period is over console.log("10. Withdraw unstake"); const withdrawUnstake = await feeVault.withdraw( unstakeKeyPair.publicKey, keypair.publicKey ); const withdrawUnstakeSignature = await handleSendTransaction( connection, withdrawUnstake, keypair ); console.log("Withdraw Unstake Signature", withdrawUnstakeSignature); } createPoolAndInteractWithFeeVaultExample() .then(() => console.log("Done")) .catch(console.error); [​](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#cpi-example-to-initialize-a-stake2earn-vault) CPI Example to Initialize a Stake2Earn Vault ========================================================================================================================================================================================================= Initialize a Stake2Earn Vault: [https://github.com/MeteoraAg/cpi-examples](https://github.com/MeteoraAg/cpi-examples) ### [​](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#script-to-deploy-a-stake2earn-vault) Script to Deploy a Stake2Earn Vault Alternatively, we also provide a convenient script to deploy a new Stake2Earn vault. The following script is only for deploying a new Stake2Earn vault only. To deploy a DAMM v1 with permanently locked liquidity, please refer to DAMM v1 Integration. [​](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#getting-started) Getting Started ----------------------------------------------------------------------------------------------------------------------------------------------- * **Repository:** [https://github.com/MeteoraAg/meteora-pool-setup](https://github.com/MeteoraAg/meteora-pool-setup) * **Pool config list:** [https://github.com/MeteoraAg/meteora-pool-setup/tree/main/config](https://github.com/MeteoraAg/meteora-pool-setup/tree/main/config) [​](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#dependencies) Dependencies ----------------------------------------------------------------------------------------------------------------------------------------- Copy Ask AI bun install [​](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#code-example) Code Example ----------------------------------------------------------------------------------------------------------------------------------------- Copy Ask AI { "rpcUrl": "https://api.mainnet-beta.solana.com", "dryRun": false, "keypairFilePath": "keypair.json", "computeUnitPriceMicroLamports": 100000, "baseMint": "FvxPZWBViVsmzS11MGi3ybNGjTKChwdfXU3UWopBujTn", "quoteSymbol": "SOL", "m3m3": { "topListLength": 100, "unstakeLockDurationSecs": 25200, "secondsToFullUnlock": 86400, "startFeeDistributeTimestamp": 1737590400 }, "lockLiquidity": { "allocations": [\ {\ "percentage": 100,\ "address": "D2Yt1jtjjk6cPiwYKs6krtbjfjjYiQmYWbFtTrgL2WR2"\ }\ ] } } You can deploy a DAMM v1 pool with a Stake2Earn Vault and Alpha Vault if required. [​](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#important-considerations) Important Considerations ================================================================================================================================================================= [​](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#stake2earn-staking-rewards-distribution-start-time) Stake2Earn Staking Rewards Distribution Start Time --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- You are recommended to configure your Stake2Earn staking rewards distribution start time (fee claim start time) to be approximately 48 hours after launch. This allows more time for total fee rewards to accumulate from trading activity in the memecoin pool. A bigger total fee reward would help make your Stake2Earn Vault look more appealing to potential stakers. [​](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#difference-between-locking-liquidity-via-stake2earn-vs-directly-locking-liquidity-in-the-memecoin-pool) Difference Between Locking Liquidity via Stake2Earn vs Directly Locking Liquidity in the Memecoin Pool ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- User lock and Stake2Earn lock use the same lock mechanism on a Dynamic AMM / Memecoin Pool. But users and Stake2Earn vaults have their own personal lock escrow account for the pool. When a user permanently locks liquidity directly on the Memecoin Pool page, the user is locking the LP token to their own personal escrow account for the pool. Fees from this locked liquidity go to the user’s wallet. However, when a user locks via the Stake2Earn creation process, the user is locking the LP to their unique Stake2Earn Vault stake escrow account. Therefore, fees from this locked liquidity go to the Stake2Earn Vault, which then distributes fees to the top stakers. [​](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#how-to-find-the-stake2earn-vault-address-and-a-user-wallet%E2%80%99s-unique-personal-stake-escrow-address%3F) How to Find the Stake2Earn Vault Address and a User Wallet’s Unique Personal Stake Escrow Address? ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Use a wallet simulator (e.g. Sherlock extension) and paste the user’s wallet address. Try to stake or unstake tokens in a Stake2Earn Vault. Click “Open explorer” and on the explorer page search for Vault and/or Stake Escrow fields to find the respective addresses. [​](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#other-considerations) Other Considerations --------------------------------------------------------------------------------------------------------------------------------------------------------- * If you plan to use a multisig on the Meteora website, please make sure it is the SquadsX multisig, as that is the only type supported on Meteora website. Otherwise, you can’t manage liquidity through the website. * There can only be one Stake2Earn Vault attached to each Memecoin Pool. Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/1-getting-started) [Swagger UIStake2Earn\ \ Next](https://docs.meteora.ag/developer-guide/integrations/stake2earn/apis/1-api-endpoints) On this page * [Prerequisites](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#prerequisites) * [Install Dependencies](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#install-dependencies) * [Initialize StakeForFee Instance](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#initialize-stakeforfee-instance) * [Code Examples to Interact with StakeForFee](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#code-examples-to-interact-with-stakeforfee) * [Stake](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#stake) * [Get Stake Balance and Claimable Balance](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#get-stake-balance-and-claimable-balance) * [Claim Fee](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#claim-fee) * [Unstake](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#unstake) * [Get Unstake Period (Seconds)](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#get-unstake-period-seconds) * [Cancel Unstake](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#cancel-unstake) * [Withdraw](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#withdraw) * [How to Create a DAMM v1 with Stake2Earn Vault](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#how-to-create-a-damm-v1-with-stake2earn-vault) * [TypeScript Code Example](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#typescript-code-example) * [CPI Example to Initialize a Stake2Earn Vault](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#cpi-example-to-initialize-a-stake2earn-vault) * [Script to Deploy a Stake2Earn Vault](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#script-to-deploy-a-stake2earn-vault) * [Getting Started](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#getting-started) * [Dependencies](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#dependencies) * [Code Example](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#code-example) * [Important Considerations](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#important-considerations) * [Stake2Earn Staking Rewards Distribution Start Time](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#stake2earn-staking-rewards-distribution-start-time) * [Difference Between Locking Liquidity via Stake2Earn vs Directly Locking Liquidity in the Memecoin Pool](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#difference-between-locking-liquidity-via-stake2earn-vs-directly-locking-liquidity-in-the-memecoin-pool) * [How to Find the Stake2Earn Vault Address and a User Wallet’s Unique Personal Stake Escrow Address?](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#how-to-find-the-stake2earn-vault-address-and-a-user-wallet%E2%80%99s-unique-personal-stake-escrow-address%3F) * [Other Considerations](https://docs.meteora.ag/developer-guide/integrations/stake2earn/typescript-sdk/2-stake2earn-integration#other-considerations) Assistant Responses are generated using AI and may contain mistakes. --- # Dynamic Vault SDK Functions - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Typescript SDK Dynamic Vault SDK Functions [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#core-functions) Core Functions ----------------------------------------------------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#createpermissionlessvaultinstruction) createPermissionlessVaultInstruction Creates an instruction to initialize a new permissionless vault. **Function** Copy Ask AI static async createPermissionlessVaultInstruction( connection: Connection, payer: PublicKey, tokenMint: PublicKey, opt?: { cluster?: Cluster; programId?: string; } ): Promise **Parameters** Copy Ask AI interface CreatePermissionlessVaultParams { connection: Connection; // Solana connection instance payer: PublicKey; // The wallet paying for the transaction tokenMint: PublicKey; // The mint address of the token for the vault opt?: { cluster?: Cluster; // Network cluster (mainnet-beta, devnet, testnet) programId?: string; // Custom program ID (optional) }; } **Returns** A transaction instruction that can be used to initialize the vault. **Example** Copy Ask AI const instruction = await VaultImpl.createPermissionlessVaultInstruction( connection, wallet.publicKey, usdcMint, { cluster: 'mainnet-beta', programId: CUSTOM_PROGRAM_ID // optional } ); const transaction = new Transaction().add(instruction); const signature = await wallet.sendTransaction(transaction, connection); **Notes** * Creates all necessary PDAs for the vault including vault account, token vault, and LP mint * The vault will be permissionless, allowing anyone to deposit and withdraw * Payer will cover the rent costs for the new accounts * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#fetchmultipleuserbalance) fetchMultipleUserBalance Fetches LP token balances for multiple vaults for a specific user. **Function** Copy Ask AI static async fetchMultipleUserBalance( connection: Connection, lpMintList: Array, owner: PublicKey ): Promise> **Parameters** Copy Ask AI interface FetchMultipleUserBalanceParams { connection: Connection; // Solana connection instance lpMintList: Array; // Array of LP mint addresses owner: PublicKey; // The user's wallet address } **Returns** An array of BN values representing the user’s LP token balance for each vault. **Example** Copy Ask AI const lpMints = [vault1LpMint, vault2LpMint, vault3LpMint]; const balances = await VaultImpl.fetchMultipleUserBalance( connection, lpMints, wallet.publicKey ); balances.forEach((balance, index) => { console.log(`Vault ${index} LP balance: ${balance.toString()}`); }); **Notes** * Returns 0 for vaults where the user has no LP tokens * Efficiently fetches multiple balances in a single call * Useful for portfolio overview displays * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#createmultiple) createMultiple Creates multiple vault instances from token mint addresses. **Function** Copy Ask AI static async createMultiple( connection: Connection, tokenMints: Array, opt?: { seedBaseKey?: PublicKey; allowOwnerOffCurve?: boolean; cluster?: Cluster; programId?: string; affiliateId?: PublicKey; affiliateProgramId?: string; } ): Promise> **Parameters** Copy Ask AI interface CreateMultipleParams { connection: Connection; // Solana connection instance tokenMints: Array; // Array of token mint addresses opt?: { seedBaseKey?: PublicKey; // Optional seed for deterministic PDAs allowOwnerOffCurve?: boolean; // Allow off-curve owner accounts cluster?: Cluster; // Network cluster programId?: string; // Custom vault program ID affiliateId?: PublicKey; // Affiliate partner ID affiliateProgramId?: string; // Affiliate program ID }; } **Returns** An array of `VaultImpl` instances for the specified token mints. **Example** Copy Ask AI const tokenMints = [usdcMint, solMint, btcMint]; const vaults = await VaultImpl.createMultiple(connection, tokenMints, { cluster: 'mainnet-beta', affiliateId: partnerPublicKey }); vaults.forEach((vault, index) => { console.log(`Vault ${index}: ${vault.vaultPda.toString()}`); }); **Notes** * Efficiently creates multiple vault instances in parallel * All vaults must already exist on-chain * Useful for initializing a portfolio of vaults * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#createmultiplewithpda) createMultipleWithPda Creates multiple vault instances from vault PDA addresses. **Function** Copy Ask AI static async createMultipleWithPda( connection: Connection, vaultsPda: Array, opt?: { seedBaseKey?: PublicKey; allowOwnerOffCurve?: boolean; cluster?: Cluster; programId?: string; affiliateId?: PublicKey; affiliateProgramId?: string; } ): Promise> **Parameters** Copy Ask AI interface CreateMultipleWithPdaParams { connection: Connection; // Solana connection instance vaultsPda: Array; // Array of vault PDA addresses opt?: { seedBaseKey?: PublicKey; // Optional seed for deterministic PDAs allowOwnerOffCurve?: boolean; // Allow off-curve owner accounts cluster?: Cluster; // Network cluster programId?: string; // Custom vault program ID affiliateId?: PublicKey; // Affiliate partner ID affiliateProgramId?: string; // Affiliate program ID }; } **Returns** An array of `VaultImpl` instances for the specified vault PDAs. **Example** Copy Ask AI const vaultPdas = [vault1Pda, vault2Pda, vault3Pda]; const vaults = await VaultImpl.createMultipleWithPda(connection, vaultPdas, { affiliateId: partnerPublicKey, affiliateProgramId: CUSTOM_AFFILIATE_PROGRAM_ID }); console.log(`Created ${vaults.length} vault instances`); **Notes** * Use this when you already have the vault PDA addresses * More direct than `createMultiple` when PDAs are known * Supports affiliate integration for revenue sharing * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#create) create Creates a single vault instance from a token mint address. **Function** Copy Ask AI static async create( connection: Connection, tokenAddress: PublicKey, opt?: { seedBaseKey?: PublicKey; allowOwnerOffCurve?: boolean; cluster?: Cluster; programId?: string; affiliateId?: PublicKey; affiliateProgramId?: string; } ): Promise **Parameters** Copy Ask AI interface CreateParams { connection: Connection; // Solana connection instance tokenAddress: PublicKey; // Token mint address opt?: { seedBaseKey?: PublicKey; // Optional seed for deterministic PDAs allowOwnerOffCurve?: boolean; // Allow off-curve owner accounts cluster?: Cluster; // Network cluster programId?: string; // Custom vault program ID affiliateId?: PublicKey; // Affiliate partner ID affiliateProgramId?: string; // Affiliate program ID }; } **Returns** A `VaultImpl` instance for the specified token. **Example** Copy Ask AI const vault = await VaultImpl.create(connection, usdcMint, { cluster: 'mainnet-beta', affiliateId: partnerPublicKey }); console.log(`Vault PDA: ${vault.vaultPda.toString()}`); console.log(`Token Mint: ${vault.tokenMint.address.toString()}`); console.log(`LP Supply: ${vault.tokenLpMint.supply.toString()}`); **Notes** * Use this for creating a single vault instance * The vault must already exist on-chain * Automatically fetches and caches vault state information * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#getuserbalance) getUserBalance Gets the user’s LP token balance for this vault. **Function** Copy Ask AI async getUserBalance(owner: PublicKey): Promise **Parameters** Copy Ask AI interface GetUserBalanceParams { owner: PublicKey; // The user's wallet address } **Returns** A BN representing the user’s LP token balance. **Example** Copy Ask AI const vault = await VaultImpl.create(connection, usdcMint); const userBalance = await vault.getUserBalance(wallet.publicKey); console.log(`User LP balance: ${userBalance.toString()}`); // Convert to human readable format const balanceInTokens = userBalance.div(new BN(10).pow(new BN(vault.tokenLpMint.decimals))); console.log(`User balance: ${balanceInTokens.toString()} LP tokens`); **Notes** * Returns 0 if the user has no LP tokens * Handles both direct deposits and affiliate deposits * Balance represents share of the vault’s total assets * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#getvaultsupply) getVaultSupply Gets the total LP token supply for the vault. **Function** Copy Ask AI async getVaultSupply(): Promise **Returns** A BN representing the total LP token supply. **Example** Copy Ask AI const vault = await VaultImpl.create(connection, usdcMint); const totalSupply = await vault.getVaultSupply(); console.log(`Total LP supply: ${totalSupply.toString()}`); // Calculate user's share percentage const userBalance = await vault.getUserBalance(wallet.publicKey); const userSharePercentage = userBalance.mul(new BN(100)).div(totalSupply); console.log(`User owns ${userSharePercentage.toString()}% of the vault`); **Notes** * Refetches the latest LP mint supply from the blockchain * Updates the cached `tokenLpMint` property * Use the cached `vault.tokenLpMint.supply` for performance if recent data is sufficient * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#getwithdrawableamount) getWithdrawableAmount Gets the amount of assets that can be immediately withdrawn from the vault. **Function** Copy Ask AI async getWithdrawableAmount(): Promise **Returns** A BN representing the withdrawable amount in base token units. **Example** Copy Ask AI const vault = await VaultImpl.create(connection, usdcMint); const withdrawableAmount = await vault.getWithdrawableAmount(); console.log(`Withdrawable amount: ${withdrawableAmount.toString()}`); // Convert to human readable format (assuming USDC with 6 decimals) const withdrawableUsdc = withdrawableAmount.div(new BN(1_000_000)); console.log(`Withdrawable: ${withdrawableUsdc.toString()} USDC`); **Notes** * Amount may be less than total vault assets due to strategy allocations * Uses current on-chain time for calculations * Does not account for user’s specific LP token balance * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#refreshvaultstate) refreshVaultState Refreshes the cached vault state and token mint information. **Function** Copy Ask AI async refreshVaultState(): Promise **Returns** Void. Updates the instance’s `vaultState` and `tokenMint` properties. **Example** Copy Ask AI const vault = await VaultImpl.create(connection, usdcMint); // Check current state console.log(`Current liquidity: ${vault.vaultState.totalLiquidity.toString()}`); // Refresh state to get latest data await vault.refreshVaultState(); // Check updated state console.log(`Updated liquidity: ${vault.vaultState.totalLiquidity.toString()}`); **Notes** * Call this before deposit/withdraw operations to ensure latest state * Updates both vault state and token mint data * Essential for accurate calculations in dynamic environments * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#deposit) deposit Deposits tokens into the vault and receives LP tokens in return. **Function** Copy Ask AI async deposit(owner: PublicKey, baseTokenAmount: BN): Promise **Parameters** Copy Ask AI interface DepositParams { owner: PublicKey; // The depositor's wallet address baseTokenAmount: BN; // Amount of base tokens to deposit } **Returns** A `Transaction` ready to be signed and sent. **Example** Copy Ask AI const vault = await VaultImpl.create(connection, usdcMint, { affiliateId: partnerPublicKey }); // Deposit 1,000 USDC (with 6 decimals) const depositAmount = new BN(1_000_000_000); const depositTx = await vault.deposit(wallet.publicKey, depositAmount); // Sign and send transaction const signature = await wallet.sendTransaction(depositTx, connection); console.log(`Deposit transaction: ${signature}`); **Notes** * Automatically handles SOL wrapping for native SOL vaults * Creates necessary token accounts if they don’t exist * Supports affiliate revenue sharing if configured * The transaction includes all necessary pre-instructions * LP tokens are minted proportional to the deposit amount * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#withdraw) withdraw Withdraws tokens from the vault by burning LP tokens. **Function** Copy Ask AI async withdraw(owner: PublicKey, baseTokenAmount: BN): Promise **Parameters** Copy Ask AI interface WithdrawParams { owner: PublicKey; // The withdrawer's wallet address baseTokenAmount: BN; // Amount of LP tokens to burn for withdrawal } **Returns** A `Transaction` ready to be signed and sent. **Example** Copy Ask AI const vault = await VaultImpl.create(connection, usdcMint); // Get user's LP token balance const userBalance = await vault.getUserBalance(wallet.publicKey); // Withdraw half of user's position const withdrawAmount = userBalance.div(new BN(2)); const withdrawTx = await vault.withdraw(wallet.publicKey, withdrawAmount); // Sign and send transaction const signature = await wallet.sendTransaction(withdrawTx, connection); console.log(`Withdraw transaction: ${signature}`); **Notes** * Automatically handles SOL unwrapping for native SOL vaults * May withdraw from vault reserves or underlying strategies * Supports affiliate revenue sharing if configured * The `baseTokenAmount` parameter refers to LP tokens to burn, not underlying tokens to receive * Automatically selects the optimal withdrawal strategy based on liquidity availability * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#getstrategiesstate) getStrategiesState Gets the state of all strategies associated with the vault. **Function** Copy Ask AI async getStrategiesState(): Promise> **Returns** An array of `StrategyState` objects representing the vault’s strategies. **Example** Copy Ask AI const vault = await VaultImpl.create(connection, usdcMint); const strategies = await vault.getStrategiesState(); strategies.forEach((strategy, index) => { console.log(`Strategy ${index}:`); console.log(` Current Liquidity: ${strategy.currentLiquidity.toString()}`); console.log(` Performance Fee: ${strategy.performanceFee.toString()}`); }); console.log(`Total strategies: ${strategies.length}`); **Notes** * Excludes the vault’s internal strategy (VAULT\_STRATEGY\_ADDRESS) * Useful for understanding vault composition and performance * Each strategy represents a different yield farming or liquidity provision approach * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#getaffiliateinfo) getAffiliateInfo Gets affiliate partnership information for the vault. **Function** Copy Ask AI async getAffiliateInfo(): Promise **Returns** An `AffiliateInfo` object containing partnership details. **Example** Copy Ask AI const vault = await VaultImpl.create(connection, usdcMint, { affiliateId: partnerPublicKey }); try { const affiliateInfo = await vault.getAffiliateInfo(); console.log(`Partner fee rate: ${affiliateInfo.feeRate}%`); console.log(`Total fees earned: ${affiliateInfo.totalFeesEarned.toString()}`); } catch (error) { console.log('No affiliate information found'); } **Notes** * Only available when vault is created with an `affiliateId` * Throws an error if no affiliate program is configured * Contains fee rates, total fees earned, and partnership terms * * * [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#state-functions) State Functions ------------------------------------------------------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#getallvaultstate) getAllVaultState Fetches state information for multiple vaults by token mint addresses. **Function** Copy Ask AI async getAllVaultState( tokensAddress: Array, program: VaultProgram, seedBaseKey?: PublicKey ): Promise> **Parameters** * `tokensAddress`: Array of token mint addresses * `program`: The vault program instance * `seedBaseKey`: Optional seed for deterministic PDAs **Returns** Array of vault state information including PDA, state, and mint data. **Example** Copy Ask AI const provider = new AnchorProvider(connection, wallet, {}); const program = new Program(IDL, PROGRAM_ID, provider); const tokenMints = [usdcMint, solMint]; const vaultsInfo = await getAllVaultState(tokenMints, program); vaultsInfo.forEach((vaultInfo, index) => { console.log(`Vault ${index}: ${vaultInfo.vaultPda.toString()}`); console.log(`Total Liquidity: ${vaultInfo.vaultState.totalLiquidity.toString()}`); }); * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#getallvaultstatebypda) getAllVaultStateByPda Fetches state information for multiple vaults by their PDA addresses. **Function** Copy Ask AI async getAllVaultStateByPda( vaultsPda: Array, program: VaultProgram ): Promise> **Parameters** * `vaultsPda`: Array of vault PDA addresses * `program`: The vault program instance **Returns** Array of vault state information including PDA, state, and mint data. **Example** Copy Ask AI const vaultPdas = [vault1Pda, vault2Pda]; const vaultsInfo = await getAllVaultStateByPda(vaultPdas, program); console.log(`Fetched ${vaultsInfo.length} vault states`); * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#getvaultstate) getVaultState Fetches state information for a single vault by token mint address. **Function** Copy Ask AI async getVaultState( tokenAddress: PublicKey, program: VaultProgram, seedBaseKey?: PublicKey ): Promise **Parameters** * `tokenAddress`: Token mint address * `program`: The vault program instance * `seedBaseKey`: Optional seed for deterministic PDAs **Returns** Vault state information including PDA, state, and mint data. **Example** Copy Ask AI const vaultInfo = await getVaultState(usdcMint, program); console.log(`Vault PDA: ${vaultInfo.vaultPda.toString()}`); console.log(`LP Mint: ${vaultInfo.vaultState.lpMint.toString()}`); * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#getvaultstatebypda) getVaultStateByPda Fetches state information for a single vault by its PDA address. **Function** Copy Ask AI async getVaultStateByPda( vaultPda: PublicKey, program: VaultProgram ): Promise **Parameters** * `vaultPda`: Vault PDA address * `program`: The vault program instance **Returns** Vault state information including PDA, state, and mint data. **Example** Copy Ask AI const vaultInfo = await getVaultStateByPda(vaultPda, program); console.log(`Token Mint: ${vaultInfo.vaultState.tokenMint.toString()}`); console.log(`Total Supply: ${vaultInfo.vaultLpMint.supply.toString()}`); * * * ### [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#getvaultliquidity) getVaultLiquidity Gets the current liquidity amount in the vault’s token account. **Function** Copy Ask AI async getVaultLiquidity( connection: Connection, tokenVaultPda: PublicKey ): Promise **Parameters** * `connection`: Solana connection instance * `tokenVaultPda`: The vault’s token account PDA **Returns** The liquidity amount as a string, or null if the account doesn’t exist. **Example** Copy Ask AI const liquidity = await getVaultLiquidity(connection, vault.tokenVaultPda); if (liquidity) { console.log(`Vault liquidity: ${liquidity} tokens`); } else { console.log('Vault account not found'); } * * * [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#helper-functions) Helper Functions --------------------------------------------------------------------------------------------------------------------------------------------------------- ### [​](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#calculatewithdrawableamount) calculateWithdrawableAmount Calculates the amount that can be withdrawn based on current time and vault state. **Function** Copy Ask AI function calculateWithdrawableAmount(currentTime: BN, vaultState: VaultState): BN **Parameters** * `currentTime`: Current blockchain timestamp * `vaultState`: The vault’s current state **Returns** The withdrawable amount as a BN. **Example** Copy Ask AI import { getOnchainTime } from './utils'; const currentTime = await getOnchainTime(connection); const withdrawable = calculateWithdrawableAmount(currentTime, vault.vaultState); console.log(`Withdrawable: ${withdrawable.toString()}`); **Notes** * Accounts for time-based withdrawal restrictions * Used internally by the `getWithdrawableAmount` method * Essential for implementing withdrawal limits and unlock schedules Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/1-getting-started) [Vault Quickstart\ \ Next](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/3-vault-quickstart) On this page * [Core Functions](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#core-functions) * [createPermissionlessVaultInstruction](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#createpermissionlessvaultinstruction) * [fetchMultipleUserBalance](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#fetchmultipleuserbalance) * [createMultiple](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#createmultiple) * [createMultipleWithPda](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#createmultiplewithpda) * [create](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#create) * [getUserBalance](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#getuserbalance) * [getVaultSupply](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#getvaultsupply) * [getWithdrawableAmount](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#getwithdrawableamount) * [refreshVaultState](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#refreshvaultstate) * [deposit](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#deposit) * [withdraw](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#withdraw) * [getStrategiesState](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#getstrategiesstate) * [getAffiliateInfo](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#getaffiliateinfo) * [State Functions](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#state-functions) * [getAllVaultState](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#getallvaultstate) * [getAllVaultStateByPda](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#getallvaultstatebypda) * [getVaultState](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#getvaultstate) * [getVaultStateByPda](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#getvaultstatebypda) * [getVaultLiquidity](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#getvaultliquidity) * [Helper Functions](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#helper-functions) * [calculateWithdrawableAmount](https://docs.meteora.ag/developer-guide/integrations/dynamic-vault/typescript-sdk/2-dynamic-vault-sdk-functions#calculatewithdrawableamount) Assistant Responses are generated using AI and may contain mistakes. --- # DBC Scripts - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation Typescript SDK DBC Scripts [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [​](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/3-dbc-scripts#create-dbc-config-key) Create DBC Config Key ========================================================================================================================================= This script creates a DBC Config Key using the `buildCurveWithMarketCap` function (this function helps to abstract the math complexity of creating a DBC Config Key). You can also use the `buildCurve`, `buildCurveWithTwoSegments`, and `buildCurveWithLiquidityWeights` functions to create a DBC Config Key. * [buildCurve](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/2-dbc-sdk-functions#buildcurve) is a function that primarily uses `migrationQuoteThreshold` and `percentageSupplyOnMigration` to build the curve config. This function is useful when you want to create a curve config with a specific migration quote threshold and percentage of supply on migration. * [buildCurveWithMarketCap](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/2-dbc-sdk-functions#buildcurvewithmarketcap) is a function that primarily uses `initialMarketCap` and `migrationMarketCap` to build the curve config. This function is useful when you want to create a curve config that has a specific starting token price and an ending migration token price. * [buildCurveWithTwoSegments](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/2-dbc-sdk-functions#buildcurvewithtwosegments) is a function that uses `initialMarketCap`, `migrationMarketCap` and `percentageSupplyOnMigration` to build the curve config. This function is useful when you want to create a 2 constant product curve structure with a specific initial market cap, migration market cap and percentage of supply on migration. * [buildCurveWithLiquidityWeights](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/2-dbc-sdk-functions#buildcurvewithliquidityweights) is a function that uses `initialMarketCap`, `migrationMarketCap` and `liquidityWeights` to build the curve config. This function is useful when you want to create a curve config with a unique price action (flat, exponential, etc.) with a specific initial market cap, migration market cap and liquidity weights. Copy Ask AI import { Connection, Keypair, PublicKey, sendAndConfirmTransaction, } from '@solana/web3.js' import { buildCurveWithMarketCap, DynamicBondingCurveClient, ActivationType, CollectFeeMode, BaseFeeMode, MigrationFeeOption, MigrationOption, TokenDecimal, TokenType, TokenUpdateAuthorityOption, } from '@meteora-ag/dynamic-bonding-curve-sdk' import { NATIVE_MINT } from '@solana/spl-token' async function buildCurveWithMarketCapAndCreateConfig() { const keypair = [] const wallet = Keypair.fromSecretKey(new Uint8Array(keypair)) console.log(`Using wallet: ${wallet.publicKey.toString()}`) const connection = new Connection( 'https://api.mainnet-beta.solana.com', 'confirmed' ) const config = Keypair.generate() console.log(`Config account: ${config.publicKey.toString()}`) const curveConfig = buildCurveWithMarketCap({ totalTokenSupply: 1000000000, initialMarketCap: 30, migrationMarketCap: 540, migrationOption: MigrationOption.MET_DAMM_V2, tokenBaseDecimal: TokenDecimal.SIX, tokenQuoteDecimal: TokenDecimal.NINE, lockedVestingParam: { totalLockedVestingAmount: 0, numberOfVestingPeriod: 0, cliffUnlockAmount: 0, totalVestingDuration: 0, cliffDurationFromMigrationTime: 0, }, baseFeeParams: { baseFeeMode: BaseFeeMode.FeeSchedulerLinear, feeSchedulerParam: { startingFeeBps: 100, endingFeeBps: 100, numberOfPeriod: 0, totalDuration: 0, }, }, dynamicFeeEnabled: true, activationType: ActivationType.Slot, collectFeeMode: CollectFeeMode.Both, migrationFeeOption: MigrationFeeOption.FixedBps100, tokenType: TokenType.SPL, partnerLpPercentage: 0, creatorLpPercentage: 0, partnerLockedLpPercentage: 50, creatorLockedLpPercentage: 50, creatorTradingFeePercentage: 50, leftover: 0, tokenUpdateAuthority: TokenUpdateAuthorityOption.Immutable, migrationFee: { feePercentage: 0, creatorFeePercentage: 0, }, }) console.log(curveConfig) try { const client = new DynamicBondingCurveClient(connection, 'confirmed') const transaction = await client.partner.createConfig({ config: config.publicKey, feeClaimer: new PublicKey('YOUR_FEE_CLAIMER_ADDRESS'), leftoverReceiver: new PublicKey('YOUR_LEFTOVER_RECEIVER_ADDRESS'), payer: wallet.publicKey, quoteMint: NATIVE_MINT, ...curveConfig, }) const { blockhash } = await connection.getLatestBlockhash('confirmed') transaction.recentBlockhash = blockhash transaction.feePayer = wallet.publicKey transaction.partialSign(config) const signature = await sendAndConfirmTransaction( connection, transaction, [wallet, config], { commitment: 'confirmed' } ) console.log(`Config created successfully!`) console.log( `Transaction: https://solscan.io/tx/${signature}` ) console.log(`Config address: ${config.publicKey.toString()}`) } catch (error) { console.error('Failed to create config:', error) } } buildCurveWithMarketCapAndCreateConfig() .then(() => process.exit(0)) .catch((error) => { console.error(error) process.exit(1) }) [​](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/3-dbc-scripts#create-dbc-token-pool) Create DBC Token Pool ========================================================================================================================================= This script creates a DBC Token Pool using the `createPool` function. Copy Ask AI import { Connection, Keypair, PublicKey, sendAndConfirmTransaction, } from '@solana/web3.js' import { DynamicBondingCurveClient } from '@meteora-ag/dynamic-bonding-curve-sdk' async function createPool() { const payerKeypair = [] const payer = Keypair.fromSecretKey(new Uint8Array(payerKeypair)) console.log(`Payer wallet: ${payer.publicKey.toString()}`) const poolCreatorKeypair = [] const poolCreator = Keypair.fromSecretKey( new Uint8Array(poolCreatorKeypair) ) console.log(`Pool creator wallet: ${poolCreator.publicKey.toString()}`) const connection = new Connection( 'https://api.mainnet-beta.solana.com', 'confirmed' ) const configAddress = new PublicKey('YOUR_CONFIG_KEY_ADDRESS') console.log(`Using config: ${configAddress.toString()}`) try { const baseMint = Keypair.generate() console.log(`Generated base mint: ${baseMint.publicKey.toString()}`) const createPoolParam = { baseMint: baseMint.publicKey, config: configAddress, name: 'YOUR_POOL_NAME', symbol: 'YOUR_POOL_SYMBOL', uri: 'YOUR_POOL_IMAGE_URI', payer: payer.publicKey, poolCreator: poolCreator.publicKey, } const client = new DynamicBondingCurveClient(connection, 'confirmed') console.log('Creating pool transaction...') const poolTransaction = await client.pool.createPool(createPoolParam) const signature = await sendAndConfirmTransaction( connection, poolTransaction, [payer, baseMint, poolCreator], { commitment: 'confirmed', skipPreflight: true, } ) console.log('Transaction confirmed!') console.log( `Pool created: https://solscan.io/tx/${signature}?cluster=devnet` ) } catch (error) { console.error('Failed to create pool:', error) console.log('Error details:', JSON.stringify(error, null, 2)) } } createPool() .then(() => process.exit(0)) .catch((error) => { console.error(error) process.exit(1) }) [​](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/3-dbc-scripts#swap-buy-in-dbc-token-pool) Swap Buy in DBC Token Pool =================================================================================================================================================== This script initializes a swap buy transaction in a DBC Token Pool using the `swap` function. Copy Ask AI import { Connection, Keypair, PublicKey, sendAndConfirmTransaction, } from '@solana/web3.js' import { DynamicBondingCurveClient } from '@meteora-ag/dynamic-bonding-curve-sdk' import BN from 'bn.js' async function swapBuy() { const keypair = [] const wallet = Keypair.fromSecretKey(new Uint8Array(keypair)) console.log(`Using wallet: ${wallet.publicKey.toString()}`) const connection = new Connection( 'https://api.mainnet-beta.solana.com', 'confirmed' ) const poolAddress = new PublicKey('YOUR_POOL_ADDRESS') console.log(`Swapping in pool: ${poolAddress.toString()}`) try { const client = new DynamicBondingCurveClient(connection, 'confirmed') const swapParam = { amountIn: new BN(1 * 1e9), // 1 SOL minimumAmountOut: new BN(0), // Can get this param from swapQuote swapBaseForQuote: false, owner: wallet.publicKey, pool: poolAddress, referralTokenAccount: null, // Can parse in a token account address to collect fees } const swapTransaction = await client.pool.swap(swapParam) const swapSignature = await sendAndConfirmTransaction( connection, swapTransaction, [wallet], { commitment: 'confirmed', skipPreflight: true, maxRetries: 5, } ) console.log( `Swap executed: https://solscan.io/tx/${swapSignature}?cluster=devnet` ) } catch (error) { console.error('Failed to execute swap:', error) } } swapBuy() .then(() => process.exit(0)) .catch((error) => { console.error(error) process.exit(1) }) [​](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/3-dbc-scripts#swap-quote-in-dbc-token-pool) Swap Quote in DBC Token Pool ======================================================================================================================================================= This script initializes a swap quotation in a DBC Token Pool using the `swapQuote` function. Copy Ask AI import { Connection, PublicKey } from '@solana/web3.js' import { DynamicBondingCurveClient } from '@meteora-ag/dynamic-bonding-curve-sdk' import BN from 'bn.js' async function swapQuote() { const connection = new Connection( 'https://api.mainnet-beta.solana.com', 'confirmed' ) const poolAddress = new PublicKey('YOUR_POOL_ADDRESS') console.log(`Getting swap quote for pool: ${poolAddress.toString()}`) try { const client = new DynamicBondingCurveClient(connection, 'confirmed') const virtualPoolState = await client.state.getPool(poolAddress) if (!virtualPoolState) { throw new Error(`Pool not found: ${poolAddress.toString()}`) } const poolConfigState = await client.state.getPoolConfig( virtualPoolState.config ) const amountIn = new BN('383233860117676543') const swapBaseForQuote = true const hasReferral = false const currentPoint = new BN(0) console.log('Calculating swap quote...') try { if ( !virtualPoolState.sqrtPrice || virtualPoolState.sqrtPrice.isZero() ) { throw new Error( 'Invalid pool state: sqrtPrice is zero or undefined' ) } if (!poolConfigState.curve || poolConfigState.curve.length === 0) { throw new Error('Invalid config state: curve is empty') } const quote = await client.pool.swapQuote({ virtualPool: virtualPoolState, config: poolConfigState, swapBaseForQuote, amountIn, slippageBps: 100, hasReferral, currentPoint, }) console.log('Swap Quote:', { amountIn: amountIn.toString(), amountOut: quote.amountOut.toString(), minimumAmountOut: quote.minimumAmountOut.toString(), nextSqrtPrice: quote.nextSqrtPrice.toString(), fee: { trading: quote.fee.trading.toString(), protocol: quote.fee.protocol.toString(), referral: quote.fee.referral?.toString() || '0', }, price: { beforeSwap: quote.price.beforeSwap.toString(), afterSwap: quote.price.afterSwap.toString(), }, }) } catch (error) { console.error('Failed to calculate swap quote:', error) console.log('Pool state:', { sqrtPrice: virtualPoolState.sqrtPrice?.toString() || 'undefined', baseReserve: virtualPoolState.baseReserve?.toString() || 'undefined', quoteReserve: virtualPoolState.quoteReserve?.toString() || 'undefined', }) console.log('Config state:', { curveLength: poolConfigState.curve?.length || 0, collectFeeMode: poolConfigState.collectFeeMode, }) } } catch (error) { console.error('Failed to get swap quote:', error) console.log('Error details:', JSON.stringify(error, null, 2)) } } swapQuote() .then(() => process.exit(0)) .catch((error) => { console.error(error) process.exit(1) }) [​](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/3-dbc-scripts#migrate-to-damm-v1) Migrate to DAMM v1 =================================================================================================================================== This script migrates a DBC Token Pool to DAMM V1. The migration process follows these steps: 1. Create Migration Metadata (skip if metadata exists) 2. Create Locker (checks if baseMint token has Locked Vesting, and if lockEscrow has been created) 3. Migrate to DAMM V1 (if isMigrated = 0) 4.1. Lock Partner LP (if partnerLockedLpPercentage > 0) 4.2. Lock Creator LP (if creatorLockedLpPercentage > 0) 4.3. Claim Partner LP (if partnerLpPercentage > 0) 4.4. Claim Creator LP (if creatorLpPercentage > 0) Copy Ask AI import { Connection, Keypair, PublicKey, sendAndConfirmTransaction, } from '@solana/web3.js' import { deriveDammV1MigrationMetadataAddress, deriveBaseKeyForLocker, deriveEscrow, DAMM_V1_MIGRATION_FEE_ADDRESS, DynamicBondingCurveClient, } from '@meteora-ag/dynamic-bonding-curve-sdk' import { BN } from 'bn.js' async function migrateToDammV1() { const keypair = [] const wallet = Keypair.fromSecretKey(new Uint8Array(keypair)) console.log(`Using wallet: ${wallet.publicKey.toString()}`) const connection = new Connection( 'https://api.mainnet-beta.solana.com', 'confirmed' ) try { const client = new DynamicBondingCurveClient(connection, 'confirmed') const poolAddress = new PublicKey( 'YOUR_POOL_ADDRESS' ) const poolState = await client.state.getPool(poolAddress) const config = new PublicKey( 'YOUR_CONFIG_KEY_ADDRESS' ) const poolConfigState = await client.state.getPoolConfig(config) // Step 1: Check if migration metadata exists console.log('Checking if migration metadata exists...') const migrationMetadata = deriveDammV1MigrationMetadataAddress(poolAddress) console.log('Migration metadata address:', migrationMetadata.toString()) const metadataAccount = await connection.getAccountInfo(migrationMetadata) if (!metadataAccount) { console.log('Creating migration metadata...') const createMetadataTx = await client.migration.createDammV1MigrationMetadata({ payer: wallet.publicKey, virtualPool: poolAddress, config: config, }) const { blockhash } = await connection.getLatestBlockhash('confirmed') createMetadataTx.recentBlockhash = blockhash createMetadataTx.feePayer = wallet.publicKey const metadataSignature = await sendAndConfirmTransaction( connection, createMetadataTx, [wallet], { commitment: 'confirmed' } ) console.log(`Migration metadata created successfully!`) console.log( `Transaction: https://solscan.io/tx/${metadataSignature}?cluster=devnet` ) } else { console.log('Migration metadata already exists') } // Step 2: Check for locked vesting and create locker if needed if ( poolConfigState.lockedVestingConfig.amountPerPeriod.gt(new BN(0)) || poolConfigState.lockedVestingConfig.cliffUnlockAmount.gt(new BN(0)) ) { // Check if escrow already exists const base = deriveBaseKeyForLocker(poolAddress) const escrow = deriveEscrow(base) const escrowAccount = await connection.getAccountInfo(escrow) if (!escrowAccount) { console.log('Found locked vesting, creating locker...') const createLockerTx = await client.migration.createLocker({ virtualPool: poolAddress, payer: wallet.publicKey, }) const { blockhash: lockerBlockhash } = await connection.getLatestBlockhash('confirmed') createLockerTx.recentBlockhash = lockerBlockhash createLockerTx.feePayer = wallet.publicKey const lockerSignature = await sendAndConfirmTransaction( connection, createLockerTx, [wallet], { commitment: 'confirmed' } ) console.log(`Locker created successfully!`) console.log( `Transaction: https://solscan.io/tx/${lockerSignature}?cluster=devnet` ) } else { console.log('Escrow already exists, skipping locker creation') } } else { console.log('No locked vesting found, skipping locker creation') } // Step 3: Migrate to DAMM V1 if (!poolState.isMigrated) { console.log('Migrating to DAMM V1...') const migrateTx = await client.migration.migrateToDammV1({ payer: wallet.publicKey, virtualPool: poolAddress, dammConfig: DAMM_V1_MIGRATION_FEE_ADDRESS[\ poolConfigState.migrationFeeOption\ ], }) const { blockhash: migrateBlockhash } = await connection.getLatestBlockhash('confirmed') migrateTx.recentBlockhash = migrateBlockhash migrateTx.feePayer = wallet.publicKey const migrateSignature = await sendAndConfirmTransaction( connection, migrateTx, [wallet], { commitment: 'confirmed' } ) console.log(`Migration to DAMM V1 completed successfully!`) console.log( `Transaction: https://solscan.io/tx/${migrateSignature}?cluster=devnet` ) } else { console.log('Pool already migrated to DAMM V1') } // Step 4.1: Lock LP tokens for creator and partner if (poolConfigState.creatorLockedLpPercentage > 0) { console.log('Locking LP tokens for creator...') const lockCreatorTx = await client.migration.lockDammV1LpToken({ payer: wallet.publicKey, virtualPool: poolAddress, dammConfig: DAMM_V1_MIGRATION_FEE_ADDRESS[\ poolConfigState.migrationFeeOption\ ], isPartner: false, }) const { blockhash: lockCreatorBlockhash } = await connection.getLatestBlockhash('confirmed') lockCreatorTx.recentBlockhash = lockCreatorBlockhash lockCreatorTx.feePayer = wallet.publicKey const lockCreatorSignature = await sendAndConfirmTransaction( connection, lockCreatorTx, [wallet], { commitment: 'confirmed' } ) console.log(`LP tokens locked for creator successfully!`) console.log( `Transaction: https://solscan.io/tx/${lockCreatorSignature}` ) } // Step 4.2: Lock LP tokens for partner if (poolConfigState.partnerLockedLpPercentage > 0) { console.log('Locking LP tokens for partner...') const lockCreatorTx = await client.migration.lockDammV1LpToken({ payer: wallet.publicKey, virtualPool: poolAddress, dammConfig: DAMM_V1_MIGRATION_FEE_ADDRESS[\ poolConfigState.migrationFeeOption\ ], isPartner: false, }) const { blockhash: lockCreatorBlockhash } = await connection.getLatestBlockhash('confirmed') lockCreatorTx.recentBlockhash = lockCreatorBlockhash lockCreatorTx.feePayer = wallet.publicKey const lockCreatorSignature = await sendAndConfirmTransaction( connection, lockCreatorTx, [wallet], { commitment: 'confirmed' } ) console.log(`LP tokens locked for creator successfully!`) console.log( `Transaction: https://solscan.io/tx/${lockCreatorSignature}` ) } // Step 4.3: Claim LP tokens for creator if (poolConfigState.creatorLpPercentage > 0) { console.log('Claiming LP tokens for creator...') const claimCreatorTx = await client.migration.claimDammV1LpToken({ payer: wallet.publicKey, virtualPool: poolAddress, dammConfig: DAMM_V1_MIGRATION_FEE_ADDRESS[\ poolConfigState.migrationFeeOption\ ], isPartner: false, }) const { blockhash: claimCreatorBlockhash } = await connection.getLatestBlockhash('confirmed') claimCreatorTx.recentBlockhash = claimCreatorBlockhash claimCreatorTx.feePayer = wallet.publicKey const claimCreatorSignature = await sendAndConfirmTransaction( connection, claimCreatorTx, [wallet], { commitment: 'confirmed' } ) console.log(`LP tokens claimed for creator successfully!`) console.log( `Transaction: https://solscan.io/tx/${claimCreatorSignature}?cluster=devnet` ) } // Step 4.4: Claim LP tokens for partner if (poolConfigState.partnerLpPercentage > 0) { console.log('Claiming LP tokens for partner...') const claimPartnerTx = await client.migration.claimDammV1LpToken({ payer: wallet.publicKey, virtualPool: poolAddress, dammConfig: DAMM_V1_MIGRATION_FEE_ADDRESS[\ poolConfigState.migrationFeeOption\ ], isPartner: true, }) const { blockhash: claimPartnerBlockhash } = await connection.getLatestBlockhash('confirmed') claimPartnerTx.recentBlockhash = claimPartnerBlockhash claimPartnerTx.feePayer = wallet.publicKey const claimPartnerSignature = await sendAndConfirmTransaction( connection, claimPartnerTx, [wallet], { commitment: 'confirmed' } ) console.log(`LP tokens claimed for partner successfully!`) console.log( `Transaction: https://solscan.io/tx/${claimPartnerSignature}?cluster=devnet` ) } } catch (error) { console.error('Failed to migrate to DAMM V1:', error) } } migrateToDammV1() .then(() => process.exit(0)) .catch((error) => { console.error(error) process.exit(1) }) [​](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/3-dbc-scripts#migrate-to-damm-v2) Migrate to DAMM v2 =================================================================================================================================== This script migrates a DBC Token Pool to DAMM V2. The migration process follows these steps: 1. Create Migration Metadata (skip if metadata exists) 2. Create Locker (checks if baseMint token has Locked Vesting, and if lockEscrow has been created) 3. Migrate to DAMM V2 (if isMigrated = 0) Copy Ask AI import { Connection, Keypair, PublicKey, sendAndConfirmTransaction, } from '@solana/web3.js' import { DynamicBondingCurveClient, DAMM_V2_MIGRATION_FEE_ADDRESS, deriveDammV2MigrationMetadataAddress, deriveBaseKeyForLocker, deriveEscrow, } from '@meteora-ag/dynamic-bonding-curve-sdk' import { BN } from 'bn.js' async function migrateToDammV2() { const keypair = [] const wallet = Keypair.fromSecretKey(new Uint8Array(keypair)) console.log(`Using wallet: ${wallet.publicKey.toString()}`) const connection = new Connection( 'https://api.mainnet-beta.solana.com', 'confirmed' ) try { const client = new DynamicBondingCurveClient(connection, 'confirmed') const poolAddress = new PublicKey( '6tCCyVyaXRZ2x1pzAAK5fA3FXRhDuH3NQ5cyUTUuv4Xv' ) const virtualPoolState = await client.state.getPool(poolAddress) const config = new PublicKey( '6tCCyVyaXRZ2x1pzAAK5fA3FXRhDuH3NQ5cyUTUuv4Xv' ) const poolConfigState = await client.state.getPoolConfig(config) if (!virtualPoolState) { throw new Error(`Pool not found: ${poolAddress.toString()}`) } // Step 1: Check if migration metadata exists console.log('Checking if migration metadata exists...') const migrationMetadata = deriveDammV2MigrationMetadataAddress(poolAddress) console.log('Migration metadata address:', migrationMetadata.toString()) const metadataAccount = await connection.getAccountInfo(migrationMetadata) if (!metadataAccount) { console.log('Creating migration metadata...') const createMetadataTx = await client.migration.createDammV2MigrationMetadata({ payer: wallet.publicKey, virtualPool: poolAddress, config: config, }) const { blockhash } = await connection.getLatestBlockhash('confirmed') createMetadataTx.recentBlockhash = blockhash createMetadataTx.feePayer = wallet.publicKey const metadataSignature = await sendAndConfirmTransaction( connection, createMetadataTx, [wallet], { commitment: 'confirmed' } ) console.log(`Migration metadata created successfully!`) console.log( `Transaction: https://solscan.io/tx/${metadataSignature}?cluster=devnet` ) } else { console.log('Migration metadata already exists') } // Step 2: Check for locked vesting and create locker if needed if ( poolConfigState.lockedVestingConfig.amountPerPeriod.gt(new BN(0)) || poolConfigState.lockedVestingConfig.cliffUnlockAmount.gt(new BN(0)) ) { // Check if locker already exists const base = deriveBaseKeyForLocker(poolAddress) const escrow = deriveEscrow(base) const escrowAccount = await connection.getAccountInfo(escrow) if (!escrowAccount) { console.log('Locker not found, creating locker...') const createLockerTx = await client.migration.createLocker({ virtualPool: poolAddress, payer: wallet.publicKey, }) const { blockhash: lockerBlockhash } = await connection.getLatestBlockhash('confirmed') createLockerTx.recentBlockhash = lockerBlockhash createLockerTx.feePayer = wallet.publicKey const lockerSignature = await sendAndConfirmTransaction( connection, createLockerTx, [wallet], { commitment: 'confirmed' } ) console.log(`Locker created successfully!`) console.log( `Transaction: https://solscan.io/tx/${lockerSignature}?cluster=devnet` ) } else { console.log('Locker already exists, skipping creation') } } else { console.log('No locked vesting found, skipping locker creation') } // Step 3: Migrate to DAMM V2 if (!virtualPoolState.isMigrated) { console.log('Migrating to DAMM V2...') const migrateTx = await client.migration.migrateToDammV2({ payer: wallet.publicKey, virtualPool: poolAddress, dammConfig: DAMM_V2_MIGRATION_FEE_ADDRESS[poolConfigState.migrationFeeOption], }) const { blockhash: migrateBlockhash } = await connection.getLatestBlockhash('confirmed') migrateTx.transaction.recentBlockhash = migrateBlockhash migrateTx.transaction.feePayer = wallet.publicKey const migrateSignature = await sendAndConfirmTransaction( connection, migrateTx.transaction, [\ wallet,\ migrateTx.firstPositionNftKeypair,\ migrateTx.secondPositionNftKeypair,\ ], { commitment: 'confirmed' } ) console.log(`Migration to DAMM V2 completed successfully!`) console.log( `Transaction: https://solscan.io/tx/${migrateSignature}?cluster=devnet` ) } else { console.log('Pool already migrated to DAMM V2') } } catch (error) { console.error('Failed to migrate to DAMM V2:', error) } } migrateToDammV2() .then(() => process.exit(0)) .catch((error) => { console.error(error) process.exit(1) }) Was this page helpful? YesNo [Previous](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/2-dbc-sdk-functions) [Rust IntegrationDynamic Bonding Curve\ \ Next](https://docs.meteora.ag/developer-guide/integrations/dbc/rust-sdk/1-rust-integration) On this page * [Create DBC Config Key](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/3-dbc-scripts#create-dbc-config-key) * [Create DBC Token Pool](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/3-dbc-scripts#create-dbc-token-pool) * [Swap Buy in DBC Token Pool](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/3-dbc-scripts#swap-buy-in-dbc-token-pool) * [Swap Quote in DBC Token Pool](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/3-dbc-scripts#swap-quote-in-dbc-token-pool) * [Migrate to DAMM v1](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/3-dbc-scripts#migrate-to-damm-v1) * [Migrate to DAMM v2](https://docs.meteora.ag/developer-guide/integrations/dbc/typescript-sdk/3-dbc-scripts#migrate-to-damm-v2) Assistant Responses are generated using AI and may contain mistakes. --- # DLMM Fee Calculation - Meteora Documentation [Meteora Documentation home page![light logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-light.png)![dark logo](https://mintlify.s3.us-west-1.amazonaws.com/meteora/images/logo/full-logo-dark.png)](https://docs.meteora.ag/) Search... ⌘KAsk AI Search... Navigation DLMM DLMM Fee Calculation [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [Overview](https://docs.meteora.ag/overview/home) [Anti Sniper Suite](https://docs.meteora.ag/anti-sniper-suite/home) [Developer Guide](https://docs.meteora.ag/developer-guide/home) [Resources](https://docs.meteora.ag/resources/community/1-tools) [Legal](https://docs.meteora.ag/legal/1-terms-of-service) [​](https://docs.meteora.ag/overview/products/dlmm/4-dlmm-fee-calculation#total-trading-fee) Total Trading Fee ================================================================================================================= LPs earn a swap fee from traders when they perform a swap. The total swap fee (fsf\_sfs​) will have two components: 1. **A base fee** (fbf\_bfb​) 2. **A variable fee** (fvf\_vfv​) The **total swap fee** is calculated as: fs\=fb+fvf\_s = f\_b + f\_vfs​\=fb​+fv​ The variable fee (fvf\_vfv​) is a function of real-time price volatility. The fee rate will be applied to the swap amount in each liquidity bin and distributed proportionally to the LPs in that bin. LPs can claim these fees whenever they are available. [​](https://docs.meteora.ag/overview/products/dlmm/4-dlmm-fee-calculation#base-fee) Base Fee ----------------------------------------------------------------------------------------------- The minimum fee charged per swap. Lower fee gets more volume but higher fee earns more per volume. Generally if you want a higher base fee, the higher the bin step. But a lower base fee than other DEXes might give more flexibility for dynamic fees to optimize for volume or fees given the market volatility. The base fee of a market is configured by the pool creator and determined by the base factor (B) and the bin step (s): fb\=B⋅sf\_b = B \\cdot sfb​\=B⋅s Base factor is the amplification to add to the bin step, to allow for adjustment of the pool base fees. [​](https://docs.meteora.ag/overview/products/dlmm/4-dlmm-fee-calculation#variable-fee-dynamic-fee) Variable Fee (Dynamic Fee) --------------------------------------------------------------------------------------------------------------------------------- The variable fee depends on the volatility of the market where it is affected by swap frequencies as well as swaps that span across many bins. Fees are calculated and distributed on a **per bin** basis, to allow for a fair fee distribution to the LPs of each bin that is crossed. For large swaps that span across bins, fees are calculated iteratively. This means that if a large swap crosses nnn bins, total swap fee is calculated per bin kkk (such that 0≤k≤n0 \\leq k \\leq n0≤k≤n), where kkk is the difference in the bin IDs from the initial bin where the swap originated and the current bin in which it is being calculated. For example, let’s use SOL/USDC. We also assume each bin step is $1 for simplicity. Let us assume that the active bin (ID = 1000) before swap is $100. A large buy order was made that pushed the price up to $102. The value of kkk for each bin is illustrated below: | Bin Price | Bin ID | kkk value | | --- | --- | --- | | $100 | 1000 | 0 | | $101 | 1001 | 1 | | $102 | 1002 | 2 | Note that kkk can also be negative if the price moves downwards. The variable fee for a bin fv(k)f\_v(k)fv​(k) is calculated using: * **Variable fee control parameter** (AAA) * **Bin step** (sss) * **Volatility accumulator** (va(k)v\_a(k)va​(k)) The formula is: fv(k)\=A(va(k)⋅s)2f\_v(k) = A(v\_a(k) \\cdot s)^2fv​(k)\=A(va​(k)⋅s)2 where: * **Volatility Accumulator** (va(k)v\_a(k)va​(k)): Captures instantaneous volatility * **Variable Fee Control Parameter** (AAA): Used to scale the variable fee component depending on the expected dynamics of the market ### [​](https://docs.meteora.ag/overview/products/dlmm/4-dlmm-fee-calculation#volatility-accumulator) Volatility Accumulator Volatility on the DLMM is derived from the number of bin changes that occur over time. Each bin change is a fixed price movement of the bin step. The **Volatility Accumulator** (va(k)v\_a(k)va​(k)) allows us to use bin crossovers as a measure of volatility beyond a single transaction. Think of the **Volatility Accumulator** (va(k)v\_a(k)va​(k)) as a witness of the current volatility of the token pair. Between each calculation step, this value will be kept in memory. It is calculated during a swap and depends on two factors: 1. **Volatility Reference** (vrv\_rvr​) from the previous swaps 2. **Introduced Volatility** (∣ir−(activeID+k)∣|i\_r - (activeID + k)|∣ir​−(activeID+k)∣) The Volatility Accumulator is calculated as: va(k)\=vr+∣ir−(activeID+k)∣v\_a(k) = v\_r + |i\_r - (activeID + k)|va​(k)\=vr​+∣ir​−(activeID+k)∣ (Note: activeIDactiveIDactiveID is the ID of the active bin **before** the swap is made.) #### [​](https://docs.meteora.ag/overview/products/dlmm/4-dlmm-fee-calculation#volatility-reference) Volatility Reference The **volatility reference** (vrv\_rvr​) depends on the time passed since the last transaction (ttt). We will define a window with an upper and lower bound. The lower bound of this window is defined as filter period (tft\_ftf​), and upper bound as decay period (tdt\_dtd​). If ttt is smaller than the **filter period** (tft\_ftf​) (this indicates a high frequency of transactions occurring), then vrv\_rvr​ stays the same. If ttt is greater than the **decay period** (tdt\_dtd​) (this indicates a low frequency of transactions occurring), then vrv\_rvr​ is reset to 0. If ttt is within the **window bounded** by tft\_ftf​ & tdt\_dtd​, then vrv\_rvr​ takes the previous value of vav\_ava​ decayed by a factor RRR vr\={vr,t