Meteora 백서

Meteora

원문

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

initial liquidity, fee parameters, an activation type, and an activation point. Pool creators can use static or dynamic configurations: * **Static configurations** reuse operator-created settings. They can be public or restricted to a specific pool creator authority. * **Dynamic configurations** let an authorized pool creator provide pool-specific parameters while still using a registered config account. * **Customizable pools** are initialized directly with pool parameters and use a separate pool address seed. For LPs, the experience is position-based. When you add liquidity, you hold a position NFT. That position tracks your liquidity, your pending fees, your pending liquidity mining rewards, and any liquidity that is locked or vesting. ## What makes DAMM v2 unique? ### Concentrated Liquidity DAMM v2 can create pools with a fixed minimum and maximum square-root price. Liquidity inside that range is active for swaps; exact-in swaps that would move beyond the boundary fail unless the partial-fill swap path is used. This is useful for launch teams that want tighter market depth around an expected price area, or for integrators that want predictable pool boundaries. ### Compounding Liquidity DAMM v2 also supports a compounding mode where the pool behaves like a full-range constant-product AMM. A configurable share of the LP fee is added back into pool reserves, while the remaining LP fee stays claimable by positions. This is useful for long-lived pools where LPs want passive liquidity growth and less operational overhead. ### Flexible Fees DAMM v2 separates fee behavior into layers: * A **base fee mode** defines the pool's primary trading fee behavior, powered by our anti-sniping mechanisms. * An optional **dynamic fee** raises fees when volatility increases. * In compounding mode, a share of the LP fee can be reinvested into pool reserves. The current base fee modes for new pools are `time scheduler linear`, `time scheduler exponential`, `market-cap scheduler linear`, and `market-cap scheduler exponential`. `rate limiter` is deprecated for new configs and new pools. Existing rate-limiter pools can still trade. The total fee is capped by the pool fee version which is currently set to `99%` max fee. ### NFT Positions Every DAMM v2 position is backed by a unique position NFT. The NFT is the ownership handle for the position, so transferring the NFT transfers control of the liquidity position. Positions can also be split, which makes it easier to separate liquidity tranches, distribute ownership, or transfer part of a position without closing the whole thing. ### Liquidity Mining DAMM v2 includes liquidity mining in the pool program itself. A pool can support up to two reward tokens, and rewards accrue to positions based on each position's share of total pool liquidity. This gives projects a direct way to incentivize LPs without deploying and managing a separate staking contract. ## Who DAMM v2 Is For <AccordionGroup> <Accordion title="Token Launch Teams"> DAMM v2 helps launch teams configure pool pricing, fee behavior, activation timing, fee collection, Token 2022 support, LP incentives, and liquidity locks in one place. </Accordion> <Accordion title="Launchpads and Integrators"> DAMM v2 gives launchpads reusable pool configurations, market-cap-based fee decay, activation controls, and a single program surface for pool creation. </Accordion> <Accordion title="Liquidity Providers"> LPs can hold transferable NFT positions, earn trading fees, earn liquidity mining rewards, and participate in either concentrated or compounding liquidity designs. </Accordion> <Accordion title="Traders and Aggregators"> DAMM v2 pools provide deep on-chain liquidity, clear fee behavior, and swap support across exact-in, partial-fill, and exact-out flows. </Accordion> </AccordionGroup> ## Explore DAMM v2 <CardGroup> <Card title="DAMM v2 Concentrated Liquidity" href="/core-products/damm-v2/concentrated-liquidity" icon="chart-line"> Learn how fixed price ranges make liquidity more capital efficient. </Card> <Card title="DAMM v2 Compounding Liquidity" href="/core-products/damm-v2/compounding-liquidity" icon="arrows-rotate"> See how auto-compounding grows full-range pool reserves over time. </Card> <Card title="DAMM v2 Fees" href="/core-products/damm-v2/fees/overview" icon="percent"> Compare base fee modes, dynamic fees, protocol fees, and fee collection behavior. </Card> <Card title="DAMM v2 NFT Positions" href="/core-products/damm-v2/nft-positions" icon="image"> Learn how position NFTs represent liquidity, fee ownership, locks, and rewards. </Card> <Card title="DAMM v2 Liquidity Mining" href="/core-products/damm-v2/liquidity-mining" icon="seedling"> Understand built-in reward campaigns for LP positions. </Card> <Card title="DAMM v2 Token 2022 Support" href="/core-products/damm-v2/token-2022-support" icon="certificate"> Review supported Token 2022 extensions and token badge requirements. </Card> </CardGroup> <CardGroup> <Card title="DAMM v2 Formulas" href="/core-products/damm-v2/formulas" icon="calculator"> Understand the product math behind prices, liquidity, fees, compounding, and rewards. </Card> </CardGroup> # DBC Accounts and Permissions Source: https://docs.meteora.ag/core-products/dbc/accounts-and-permissions Review the main DBC on-chain accounts, lifecycle flags, permissions, transfer-hook accounts, limits, and claim gates. This page summarizes the DBC implementation details that are useful when reading pool state, building integrations, or checking whether a claim or migration action is allowed. ## Main Accounts | Account | What It Stores | | - | - | | `PoolConfig` | Reusable launch template: quote mint, fee claimer, leftover receiver, bonding curve, fees, migration target, token settings, liquidity distribution, migration fee settings, and migrated-pool fee settings. | | `ConfigWithTransferHook` | Transfer-hook launch template: a `PoolConfig` plus the executable transfer-hook program configured by the partner. | | `VirtualPool` | Live launch state: creator, base and quote vaults, reserves, current square-root price, activation point, fee balances, migration progress, surplus and claim flags, and protocol migration fee balances. | | `TransferHookPool` | Transfer-hook pool state. It stores the same `PoolState` fields as `VirtualPool` with a separate discriminator. | | `PartnerMetadata` | Optional partner metadata used by launchpad partners. | | `VirtualPoolMetadata` | Optional metadata account for a launched virtual pool, created by the pool creator. | | `TokenBadge` | Operator-created allowlist account for a Token 2022 quote mint that is not permissionless-supported. | | `Operator` | Admin-created permission account used for protocol pool creation fee claims and token badge management. | SDK state readers normalize standard and transfer-hook account variants. Raw account readers and indexers should still distinguish `PoolConfig` from `ConfigWithTransferHook`, and `VirtualPool` from `TransferHookPool`. ## Lifecycle State The shared `PoolState` inside `VirtualPool` and `TransferHookPool` tracks migration progress with four states. | State | Meaning | | - | - | | `PreBondingCurve` | The pool is still trading on the DBC curve. | | `PostBondingCurve` | The curve is complete and a locker step is still needed. This is used when locked vesting is configured. | | `LockedVesting` | The pool is ready for DAMM pool creation, or vesting/locker setup has been completed. | | `CreatedPool` | The migrated DAMM pool has been created. | When the quote reserve reaches `migration_quote_threshold`, normal curve trading stops. If locked vesting is configured, the pool moves to `PostBondingCurve`; otherwise it moves directly to `LockedVesting`. ## Core Limits | Setting | Program Constraint | | - | - | | Active curve points | `1` to `16` points. The account stores 20 slots for compatibility and future capacity. | | Token decimals | `6` to `9`. | | Bonding-curve minimum base fee | `0.25%`, stored as `2_500_000` over `1_000_000_000`. | | Bonding-curve maximum total fee | `99%`, stored as `990_000_000` over `1_000_000_000`. | | Rate limiter duration | Existing rate-limiter pools use up to `43,200` seconds for timestamp activation or `108,000` slots for slot activation. New configs cannot select this mode. | | Migration fee percentage | Up to `99%`. If the migration fee is `0`, the creator migration fee percentage must also be `0`. | | Pool creation fee | If non-zero, from `0.001 SOL` to `100 SOL`, paid in lamports. | | Migrated pool fee | `0.1%` to `10%` when custom DAMM v2 migrated-pool fees are configured. | | Day-one locked liquidity | At least `10%` of migrated liquidity must still be locked after one day. | | DAMM v2 vesting lock duration | At most `2` years. | | Transfer hook program | Must be executable and cannot be DBC, SPL Token, Token 2022, or the default pubkey. | ## Permissions | Action | Required Authority | | - | - | | Create config | Any payer can create a config account, but the config fixes the `fee_claimer` and `leftover_receiver`. | | Create transfer-hook config | Any payer can create it, but the config must be Token 2022 and stores an executable transfer-hook program. | | Initialize virtual pool | Creator signs and launches from an existing config. | | Initialize transfer-hook pool | Creator signs and launches from an existing transfer-hook config. | | Create virtual pool metadata | Current pool creator. | | Transfer pool creator | Current pool creator. | | Claim partner trading fee | Config `fee_claimer`. Transfer-hook pools use the transfer-hook-aware claim path. | | Claim creator trading fee | Current pool creator. Transfer-hook pools use the transfer-hook-aware claim path. | | Partner withdraw surplus | Config `fee_claimer`. | | Creator withdraw surplus | Current pool creator. | | Withdraw partner migration fee | Config `fee_claimer`. | | Withdraw creator migration fee | Current pool creator. | | Withdraw leftover | Permissionless instruction, but funds can only go to the config `leftover_receiver` ATA after migration. | | Claim protocol trading or migration fees | `claim_protocol_fee2` uses the fixed `protocol_fee_authority` signer. The older `claim_protocol_fee` and `zap_protocol_fee` instructions are removed. | | Claim protocol pool creation fee | Operator with `ClaimProtocolFee` permission. | | Create or close a quote-mint token badge | Operator with `CreateTokenBadge` or `CloseTokenBadge` permission. | Several claim paths also use one-time flags on the pool state, so a valid signer cannot claim the same surplus, migration fee, pool creation fee, or leftover more than once. ## Claims by Lifecycle Stage | Lifecycle Stage | Claim Paths | | - | - | | After virtual pool creation | Partner and protocol pool creation fees can be claimed once, when configured. | | During bonding curve trading | Partner, creator, and protocol trading fees can be claimed as fees accrue. | | After curve completion | Surplus and partner or creator migration fees become available. | | After migrated pool creation | Fixed-supply leftover withdrawal, DAMM v1 LP-token claims, and DAMM v2 migrated position ownership are finalized. | ## Token Support DBC can launch SPL Token or Token 2022 base mints. New configs must migrate to DAMM v2. Existing DAMM v1 pools can still graduate. Transfer-hook launches are Token 2022 only. They use `ConfigWithTransferHook`, `TransferHookPool`, `swap2_with_transfer_hook`, and transfer-hook-aware trading fee claims. The base mint's transfer hook is revoked when the curve completes. Quote mints can be SPL Token mints. Token 2022 quote mints are permissionless only when their extensions are limited to `MetadataPointer` and `TokenMetadata` and the transfer fee is zero. Other Token 2022 quote extensions need a `TokenBadge`. Native Token 2022 mint behavior is rejected as a quote mint. ## Config Validation Highlights DBC validates the launch template before it can be used: * The quote mint must be supported, or a valid token badge must be supplied at remaining account index `0`. * The quote mint transfer fee must be zero, including any scheduled fee. * The collect fee mode must be `QuoteToken` or `OutputToken`. * The migration target must be DAMM v2. `MeteoraDamm` is rejected for new configs and new pools. * `BaseFeeMode::RateLimiter` is rejected for new configs and new pools. * Transfer-hook configs must use Token 2022 and a valid executable transfer-hook program. * Mint-authority token authority options are only valid for transfer-hook configs. * Liquidity percentages across partner, creator, permanent locks, and vesting must add to `100%`. * Curve prices must strictly increase and every active curve point must have positive liquidity. * Fixed-supply configs must set a non-default leftover receiver and must provide enough supply for the curve, migration liquidity, locked vesting, and the 25% swap buffer. # DBC Dynamic Fees Source: https://docs.meteora.ag/core-products/dbc/fees/dynamic-fees Learn how DBC dynamic fees add a volatility-responsive fee layer on top of the selected base fee mode. DBC dynamic fees are an optional fee layer that responds to recent price movement. When the launch becomes more volatile, the dynamic fee can increase. When activity calms down, the dynamic fee decays. This lets a launch price volatility without permanently raising the base fee. ## How Dynamic Fees Fit With Base Fees Every DBC pool has a base fee mode. Dynamic fees sit on top of that base fee. ```math theme={"system"} \text{Total Trading Fee} = \text{Base Fee} + \text{Dynamic Fee} ``` If dynamic fees are disabled, the dynamic fee is zero. ## How It Works DBC tracks recent price movement with a volatility accumulator. When swaps move price, the accumulator can increase. As time passes, the volatility reference can decay. The final dynamic fee is calculated from that volatility measurement and the dynamic fee settings. | Setting | Product Meaning | | - | - | | Bin step | Price sensitivity used to measure movement. | | Filter period | A short window that smooths very high-frequency updates. | | Decay period | The time window after which volatility can decay or reset. | | Reduction factor | Controls how much the volatility reference decays. | | Max volatility accumulator | Caps the volatility measurement. | | Variable fee control | Controls how strongly volatility affects the fee. | ## Dynamic Fee Formula ```math theme={"system"} \text{Dynamic Fee} = \left\lceil \frac{(\text{Volatility Accumulator} \times \text{Bin Step})^2 \times \text{Variable Fee Control}}{100000000000} \right\rceil ``` In product terms: * More recent price movement can increase the fee. * The fee is capped by configuration so it does not grow without bound. * The fee can cool down as volatility decays. * The total trading fee is still capped at `99%` after the base fee and dynamic fee are added. ## Why Use Dynamic Fees <CardGroup> <Card title="Volatility Response" icon="wave-pulse"> Fees can increase when price movement becomes more intense. </Card> <Card title="Launch Protection" icon="shield"> Dynamic fees can add extra cost during sudden demand spikes. </Card> <Card title="LP Compensation" icon="hand-holding-dollar"> Fee capture can increase during moments when the pool is taking more price risk. </Card> <Card title="Works With Base Modes" icon="layer-group"> Dynamic fees can be paired with fixed fees or schedulers. Rate limiter mode is deprecated for new configs. </Card> </CardGroup> ## Product Examples <AccordionGroup> <Accordion title="Fixed Fee + Dynamic Fee"> The launch keeps a simple default fee, but the fee can rise during volatile bursts. </Accordion> <Accordion title="Time Scheduler + Dynamic Fee"> The launch starts with high time-based fees and adds volatility response on top. </Accordion> <Accordion title="Existing Rate Limiter + Dynamic Fee"> Existing rate-limiter pools can still add volatility response on top of buy-size-sensitive fees. New configs cannot select rate limiter mode. </Accordion> </AccordionGroup> ## SDK Helper Behavior When using DBC SDK curve-building helpers with dynamic fees enabled, the helper-generated dynamic fee is designed around a maximum dynamic fee of up to 20% of the base fee. Example: | Fee Layer | Example | | - | - | | Base fee | 1.00% | | Max dynamic fee from helper | Up to 0.20% | | Total fee | Up to 1.20% | This is a helper-level product convention for common launch configurations. Custom configurations still need to respect the program's dynamic fee validation rules, including the default 1 bps bin step, filter period below decay period, reduction factor at most `10000`, and volatility parameter caps. # DBC Fee Scheduler Source: https://docs.meteora.ag/core-products/dbc/fees/fee-scheduler Learn how DBC fee schedulers support fixed, linear, and exponential fee behavior during the bonding curve phase. The DBC fee scheduler controls how the base fee changes after a pool opens. It can be used in three product ways: | Scheduler Style | Product Behavior | Best Fit | | - | - | - | | Fixed | Fee stays constant. | Simple launches with predictable fee messaging. | | Linear | Fee decreases by the same amount each period. | Launches that want a clear anti-sniper schedule. | | Exponential | Fee decreases by a percentage of the current fee each period. | Launches that want stronger early protection and faster early relief. | ## How Scheduler Settings Work A scheduler uses four core settings. | Setting | Product Meaning | | - | - | | Cliff fee | The starting fee when trading opens. | | Number of periods | How many fee reductions can happen. | | Period frequency | How long each period lasts. | | Reduction factor | How much the fee decreases each period. | The schedule is measured from the pool's activation point. Activation can be based on slot or timestamp, depending on the config. ## Fixed-Fee Behavior Fixed-fee behavior is the simplest scheduler setup. ```math theme={"system"} \text{Fee} = \text{Cliff Fee} ``` In product terms, every trade pays the same base fee unless dynamic fees are enabled. This is useful for launchpads that want broad, easy-to-explain presets. <Note> Fixed fee is not a separate on-chain scheduler curve. It is scheduler behavior where `period_frequency`, `number_of_period`, and `reduction_factor` are all zero, so the program returns the cliff fee for every swap. </Note> ## Linear Scheduling Linear scheduling reduces the fee by the same amount each period. ```math theme={"system"} \text{Fee} = \text{Cliff Fee} - (\text{Passed Periods} \times \text{Reduction Factor}) ``` Think of it like a staircase. ```text theme={"system"} High fee | |____ |____ |____ |____ Final fee ``` Linear scheduling is easy to publish because every step is predictable. ## Exponential Scheduling Exponential scheduling reduces the fee by a percentage-style factor each period. ```math theme={"system"} \text{Fee} = \text{Cliff Fee} \times (1 - \text{Reduction Factor})^\text{Passed Periods} ``` This usually drops faster early, then tapers. ```text theme={"system"} High fee |\ | \ | \__ | \____ Final fee ``` Exponential scheduling is useful when the launch wants the strongest protection near opening, but does not want to keep fees elevated for too long. ## Fee Bounds Scheduler fees must stay within DBC bonding phase fee bounds. | Bound | Product Meaning | | - | - | | Minimum base fee | 0.25% minimum base fee for bonding phase configurations. | | Maximum total fee | 99% maximum fee cap to avoid invalid launch configurations. | If any scheduler field is non-zero, all three schedule fields must be non-zero. Mixed zero and non-zero scheduler settings are invalid. ## Choosing a Scheduler <AccordionGroup> <Accordion title="I want the simplest possible fee"> Use fixed-fee behavior. It is ea
프로젝트로 돌아가기