Meteora 백서

Meteora

원문

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

mation has been initialized. If liquidity mining is not active, the pool supports limit-order behavior. ## Who DLMM Is For <AccordionGroup> <Accordion title="Liquidity providers"> DLMM is for LPs who want more control over capital placement, fee capture, and strategy design. You can concentrate liquidity, provide single-sided liquidity, rebalance as the market moves, and claim fees from the bins where your liquidity is active. </Accordion> <Accordion title="Token teams"> DLMM is for teams launching or growing token markets. It gives you a flexible liquidity layer for bootstrapping depth, supporting aggregator routing, and capturing fees during high-volume market periods. </Accordion> <Accordion title="Traders and aggregators"> DLMM is for traders who need deep liquidity and efficient routing. Bins can deliver zero-slippage execution at a fixed price until the active bin is consumed, while the full market is composed from many bins. </Accordion> </AccordionGroup> ## What To Read Next <CardGroup> <Card title="DLMM Dynamic Positions" href="/core-products/dlmm/dynamic-positions" icon="arrows-left-right-to-line"> Learn how position accounts track ownership, bin ranges, liquidity shares, fees, rewards, and resizable ranges. </Card> <Card title="DLMM Limit Order" href="/core-products/dlmm/limit-order" icon="list-check"> Learn how limit-order mode lets selected bins behave like on-chain buy or sell orders. </Card> <Card title="DLMM Collect Fee Mode" href="/core-products/dlmm/collect-fee-mode" icon="coins"> See how pools choose whether fees are collected from the input token or in token Y. </Card> <Card title="DLMM Liquidity Mining" href="/core-products/dlmm/liquidity-mining" icon="seedling"> Learn how reward-enabled pools distribute incentives to active liquidity. </Card> <Card title="DLMM Token 2022 Support" href="/core-products/dlmm/token-2022-support" icon="certificate"> Review which Token 2022 extensions work permissionlessly and which require a token badge. </Card> <Card title="Strategies and Use Cases" href="/core-products/dlmm/strategies-and-use-cases" icon="chess"> Explore common LP strategies such as Curve, Bid-Ask, Spot-Concentrated, and Spot-Wide. </Card> </CardGroup> <CardGroup> <Card title="DLMM Formulas" href="/core-products/dlmm/formulas" icon="calculator"> Understand the product math behind bin prices, liquidity, and dynamic fees without going deep into code. </Card> </CardGroup> <Warning>DLMM can be more capital-efficient than traditional AMMs, but it also requires more active position management. If the active price moves outside your selected range, that position stops earning trading fees until the price returns or you rebalance.</Warning> # Alpha Vault Changelog Source: https://docs.meteora.ag/developer-guides/alpha-vault/changelog Track Alpha Vault program and TypeScript SDK versions, source-backed integration notes, and known documentation gaps. <Tip> Track Alpha Vault releases here. </Tip> <Update label="alpha-vault 0.4.1" description="Merkle Proof Metadata"> ## Release summary | Component | Version | PR | | - | - | - | | Program | `0.4.1` | [alpha-vault #76](https://github.com/MeteoraAg/alpha-vault/pull/76) | | TypeScript SDK | `1.1.14` | [alpha-vault-sdk #16](https://github.com/MeteoraAg/alpha-vault-sdk/pull/16) | ## What We Shipped * Merkle Proof Metadata * User able to withdraw extra quote token in prorata vault ## What To Do <div> <table> <thead> <tr> <th>Integrators</th> <th>What Changed</th> <th>What To Do</th> </tr> </thead> <tbody> <tr> <td><strong>Partners</strong></td> <td> <ul> <li>Merkle Proof Metadata</li> </ul> </td> <td> <ul> <li>Bump your SDK version to <code>@meteora-ag/alpha-vault-sdk\@1.1.14</code> to start testing.</li> </ul> </td> </tr> </tbody> </table> </div> ## Program: `alpha-vault` `0.4.1` Program ID (mainnet and devnet): `vaU6kP7iNEGkbmPkLmZfGwiGxd4Mob24QQCie5R9kd2` [Program PR #76](https://github.com/MeteoraAg/alpha-vault/pull/76) ### Changed * Allow user to withdraw overflowed deposit (extra token required to fill vault) using `withdraw` endpoint right after deposit close. ### Added * New endpoints `create_merkle_proof_metadata` and `close_merkle_proof_metadata`, that allows `vault_authority (creator)` to add an url to proof, easier to integrations to get proof ## TypeScript SDK: `@meteora-ag/alpha-vault-sdk` `1.1.14` [SDK PR #16](https://github.com/MeteoraAg/alpha-vault-sdk/pull/16) ### Added * `createMerkleProofMetadata` function. Allow vault creator to submit merkle proof API endpoint. * `closeMerkleProofMetadata` function. Allow vault creator to close merkle proof metadata account. * `getMerkleProofUrl` function. Get merkle proof API endpoint from merkle proof metadata account. If not available, it default back to meteora API endpoint * `deriveMerkleProofMetadata` function. Derive merkle proof metadata account PDA. * `getMerkleProofForDeposit` function. Get merkle proof required for deposit based on merkle proof API stored in `MerkleProofMetadata`. ### Changed * `withdrawRemainingQuote` can only be invoked after vault fill stage, which the condition is `current_point > last_buying_point`. * `withdraw` have 2 stages now. The first stage is to withdraw from escrow and the second stage is to withdraw excessive quote token from the vault. The second stage (new stage) is only applicable when the vault is in prorata mode. The second stage is triggered when the `current_point >= last_join_point && current_point <= last_buying_point`. The second stage is being represented as `canWithdrawDepositOverflow` in `InteractionState` object, and the amount can be withdrawn in that stage is `availableDepositOverflow` in `InteractionState` object. </Update> # Alpha Vault Developer Guide Source: https://docs.meteora.ag/developer-guides/alpha-vault/index Learn how to build Alpha Vault integrations with the Anchor program, TypeScript SDK, Rust CPI notes, account reference, events, errors, and release notes. Alpha Vault is Meteora's pre-launch allocation program for DLMM, DAMM v1, and DAMM v2 Launch Pools. Users deposit the pool quote token into a vault before public trading starts; the vault buys the launch token from the connected pool during the protected pre-activation window, then users claim bought tokens and withdraw unused quote according to the vault configuration. For product and economic concepts, you can read the following documentations. <CardGroup> <Card title="Learn more about Alpha Vault" icon="book-open" href="/helper-products/alpha-vault/what-is-alpha-vault"> Overview of the Alpha Vault lifecycle, pool linkage, deposit window, purchase window, and claim flow. </Card> <Card title="Alpha Vault Formulas" icon="calculator" href="/helper-products/alpha-vault/formulas"> Formulas and definitions for allocation, refund, vesting, and rounding. </Card> </CardGroup> ## Integration <CardGroup> <Card title="Program Accounts" icon="table-cells" href="/developer-guides/alpha-vault/program/accounts"> Account model for vaults, escrows, configs, Merkle roots, Merkle proof metadata, crank fee whitelists, PDAs, enums, and constants. </Card> <Card title="Program Instructions" icon="list" href="/developer-guides/alpha-vault/program/instructions"> Instruction families for vault creation, escrow creation, deposits, withdrawals, claims, fills, metadata, authority, and admin config. </Card> <Card title="Program Events" icon="list" href="/developer-guides/alpha-vault/program/events"> Event payloads emitted by vault creation, escrow actions, fills, claims, refunds, Merkle metadata, and crank fee whitelist changes. </Card> <Card title="Program Errors" icon="triangle-exclamation" href="/developer-guides/alpha-vault/program/errors"> Anchor custom error codes, enum names, messages, and common integration causes. </Card> <Card title="TypeScript SDK" icon="code" href="/developer-guides/alpha-vault/typescript-sdk/getting-started"> TypeScript SDK for reading vault state, creating vaults and escrows, deposits, withdrawals, claims, fills, and Merkle helpers. </Card> <Card title="Rust Integration" icon="terminal" href="/developer-guides/alpha-vault/rust-integration/cpi"> Rust integration notes for the Anchor crate, `cpi` feature, account types, and CPI call patterns. </Card> </CardGroup> ## Program IDs The public Alpha Vault program ID is the same on mainnet and devnet: | Network | Program ID | | - | - | | Mainnet Beta | `vaU6kP7iNEGkbmPkLmZfGwiGxd4Mob24QQCie5R9kd2` | | Devnet | `vaU6kP7iNEGkbmPkLmZfGwiGxd4Mob24QQCie5R9kd2` | | Localnet feature | `SNPmGgnywBvvrAKMLundzG6StojyHTHDLu7T4sdhP4k` | The program treasury used for escrow fees and crank fees is: | Account | Address | | - | - | | Alpha Vault treasury | `BJQbRiRWhJCyTYZcAuAL3ngDCx3AyFQGKDq8zhiZAKUw` | <CardGroup> <Card title="Alpha Vault IDL" icon="file-code" href="https://github.com/MeteoraAg/alpha-vault-sdk/blob/main/ts-client/src/alpha-vault/alpha_vault.json"> Anchor IDL used by the TypeScript SDK. </Card> <Card title="TypeScript SDK" icon="node-js" href="https://github.com/MeteoraAg/alpha-vault-sdk"> Public SDK for transactions, PDA derivation, account wrappers, Merkle helpers, and examples in tests. </Card> </CardGroup> <Note> Alpha Vault must be connected to a launch pool whose state points back to the vault address. The vault does not price swaps itself; fills call into the connected DLMM, DAMM v1, or DAMM v2 pool. </Note> ## Commands | Task | Command | | - | - | | Install TypeScript SDK dependencies | `cd alpha-vault-sdk/ts-client && npm install` | | Build TypeScript SDK | `cd alpha-vault-sdk/ts-client && npm run build` | | Run TypeScript SDK tests | `cd alpha-vault-sdk/ts-client && npm test` | | Build `alpha_vault` program | `cd alpha-vault && anchor build` | | Run Anchor program tests | `cd alpha-vault && anchor test` | ## Stay Updated <CardGroup> <Card title="Alpha Vault Changelog" icon="newspaper" href="/developer-guides/alpha-vault/changelog"> Program, SDK, event, and integration notes for release planning. </Card> </CardGroup> # Alpha Vault Program Accounts Source: https://docs.meteora.ag/developer-guides/alpha-vault/program/accounts Understand Alpha Vault accounts, PDA seeds, enums, constants, vaults, escrows, configs, Merkle roots, and crank fee whitelists. <Note> This page summarizes the `alpha_vault` account model from the local Anchor source and SDK IDL. For exact generated TypeScript layouts, use the account types exported by `@meteora-ag/alpha-vault`. </Note> ## Address Map | Address | How it is chosen | Use | | - | - | - | | `Vault` | PDA from `vault`, `base`, and pool | Main state for one Alpha Vault. The `base` seed is either a direct base signer or a reusable config account. | | Quote token vault | Associated token account for the `Vault` PDA and quote mint | Holds user quote deposits until fills, withdrawals, or remaining-quote refunds. | | Base token vault | Associated token account for the `Vault` PDA and base mint | Holds tokens bought from the connected launch pool for vesting claims. | | `Escrow` | PDA from `escrow`, `Vault`, and owner | User state for deposits, claims, refunds, caps, and close eligibility. | | `ProrataVaultConfig` | PDA from `prorata_config` and config index | Admin-created reusable Pro Rata timing and cap template. | | `FcfsVaultConfig` | PDA from `fcfs_config` and config index | Admin-created reusable FCFS timing and cap template. | | `MerkleRootConfig` | PDA from `merkle_root`, `Vault`, and version | Merkle root for permissioned Merkle-proof escrow creation. | | `MerkleProofMetadata` | PDA from `merkle_proof_metadata` and `Vault` | Optional proof URL used by clients to fetch wallet cap proofs. | | `CrankFeeWhitelist` | PDA from `crank_fee_whitelist` and cranker | Lets a cranker fill a vault without paying the crank fee. | | Event authority | Anchor event-CPI PDA | Required by event-emitting instructions as generated by Anchor clients. | ## PDA Seeds | SDK helper | Seeds | Use | | - | - | - | | `deriveAlphaVault(base, pool, programId)` | `["vault", base, pool]` | Main vault account. | | `deriveEscrow(alphaVault, owner, programId)` | `["escrow", alphaVault, owner]` | User escrow account. | | `deriveMerkleRootConfig(alphaVault, version, programId)` | `["merkle_root", alphaVault, version]` | Merkle root account for one version. | | `deriveMerkleProofMetadata(alphaVault, programId)` | `["merkle_proof_metadata", alphaVault]` | Optional proof URL metadata account. | | `deriveCrankFeeWhitelist(cranker, programId)` | `["crank_fee_whitelist", cranker]` | Crank fee whitelist account. | | Direct Pro Rata or FCFS vault | `["vault", base signer, pool]` | Used by direct customizable vault initialization. | | Config-based vault | `["vault", config, pool]` | Used by `initialize_vault_with_prorata_config` and `initialize_vault_with_fcfs_config`. | ## Constants | Constant | Value | Meaning | | - | - | - | | `PROGRAM_ID.mainnet-beta` | `vaU6kP7iNEGkbmPkLmZfGwiGxd4Mob24QQCie5R9kd2` | Public Alpha Vault program ID. | | `PROGRAM_ID.devnet` | `vaU6kP7iNEGkbmPkLmZfGwiGxd4Mob24QQCie5R9kd2` | Devnet Alpha Vault program ID. | | `PROGRAM_ID.localhost` | `SNPmGgnywBvvrAKMLundzG6StojyHTHDLu7T4sdhP4k` | Localnet program ID with the `localnet` feature. | | `ALPHA_VAULT_TREASURY_ID` | `BJQbRiRWhJCyTYZcAuAL3ngDCx3AyFQGKDq8zhiZAKUw` | Treasury for escrow fees and crank fees. | | `SLOT_BUFFER` | `3000` slots | Minimum slot-based deposit duration on non-localnet builds. | | `TIME_BUFFER` | `1200` seconds | Minimum timestamp-based deposit duration on non-localnet builds. | | `MAX_ESCROW_FEE_IN_LAMPORT` | `10_000_000` lamports | Maximum permissionless escrow creation fee. | | `CRANK_FEE` | `100_000` lamports | Fee paid by non-whitelisted crankers during fill instructions. | | Max lock duration | One year | Enforced separately for slot and timestamp activation on non-localnet builds. | | Max vesting duration | One year | Enforced separately for slot and timestamp activation on non-localnet builds. | ## Enums | Enum | Values | | - | - | | `PoolType` | `0` DLMM, `1` Dynamic AMM / DAMM v1, `2` DAMM v2. The SDK names these `DLMM`, `DAMM`, and `DAMMV2`. | | `VaultMode` | `0` Pro Rata, `1` FCFS. | | `WhitelistMode` | `0` permissionless, `1` permission with Merkle proof, `2` permission with authority. | | `ActivationType` | `0` slot, `1` timestamp. The vault inherits the activation type from the connected pool. | | `VaultState` | `PREPARING`, `DEPOSITING`, `PURCHASING`, `LOCKING`, `VESTING`, `ENDED` in the TypeScript SDK. | | `AccountsType` | DLMM remaining-account slices for transfer-hook X, transfer-hook Y, and transfer-hook reward accounts. | ## Vault `Vault` is the primary zero-copy state account. Padding and deprecated fields are omitted from this table. | Field | Type | Use | | - | - | - | | `pool` | `Pubkey` | Connected DLMM, Dynamic AMM, or DAMM v2 launch pool. | | `token_vault` | `Pubkey` | Quote token vault controlled by the `Vault` PDA. | | `token_out_vault` | `Pubkey` | Base token vault controlled by the `Vault` PDA. | | `quote_mint` | `Pubkey` | Pool quote token accepted for deposits. Must match the pool token Y or token B mint. | | `base_mint` | `Pubkey` | Pool launch token bought by the vault. Must match the pool token X or token A mint. | | `base` | `Pubkey` | Direct base signer or reusable config account used in the vault PDA. | | `max_buying_cap` | `u64` | Maximum quote amount a Pro Rata vault can swap. | | `max_depositing_cap` | `u64` | Maximum total quote amount an FCFS vault can accept. | | `individual_depositing_cap` | `u64` | Per-user cap for FCFS permissionless deposits. Permissioned escrows use their own `max_cap`. | | `depositing_point` | `u64` | First slot or timestamp when escrow creation and deposits are allowed. | | `start_vesting_point` | `u64` | First slot or timestamp when bought tokens become claimable. | | `end_vesting_point` | `u64` | Slot or timestamp when linear vesting ends. | | `total_deposit` | `u64` | Total quote deposited across escrows, excluding quote transfer fees. | | `total_escrow` | `u64` | Number of open escrow accounts. | | `swapped_amount` | `u64` | Quote amount already used by fill instructions. | | `bought_token` | `u64` | Base token amount received from fills. | | `total_refund` | `u64` | Quote refunded through overflow or remaining-quote withdrawals. | | `total_claimed_token` | `u64` | Base token claimed across all escrows. | | `escrow_fee` | `u64` | Flat lamport fee charged when a permissionless escrow is opened. Must be zero for permissioned vaults. | | `total_escrow_fee` | `u64` | Aggregate escrow fees collected. | | `pool_type` | `u8` | `PoolType` enum value. | | `vault_mode` | `u8` | `VaultMode` enum value. | | `whitelist_mode` | `u8` | `WhitelistMode` enum value. | | `activation_type` | `u8` | `ActivationType` enum value inherited from the pool. | | `vault_authority` | `Pubkey` | Creator authority that can transfer authority and manage Merkle proof metadata/root configs. | | `bump` | `u8` | Vault PDA bump. | ## Escrow An `Escrow` belongs to one owner and one vault. | Field | Type | Use | | - | - | - | | `vault` | `Pubkey` | Parent `Vault`. | | `owner` | `Pubkey` | User that owns the escrow and signs user actions. | | `total_deposit` | `u64` | User quote amount currently attributed to this escrow. | | `claimed_token` | `u64` | Base token already claimed. | | `last_claimed_point` | `u64` | Last slot or timestamp used by claim accounting. | | `refunded` | `u8` | Boolean-like flag set after `withdraw_remaining_quote`. | | `max_cap` | `u64` | Permissioned wallet cap. Permissionless escrows store `0`. | | `withdrawn_deposit_overflow` | `u64` | Pro Rata overflow quote already withdrawn before the buy window ends. | ## Config Accounts Reusable config accounts are admin-created templates. Config-based vault initialization multiplies quote-denominated caps by the quote mint decimals and derives absolute vesting points from the connected pool activation point. | Account | Fields | Use | | - | - | - | | `ProrataVaultConfig` | `max_buying_cap`, `start_vesting_duration`, `end_vesting_duration`, `escrow_fee`, `activation_type` | Reusable Pro Rata config. | | `FcfsVaultConfig` | `max_depositing_cap`, `start_vesting_duration`, `end_vesting_duration`, `depositing_duration_until_last_join_point`, `individual_depositing_cap`, `escrow_fee`, `activation_type` | Reusable FCFS config. | ## Permission Accounts | Account | Fields | Use | | - | - | - | | `MerkleRootConfig` | `root`, `vault`, `version` | Stores one Merkle root for wallet caps. The Merkle leaf is derived from wallet address and `max_cap`. | | `MerkleProofMetadata` | `vault`, `proof_url` | Optional URL used by the SDK to fetch Merkle proof data for deposits. | | `CrankFeeWhitelist` | `owner` | Stores the cranker public key that can skip the crank fee. | ## Timing Windows | Window | Source | Program behavior | | - | - | - | | Deposit window | `depositing_point` through pool `last_join_point` | Escrow creation and deposits are allowed. Pro Rata withdrawals are allowed. | | Buy window | Pool `pre_activation_start_point` through `last_buying_point` | Fill instructions can swap quote into base through the connected pool. | | Lock window | After buy window and before `start_vesting_point` | Users cannot claim yet, but can withdraw remaining quote after the buying window. | | Vesting window | `start_vesting_point` through `end_vesting_point` | Bought base tokens vest linearly and can be claimed. | ## Token 2022 Support Alpha Vault uses checked transfers through the token program associated with the connected pool and mint. | Extension or behavior | Support | | - | - | | Transfer Fee | Supported. Deposits calculate transfer-fee excluded amounts; withdrawals and claims emit excluded output amounts. | | Transfer Memo | Supported for outgoing vault-to-use
프로젝트로 돌아가기