Skip to content

MeteoraAg/meteora-invent

Repository files navigation

Meteora Invent

A toolkit consisting of everything you need to invent innovative token launches on Meteora.

Metsumi

Meet Metsumi, your personal launch assistant engineered to help you launch anything and do any action on Meteora programs with just a few configurations and CLI commands.

Metsumi

πŸ“‹ Table of Contents

πŸš€ Getting Started

Prerequisites

  • Node.js >= 18.0.0
  • pnpm >= 10.0.0

Clone the repository

git clone https://github.com/MeteoraAg/meteora-invent.git

Installation

# Install pnpm if you haven't already
npm install -g pnpm

# Install all dependencies
pnpm install

πŸ“¦ Workspaces


Studio (@meteora-invent/studio)


The studio workspace contains all the actions for interacting with Meteora's programs.

Setup

  1. Copy the .env.example file to .env and configure the environment variables.
cp studio/.env.example studio/.env
  1. (Optional) Start a Local Test Validator

You can also run the studio actions on localnet - http://localhost:8899 with the following command

pnpm studio start-test-validator
  1. Generate a keypair from your private key:
pnpm studio generate-keypair

# For devnet (airdrops 5 SOL)
pnpm studio generate-keypair --network devnet --airdrop

# For localnet (airdrops 5 SOL)
# Ensure that you have already started the local validator with pnpm start-test-validator
pnpm studio generate-keypair --network localnet --airdrop
  1. Configure the config files in the studio/config directory.

Note: You can use the provided example configurations as a starting point. Make sure to replace the placeholders with your actual values.

  1. (Optional) Airdrop SOL to your generated keypair if you need SOL to test on devnet or localnet:
# Airdrop 5 SOL on devnet
pnpm studio airdrop-sol --network devnet

# Airdrop 5 SOL on localnet
# Ensure that you have already started the local validator with pnpm start-test-validator
pnpm studio airdrop-sol --network localnet

DLMM Actions

Create a Customizable Permissionless DLMM Pool

Configure dlmmConfig in dlmm_config.jsonc file and run the following command to create the DLMM pool.

If you don't have a base mint, you can configure createBaseToken in the config file and run the following command.

pnpm studio dlmm-create-pool

If you already have a base mint created, you can provide it via the CLI with a --baseMint flag and run the following command.

pnpm studio dlmm-create-pool --baseMint <YOUR_BASE_MINT_ADDRESS>
Seed Liquidity (LFG)

Configure lfgSeedLiquidity in dlmm_config.jsonc file and run the following command to seed the liquidity in the already deployed DLMM pool.

Note: You need to ensure that the deployed DLMM pool is not trading yet.

pnpm studio dlmm-seed-liquidity-lfg --baseMint <YOUR_BASE_MINT_ADDRESS>
Seed Liquidity (Single Bin)

Configure singleBinSeedLiquidity in dlmm_config.jsonc file and run the following command to seed the liquidity in a single bin in the already deployed DLMM pool.

Note: You need to ensure that the deployed DLMM pool is not trading yet.

pnpm studio dlmm-seed-liquidity-single-bin --baseMint <YOUR_BASE_MINT_ADDRESS>
Set DLMM Pool Status

Configure setDlmmPoolStatus in dlmm_config.jsonc file and run the following command to set the trading status of the DLMM pool. This command is used by the operator of the pool to either enable or disable trading for the DLMM pool.

pnpm studio dlmm-set-pool-status --poolAddress <YOUR_POOL_ADDRESS>

DAMM v2 Actions

Create a Balanced Constant Product Pool

Configure dammV2Config in damm_v2_config.jsonc file and run the following command to create the DAMM v2 pool.

If you don't have a base mint, you can configure createBaseToken in the config file and run the following command.

pnpm studio damm-v2-create-balanced-pool

If you already have a base mint, you can provide it via the CLI with a --baseMint flag and run the following command.

pnpm studio damm-v2-create-balanced-pool --baseMint <YOUR_BASE_MINT_ADDRESS>
Create a One-Sided Pool

Configure dammV2Config in damm_v2_config.jsonc file and run the following command to create the DAMM v2 one-sided pool.

If you don't have a base mint, you can configure createBaseToken in the config file and run the following command.

pnpm studio damm-v2-create-one-sided-pool

If you already have a base mint, you can provide it via the CLI with a --baseMint flag and run the following command.

pnpm studio damm-v2-create-one-sided-pool --baseMint <YOUR_BASE_MINT_ADDRESS>
Split Position

Configure splitPosition in damm_v2_config.jsonc file and run the following command to split an existing position in the already deployed DAMM v2 pool.

pnpm studio damm-v2-split-position --poolAddress <YOUR_POOL_ADDRESS>
Claim Position Fee

If you already have an existing position in a DAMM v2 pool with unclaimed fees, you can run the following command to claim the fees.

pnpm studio damm-v2-claim-position-fee --poolAddress <YOUR_POOL_ADDRESS>
Add Liquidity

Configure addLiquidity in damm_v2_config.jsonc file and run the following command to add liquidity to an existing position in the already deployed DAMM v2 pool.

pnpm studio damm-v2-add-liquidity --poolAddress <YOUR_POOL_ADDRESS>
Remove Liquidity

If you already have an existing position in a DAMM v2 pool with liquidity, you can run the following command to remove the liquidity and close the position.

pnpm studio damm-v2-remove-liquidity --poolAddress <YOUR_POOL_ADDRESS>
Close Position

If you already have an existing position in a DAMM v2 pool without liquidity, you can run the following command to close the position.

pnpm studio damm-v2-close-position --poolAddress <YOUR_POOL_ADDRESS>

DAMM v1 Actions

Create a Constant Product Pool

Configure dammV1Config in damm_v1_config.jsonc file and run the following command to create the DAMM v1 pool.

If you don't have a base mint, you can configure createBaseToken in the config file and run the following command.

pnpm studio damm-v1-create-pool

If you already have a base mint created, you can provide it via the CLI with a --baseMint flag and run the following command.

pnpm studio damm-v1-create-pool --baseMint <YOUR_BASE_MINT_ADDRESS>
Lock Liquidity

Configure dammV1LockLiquidity in damm_v1_config.jsonc file and run the following command to lock the liquidity in the already deployed DAMM v1 pool.

pnpm studio damm-v1-lock-liquidity --baseMint <YOUR_BASE_MINT_ADDRESS>
Create a Stake2Earn Farm

Configure stake2EarnFarm in damm_v1_config.jsonc file and run the following command to create the Stake2Earn farm on top of the already deployed DAMM v1 pool.

pnpm studio damm-v1-create-stake2earn-farm --baseMint <YOUR_BASE_MINT_ADDRESS>
Lock Liquidity (Stake2Earn)

Configure dammV1LockLiquidity in damm_v1_config.jsonc file and run the following command to lock the liquidity in the already deployed DAMM v1 pool with the Stake2Earn farm.

pnpm studio damm-v1-lock-liquidity-stake2earn --baseMint <YOUR_BASE_MINT_ADDRESS>

DBC Actions

Create a DBC Config

Configure dbcConfig in dbc_config.jsonc file and run the following command to create the DBC config key. This config key is used to create the DBC pool and contains all the settings for the pre-graduation and post-graduation pools.

pnpm studio dbc-create-config
Create a DBC Pool

Configure dbcPool in dbc_config.jsonc file and run the following command to create the DBC pool.

If you don't have a DBC config key, you can run the following command and the config key + pool will be created together.

pnpm studio dbc-create-pool

If you already have an existing DBC config key, you can provide it via the CLI with a --config flag and run the following command.

pnpm studio dbc-create-pool --config <YOUR_DBC_CONFIG_KEY>
Claim Trading Fees

If you already have an existing DBC pool with accumulated fees, you can run the following command with the --baseMint flag to claim the fees.

pnpm studio dbc-claim-trading-fee --baseMint <YOUR_BASE_MINT_ADDRESS>
Migrate to DAMM v1

If you already have an existing DBC pool, with poolState.quoteReserve > poolConfig.migrationQuoteThreshold (100% bonding curve progress), you can run the following command with the --baseMint flag to migrate the DBC pool to DAMM v1.

pnpm studio dbc-migrate-to-damm-v1 --baseMint <YOUR_BASE_MINT_ADDRESS>
Migrate to DAMM v2

If you already have an existing DBC pool, with poolState.quoteReserve > poolConfig.migrationQuoteThreshold (100% bonding curve progress), you can run the following command with the --baseMint flag to migrate the DBC pool to DAMM v2.

pnpm studio dbc-migrate-to-damm-v2 --baseMint <YOUR_BASE_MINT_ADDRESS>
Swap (Buy/Sell)

Configure dbcSwap in dbc_config.jsonc file and run the following command to swap in the DBC pool.

pnpm studio dbc-swap --baseMint <YOUR_BASE_MINT_ADDRESS>
Transfer Pool Creator

Configure dbcTransferPoolCreator in dbc_config.jsonc file and run the following command to transfer the pool creator of the DBC pool.

pnpm studio dbc-transfer-pool-creator --baseMint <YOUR_BASE_MINT_ADDRESS>

Alpha Vault Actions

Create an Alpha Vault

Configure alphaVault in alpha_vault_config.jsonc file and run the following command to create the alpha vault with an existing DAMM v1 or DAMM v2 or DLMM pool.

pnpm studio alpha-vault-create --baseMint <YOUR_BASE_MINT_ADDRESS>

Presale Vault Actions

Create a Presale Vault

Configure presaleVault in presale_vault_config.jsonc file and run the following command to create the presale vault for a specific base token.

pnpm studio presale-vault-create --baseMint <YOUR_BASE_MINT_ADDRESS>

Scaffolds


Fun Launch (@meteora-invent/scaffold-fun-launch)

A Next.js application template for creating a launchpad.

Getting Started

Copy the .env.example file to .env and configure the environment variables.

cp scaffolds/fun-launch/.env.example scaffolds/fun-launch/.env

Install Dependencies

pnpm install

Running the Scaffold

# Run the fun-launch scaffold in development
pnpm --filter @meteora-invent/scaffold/fun-launch dev

# Build the fun-launch scaffold
pnpm --filter @meteora-invent/scaffold/fun-launch build

πŸ—οΈ Structure

meteora-invent/
β”œβ”€β”€ packages/          # Shared packages
β”‚   └── config/
β”‚       β”œβ”€β”€ eslint/
β”‚       β”œβ”€β”€ prettier/
β”‚       └── typescript/
β”œβ”€β”€ scaffolds/         # Scaffolds - production-ready frontend application templates
β”‚   └── fun-launch/
└── studio/            # Studio - a collection of actions for you to innovate and create
    β”œβ”€β”€ config
    β”‚   β”œβ”€β”€ alpha_vault_config.jsonc
    β”‚   β”œβ”€β”€ damm_v1_config.jsonc
    β”‚   β”œβ”€β”€ damm_v2_config.jsonc
    β”‚   β”œβ”€β”€ dbc_config.jsonc
    β”‚   └── dlmm_config.jsonc
    β”œβ”€β”€ data
    β”‚   β”œβ”€β”€ image
    β”‚   β”‚   └── test-token.jpg
    β”‚   β”œβ”€β”€ kv_proof_example.json
    β”‚   └── whitelist_wallet_example.csv
    β”œβ”€β”€ LLM.txt
    β”œβ”€β”€ package.json
    β”œβ”€β”€ README.md
    β”œβ”€β”€ src
    β”‚   β”œβ”€β”€ actions
    β”‚   β”‚   β”œβ”€β”€ alpha_vault
    β”‚   β”‚   β”‚   └── create_alpha_vault.ts
    β”‚   β”‚   β”œβ”€β”€ damm_v1
    β”‚   β”‚   β”‚   β”œβ”€β”€ create_pool.ts
    β”‚   β”‚   β”‚   β”œβ”€β”€ create_stake2earn_farm.ts
    β”‚   β”‚   β”‚   β”œβ”€β”€ lock_liquidity_stake2earn.ts
    β”‚   β”‚   β”‚   └── lock_liquidity.ts
    β”‚   β”‚   β”œβ”€β”€ damm_v2
    β”‚   β”‚   β”‚   β”œβ”€β”€ add_liquidity.ts
    β”‚   β”‚   β”‚   β”œβ”€β”€ claim_position_fee.ts
    β”‚   β”‚   β”‚   β”œβ”€β”€ close_position.ts
    β”‚   β”‚   β”‚   β”œβ”€β”€ create_balanced_pool.ts
    β”‚   β”‚   β”‚   β”œβ”€β”€ create_one_sided_pool.ts
    β”‚   β”‚   β”‚   β”œβ”€β”€ remove_liquidity.ts
    β”‚   β”‚   β”‚   └── split_position.ts
    β”‚   β”‚   β”œβ”€β”€ dbc
    β”‚   β”‚   β”‚   β”œβ”€β”€ claim_trading_fee.ts
    β”‚   β”‚   β”‚   β”œβ”€β”€ create_config.ts
    β”‚   β”‚   β”‚   β”œβ”€β”€ create_pool.ts
    β”‚   β”‚   β”‚   β”œβ”€β”€ migrate_damm_v1.ts
    β”‚   β”‚   β”‚   β”œβ”€β”€ migrate_damm_v2.ts
    β”‚   β”‚   β”‚   β”œβ”€β”€ swap.ts
    β”‚   β”‚   β”‚   └── transfer_pool_creator.ts
    β”‚   β”‚   β”œβ”€β”€ dlmm
    β”‚   β”‚   β”‚   β”œβ”€β”€ create_pool.ts
    β”‚   β”‚   β”‚   β”œβ”€β”€ seed_liquidity_lfg.ts
    β”‚   β”‚   β”‚   β”œβ”€β”€ seed_liquidity_single_bin.ts
    β”‚   β”‚   β”‚   └── set_pool_status.ts
    β”‚   β”‚   β”œβ”€β”€ presale_vault
    β”‚   β”‚   β”‚   └── create_presale_vault.ts
    β”‚   β”‚   └── settings
    β”‚   β”‚       β”œβ”€β”€ airdrop_sol.ts
    β”‚   β”‚       └── generate_keypair.ts
    β”‚   β”œβ”€β”€ helpers
    β”‚   β”‚   β”œβ”€β”€ accounts.ts
    β”‚   β”‚   β”œβ”€β”€ cli.ts
    β”‚   β”‚   β”œβ”€β”€ common.ts
    β”‚   β”‚   β”œβ”€β”€ config.ts
    β”‚   β”‚   β”œβ”€β”€ index.ts
    β”‚   β”‚   β”œβ”€β”€ metadata.ts
    β”‚   β”‚   β”œβ”€β”€ token.ts
    β”‚   β”‚   β”œβ”€β”€ transaction.ts
    β”‚   β”‚   β”œβ”€β”€ utils.ts
    β”‚   β”‚   └── validation.ts
    β”‚   β”œβ”€β”€ lib
    β”‚   β”‚   β”œβ”€β”€ alpha_vault
    β”‚   β”‚   β”‚   β”œβ”€β”€ merkle_tree
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ balance_tree.ts
    β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ index.ts
    β”‚   β”‚   β”‚   β”‚   └── merkle_tree.ts
    β”‚   β”‚   β”‚   β”‚   └── metadata.ts
    β”‚   β”‚   β”‚   β”œβ”€β”€ index.ts
    β”‚   β”‚   β”‚   └── utils.ts
    β”‚   β”‚   β”œβ”€β”€ damm_v1
    β”‚   β”‚   β”‚   β”œβ”€β”€ index.ts
    β”‚   β”‚   β”‚   └── stake2earn.ts
    β”‚   β”‚   β”œβ”€β”€ damm_v2
    β”‚   β”‚   β”‚   └── index.ts
    β”‚   β”‚   β”œβ”€β”€ dbc
    β”‚   β”‚   β”‚   └── index.ts
    β”‚   β”‚   └── dlmm
    β”‚   β”‚       └── index.ts
    β”‚   β”œβ”€β”€ tests
    β”‚   β”‚   β”œβ”€β”€ artifacts
    β”‚   β”‚   β”‚   β”œβ”€β”€ accounts
    β”‚   β”‚   β”‚   β”‚   └── 3ifhD4Ywaa8aBZAaQSqYgN4Q1kaFArioLU8uumJMaqkE.json
    β”‚   β”‚   β”‚   β”œβ”€β”€ alpha_vault.so
    β”‚   β”‚   β”‚   β”œβ”€β”€ cp_amm.so
    β”‚   β”‚   β”‚   β”œβ”€β”€ dynamic_amm.so
    β”‚   β”‚   β”‚   β”œβ”€β”€ dynamic_bonding_curve.so
    β”‚   β”‚   β”‚   β”œβ”€β”€ dynamic_fee_sharing.so
    β”‚   β”‚   β”‚   β”œβ”€β”€ dynamic_vault.so
    β”‚   β”‚   β”‚   β”œβ”€β”€ lb_clmm.so
    β”‚   β”‚   β”‚   β”œβ”€β”€ locker.so
    β”‚   β”‚   β”‚   └── metaplex.so
    β”‚   β”‚   └── keys
    β”‚   β”‚       └── localnet
    β”‚   β”‚           └── admin-bossj3JvwiNK7pvjr149DqdtJxf2gdygbcmEPTkb2F1.json
    β”‚   └── utils
    β”‚       β”œβ”€β”€ constants.ts
    β”‚       └── types.ts

🀝 Contributing

  1. Create a feature branch
  2. Make your changes
  3. Run pnpm format and pnpm lint
  4. Submit a pull request

πŸ“„ License

ISC

About

Launch anything on Meteora and do any onchain actions with Metsumi, your personal launch assistant

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •