Meteora 백서

Meteora

원문

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

metrics at a product level. ## Total trading fee Every swap can charge a trading fee. The trading fee is calculated from the input amount: ```math theme={"system"} \text{trading fee} = \text{input amount} \times \frac{\text{trade fee numerator}}{\text{trade fee denominator}} ``` The LP-relevant portion of the fee remains with the pool and increases the value backing LP tokens. In practice, LPs do not need to manually collect this fee from a DAMM v1 LP-token pool. The fee is reflected in pool share value. ## Protocol fee DAMM v1 can also charge a protocol fee: ```math theme={"system"} \text{protocol fee} = \text{total trading fee} \times \frac{\text{protocol fee numerator}}{\text{protocol fee denominator}} ``` The protocol fee is separate from the LP value. Depending on pool configuration, protocol, host, and partner fee settings can determine how swap fees are split. ### Constant Product pools * **Standard Pools:** **20%** Protocol Fee, **80%** LP Fee (0.25% trade fee) * **Launch Pools:** **20%** Protocol Fee, **80%** LP Fee (customizable trade fee) ### Stable Swap pools * **0%** Protocol Fee, **100%** LP Fee (0.01% trade fee) ### Swaps Swap hosts can include a host fee account in the swap transaction to receive **20%** of the protocol fee. For LPs, the key question is: what portion of the trading fee remains in the pool and increases LP token value? ## Host and partner fee routing DAMM v1 also has fee routing logic for partner fee arrangements. A configured partner can accrue up to **50%** of protocol-side fees after any host fee routing. This does not change the core LP concept: LPs evaluate the net value accruing to the pool after applicable fee splits. ## Base APY Base APY measures how much the value of a pool share has increased over a period, annualized. ```math theme={"system"} \text{base APY} = \left(\left(\frac{\text{Virtual Price}_{2}}{\text{Virtual Price}_{1}}\right)^{\frac{\text{1 year}}{\text{timeframe}}} - 1\right) \times 100 ``` Where: * `Virtual Price 1` is the older virtual price. * `Virtual Price 2` is the newer virtual price. * `timeframe` is the measurement period. Virtual price is: ```math theme={"system"} \text{virtual price} = \frac{D}{\text{LP token supply}} ``` `D` is the curve invariant computed from the pool's token amounts after converting vault LP shares into underlying token balances. For constant-product pools, `D = sqrt(x * y)`. For stable pools, `D` comes from the stable-swap invariant. Virtual price can rise because of: * Swap fees. * Eligible Dynamic Vault yield. * Any value that increases pool assets relative to LP token supply. <Note> Base APY is backward-looking. It annualizes what happened during a measurement window. It is not a promise that the same return will continue. </Note> ## 365-day fee over TVL This metric annualizes recent swap fee generation against pool liquidity: ```math theme={"system"} \text{365d fee / TVL} = \frac{\text{24h fees} \times 365}{\text{pool TVL}} ``` Where: * `24h fees` is the fee value generated over the last 24 hours. * `pool TVL` is the current value of liquidity in the pool. This is useful for comparing how efficiently different pools are generating trading fees. A smaller pool with heavy volume may show a high fee-over-TVL number. A large pool with quiet volume may show a lower number. ## Dynamic Vault yield Some DAMM v1 pools can earn additional yield through Dynamic Vaults. This yield comes from eligible idle assets being allocated to supported external strategies. Vault yield can contribute to base APY because it can increase the value backing the pool's vault LP positions. The important distinction: * **Trading fee yield** comes from swaps. * **Vault yield** comes from eligible vault strategies. * **Farm APR** comes from reward token emissions. These can all appear in the LP return profile, but each has different drivers and risks. ## External farm APR External liquidity mining APR estimates the annualized value of farm rewards relative to farm TVL: ```math theme={"system"} \text{LM APR} = \left(\left(1 + \frac{\text{farm reward per day}}{\text{farm TVL}}\right)^{365} - 1\right) \times 100 ``` Where: * `farm reward per day` is the daily value of reward emissions. * `farm TVL` is the value of LP tokens staked in the farm. Farm APR is only relevant if LPs stake LP tokens in the separate farm program. LP tokens sitting unstaked in a wallet still own pool liquidity, but they do not earn farm rewards from that farm. ## Reading a DAMM v1 pool return stack When comparing DAMM v1 pools, break the displayed return into layers: ### 1. Organic trading demand Does the pair have real swap volume? High trading volume can generate sustainable fees. ### 2. Pool depth How much TVL is competing for those fees? More TVL can reduce slippage, but it also spreads fee revenue across more LP capital. ### 3. Vault yield eligibility Does one side or both sides of the pool connect to Dynamic Vault yield? If yes, what are the supported assets and risk assumptions? ### 4. Farm incentives Is there an active farm? What reward token is emitted? How long does it last? How much LP liquidity is staked? ### 5. Asset risk A high displayed APY does not offset all asset risk. LPs still face price movement, depeg risk, smart contract risk, and incentive changes. ## Practical example A DAMM v1 stablecoin pool might have: * Low but steady trading fees. * Eligible Dynamic Vault yield on one or both stable assets. * A temporary partner farm. The combined displayed return may look attractive, but each component behaves differently. Trading fees depend on volume. Vault yield depends on external strategy rates and risk. Farm APR depends on reward funding and how many LP tokens are staked. A healthy LP decision looks at all three instead of chasing the largest number on the screen. # DAMM v1 Formulas Source: https://docs.meteora.ag/legacy-products/damm-v1/damm-v1-formulas Understand the product math behind DAMM v1 constant-product pools, stable pools, fees, LP shares, virtual price, vault yield, and farming rewards. DAMM v1 is a full-range AMM with two main curve designs: constant-product pools for volatile assets, and stable-swap pools for assets that should trade close together. The formulas below explain how the product behaves without turning this page into an integration guide. ## Constant-product pools The basic volatile-pool formula is: ```math theme={"system"} x \times y = k ``` Where: * `x` is the amount of token A in the pool. * `y` is the amount of token B in the pool. * `k` is the pool invariant. When a trader adds token A and removes token B, `x` rises and `y` falls. The pool reprices the trade so the relationship between both reserves stays balanced. For users, this means: * Larger pools usually create lower price impact. * Larger trades move price more than smaller trades. * The pool supports a continuous price range from very low to very high prices. ## Constant-product swap output Before fees, a simplified output calculation looks like this: ```math theme={"system"} \text{new source reserve} = \text{source reserve} + \text{input amount} ``` ```math theme={"system"} \text{new destination reserve} = \frac{k}{\text{new source reserve}} ``` ```math theme={"system"} \text{output amount} = \text{destination reserve} - \text{new destination reserve} ``` DAMM v1 uses safe on-chain integer math, so tiny rounding differences can happen at the smallest token unit. Product-wise, the idea is straightforward: every buy makes the bought token scarcer in the pool, which raises its price for the next trade. ## Stable pools Stable pools are designed for assets that should trade near a target relationship, such as USDC/USDT or SOL/LST markets. Instead of using only `x × y = k`, DAMM v1 stable pools use a StableSwap-style invariant with an amplification factor. A simplified StableSwap invariant can be represented as: ```math theme={"system"} A \cdot n^n \cdot \sum x_i + D = A \cdot n^n \cdot D + \frac{D^{n+1}}{n^n \cdot \prod x_i} ``` Where: * `A` is the amplification factor. * `n` is the number of assets in the pool. DAMM v1 pools are two-token pools. * `x_i` represents normalized token balances. * `D` is the stable pool invariant. In plain English: amplification makes the pool behave as if it has deeper liquidity near the target price. That helps reduce slippage when both assets are close to their expected relationship. <Note> A higher amplification factor concentrates more liquidity near the target relationship, but it also makes the pool less forgiving when the assets move far away from that relationship. </Note> ## Token normalization Stable pools normalize token amounts before applying the curve. This matters when two tokens have different decimals. ```math theme={"system"} \text{normalized amount} = \text{raw amount} \times \text{token multiplier} ``` The goal is to compare both assets on a consistent precision scale before calculating swaps, deposits, and withdrawals. ## LST depeg adjustment For supported LST pools, DAMM v1 can account for the changing value of the staking token relative to SOL. The program stores and updates a base virtual price for the LST side of the pool. Conceptually: ```math theme={"system"} \text{pegged LST amount} = \text{LST amount} \times \text{LST virtual price} ``` This lets the pool reason about an LST's value instead of treating one LST as always equal to one SOL. That is important because LSTs generally increase in SOL terms as staking rewards accrue. ## LP share ownership LP tokens represent a share of the pool. A simplified LP ownership formula is: ```math theme={"system"} \text{LP ownership share} = \frac{\text{LP tokens held}}{\text{total LP token supply}} ``` The value of that share depends on the pool's underlying token value: ```math theme={"system"} \text{LP share value} = \text{ownership share} \times \text{total pool value} ``` DAMM v1 pools route token balances through Dynamic Vaults. That means the pool often measures its token A and token B totals by converting vault LP balances back into underlying token amounts. ## Virtual price Virtual price is a useful way to understand whether a pool share is becoming more valuable over time. ```math theme={"system"} \text{virtual price} = \frac{D}{\text{LP token supply}} ``` `D` is the curve invariant computed from the pool's vault-backed token amounts. For constant-product pools, DAMM v1 uses `sqrt(x * y)`. For stable pools, it uses the StableSwap invariant. Virtual price can rise when: * Swaps generate fees that remain in the pool. * Eligible vault assets earn yield. * Rewards or yield increase the underlying value backing pool shares. For LPs, virtual price is the bridge between pool activity and share value. ## Trading fees DAMM v1 charges trading fees on swaps. A simplified fee calculation is: ```math theme={"system"} \text{trading fee} = \text{input amount} \times \frac{\text{trade fee numerator}}{\text{trade fee denominator}} ``` DAMM v1 also supports protocol fees: ```math theme={"system"} \text{protocol fee} = \text{trading fee} \times \frac{\text{protocol fee numerator}}{\text{protocol fee denominator}} ``` The protocol fee is computed from the total trading fee. The remaining fee value benefits LPs because it stays with the pool and increases the value backing LP tokens. <Info> DAMM v1's fee math has a minimum-fee behavior for non-zero trades when the calculated fee would otherwise round down to zero. This prevents tiny trades from bypassing fees entirely. </Info> ## Base APY from virtual price DAMM v1 APY can be estimated from virtual price growth over a time window: ```math theme={"system"} \text{base APY} = \left(\left(\frac{\text{Virtual Price}_{2}}{\text{Virtual Price}_{1}}\right)^{\frac{\text{1 year}}{\text{timeframe}}} - 1\right) \times 100 ``` Where: * `Virtual Price 1` is the earlier virtual price. * `Virtual Price 2` is the later virtual price. * `timeframe` is the time between the two measurements. This base APY can include the effect of trading fees and eligible vault yield because both can increase the value backing each LP token. ## 365-day fee over TVL A simple fee efficiency metric annualizes recent swap fees against pool liquidity: ```math theme={"system"} \text{365d fee / TVL} = \frac{\text{24h fees} \times 365}{\text{pool TVL}} ``` This helps LPs compare how much fee activity a pool is generating relative to the amount of liquidity supplied. ## External farm rewards External DAMM v1 farms distribute reward tokens to staked LP tokens over time. Farming is a separate reward layer around the AMM LP token, not core swap logic inside the AMM program. A simplified reward rate is: ```math theme={"system"} \text{reward rate} = \frac{\text{funded reward amount}}{\text{reward duration}} ``` Reward per staked LP token grows as time passes: ```math theme={"system"} \text{reward per token} = \text{previous reward per token} + \frac{\text{elapsed time} \times \text{reward rate}}{\text{total staked LP tokens}} ``` A user's pending reward is based on their staked balance: ```math theme={"system"} \text{user reward} = \text{staked LP tokens} \times \text{reward per token since last update} ``` DAMM v1 farm integrations have historically supported up to two reward tokens. Check the farm program and campaign configuration for exact reward-accounting behavior. ## LM APR Liquidity mining APR estimates the annualized value of farm emissions relative to farm TVL: ```math theme={"system"} \text{LM APR} = \left(\left(1 + \frac{\text{farm reward per day}}{\text{farm TVL}}\right)^{365} - 1\right) \times 100 ``` Where: * `farm reward per day` is the daily token emission value in USD. * `farm TVL` is the value of LP tokens staked in the farm. * `pool TVL` is the value of all token A and token B liquidity in the pool. # Dynamic Vault Yield Source: https://docs.meteora.ag/legacy-products/damm-v1/dynamic-vaults-yield Learn how DAMM v1 pools can earn additional yield by routing eligible idle liquidity through Meteora Dynamic Vaults. One of DAMM v1's defining features is that pool liquidity can sit on top of Dynamic Vaults. Instead of leaving every token idle inside a standard pool account, eligible DAMM v1 assets can be connected to vaults that allocate unused liquidity into supported external strategies. For LPs, this creates an additional return layer. A DAMM v1 pool can earn swap fees from trading activity while eligible idle assets may also earn lending yield through the Dynamic Vault layer. ## What Dynamic Vaults do Dynamic Vaults are Meteora's capital allocation layer. A vault holds a supported token, keeps part of the liquidity available in reserve, and can allocate part of the liquidity into approved strategies. A vault tracks: * The token it supports. * The total amount of that token controlled by the vault. * The reserve token account available for immediate liquidity. * Approved strategies that can receive allocations. * Vault LP supply, which represents shares of the vault. * Locked profit accounting, which smooths newly reported gains over time. DAMM v1 pools use vault LP positions to represent the pool's ownership of each token-side vault. ## How this connects to DAMM v1 A DAMM v1 pool has two token sides. Each side points to a Dynamic Vault. When the pool needs to understand its balances, it converts its vault LP holdings back into the current underlying token amounts. That means the AMM can continue to price swaps, deposits, withdrawals, and LP share value while the vault layer manages eligible idle liquidity behind the scenes. <Info> In DAMM v1 source, the pool stores vault accounts and vault LP token accounts for both token sides. This is the core reason DAMM v1 is described as an AMM built on Dynamic Vault infrastructure. </Info> ## Why this creates additional yield In a normal AMM, unused liquidity simply waits for the next trade. In a DAMM v1 pool with supported vault assets, a portion of idle liquidity can be allocated to external yield sources. The return stack becomes: 1. Traders pay swap fees. 2. LP token value can rise as fees remain in the pool. 3. Eligible vault assets may earn strategy yield. 4. Vault yield can increase the value backing the pool's vault LP positions. 5. LPs benefit through pool share value and virtual price growth. This helps reduce reliance on constant liquidity mining emissions. A pool can be more attractive to LPs even when trading volume is uneven or reward campaigns are not active. ## Reserve liquidity and withdrawals Dynamic Vaults do not send every token into a strategy. A portion of liquidity can remain in the vault reserve to support normal pool operations. This reserve matters because DAMM v1 pools still need liquidity for: * Swaps. * Balanced withdrawals. * Single-sided withdrawals where supported. * LP operations and pool accounting. If a very large withdrawal exceeds immediately available reserve liquidity for a vault-backed asset, the user experience may require smaller withdrawals or operational support while liquidity is moved back from strategies. <Warning> Vault-backed yield improves capital productivity, but it is not the same as instant idle cash. Strategy allocations can affect how much liquidity is immediately available in the reserve at a given moment. </Warning> ## Locked profit and smoother share value Dynamic Vaults use locked profit accounting. When a vault reports gains, those gains are not necessarily made fully available to new deposits immediately. Instead, profit can unlock over time. The product reason is fairness. Without smoothing, someone could deposit immediately before a gain is reported and withdraw after capturing value they did not help earn. Locked profit helps reduce that kind of timing advantage. For LPs, this means vault yield may show up as gradual share value improvement rather than an instant jump. ## Where LPs see the impact DAMM v1 LPs typically experience vault yield through pool performance metrics, such as virtual price growth or displayed yield metrics. The exact UI label can vary, but the product idea is consistent: vault yield increases the underlying value backing pool shares when strategies perform positively. A simplified virtual price view is: ```math theme={"system"} \text{virtual price} = \frac{\text{total pool value}}{\text{LP token supply}} ``` If pool value rises from fees or vault yield while LP supply stays the same, virtual price increases. ## Eligible assets Dynamic Vault yield depends on vault support. Historically, DAMM v1 vault yield has been most relevant for major liquid assets such as USDC, USDT, and SOL, where external lending or liquidity strategies exist. Not every token pair can earn vault yield. A long-tail token may still use DAMM v1's AMM design, but the additional vault yield layer depends on whether the token side has a supported Dynamic Vault strategy. ## Risk considerations Dynamic Vault yield introduces additional risk considerations beyond basic AMM liquidity: * External strategy risk. * Lending market risk. * Smart contract risk. * Liquidity availability risk. * Operational and keeper risk. * Changes in external yield rates. Meteora's vault design includes controls such as approved strategy lists, reserve management, operators, and rebalancing, but LPs should still treat vault yield as a DeFi strategy exposure. ## How to think about vault yield Dynamic Vault yield is best understood as a baseline capital productivity layer. It does not replace trading volume, and it does not replace farms. Instead, it makes DAMM v1 pools more durable by giving eligible idle assets something productive to do between trades. For a strong DAMM v1 pool, the ideal return mix is: * **Organic fees** from useful trading volume. * **Vault yield** from eligible idle assets. * **Targeted farms** for strategi
프로젝트로 돌아가기