Meteora 백서

Meteora

원문

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

s all pools (balances, unclaimed fees, PnL) in USD and SOL - SOL price used for conversion (omitted if unavailable) Results can be sorted by various metrics and support pagination. # Arguments * `user` - The wallet address of the user * `page` - Page number for pagination (default: 1, minimum: 1) * `page_size` - Number of pools per page (default: 20, maximum: 50) * `sort_by` - Field to sort by: `current_balances`, `unclaimed_fee`, `pool_tvl`, `pool_volume_24h`, or `fee_per_tvl_24h` (default: `current_balances`) * `sort_direction` - Sort direction: `asc` or `desc` (default: `desc`) # Returns * `200` - The user's open portfolio with pool metadata, balances, and total metrics * `400` - Invalid user address or query parameters # Get position PnL data (open and closed positions with on-the-fly calculation) Source: https://docs.meteora.ag/api-reference/dlmm/positions/get-position-pnl-data-open-and-closed-positions-with-on-the-fly-calculation /developer-guides/dlmm/api-reference/openapi.json get /positions/{pool_address}/pnl Returns positions for a specific pool and user with calculated PnL values. Includes SOL-denominated amounts when SOL price is available (omitted otherwise). Results can be filtered by status (open/closed) and are paginated. # Arguments * `pool_address` - The address of the pool * `user` - The user address * `status` - Filter by status: "open", "closed", or omit for all (default: all) * `page` - Page number starting from 1 (default: 1) # Returns * `200` - Paginated list of positions with PnL data in USD and SOL # Get the historical events for a position Source: https://docs.meteora.ag/api-reference/dlmm/positions/get-the-historical-events-for-a-position /developer-guides/dlmm/api-reference/openapi.json get /positions/{address}/historical This endpoint returns the historical actions for a position. # Arguments * `address` - The address of the position # Returns * `200` - The historical actions for the position # Protocol Overview Source: https://docs.meteora.ag/api-reference/dlmm/stats/protocol-overview /developer-guides/dlmm/api-reference/openapi.json get /stats/protocol_metrics Returns aggregated protocol-level metrics across all pools # Get Wallet Pool Total Claims Source: https://docs.meteora.ag/api-reference/dlmm/wallets/get-wallet-pool-total-claims /developer-guides/dlmm/api-reference/openapi.json get /wallets/{wallet}/pools/{pool_address}/total_claims Returns combined total claimed fees and rewards for a wallet in a specific pool # get_apy_by_time_range Source: https://docs.meteora.ag/api-reference/dynamic-vault/apy/get_apy_by_time_range /developer-guides/dynamic-vault/api-reference/openapi.json get /apy_filter/{token_mint}/{start_timestamp}/{end_timestamp} Returns APY information for a specific token mint within a given time range # get_apy_state Source: https://docs.meteora.ag/api-reference/dynamic-vault/apy/get_apy_state /developer-guides/dynamic-vault/api-reference/openapi.json get /apy_state/{token_mint} Returns APY (Annual Percentage Yield) information for strategies associated with a specific token mint # get_vault_addresses Source: https://docs.meteora.ag/api-reference/dynamic-vault/vaults/get_vault_addresses /developer-guides/dynamic-vault/api-reference/openapi.json get /vault_addresses Returns a list of vault addresses with their associated information # get_vault_info Source: https://docs.meteora.ag/api-reference/dynamic-vault/vaults/get_vault_info /developer-guides/dynamic-vault/api-reference/openapi.json get /vault_info Returns detailed information about all monitored vaults including their states, strategies, and performance metrics # get_vault_state Source: https://docs.meteora.ag/api-reference/dynamic-vault/vaults/get_vault_state /developer-guides/dynamic-vault/api-reference/openapi.json get /vault_state/{token_mint} Returns the current state of a specific vault identified by its token mint address # get_virtual_price Source: https://docs.meteora.ag/api-reference/dynamic-vault/virtual-price/get_virtual_price /developer-guides/dynamic-vault/api-reference/openapi.json get /virtual_price/{token_mint}/{strategy} Returns virtual price information for a specific strategy within a vault # Get analyticsall Source: https://docs.meteora.ag/api-reference/stake2earn/analytics/get-analyticsall /developer-guides/stake2earn/api-reference/openapi.json get /analytics/all # Get vault Source: https://docs.meteora.ag/api-reference/stake2earn/vault/get-vault /developer-guides/stake2earn/api-reference/openapi.json get /vault/{vault_address} # Get vaultall Source: https://docs.meteora.ag/api-reference/stake2earn/vault/get-vaultall /developer-guides/stake2earn/api-reference/openapi.json get /vault/all # Get vaultfilter Source: https://docs.meteora.ag/api-reference/stake2earn/vault/get-vaultfilter /developer-guides/stake2earn/api-reference/openapi.json get /vault/filter # DAMM v2 Compounding Liquidity Source: https://docs.meteora.ag/core-products/damm-v2/compounding-liquidity Learn how DAMM v2 compounding liquidity reinvests a share of LP fees into full-range pool reserves. DAMM v2 compounding liquidity is a pool mode where a share of LP fees is automatically reinvested back into the pool. Instead of every LP fee waiting to be claimed and manually compounded back, the pool can use part of those fees to grow reserves and deepen liquidity over time. This is useful for long-term pools where LPs want liquidity growth, fewer manual fee actions, and a simpler full-range market design. ## How It Works Compounding liquidity uses `Compounding` collect fee mode. In this mode: * The pool behaves like a full-range constant-product AMM. * Fees are collected in token B. * A configurable share of the LP fee is added back into the pool's token B reserves. * The remaining LP fee stays claimable by position owners. ```math theme={"system"} \text{LP Fee} = \text{Compounding Fee} + \text{Claimable Fee} ``` The compounding share is controlled by `compounding_fee_bps`, in basis points. | `compounding_fee_bps` | Product Meaning | | - | - | | `2500` | 25% of LP fees compound, 75% remain claimable | | `5000` | 50% of LP fees compound, 50% remain claimable | | `10000` | 100% of LP fees compound, no LP fee remains claimable | <Note> `compounding_fee_bps` must be greater than `0` and at most `10000` for compounding pools. It must be `0` for `BothToken` and `OnlyB` pools. </Note> ## Full-Range by Design Compounding pools do not use custom concentrated price ranges. The program stores their range as `0` to `u128::MAX` and prices them from reserves: ```math theme={"system"} \text{token A reserves} \times \text{token B reserves} = k ``` This makes the pool easier to reason about: reserves grow as compounded fees are added back, and LPs benefit proportionally through their position liquidity. ## Initial Liquidity Compounding pools have one special initialization rule: the requested initial liquidity must be greater than `DEAD_LIQUIDITY`, which is `100 << 64`. DAMM v2 subtracts this dead liquidity from the first position's liquidity while keeping it in the pool's total liquidity. <Info> The dead-liquidity rule prevents the pool from starting at a fragile zero-liquidity edge. It also means the first position receives slightly less liquidity than the raw initialization liquidity. </Info> The initial token amounts are derived from the requested liquidity and initial square-root price: ```math theme={"system"} \text{token A} = \left\lceil \frac{L}{\sqrt{P}} \right\rceil ``` ```math theme={"system"} \text{token B} = \left\lceil \frac{L \times \sqrt{P}}{2^{128}} \right\rceil ``` The initial square-root price still must be inside DAMM v2's global price limits, even though the compounding pool itself has no custom range. ## What LPs Experience In a non-compounding pool, LP fees accumulate as claimable balances on the position. In a compounding pool, the LP fee is split after the protocol fee is removed: * **Compounded portion**: added to pool reserves, increasing pool depth. * **Claimable portion**: remains pending on the LP position and can be claimed later. This lets a pool balance two goals: grow liquidity over time and still provide claimable fee income. ## Why Token B Matters In compounding mode, fees are always handled in token B. For an A-to-B swap, the fee is taken from token B output. For a B-to-A swap, the fee is taken from token B input. Token B is commonly the quote token, such as SOL or USDC. ## Product Benefits <CardGroup> <Card title="Automatic Reserve Growth" icon="arrows-rotate"> A share of LP fees goes directly back into the pool, increasing liquidity without a separate reinvest action. </Card> <Card title="Simpler Full-Range Liquidity" icon="infinity"> The pool follows the familiar constant-product model instead of a custom price range. </Card> <Card title="Flexible Fee Split" icon="scissors"> Pool creators can choose how much LP fee compounds and how much remains claimable. </Card> <Card title="Long-Term LP Alignment" icon="handshake"> LPs benefit from deeper pool reserves while still owning their position through an NFT. </Card> </CardGroup> ## Best Use Cases <AccordionGroup> <Accordion title="Mature Trading Pairs"> Established markets can use compounding liquidity to grow depth as trading activity generates fees. </Accordion> <Accordion title="Passive LP Strategies"> LPs who prefer fewer manual actions can let part of their fee income automatically support the pool. </Accordion> <Accordion title="Treasury or Protocol-Owned Liquidity"> Projects can use compounding to reinforce long-term liquidity depth while keeping fee behavior transparent on-chain. </Accordion> </AccordionGroup> ## When Not to Use It Use concentrated liquidity instead if the pool needs a custom minimum and maximum price range. Compounding liquidity is intentionally full-range, so it is not the right fit for a tightly targeted launch range. # DAMM v2 Concentrated Liquidity Source: https://docs.meteora.ag/core-products/damm-v2/concentrated-liquidity Learn how DAMM v2 concentrated liquidity uses a fixed price range to focus pool liquidity. DAMM v2 concentrated liquidity lets a pool focus liquidity inside a chosen price range. Instead of using an unbounded constant-product curve, the pool creator sets lower and upper price bounds when the pool is initialized. This makes liquidity more efficient when a market has an expected trading area. More of the deposited capital can sit near the current price, giving traders better depth and giving LPs more fee exposure per dollar deployed. ## How It Works A concentrated DAMM v2 pool has three important square-root price values: * **Minimum price**: the lower bound of the pool's active range. * **Maximum price**: the upper bound of the pool's active range. * **Current price**: the live pool price between those bounds. When the current price is inside the range, swaps can use the pool's liquidity. If an exact-in or exact-out swap would move price beyond the lower or upper boundary, the instruction returns a price-range violation. The partial-fill swap path can consume only the amount that moves the pool to the boundary and return the unused input amount. <Info> Concentrated pools require `sqrt_min_price < sqrt_max_price`, both bounds inside DAMM v2's global price limits, and an initial square-root price inside the configured range. </Info> ## Why Concentrate Liquidity In a full-range pool, liquidity is available across the entire price curve. That is simple, but a large part of the capital may sit far away from where trading actually happens. Concentrated liquidity narrows the active range, so capital can work harder around the prices that matter. <CardGroup> <Card title="Better Depth Near Target Price" icon="water"> More liquidity can be placed around the expected trading range, improving execution for traders. </Card> <Card title="More Efficient LP Capital" icon="chart-line"> LPs can earn fees from a more focused liquidity range instead of spreading capital thinly. </Card> <Card title="Launch Price Control" icon="rocket"> Token teams can design pool ranges around expected launch, migration, or listing prices. </Card> <Card title="Integrator Flexibility" icon="puzzle-piece"> Launchpads and protocols can create pools with standardized or custom price-range behavior. </Card> </CardGroup> ## Deposit Ratios In a concentrated pool, the current price determines the token ratio needed to add liquidity. The program calculates token amounts from the current price and the fixed range: ```math theme={"system"} \Delta A = L \times \frac{\sqrt{P_{\max}} - \sqrt{P}}{\sqrt{P_{\max}} \times \sqrt{P}} ``` ```math theme={"system"} \Delta B = L \times (\sqrt{P} - \sqrt{P_{\min}}) ``` If the current price is closer to the lower side of the range, the pool needs more token A. If the current price is closer to the upper side of the range, the pool needs more token B. This is not a UI quirk. It is how concentrated liquidity represents exposure across the selected price range. <Note> When adding liquidity or making initial deposits, required token amounts are rounded up. Conversely, withdrawals and swap outputs are rounded down. This ensures the pool does not receive too little or pay out too much due to integer math. </Note> ## Range Selection Choosing a range is a product decision: | Range Choice | Product Effect | | - | - | | Narrower range | More capital efficiency near the target price, but less room for price movement | | Wider range | More room for trading across price movement, but less concentrated depth | | Full range | Broadest concentrated range, but not the same as compounding mode | <Warning> In concentrated liquidity mode, the price range is set when the pool is created. DAMM v2 positions do not choose independent per-position ranges. </Warning> ## Best Use Cases <AccordionGroup> <Accordion title="Launch Pools With Expected Price Bands"> A project can configure liquidity around a launch or migration price so early trading has stronger depth near the expected market. </Accordion> <Accordion title="Stable or Correlated Token Pairs"> Pairs that usually trade in a known band can use a tighter range to make liquidity more efficient. </Accordion> <Accordion title="Launchpad Pool Templates"> Launchpads can create repeatable configurations for markets that need the same range and fee behavior. </Accordion> </AccordionGroup> ## Concentrated vs Compounding Concentrated liquidity is best when the pool needs a specific price range. Compounding liquidity is best when the pool should behave as a full-range constant-product market where a share of LP fees can automatically grow reserves. If you need a custom minimum and maximum price, use concentrated liquidity. If you need auto-compounding full-range reserves, use [DAMM v2 Compounding Liquidity](/core-products/damm-v2/compounding-liquidity). # DAMM v2 Dynamic Fees Source: https://docs.meteora.ag/core-products/damm-v2/fees/dynamic-fees Learn how DAMM v2 dynamic fees add a volatility-responsive fee layer on top of the selected base fee mode. DAMM v2 dynamic fees are an optional fee layer that responds to market volatility. When price movement is higher, the dynamic fee can increase. When the market calms down, the dynamic fee decays. This gives pools a way to charge more during turbulent periods without permanently raising the base fee. ## How It Fits With Base Fees Every DAMM v2 pool has one 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 DAMM v2 tracks recent price movement through a volatility accumulator. The accumulator rises when price changes and can decay or reset over time. Key settings include: | Setting | Product Meaning | | - | - | | Bin step | Price sensitivity used by the volatility calculation; currently fixed to 1 bps | | Filter period | Very short-term window that helps smooth noisy updates | | Decay period | Time window after which volatility can decay or reset | | Reduction factor | How much of the previous accumulator becomes the next volatility reference | | Max volatility accumulator | Cap that prevents the volatility measure from growing without bound | | Variable fee control | How strongly volatility affects the final dynamic fee numerator | The dynamic fee numerator is: ```math theme={"system"} \left\lceil \frac{(\text{Volatility Accumulator} \times \text{Bin Step})^2 \times \text{Variable Fee Control}}{100{,}000{,}000{,}000} \right\rceil ``` ## Validation Limits The current implementation enforces: | Parameter | Constraint | | - | - | | `bin_step` | Must equal `1` | | `bin_step_u128` | Must equal the default fixed-point value for 1 bps | | `filter_period` and `decay_period` | `filter_period < decay_period` | | `reduction_factor` | At most `10000` | | `variable_fee_control` | At most `0xffffff` | | `max_volatility_accumulator` | At most `0xffffff` | Operators can enable or update dynamic fees with non-default dynamic fee parameters. Passing default dynamic fee parameters disables dynamic fees, but only if dynamic fees are already enabled. ## Why Use Dynamic Fees <CardGroup> <Card title="Volatility Response" icon="wave-pulse"> Fees can increase when market movement becomes more intense. </Card> <Card title="LP Compensation" icon="hand-holding-dollar"> LPs can earn higher fees during periods where price risk may be higher. </Card> <Card title="Temporary Protection" icon="shield"> The fee can decay as volatility settles instead of staying elevated forever. </Card> <Card title="Works With Base Modes" icon="layer-group"> Dynamic fees can be paired with DAMM v2 base fee modes for more adaptive fee design. </Card> </CardGroup> ## Product Examples <AccordionGroup> <Accordion title="Launch With Extra Volatility Protection"> A launch pool can use a time scheduler or market cap scheduler as the base fee, then add dynamic fees to react to sudden price movement. </Accordion> <Accordion title="Mature Pool With Adaptive LP Fees"> A long-term pool can keep a moderate base fee and let dynamic fees increase only when trading becomes volatile. </Accordion> <Accordion title="Integrator-Controlled Risk Settings"> Launchpads can create fee presets with different dynamic fee sensitivity for different token categories. </Accordion> </AccordionGroup> ## Important Takeaway Dynamic fees are not a replacement for the base fee. They are an adaptive layer. The base fee defines the pool's default fee behavior, while the dynamic fee responds to recent market movement. # DAMM v2 Market Cap Scheduler Source: https://docs.meteora.ag/core-products/damm-v2/fees/market-cap-scheduler Learn how DAMM v2 market-cap scheduler fees decrease as pool price grows, using linear or exponential curves. DAMM v2 market-cap scheduler fees reduce trading fees as the pool price grows. Unlike time scheduler fees, the fee does not drop just because time passes. It drops when the current square-root price moves through configured steps above the initial square-root price. This is useful for launches where fee reductions should follow market growth instead of a countdown. ## How It Works DAMM v2 compares the current pool square-root price against the initial square-root price. Each time the current square-root price increases by a configured `sqrt_price_step_bps`, the scheduler advances and lowers the fee. Key settings include: | Setting | Product Meaning | | - | - | | Cliff fee numerator | Starting fee when the pool opens | | Number of periods | Maximum number of fee reductions | | Sqrt price step bps | Square-root price movement needed to trigger each reduction | | Scheduler expiration duration | Time after which the scheduler settles at its
프로젝트로 돌아가기