bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 75쪽 중 18쪽
uthority: "FhVo3mqL8PW5pH5U2CN4XE33DokiyZnUwuGpH2hmHLuM",
activation_type: 0,
},
{
config_address: "9EZYAJrcqNWNQzP2trzZesP7XKMHA1jEomHzbRsdX8R2",
trade_fee_bps: 400,
protocol_fee_bps: 2000,
activation_duration: 0,
vault_config_key: "11111111111111111111111111111111",
pool_creator_authority: "FhVo3mqL8PW5pH5U2CN4XE33DokiyZnUwuGpH2hmHLuM",
activation_type: 0,
},
{
config_address: "8cdKo87jZU2R12KY1BUjjRPwyjgdNjLGqSGQyrDshhud",
trade_fee_bps: 600,
protocol_fee_bps: 2000,
activation_duration: 0,
vault_config_key: "11111111111111111111111111111111",
pool_creator_authority: "FhVo3mqL8PW5pH5U2CN4XE33DokiyZnUwuGpH2hmHLuM",
activation_type: 0,
},
{
config_address: "DHLo9myvBGbdAL4wn2hkVwphUvFndtzU6zxDqA11m8x6",
trade_fee_bps: 9900,
protocol_fee_bps: 2000,
activation_duration: 0,
vault_config_key: "11111111111111111111111111111111",
pool_creator_authority: "GL6VhXKBV9Had23RqU4zm3XDoguuiixN8foqaXSLskDt",
activation_type: 1,
},
{
config_address: "4ZJdHvduu88ZUiJ5ryqUbTDP3dLZjYT5Cfeb8MPqJh9G",
trade_fee_bps: 1500,
protocol_fee_bps: 2000,
activation_duration: 0,
vault_config_key: "11111111111111111111111111111111",
pool_creator_authority: "HeXJcGfU4qrqGpKAf8bxdYynBgFgTeCphV7YPx9rTMig",
activation_type: 1,
},
{
config_address: "9hPtZgNhanLvReByrwyqr9uxhW8TMUg9S4My32nZLGDo",
trade_fee_bps: 25,
protocol_fee_bps: 2000,
activation_duration: 0,
vault_config_key: "11111111111111111111111111111111",
pool_creator_authority: "HeXJcGfU4qrqGpKAf8bxdYynBgFgTeCphV7YPx9rTMig",
activation_type: 1,
},
{
config_address: "7WrjmZfwqLLfPxBXKM6EJ3fQcYe6x5rwQuPe1BuupBYF",
trade_fee_bps: 100,
protocol_fee_bps: 2000,
activation_duration: 0,
vault_config_key: "11111111111111111111111111111111",
pool_creator_authority: "DzG1zpeUVFoEXSq2WHtvx6pAX4DjqnXnUi8AYK6TRLXr",
activation_type: 1,
},
{
config_address: "HFXUgLuJ9hY6tSeqvGUT9J4dJHyZkuP3rogiZR2NgXaT",
trade_fee_bps: 30,
protocol_fee_bps: 2000,
activation_duration: 0,
vault_config_key: "11111111111111111111111111111111",
pool_creator_authority: "DzG1zpeUVFoEXSq2WHtvx6pAX4DjqnXnUi8AYK6TRLXr",
activation_type: 1,
},
{
config_address: "2puU1kzQVM5ATDsxCRGixQM9dadmVGd7sTqNJQFBvnKg",
trade_fee_bps: 500,
protocol_fee_bps: 2000,
activation_duration: 0,
vault_config_key: "11111111111111111111111111111111",
pool_creator_authority: "H4tyRJRzBeppnYCXKpPWsanqf2147QhriJdG4yaBmigr",
activation_type: 1,
},
{
config_address: "Cau4rq22bZEEscAe9TL7CEKnAJjss8csRtKXqjQHmfuj",
trade_fee_bps: 25,
protocol_fee_bps: 2000,
activation_duration: 0,
vault_config_key: "11111111111111111111111111111111",
pool_creator_authority: "H4tyRJRzBeppnYCXKpPWsanqf2147QhriJdG4yaBmigr",
activation_type: 1,
},
{
config_address: "5vd4r737pWhmuvrq6E5vea66PYD2WfqGTwsyrV2YEodG",
trade_fee_bps: 1500,
protocol_fee_bps: 2000,
activation_duration: 0,
vault_config_key: "11111111111111111111111111111111",
pool_creator_authority: "H4tyRJRzBeppnYCXKpPWsanqf2147QhriJdG4yaBmigr",
activation_type: 1,
},
{
config_address: "21PjsfQVgrn56jSypUT5qXwwSjwKWvuoBCKbVZrgTLz4",
trade_fee_bps: 1500,
protocol_fee_bps: 2000,
activation_duration: 0,
vault_config_key: "11111111111111111111111111111111",
pool_creator_authority: "CGsqR7CTqTwbmAUTPnfg9Bj9GLJgkrUD9rhjh3vHEYvh",
activation_type: 0,
},
]
```
</Accordion>
</AccordionGroup>
<Note>The list of config key addresses on devnet can be found [here](/api-reference/damm-v1/pools/pool-configs).</Note>
If you want to create an Alpha Vault along with your DAMM v1 pool, you will need to find a `pool_config_key` that is mapped to a `vault_config_key` that meets your requirements.
<AccordionGroup>
<Accordion title="List of vault config keys (Mainnet)">
```json theme={"system"}
{
"prorata_configs": [
{
"address": "5R3JS7mfW8BCRiQvv4532qaicSc92Hk8JrfBArF4t6Ax",
"max_buying_cap": 1000,
"start_vesting_duration": 3600,
"end_vesting_duration": 7200,
"escrow_fee": 0,
"activation_type": 1
},
{
"address": "DxFmi5KH9eqykWAeQ4E7Xughf2TT3nuSpS3zbFYZGGbW",
"max_buying_cap": 10,
"start_vesting_duration": 1,
"end_vesting_duration": 36000,
"escrow_fee": 0,
"activation_type": 0
},
{
"address": "DtMkmYxhLCe2mUtkAJjhmBBwGgkdr3e8DuPfWzs5WDf",
"max_buying_cap": 10000,
"start_vesting_duration": 1,
"end_vesting_duration": 18000,
"escrow_fee": 0,
"activation_type": 0
},
{
"address": "6ocT1Ar8rrsR5MDov9wkmRnv57MYQz4QXnGu1Tn49Pbi",
"max_buying_cap": 10000,
"start_vesting_duration": 1,
"end_vesting_duration": 192857,
"escrow_fee": 0,
"activation_type": 0
},
{
"address": "83ado8rmkVtEvPuwkchDGS3JzhQqRbKqc6bKY2k8ZC7r",
"max_buying_cap": 1000000,
"start_vesting_duration": 1,
"end_vesting_duration": 32653,
"escrow_fee": 0,
"activation_type": 0
},
{
"address": "6Awx9h9cvvPQyu6Eiov6F3Z4j3q9M3Gr2Fz1CaLsgdiv",
"max_buying_cap": 18446744073,
"start_vesting_duration": 1,
"end_vesting_duration": 1,
"escrow_fee": 0,
"activation_type": 1
},
{
"address": "G9xwsDRa3KUW3JJr9Z38szTVschFCbrCq8NySVXxRGL1",
"max_buying_cap": 350,
"start_vesting_duration": 1,
"end_vesting_duration": 1365237,
"escrow_fee": 0,
"activation_type": 0
},
{
"address": "GKuKzmj3bHqd3MVag37rrtVGxP37PzM7pJYF6AYk7Vwq",
"max_buying_cap": 200,
"start_vesting_duration": 86400,
"end_vesting_duration": 259200,
"escrow_fee": 0,
"activation_type": 1
},
{
"address": "36oTYeP9K1qEpF3UVRokvjJYrcbA5PZeinYMnd1TgRz1",
"max_buying_cap": 200,
"start_vesting_duration": 86400,
"end_vesting_duration": 259200,
"escrow_fee": 0,
"activation_type": 1
}
],
"fcfs_configs": [
{
"address": "HHVfAboWxsCsWtdHbyL3BNCvxfAdAcV3QPe8s8NtZxRX",
"max_depositing_cap": 1177,
"start_vesting_duration": 1,
"end_vesting_duration": 36853081,
"depositing_duration_until_last_join_point": 9000,
"individual_depositing_cap": 1000000,
"escrow_fee": 0,
"activation_type": 0
},
{
"address": "DEpRg7voUQcKZapijVKiGPJN2iTGxjQswDoooanrmSHT",
"max_depositing_cap": 1177,
"start_vesting_duration": 1,
"end_vesting_duration": 36940618,
"depositing_duration_until_last_join_point": 8551,
"individual_depositing_cap": 1,
"escrow_fee": 0,
"activation_type": 0
},
{
"address": "FgWCWqAwUpYpwLa22F6emXN5c9gQMvDkyfYfKzffzuoX",
"max_depositing_cap": 1,
"start_vesting_duration": 4500,
"end_vesting_duration": 31500,
"depositing_duration_until_last_join_point": 36000,
"individual_depositing_cap": 1,
"escrow_fee": 0,
"activation_type": 0
},
{
"address": "2sxe5NvHunqQo485dC7akSKfs2cgq7vaeBe1mRehewP3",
"max_depositing_cap": 125,
"start_vesting_duration": 1,
"end_vesting_duration": 1,
"depositing_duration_until_last_join_point": 41959,
"individual_depositing_cap": 1,
"escrow_fee": 0,
"activation_type": 0
},
{
"address": "7ixojP8Zuu4csfTycHi8ywQymHm9zxAhu1TjnFuJaq2R",
"max_depositing_cap": 10,
"start_vesting_duration": 1,
"end_vesting_duration": 24107,
"depositing_duration_until_last_join_point": 24107,
"individual_depositing_cap": 1,
"escrow_fee": 0,
"activation_type": 0
},
{
"address": "Hhf8R5ebqy4iGPutXmgkJEoioYRy4HJ2mWBhj8tR9KV5",
"max_depositing_cap": 125,
"start_vesting_duration": 1,
"end_vesting_duration": 1,
"depositing_duration_until_last_join_point": 33098,
"individual_depositing_cap": 1,
"escrow_fee": 0,
"activation_type": 0
},
{
"address": "9hi8rMnE5QA2KsQSvUNgsc5kqznPRL43JsNHhFgZvRDA",
"max_depositing_cap": 10,
"start_vesting_duration": 1,
"end_vesting_duration": 24713,
"depositing_duration_until_last_join_point": 33103,
"individual_depositing_cap": 1,
"escrow_fee": 0,
"activation_type": 0
},
{
"address": "3QmGDNGSnwwBYNAgokmVkcT6dM7PZGJLziV7VfC4f5er",
"max_depositing_cap": 1,
"start_vesting_duration": 57142,
"end_vesting_duration": 73469,
"depositing_duration_until_last_join_point": 57142,
"individual_depositing_cap": 1,
"escrow_fee": 0,
"activation_type": 0
},
{
"address": "E8WUpiScTWhsdgMaBBGJ8rdUoQuq9P6c7PBcWtrzm6U6",
"max_depositing_cap": 1000,
"start_vesting_duration": 9000,
"end_vesting_duration": 18000,
"depositing_duration_until_last_join_point": 9000,
"individual_depositing_cap": 100,
"escrow_fee": 0,
"activation_type": 1
},
{
"address": "EGY9HAUcYvbkQcKUARyKXt8qSRayG8Y8694kcUcyKQo4",
"max_depositing_cap": 50,
"start_vesting_duration": 1,
"end_vesting_duration": 1,
"depositing_duration_until_last_join_point": 7200,
"individual_depositing_cap": 50,
"escrow_fee": 0,
"activation_type": 1
},
{
"address": "48ZoRd8WFe3bKJeYHnamkkCEXY6kUSqydNg4vYa9Vjmh",
"max_depositing_cap": 50,
"start_vesting_duration": 1,
"end_vesting_duration": 1,
"depositing_duration_until_last_join_point": 14100,
"individual_depositing_cap": 50,
"escrow_fee": 0,
"activation_type": 1
},
{
"address": "34vg8kLiGUQrhUckmKdrirYRmsurcs9m9dtM63JvwSEe",
"max_depositing_cap": 143,
"start_vesting_duration": 86400,
"end_vesting_duration": 86400,
"depositing_duration_until_last_join_point": 7200,
"individual_depositing_cap": 143,
"escrow_fee": 0,
"activation_type": 1
},
{
"address": "5833XAhnaeQ8pStDVA31m8ZgkzxY7RvgnAPRWwtn68b3",
"max_depositing_cap": 135,
"start_vesting_duration": 1,
"end_vesting_duration": 1,
"depositing_duration_until_last_join_point": 10500,
"individual_depositing_cap": 135,
"escrow_fee": 0,
"activation_type": 1
}
]
}
```
</Accordion>
</AccordionGroup>
<Note>The list of vault config keys on devnet can be found [here](/api-reference/damm-v1/alpha-vault/alpha-vault-configs).</Note>
<Note>If there is no existing config in the list that fits your project's requirement, you can reach out to the team on [discord](https://discord.gg/meteora) to create a new config.</Note>
# Adding a Fee Scheduler to a Config
For DAMM v1, the anti-snipe Fee Scheduler is applied offchain. Our team at Meteora can assist in applying a custom fee scheduler for your pools where we will create a dedicated config key for your team with `pool_creator_authority` linked to your signer wallet for pool creation.
<Warning>Because the fee scheduler is applied offchain, Meteora would need to customize the fee curve/schedule for you. You can't do it on your own.</Warning>
You can use the following API endpoint to check the associated fee scheduler configuration of a config key.
<CardGroup>
<Card title="Fee Scheduler Configuration API" href="/api-reference/damm-v1/fee-configs/fee-configs" icon="link">
Get the associated fee scheduler configurations for each existing pool config.
</Card>
</CardGroup>
# Understanding Pool Config Fields
| Field | Description |
| - | - |
| `config_address` | Config key address |
| `trade_fee_bps` | Pool trading fee |
| `protocol_fee_bps` | Protocol fee charged from the total trading fee (fixed at 2000 = 20% for constant product pools; 0 for stable swap pools) |
| `activation_duration` | Used to determine when exactly the pool will start trading |
| `vault_config_key` | Alpha vault config key. Address of the vault config key. If it is `11111111111111111111111111111111`, means no alpha vault. |
| `pool_creator_authority` | Address which can use the pool config key to create a pool. If it is `11111111111111111111111111111111`, it's public and available for everyone to use |
| `activation_type` | Pool activation type. `0` = slot, `1` = time |
**Pool Activation Time Calculation (depending on the `activation_type`)**
* `current_time + activation_duration`
* `current_slot + activation_duration`
# Pool Config Example
```json theme={"system"}
{
"config_address": "FiENCCbPi3rFh5pW2AJ59HC53yM32eLaCjMKxRqanKFJ",
"trade_fee_bps": 1500,
"protocol_fee_bps": 2000,
"activation_duration": 0,
"vault_config_key": "11111111111111111111111111111111",
"pool_creator_authority": "11111111111111111111111111111111",
"activation_type": 0
}
```
# User Flow Example
A pool config may or may not have an associated vault config. There's no vault config associated when the `vault_config_key` is `11111111111111111111111111111111`.
When the pool config has a vault config, user can create the pool + Alpha Vault that is binded (auto-whitelisted) by the pool. The Alpha Vault created will inherit the parameters (Pro Rata / FCFS + buying\_cap, vesting duration, etc.) from the vault config.
## Creating Pool ABC/SOL with an Alpha Vault
Let's say a user wants to create the pool ABC/SOL with an Alpha Vault, the user will need to:
1. **Check for pool config** that have `vault_config_key` not = `1111...`, and `pool_creator_authority` is the user or `1111...` (accessible by the public)
2. **Based on the vault requirement** the user wants, the user will need to:
* a) Check all the pool configs from step 1, which are each mapped to a `vault_config_key`, as well as
* b) Check for vault config and look for one that fits the requirement
3. **If the user finds a requirement** that suits their needs, they can use that `pool_config_key` to create the pool, then use the pool config-mapped `vault_config_key` to create the vault. As long as `vault_config_key` is used, the vault is automatically whitelisted upon pool creation.
All the settings are already predefined by `pool_config` + its mapped `vault_config_key`.
<Note>The permutations for pool config + Alpha Vault are created by Meteora. Please reach out to us on [discord](https://discord.gg/meteora) if you need a specific configuration.</Note>
### Pool Config Example
```json theme={"system"}
{
"config_address": "8aPHoLN8ke6PhWeYA7ELi19fppptVYUCQvqKWR5yP1sn",
"trade_fee_bps": 150,
"protocol_fee_bps": 2000,
"activation_duration": 1512000,
"vault_config_key": "7ixojP8Zuu4csfTycHi8ywQymHm9zxAhu1TjnFuJaq2R",
"pool_creator_authority": "5unTfT2kssBuNvHPY6LbJfJpLqEcdMxGYLWHwShaeTLi",
"activation_type": 0
}
```
### Alpha Vault Config Example
```json theme={"system"}
{
"address": "7ixojP8Zuu4csfTycHi8ywQymHm9zxAhu1TjnFuJaq2R",
"max_depositing_cap": 10,
"start_vesting_duration": 1,
"end_vesting_duration": 24107,
"depositing_duration_until_last_join_point": 24107,
"individual_depositing_cap": 1,
"escrow_fee": 0,
"activation_type": 0
}
```
In this example above, only the `pool_creator_authority` => `5unTfT2kssBuNvHPY6LbJfJpLqEcdMxGYLWHwShaeTLi` can use the pool config `8aPHoLN8ke6PhWeYA7ELi19fppptVYUCQvqKWR5yP1sn` to create a pool with the below settings:
* **1.5% fee**
* **20% protocol fee** and **80%** LP fee (fixed Meteora fee for constant product pools)
* Pool starts trading after **1512000 slot** upon creation
* **Slot based activation**
You can also create a binded Alpha Vault with **FCFS config** as shown below:
* Max deposit cap = **10 token**
* Vested over **24106 slot** after pool activate
* Deposit opens at **24107 slot** before vault crank
* Every escrow maximum can only deposit **1 token**
# DAMM v1 Program Accounts
Source: https://docs.meteora.ag/developer-guides/damm-v1/program/accounts
Understand DAMM v1 dynamic AMM accounts, including pools, configs, lock escrows, operators, vault relationships, constants, enums, and PDA seeds.
<Note>
This page summarizes the `amm` program and the `damm-v1-sdk` account helpers. For exact generated layouts, use the bundled IDL and TypeScript types exported by `@meteora-ag/dynamic-amm-sdk`.
</Note>
## PDA Map
DAMM v1 sorts token mint public keys lexicographically for permissionless pool PDAs. The helpers call the larger key `first` and the smaller key `second`.
| Account | SDK or Rust helper | Seeds |
| - | - | - |
| Permissionless pool | `derivePoolAddress(...)`, `derive_permissionless_pool_key` | curve type byte, sorted mints |
| Permissionless pool with fee tier | `derivePoolAddress(...)`, `derive_permissionless_pool_key_with_fee_tier` | curve type byte, sorted mints, optional little-endian trade-fee bps |
| Config-based constant-product pool | `derivePoolAddressWithConfig(...)`, `derive_permissionless_constant_product_pool_with_config_key` | sorted mints, config |
| Customizable constant-product pool | `deriveCustomizablePermissionlessConstantProductPoolAddress(...)`, `derive_customizable_permissionless_constant_product_pool_key` | `pool`, sorted mints |
| Config | `deriveConfigPda(index, programId)` | `config`, little-endian `u64` index |
| LP mint | `derive_lp_mint_key(pool)` | `lp_mint`, pool |
| Vault A/B LP token account | `derive_vault_lp_key(vault, pool)` | vault, pool |
| Protocol fee token account | `deriveProtocolTokenFee(pool, mint, programId)` | `fee`, token mint, pool |
| Lock escrow | `deriveLockEscrowPda(pool, owner, programId)` | `lock_escrow`, pool, owner |
| Operator | source helper | `operator`, whitelisted address |
| LP mint metadata | `deriveMintMetadata(lpMint)` | Metaplex `metadata`, metadata program, LP mint |
Permissioned pools use an arbitrary signer account for the pool address rather than a pool PDA.
## Constants
| Constant | Value | Use |
| - | - | - |
| `PROGRAM_ID` | `Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB` | Deployed DAMM v1 program. |
| `STAGING_PROGRAM_ID` | `ammbh4CQztZ6txJ8AaQgPsWjd6o7GhmvopS2JAo5bCB` | Staging program compiled behind the staging feature. |
| `FEE_DENOMINATOR` | `100_000` | Trade, protocol, host, and partner fee denominator. |
| `MAX_FEE_BPS` | `1500` | Max trade fee for program validation, equal to 15%. |
| `MEME_MIN_FEE_BPS` / `MEME_MAX_FEE_BPS` | `25` / `1500` | Customizable pool fee bounds, equal to 0.25% through 15%. |
| `FEE_NUMERATOR_DIVISIBLE_FACTOR` | `50` | Customizable fee numerator must be divisible by 50. |
| `MAX_PARTNER_FEE_NUMERATOR` | `50_000` | Max partner share of protocol fee, equal to 50%. |
| `HOST_TRADE_FEE_NUMERATOR` | `20_000` | Referral host share of protocol fee, equal to 20%. |
| `PERMISSIONLESS_AMP` | `100` | Stable-pool amplification for permissionless stable pools. |
| `MAX_AMP` | `10_000` | Max stable-swap amplification coefficient. |
| `MIN_CHANGE_AMP_DURATION` | `600` seconds | Minimum time between stable amp updates. |
| `SLOT_BUFFER` | `9000` slots | Mainnet slot-based pre-activation buffer. |
| `TIME_BUFFER` | `3600` seconds | Mainnet timestamp-based pre-activation buffer. |
| `MAX_ACTIVATION_SLOT_DURATION` | `SLOT_BUFFER * 24 * 31` | Max future slot activation duration. |
| `MAX_ACTIVATION_TIME_DURATION` | `TIME_BUFFER * 24 * 31` | Max future timestamp activation duration. |
| `QUOTE_MINTS` | SOL, USDC | Quote mints allowed for alpha-vault launch-pool paths on mainnet builds. |
## Enums
| Enum | Values |
| - | - |
| `PoolType` | `Permissioned`, `Permissionless`. |
| `ActivationType` | `0` slot, `1` timestamp. |
| `CurveType` | `ConstantProduct`, `Stable { amp, token_multiplier, depeg, last_amp_updated_timestamp }`. |
| `DepegType` | `None`, `Marinade`, `Lido`, `SplStake`. |
| `OperatorPermission` | `0` claim protocol fee, `1` zap protocol fee. |
## Pool
`Pool` is the primary DAMM v1 state account.
| Field | Use |
| - | - |
| `lp_mint` | Pool LP token mint. The LP mint authority is the vault-LP signer PDA. |
| `token_a_mint`, `token_b_mint` | Pool token mints. |
| `a_vault`, `b_vault` | Dynamic Vault accounts that hold token A and token B inventory. |
| `a_vault_lp`, `b_vault_lp` | Program-owned token accounts holding each Dynamic Vault LP token. |
| `a_vault_lp_bump` | Bump used for the vault-LP signer PDA. |
| `enabled` | Swap and liquidity access flag. Disabled pools still allow balanced withdrawal. |
| `protocol_token_a_fee`, `protocol_token_b_fee` | Protocol fee token accounts. |
| `fee_last_updated_at` | Timestamp of last fee update. |
| `fees` | `PoolFees` trade and protocol fee fractions. |
| `pool_type` | Permissioned or permissionless pool classification. |
| `stake` | Stake/depeg account used by LST stable pools when configured. |
| `total_locked_lp` | Total LP amount locked through DAMM v1 lock escrow logic. |
| `bootstrapping` | Launch-pool activation point, whitelisted vault, and activation type. |
| `partner_info` | Partner fee authority and pending partner fee balances. |
| `padding` | Reserved bytes for future layout compatibility. |
| `curve_type` | Constant product or stable-swap curve parameters. |
## Config
`Config` defines config-based constant-product launc프로젝트로 돌아가기