Create a Stake2Earn v1 Launch Pool
Stake2Earn Pool is a DAMM v1 Pool that is launched with a Stake2Earn Vault. This page provides the code examples and steps to create a Stake2Earn Pool.
DAMM v1 Pool: A DAMM v1 Pool created with a fee scheduler and with initial liquidity perma-locked.
Stake2Earn Vault: Stake-to-earn farming mechanism and vault where top stakers can earn a share of fees from the locked liquidity.
Stake2Earn Pool: A Memecoin Pool with a Stake2Earn Vault.
Getting Started
For Creating a Memecoin Pool with Fee Scheduler - Using TypeScript SDK:
- DAMM v1 SDK: https://github.com/MeteoraAg/damm-v1-sdk
- Stake2Earn Vault SDK: https://github.com/MeteoraAg/stake-for-fee-sdk
- DAMM v1 Program ID:
Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB
- Stake2Earn Vault Program ID:
FEESngU3neckdwib9X3KWqdL7Mjmqk9XNp3uh5JbP4KP
- Devnet: https://damm-api.devnet.meteora.ag/swagger-ui/
For Creating a Stake2Earn Vault - Using Bun Scripts:
- Clone repo: https://github.com/MeteoraAg/meteora-pool-setup
- Config list to reference: https://github.com/MeteoraAg/meteora-pool-setup/tree/main/config
- Readme: https://github.com/MeteoraAg/meteora-pool-setup/blob/main/README.md
API
- DAMM v1 API endpoints: https://damm-api.meteora.ag/swagger-ui/
- Stake2Earn Mainnet API endpoint: https://stake-for-fee-api.meteora.ag/swagger-ui/
- API endpoint to get Stake2Earn vault info from pool address: https://stake-for-fee-api.meteora.ag/swagger-ui/#/vault/filter_vaults
- Stake2Earn Devnet API endpoint: https://devnet.stake-for-fee-api.meteora.ag/swagger-ui/
Dependencies
Install Bun: You’ll also need bun to run the scripts. Install it via bun installation. Then install the dependencies by running the command bun install
Scripts
1. Install dependencies and initialize AmmImpl instance
DAMM v1 SDK: https://github.com/MeteoraAg/damm-v1-sdk
1.1 Install dependencies
1.2 Initialize AmmImpl instance
2. Fee Schedule Setup: Choose a suitable Pool and Fee Config
What fee parameters to choose depends on your project’s needs. You will need to look at the pool config list and choose a suitable pool_config_key with your preferred fee parameters.
If you want to create an Alpha Vault along with your new pool, you also need to find a pool_config_key that is mapped to a vault_config_key that meets your requirements.
If none of the pool_config_key in the list meet your requirements, please reach out to Meteora for a custom pool config key.
2.1 Public Pool Config List
- Pool config list: https://damm-api.meteora.ag/swagger-ui/#/pools/get_all_pool_configs
- Devnet API: https://damm-api.devnet.meteora.ag/swagger-ui/ You can also get the list of config keys from devnet API
- API endpoint to return the associated fee curve for each existing config: https://damm-api.meteora.ag/swagger-ui/#/fee_config/get_config_associated_fee_configs
Using this endpoint, integrators can input the config pubkey, and it will return an array of fee update timings for the config, if there’s any.
Integrators may choose a pool_config_key with a fee curve that suits your integration.
If there is no existing config in the list that fits your project’s requirement, a new config needs to be created.
Only the Meteora team can create a new config to add it to the preset pool config list.
2.2 Default Pool Config used by Meteora Frontend
By default, Meteora’s frontend is currently using this pool config key for Memecoin Pool creation: FiENCCbPi3rFh5pW2AJ59HC53yM32eLaCjMKxRqanKFJ
For the FiENCCbPi3rFh5pW2AJ59HC53yM32eLaCjMKxRqanKFJ
pool config, it doesn’t allow creation of any Alpha Vault, therefore its field vault_config_key is 1111111...
2.3 New Custom Pool Config and Fee Curve for Integrators / Launchpads
Custom Pool Config Key: Integrators such as launchpads or other partners may need to use their own unique custom pool config key, if they want custom pool_creator_authority to prevent front-running of the token launch pool.
Custom Fee Curve: If you are an integrator, Meteora can also apply a custom fee curve/schedule for your pools, but we will need to create a dedicated config key for your team, where pool_creator_authority is linked to your signer wallet for pool creation. You would need to send us your signer wallet that would be used to deploy the pools.
Custom Pool Config and Fee Curve is used by integrators such as Moonshot by DEX Screener.
2.4 Custom Fee Curve for a Specific Pool
If required, Meteora can set a custom fee curve for a single, specific pool. This would override the fee curve used by the pool’s config key, doesn’t matter which config key is used.
3. Create a Memecoin Pool with Stake2Earn Vault
3.1 Using TypeScript SDK
After you have selected your preferred pool config key, use this example to create a Memecoin Pool with Stake2Earn Vault: https://github.com/MeteoraAg/stake-for-fee-sdk/blob/main/ts-client/src/examples/index.ts
This code example includes the steps to:
- Mint a token
- Create dynamic vault and pool
- Create Stake2Earn Vault
- Lock user’s LP to Stake2Earn Vault
3.2 Using Bun Scripts
Alternatively, the following bun script examples can be used to initialize a Stake2Earn Vault for the Memecoin Pool you created on Meteora.
First, make sure you create the token mint and the Memecoin Pool. After that, you need to lock the liquidity, before creating the Stake2Earn Vault for the Memecoin Pool. The addresses in the allocations should contain the feeFarm (Stake2Earn Vault) address.
Clone repo: https://github.com/MeteoraAg/meteora-pool-setup
Select an example config from the list to reference and change the parameters inside according to your needs: https://github.com/MeteoraAg/meteora-pool-setup/tree/main/config
Run the script with the config file which is set with your preferred parameters
Lock Liquidity
Create the Stake2Earn Vault
Important Considerations
Stake2Earn staking rewards distribution start time
You are recommended to configure your Stake2Earn staking rewards distribution start time (fee claim start time) to be approximately 48 hours after launch. This allows more time for total fee rewards to accumulate from trading activity in the memecoin pool. A bigger total fee reward would help make your Stake2Earn Vault look more appealing to potential stakers.
Difference between locking liquidity via Stake2Earn vs directly locking liquidity in the Memecoin Pool
User lock and Stake2Earn lock use the same lock mechanism on a Dynamic AMM / Memecoin Pool. But users and Stake2Earn vaults have their own personal lock escrow account for the pool.
When a user permanently locks liquidity directly on the Memecoin Pool page, the user is locking the LP token to their own personal escrow account for the pool. Fees from this locked liquidity go to the user’s wallet.
However, when a user locks via the Stake2Earn creation process, the user is locking the LP to their unique Stake2Earn Vault stake escrow account. Therefore, fees from this locked liquidity go to the Stake2Earn Vault, which then distributes fees to the top stakers.
How to find the Stake2Earn vault address and a user wallet’s unique personal Stake Escrow address?
Use a wallet simulator (e.g. Sherlock extension) and paste the user’s wallet address. Try to stake or unstake tokens in a Stake2Earn Vault.
Click “Open explorer” and on the explorer page search for Vault and/or Stake Escrow fields to find the respective addresses.
Other Considerations
If you plan to use a multisig on the Meteora website, please make sure it is the SquadsX multisig, as that is the only type supported on Meteora website. Otherwise, you can’t manage liquidity through the website.