All twenty-three errors of the kodama program with code, name and message, the instructions that raise each and under what condition, and the Anchor, Raydium and Token errors a caller meets beside them.
A refused instruction fails its whole transaction. The program's own errors are custom program errors numbered from 6000, shown in logs and simulations in hex: 6000 is 0x1770. The name and message come from the IDL at backend/programs/kodama/idl.json, and IDL.errors in backend/src/program/index.ts holds the same list.
LaunchLab and CPMM are Anchor programs too and number their own errors from 6000. A code belongs to the first program the logs show failing, never to the program that called it. Read the first Program … failed line before naming an error.
errors.ts
import { IDL, PROGRAM_ID } from'./backend/src/program/index.js'/** The kodama error for a custom code raised by the kodama program, or null for another program's. */exportfunction kodamaError(failedProgram: string, code: number) {
if (failedProgram !== PROGRAM_ID.toBase58()) returnnullreturn IDL.errors.find((error) => error.code === code) ?? null
}
The path is written from the repo's root. How the API reports these errors is on API errors.
An account is in the wrong place, is missing, or is not what its place requires.
Raised by
When
prepare_tree
cpmm_config is not owned by CPMM or is not a fee tier account.
plant
first_buy is above 0 and planter_quote is left out.
echoed_buy
venue is 1 and one of the seven CPMM accounts is left out. echo_record is not the Kodama address for echo_owner. That address holds a Kodama of another tree or owner, or holds anything else than an empty System account. The LaunchLab pool, the CPMM pool or the tier is not owned by its program or is not that kind of account.
harvest
The coin has graduated and one of the CPMM or Fee Key accounts is left out. Liquidity fees are being collected and lp_lock_program, token_2022_program or memo_program is left out or wrong. A token account the instruction reads is not a Token program account of the expected mint and owner. The LaunchLab pool, the CPMM pool, the tier or the LP-Lock position is not owned by its program or is not that kind of account. A remaining account is not writable, is passed twice, is not owned by the program, is a Kodama of another tree, or is not at its own Kodama address.
A LaunchLab account does not pass the program's checks.
Raised by
When
prepare_tree
The PlatformConfig LaunchLab created does not name the purse in every seat, with a fee rate of fee_ppm, a creator fee of 0, all liquidity locked to the platform, and the Grove's tier.
plant
global_config is not a LaunchLab GlobalConfig, is not of curve type 0, or does not quote in wrapped SOL, or platform_config fails the PlatformConfig check.
echoed_buy, harvest
The LaunchLab pool's GlobalConfig, PlatformConfig, mint, quote mint or creator differ from the tree's, or the pool does not carry the settings every Kodama coin is created with. The PlatformConfig fails its check.
echoed_buy
venue is 0 and the curve is no longer trading. The curve vaults are not the pool's.
A CPMM account does not pass the program's checks, or CPMM was asked for at the wrong time.
Raised by
When
prepare_tree, echoed_buy, harvest
The tier's index is not the Grove's cpmm_index, or its trade fee, creator fee or creator fee share are not 2,000, 19,000 and 0.
echoed_buy
venue is neither 0 nor 1. venue is 1 and the coin has not graduated. cpmm_config is not the Grove's. The pool is not the tier's own pool for the coin and wrapped SOL with the purse as creator and its creator fee charged in SOL. The pool is not open yet or has swaps off. The authority, a vault or the observation account is not the pool's.
harvest
collect_liquidity is true and the coin has not graduated. cpmm_config is not the Grove's. The pool fails the check above. The authority, a vault, the LP mint or the creator fee share address is not the pool's.
fee_key_token is not the purse's associated token account for fee_key_mint, or does not hold exactly 1. lock_authority is not LP-Lock's authority. locked_lp_vault is not that authority's account for the LP mint. locked_liquidity is not the LP-Lock position of fee_key_mint, or its pool, key, LP mint or locker are not this pool's migration lock. The Tree already has a pool and a Fee Key written and these are others.
A sum, difference or product left the range of its type. Every instruction that does arithmetic can raise it: prepare_tree, echoed_buy, move_in, move_out, water, harvest, close_day, settle, pick, claim_planter and claim_echo.
The kodama's echo_payable is 0 after the tree's echo reserve has been applied to its echo_pending. Echo share that no harvest has backed yet is not claimable.
The kodama's latest watering is in a closed day and not settled, and the optional day account was left out. Pass the Day for the kodama's last_watered_day, or run settle first.
Anchor checks every account against the instruction's constraints before the handler runs. These are the checks the program declares and the Anchor error each raises.
Code
Name
When, in this program
2001
ConstraintHasOne
A Tree is passed with a grove, mint, coin_vault, purse or platform_config other than the one it records. A Kodama is passed with another tree, or by a signer who is not its owner. In settle, the Day is another tree's.
2004
ConstraintOwner
In close_day, the day address is no longer owned by the System program.
2006
ConstraintSeeds
A grove, burner, tree, purse, kodama, day or event_authority is not at the address its seeds give.
2007
ConstraintExecutable
launchlab_program or metadata_program is not an executable program.
2012
ConstraintAddress
An account with one possible address is another: the wrapped SOL mint, a Raydium program, authority, pool or vault, the metadata address, the tree's coin_vault, launchlab_pool, platform_config or mint, the Grove's global_config or cpmm_config, or the purse's token accounts.
2014
ConstraintTokenMint
owner_coin, coin_vault, buyer_base, buyer_quote or planter_quote is a token account of another mint.
2015
ConstraintTokenOwner
One of the same token accounts belongs to another owner.
3010
AccountNotSigner
A required signer did not sign.
3011
AccountNotSystemOwned
The purse or burner passed is not owned by the System program.
3012
AccountNotInitialized
An account the instruction reads does not exist yet: a Tree before prepare_tree, a Kodama before its first move_in, a Day that was never created, or a token account.
Creating an account that already exists fails in the System program, not in Anchor. That is what a second prepare_tree for the same mint meets.
The program calls LaunchLab, CPMM, LP-Lock and the Token program, and their errors pass through unchanged, raised by that program. The API names these when it reports a refused transaction:
Program
Code
Name
What it means
LaunchLab
6004
ExceededSlippage
The buy would return fewer coins than minimum_out: the price moved. Build the trade again, or allow more slippage.
LaunchLab
6005
PoolFunding
The coin changed phase. Build the trade again.
LaunchLab
6006
PoolMigrated
The coin changed phase. Build the trade again.
Token
0
NotRentExempt
The account is not rent-exempt.
Token
1
InsufficientFunds
Not enough tokens in the account: fewer coins in owner_coin than move_in moves, or less wrapped SOL than a buy spends.
Token
2
InvalidMint
The mint is invalid.
Token
3
MintMismatch
The account belongs to another mint.
Token
4
OwnerMismatch
The account belongs to another owner.
Token
17
AccountFrozen
The token account is frozen.
Token
18
MintDecimalsMismatch
The decimals do not match the mint.
LaunchLab's 6004 and the program's own 6004, InvalidConfig, are different errors. The program that failed tells them apart.