Automatic DAMM v2 graduation
Execution
The BullMQ worker scans database-recorded live and graduating launches on the configured network every MIGRATION_SCAN_INTERVAL_SECONDS (default 30). Mainnet execution requires explicit release opt-in. Scanning uses keyset pagination, requires no browser traffic, and requeues completed or failed jobs. Per-token BullMQ IDs and PostgreSQL advisory locks prevent simultaneous transaction construction. Another keeper's completed migration triggers supply, authority and DAMM pool verification rather than a second migration.
The installed official Meteora DBC SDK builds migrateToDammV2. Its payer is the dedicated protocol keeper, not the creator. The program migration discriminator, pool, config, mint, quote mint, fee claimer, canonical pool address and fixed DAMM fee option must match the recorded launch. The keeper refuses arbitrary transfer instructions, alternate migration destinations and metadata-authority reuse. Mainnet additionally requires explicit release opt-in and RPC network verification. LP recipients remain those specified by the existing on-chain configuration. Keeper payment does not change creator or partner LP entitlements.
Before broadcast the worker signs the SDK transaction, simulates the exact compiled message with signature verification, checks rent plus network fee against its maximum, and commits a signed outbox in chain_transactions.preview. Only signed transaction bytes are stored, not ephemeral secret keys. Public lifecycle responses omit the signed outbox. A signed transaction's deterministic signature is stored before broadcast for crash recovery. This is not proof of submission or confirmation. RPC confirmation and message, supply and authority checks determine success.
Configuration
MIGRATION_AUTOMATION_ENABLED: false by default. Set true on the worker and web deployment after setup.MIGRATION_KEEPER_ADDRESS: dedicated public fee-payer address, configured on worker and web.MIGRATION_KEEPER_KEYPAIR: worker-only secret, 64-byte JSON array or base64 JSON. Do not add to Vercel or browser configuration.MIGRATION_KEEPER_KEYPAIR_PATH: optional private local key path instead of an environment secret.MIGRATION_MAX_SPEND_LAMPORTS: default 100000000, a 0.1 SOL ceiling including rent and fee estimates.MIGRATION_DAILY_ATTEMPT_LIMIT: default 10. Failed and expired signed attempts count toward the rolling-day limit. The default upper reservation bound is 1 SOL per 24 hours.MIGRATION_SCAN_INTERVAL_SECONDS: default 30.
Replenishing the keeper from platform trading fees
MIGRATION_FEE_FUNDING_ENABLED=true on the worker opts into a separate, signed partner-fee claim before graduation when the keeper holds less than MIGRATION_MAX_SPEND_LAMPORTS. The feature defaults to false. Both migration automation and network execution must also be enabled. No deployment flag is enabled by adding this code.
For a SOL-paired pool that has reached its migration threshold, the worker claims only existing, unclaimed partner quote-token fees to the configured migration keeper. Creator fees, base tokens, curve principal, LP ownership, and the launch fee configuration are unchanged. This adds no new user fee. The source is Meteora's partner trading fee balance, not the optional percentage-based migration fee, which stays zero in new MUTATE configs.
The maximum SOL claim is the smallest of the available partner fees, the migration spending ceiling, and the keeper reserve deficit plus the collection cost allowance. This funds an operating reserve, not an exact reimbursement for a completed migration. A small excess above the target may remain to cover subsequent operating costs. Non-SOL pools use the funded-keeper path unless the separate conversion controls below are enabled and the quote mint has an approved budget.
MIGRATION_FUNDING_MAX_COST_LAMPORTS: defaults to 10,000,000 (0.01 SOL). Collection simulation checks gross costs including rent and network fees, so incoming fee revenue cannot hide excessive spending.MIGRATION_FUNDING_DAILY_ATTEMPT_LIMIT: defaults to 10 signed collection attempts per rolling 24 hours, including failed and expired attempts. At the defaults, this permits up to 1 SOL in partner-fee claims and a conservative 0.1 SOL collection-cost reservation per rolling day, in addition to the existing migration budget.- The keeper must front the first transaction's network fee and account rents. Funding simulation must leave at least the configured migration reserve after fees. Partner fees are not guaranteed to cover this reserve. An empty wallet or insufficient earned fees still requires operator funding.
- The worker needs the existing partner fee authority signer, which currently matches MUTATE's metadata authority. The key stays server-only. A fresh wrapped SOL account avoids closing or draining a pre-existing account. Both the fee authority and keeper sign the exact bounded fee-claim transaction.
- PostgreSQL's global keeper lock serializes reservations across launches. Pending migration or fee-funding transactions block new spending until reconciliation. A signed receipt commits before broadcast. Recovery resends identical bytes and signatures. Confirmed receipts retain RPC payer balances, net keeper change, network fee, and slot. A requested maximum claim is never labelled as realised revenue.
- Receipts appear as
migration-fundingin the existing token transaction history, with the source pool, recipient, maximum claim, and settlement data. Public responses omit signed transaction bytes. These operating-wallet receipts are not automatically added to treasury buyback revenue or allocated a second time.
Official SDK support: claimPartnerTradingFee. Local tests use the installed SDK and controlled RPC responses. A real fee collection and graduation receipt is still required before claiming mainnet acceptance.
Admin-controlled non-SOL conversion
The private worker optionally claims and converts existing partner quote-token fees into SOL. No public API accepts conversion requests, routes, or recipients. Admins control the worker's deployment variables. The worker performs eligible conversions automatically using its signers, without a separate admin signature for every attempt. These application controls do not constrain a stolen signing key.
Required worker settings, in addition to execution, migration automation, and fee funding:
MIGRATION_FEE_CONVERSION_ENABLED=true, default false.MIGRATION_JUPITER_API_KEY, a worker-only Jupiter API credential. Never use a public environment variable.MIGRATION_CONVERSION_ASSETS_JSON, default[]. Each approved standard SPL quote mint needsmint,maxInputRaw, anddailyInputRawstring fields. Limits use the mint's smallest units. For a six-decimal asset,1000000means one token. No assets are approved by default. Duplicate mints, native SOL, malformed amounts, and amounts above u64 are rejected.MIGRATION_CONVERSION_SLIPPAGE_BPS, default 50 (0.5%), maximum 300.MIGRATION_CONVERSION_PRICE_IMPACT_BPS, default 100 (1%), maximum 300.
Per-asset input budgets count all signed attempts during the rolling 24-hour period, including failed or expired attempts. SOL claims and conversions share MIGRATION_FUNDING_DAILY_ATTEMPT_LIMIT and the collection-cost limit. An initial capped quote is scaled down toward the keeper reserve deficit, then rebuilt and revalidated. Expected output cannot exceed the configured migration spending ceiling. Insufficient fees, liquidity, budgets, initial SOL, or route support stop before broadcast.
The worker requests raw instructions from Jupiter Swap V2 /build, using a fresh temporary owner, keeper fee payer, and an explicit temporary wrapped SOL destination. Only Jupiter's pinned router instruction is used. Remote setup, cleanup, tip, and compute-budget instructions are not executed. Local instructions claim only partner quote fees, create the isolated accounts, and enforce minimum output with an SPL TransferChecked before unwrapping SOL to the keeper. The keeper, metadata signer, launched token, and source launch vaults are excluded from the router's account list. The router receives only the temporary owner as a signer. All input comes from the atomic fee claim. Existing wallet token balances are not used.
The temporary quote, base, output, and keeper wrapped SOL accounts must not already exist. Closing the temporary quote account enforces zero leftover input. A lower-than-required fee claim or swap output causes the entire transaction to fail, reverting both claim and conversion. All temporary account rent and wrapped SOL return to the keeper. The keeper fronts temporary rents and network fees. Conversion cannot bootstrap an empty SOL wallet.
Address lookup tables are resolved through the network-verified RPC. Routes must fit one version-0 transaction within 1,232 bytes and pass signature-verified simulation. Routes requiring additional remote setup, pre-existing keeper wrapped SOL accounts, Token-2022 assets, or larger transactions are unsupported and fail closed. The local packet-size tests use compact synthetic routes, not live Jupiter execution proof.
The signed atomic transaction commits to the same durable outbox before broadcast. Its token-history receipt includes conversion: true, source pool, input mint, maximum input, minimum SOL output, recipient, and RPC-confirmed net SOL movement and network fee. Maximum input is a reservation, not a statement of realised token spending. These receipts do not create buyback revenue allocations. Real quote-asset collection, conversion, and subsequent graduation still require mainnet acceptance receipts.
Provider reference: Jupiter Swap V2 build.
The signing key is a fee payer, not a metadata update authority. Retain a protected backup. Mainnet requires a separately reviewed signer and infrastructure. Switching SOLANA_CLUSTER alone does not enable mainnet. Follow mainnet transition.
Spending limits are application-enforced, not restrictions on the wallet key itself. A stolen keeper key puts its entire funded balance at risk. Keep the balance bounded, monitor funding and signatures, and do not use the keeper as a treasury or deposit address. Devnet funding is an operational test deposit, not realized platform revenue or buyback funding.
Recovery
On an ambiguous RPC failure, replay the persisted transaction unchanged until confirmation or expiry. Reconcile before constructing a replacement. A legacy unsigned preparation blocks the keeper until expiry. Authority-verification failures stop further execution and require operator review. Daily-limit failures retry without creating additional signed attempts. The continuous scanner recovers exhausted jobs after limits reset or infrastructure recovers.
Stop automation by setting the worker flag false and redeploying. Disabling automation does not reverse a transaction already broadcast. If a key is compromised, stop the worker, drain or rotate the keeper through an operator-approved wallet flow, and inspect every stored signature.
Verification boundary
Unit and controlled-RPC tests are not on-chain execution proof. A full acceptance run needs a newly bonded devnet pool, an automatically paid migration signature, retained metadata authority and fixed supply, and a successful post-graduation trade. TEST's manually approved migration must not be described as an automatic keeper migration.
Official SDK reference: https://github.com/MeteoraAg/dynamic-bonding-curve-sdk/blob/main/packages/dynamic-bonding-curve/docs.md#migratetodammv2