Meteora 백서

Meteora

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 75쪽 중 5쪽

ag/core-products/damm-v2/liquidity-mining Learn how DAMM v2 distributes built-in liquidity mining rewards directly to LP positions. DAMM v2 has liquidity mining built into the pool program. Projects can fund reward campaigns directly on a pool, and LP positions earn those rewards automatically while they provide liquidity. There is no separate farm contract, no LP token wrapping, and no extra staking step for LPs. If a position has eligible liquidity, it can accrue rewards. ## How It Works Each DAMM v2 pool has up to two reward slots. Once a reward slot is initialized, it cannot return to the uninitialized state. A reward slot defines: * The reward token mint. * The reward vault that holds funded tokens. * The funder that can add reward tokens. * The reward duration. * The reward rate over time. As time passes, rewards accrue across the pool and are assigned to positions based on each position's share of total liquidity. ```math theme={"system"} \text{Position Share} = \frac{\text{Position Liquidity}}{\text{Total Pool Liquidity}} ``` If a position owns 10% of the pool liquidity during a reward period, it earns roughly 10% of the emitted rewards for that period. ## What Counts as Liquidity DAMM v2 uses total position liquidity for reward accounting. That can include: * Unlocked liquidity. * Vesting liquidity. * Permanently locked liquidity. This is important for launches and treasuries. A team can lock liquidity for commitment and still let that liquidity participate in the same reward campaign as other LP liquidity. ## Reward Campaign Lifecycle <Steps> <Step title="Initialize a reward slot"> The pool creator or an authorized operator sets up reward slot 0 or 1 with a reward mint, funder, and duration. </Step> <Step title="Fund the reward vault"> The funder sends reward tokens into the vault. DAMM v2 calculates the reward rate over the active duration. </Step> <Step title="LP positions accrue rewards"> Positions earn rewards over time based on their share of total liquidity. </Step> <Step title="Position owners claim rewards"> Rewards remain pending on the position until the position owner claims them. </Step> </Steps> ## Reward Limits | Feature | DAMM v2 Behavior | | - | - | | Reward slots | Up to 2 per pool | | Minimum reward duration | 1 day | | Maximum reward duration | 1 year | | Reward accounting | Pro-rata by position liquidity | | Separate staking contract | Not required | | Token 2022 reward tokens | Supported with the same permissionless extensions and token badge rules as pool mints | <Note> Only the configured funder can fund a reward slot. Reward duration can be updated separately, but it must remain within the 1 day to 1 year limit. </Note> ## Why It Matters Liquidity mining helps projects bootstrap deeper markets. Instead of asking LPs to provide liquidity only for trading fees, a project can add reward tokens that make participation more attractive during key market phases. <CardGroup> <Card title="Launch Incentives" icon="rocket"> Reward early LPs during the first days or weeks of a new pool. </Card> <Card title="Sticky Liquidity" icon="magnet"> Encourage LPs to keep capital in the pool through important growth periods. </Card> <Card title="No Separate Farm" icon="layer-group"> Rewards accrue directly to DAMM v2 positions, reducing operational complexity. </Card> <Card title="Position-Aware Rewards" icon="image"> Rewards are tied to NFT positions, making incentives easier to track and compose. </Card> </CardGroup> ## Empty Liquidity Periods If a reward campaign is active but the pool has no liquidity, DAMM v2 tracks the number of empty-liquidity seconds. On the next funding, the funder can carry that ineligible reward value forward into the new reward window. If they do not carry it forward, the ineligible reward must be withdrawn before funding again. ## Product Takeaway DAMM v2 liquidity mining is designed for simple, native LP incentives. Projects can fund reward campaigns, LPs can earn without staking elsewhere, and positions keep trading fees, locks, and rewards under one NFT-backed ownership model. # DAMM v2 NFT Positions Source: https://docs.meteora.ag/core-products/damm-v2/nft-positions Learn how DAMM v2 uses NFT-backed positions to represent LP liquidity, pending fees, rewards, vesting locks, and permanent locks. Every DAMM v2 LP position is represented by a unique position NFT. The NFT is the ownership handle for the liquidity position: whoever holds the position NFT controls the position. This turns liquidity into a portable on-chain asset. A position can be transferred between wallets, separated into multiple positions, tracked by marketplaces or dashboards, and composed by other protocols. ## What a Position Represents A DAMM v2 position tracks the liquidity and rewards tied to one position NFT. <CardGroup> <Card title="Liquidity Ownership" icon="wallet"> The position records how much liquidity belongs to the NFT holder. </Card> <Card title="Pending Fees" icon="coins"> Trading fees accrue to the position until the owner claims them. </Card> <Card title="Liquidity Mining Rewards" icon="seedling"> Built-in reward campaigns accrue to each position based on total liquidity. </Card> <Card title="Locks and Vesting" icon="lock"> A position can contain unlocked, vesting, and permanently locked liquidity. </Card> </CardGroup> ## Liquidity Buckets DAMM v2 positions separate liquidity into three buckets: | Bucket | Product Meaning | | - | - | | Unlocked liquidity | Liquidity that can be withdrawn by the position owner | | Vesting liquidity | Liquidity that unlocks over time according to a schedule | | Permanently locked liquidity | Liquidity that cannot be withdrawn, but still supports the pool | Locked liquidity still earns. DAMM v2 uses total position liquidity when tracking trading fees and liquidity mining rewards, so vesting and permanently locked liquidity can continue participating while withdrawal is restricted. ## Position NFTs Position NFTs are Token 2022 NFTs created by the DAMM v2 program. They are minted with zero decimals and supply `1`, use Token 2022 metadata, and are tied to a DAMM v2 position account. For product users, the important behavior is simple: * Holding the NFT gives control over the position. * Transferring the NFT transfers control of the position. * The NFT makes the position discoverable and composable. <Info> DAMM v2 uses the pool as the freeze authority for position NFTs and the pool authority as mint/update authority. The default metadata name is `Meteora Position NFT` with symbol `MPN`. </Info> ## Fees and Rewards Position fees are separate from liquidity removal. A position can hold pending token A fees, pending token B fees, and pending rewards from up to two liquidity mining reward slots. The exact fee tokens depend on the pool's collect fee mode: | Mode | What LPs Claim | | - | - | | BothToken | Fees can accrue in both token A and token B | | OnlyB | Fees accrue in token B | | Compounding | Fees accrue in token B, with a configurable share automatically reinvested into pool reserves | ## Splitting Positions DAMM v2 positions can be split. This lets one position become two positions while dividing unlocked liquidity, permanent locked liquidity, pending token A fees, pending token B fees, pending rewards, and supported inner vesting state. Split numerators use a denominator of `1,000,000,000`. Each split amount is rounded down, so tiny residual amounts can remain in the source position. This is useful when you want to: * Transfer only part of a position. * Separate treasury, market maker, or community allocations. * Split vesting tranches before distributing position ownership. * Sell or custody part of an LP position without exiting the rest. ## Liquidity Locks DAMM v2 supports two lock styles: * **Vesting lock**: liquidity unlocks on a schedule, such as a cliff followed by periodic releases. * **Permanent lock**: liquidity cannot be withdrawn, creating a durable liquidity commitment. This gives token teams a way to show long-term alignment while keeping fee and reward participation active. <Note> Inner vesting stores the vesting schedule inside the position itself. A position must not already have active inner vesting when a new inner vesting lock is applied. </Note> ## Closing a Position A position can only be closed after it is empty. That means total liquidity is zero, pending token A and token B fees are zero, and pending rewards in both reward slots are zero. When a position is closed, the program burns the position NFT, closes the NFT token account, closes the NFT mint, and closes the position account. ## Why NFT Positions Matter NFT positions make DAMM v2 liquidity easier to reason about as a product: * LP ownership is represented by a familiar token object. * Transfers are simple because ownership follows the NFT. * Positions can contain complex state without making the user manage separate farm or lock accounts. * Integrators can build dashboards, custody flows, marketplaces, and collateral products around the NFT. # DAMM v2 Token 2022 Support Source: https://docs.meteora.ag/core-products/damm-v2/token-2022-support Learn how DAMM v2 supports SPL Token and Token 2022 mints, transfer-fee tokens, metadata extensions, token badges, and reward tokens. DAMM v2 supports both standard SPL Token mints and Token 2022 mints. This lets more Solana assets use DAMM v2 pools while preserving safety around extensions that can change token behavior. Token 2022 support is split into two paths: <CardGroup> <Card title="Permissionless Support" icon="unlock"> If your mint only uses supported safe extensions, you can create and use a DAMM v2 pool without a token badge. </Card> <Card title="Token Badge Support" icon="badge-check"> If your mint uses extensions outside the permissionless allowlist, Meteora can review it and initialize a token badge so the mint can pass DAMM v2 validation. </Card> </CardGroup> ## How DAMM v2 Detects Token Programs When a pool is created, DAMM v2 checks whether each mint is owned by the standard SPL Token Program or the Token 2022 Program. The pool stores that information as token flags, so future swaps, liquidity changes, fee claims, and reward flows can use the correct token program. The two pool mints must be different. If a Token 2022 mint is not permissionlessly supported, the initializer must provide a valid token badge account for that mint, unless the pool is created from a private config that has the `CreatePoolWithoutMintValidation` permission. For users, the benefit is simple: DAMM v2 can handle pools where one or both tokens are Token 2022 mints, as long as their extensions are permissionlessly supported, the mint has a valid token badge, or the private config is allowed to skip mint validation. ## Permissionlessly Supported Extensions If your Token 2022 mint uses only the following supported extensions, it can be used permissionlessly in DAMM v2: * `TransferFeeConfig` * `MetadataPointer` * `TokenMetadata` * `TransferHook`, only when both the hook program ID and hook authority are unset SPL Token mints are always accepted. A Token 2022 mint with no extensions is also accepted permissionlessly. <CardGroup> <Card title="Transfer Fee Config" icon="percent"> DAMM v2 accounts for transfer fees when tokens move into or out of pools, including deposits, withdrawals, swaps, and reward funding. </Card> <Card title="Metadata Pointer" icon="tag"> DAMM v2 supports mints that point to metadata through the Token 2022 metadata pointer extension. </Card> <Card title="Token Metadata" icon="file-lines"> DAMM v2 supports mints that use Token 2022 token metadata for display and integration context. </Card> <Card title="Revoked Transfer Hook" icon="link-slash"> Transfer Hook is permissionless only when both the hook program ID and authority are unset. </Card> </CardGroup> ## Token Badge Review Some Token 2022 extensions can materially change how a token behaves. These tokens require a **token badge** before they can be used in DAMM v2 pool creation or reward initialization. Examples include extensions such as: * Interest bearing configuration * Permanent delegate * Non-transferable tokens * Default account state * Pausable configuration * Confidential transfer mint configuration * Scaled UI amount configuration * Transfer Hook when the hook program ID or authority is still set * Other mint extensions that are not on the permissionless allowlist At the program level, a valid token badge allows a Token 2022 mint to pass DAMM v2 mint validation even if it uses extensions outside the permissionless allowlist. The badge is created by a Meteora operator after review. You cannot create a badge for a mint that is already permissionlessly supported. ## Private Config Mint Validation Bypass Private configs, meaning those with a `pool_creator_authority`, can store a `permission` bitmask. The only permission today is `CreatePoolWithoutMintValidation`. When that bit is set, `initialize_pool` and `initialize_pool_with_dynamic_config` skip the permissionless-mint and token-badge checks for that config. This is the DAMM v2 path used by DBC-migrated Stock Tokens and other quote mints that were allowlisted in DBC but are not permissionless-supported in DAMM v2. A DBC token badge is not a DAMM v2 token badge. DBC migration uses DAMM v2 configs that already have this permission, so the graduated pool can be created without a separate DAMM v2 badge. | Path | Mint validation | | - | - | | Public static config | Permissionless allowlist or a DAMM v2 token badge. | | Private config without permission | Permissionless allowlist or a DAMM v2 token badge. | | Private config with `CreatePoolWithoutMintValidation` | Skips allowlist and badge checks. Token 2022 wrapped SOL is still rejected. | | `initialize_customizable_pool` | Always uses the permissionless allowlist or a DAMM v2 token badge. Config permissions do not apply. | <Warning> The Token 2022 native mint is still rejected when `CreatePoolWithoutMintValidation` is set. Use the standard wrapped SOL mint. </Warning> <Note> To apply for a token badge, complete this [Google Form](https://forms.gle/59n3zDiGS2C6qMfd7) with details about the token and its extensions. After submitting, open a ticket in the [Meteora Discord](https://discord.gg/meteo) so the team can review it. </Note> <AccordionGroup> <Accordion title="I use standard metadata or transfer fees"> Your mint may be eligible for permissionless DAMM v2 support, as long as it only uses permissionless extensions. </Accordion> <Accordion title="I use transfer hooks"> Transfer Hook is permissionless only when both the hook program ID and authority are unset. If either remains set, request token badge review before creating the pool or initializing the mint as a reward token. </Accordion> <Accordion title="I use advanced or authority-based extensions"> Request a token badge before creating the pool. This gives Meteora a review point for extensions that can affect transfers, account state, authorities, pausing, confidentiality, non-transferability, scaled UI amounts, or other behavior that can materially affect swaps, deposits, withdrawals, and integrations. </Accordion> </AccordionGroup> ## Reward Tokens DAMM v2 liquidity mining rewards can also use Token 2022 mints, subject to the same extension support rules. If a reward mint is not permissionlessly supported, it needs a valid token badge before the reward slot can be initialized. ## Unsupported Cases <Warning> The Token 2022 native mint `So11111111111111111111111111111111111111112` is not supported in DAMM v2. A token badge and `CreatePoolWithoutMintValidation` cannot override this restriction. Use the standard wrapped SOL mint for SOL liquidity. </Warning> DAMM v2 does not provide a general transfer-hook remaining-account surface for swaps, liquidity, fees, or rewards. Even with a token badge, mints that still execute an active transfer-hook program can fail when tokens move, because DAMM v2 transfers do not forward transfer-hook extra accounts. ## Transfer Fee Accounting For deposits and other flows that need a target post-fee vault amount, DAMM v2 calculates the transfer-fee-included amount the user must send. For withdrawals, swaps, reward funding, and similar flows that reason about received amounts, it calculates the post-fee amount after the current epoch transfer fee. The code also handles the Token 2022 edge case where the transfer fee is 100% by using the mint's maximum transfer fee. ## Why This Matters Token 2022 expands what tokens can do, but not every extension is safe for a liquidity pool by default. DAMM v2 balances flexibility with pool safety: * Simple, common extensions work permissionlessly. * Sensitive extensions go through token badge review. * Transfer-fee tokens can be supported without forcing users to manually reason about every transfer adjustment. * Reward tokens follow the same safety model as pool tokens. # What is DAMM v2? Source: https://docs.meteora.ag/core-products/damm-v2/what-is-damm-v2 Learn more about Meteora's DAMM v2 configurable constant-product pools, concentrated or compounding liquidity, launch fee modes, NFT positions, rewards, locks, and Token 2022 support. DAMM v2 is Meteora's configurable constant-product AMM for Solana markets. It is built for pools that need explicit launch settings, fee behavior, liquidity ownership, reward distribution, and token support in one on-chain program. At its core, a DAMM v2 pool holds two token vaults, tracks a current square-root price, and lets traders swap against shared liquidity. The pool can use either a fixed concentrated price range or a full-range compounding model. LP ownership is represented by Token 2022 position NFTs, and the position account tracks liquidity, pending fees, rewards, vesting locks, and permanent locks. <Info> DAMM v2 runs on the mainnet program `cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG`. </Info> ## Why DAMM v2 Exists Token markets need different liquidity behavior at different stages. A new launch may need scheduled fees, quote-token fee collection, activation timing, or an alpha-vault window. A mature pair may need full-range liquidity with compounding. A launchpad may need reusable pool configurations. A project treasury may need locked liquidity that still earns fees and rewards. DAMM v2 is designed to support those different needs without forcing every pool into the same template. <CardGroup> <Card title="Configurable Liquidity" icon="sliders"> Choose a fixed price range for concentrated liquidity, or use compounding mode for full-range constant-product liquidity. </Card> <Card title="Launch-Ready Fees" icon="shield"> Use time schedulers, market-cap schedulers, and optional dynamic fees to shape trading fees. Rate limiter mode is deprecated for new configs. </Card> <Card title="NFT Positions" icon="image"> Each LP position is represented by a Token 2022 NFT, making liquidity ownership transferable and easier to compose. </Card> <Card title="Built-In Liquidity Mining" icon="seedling"> Pools can distribute up to two reward tokens directly to LP positions without a separate farm. </Card> <Card title="Liquidity Locks" icon="lock"> Positions can hold unlocked, vesting, and permanently locked liquidity, while locked liquidity continues earning. </Card> <Card title="Token 2022 Support" icon="certificate"> DAMM v2 supports common Token 2022 extensions and a token badge review path for more sensitive token designs. </Card> </CardGroup> ## How DAMM v2 Works A DAMM v2 pool is created around two different token mints: token A and token B. Token B is commonly the quote asset, such as SOL or USDC, because `OnlyB` and `Compounding` fee modes collect fees in token B. The pool has an initial square-root price,
프로젝트로 돌아가기