Skip to content
Solana

Docs · Reference

Instructions, errors and events

Every reel instruction tag, every custom error code with its hex form, and the events an indexer decodes from the logs.

Instructions

Instruction data starts with a one-byte tag, followed by packed little-endian fields with no padding. Keys are 32 bytes; strings are a length byte and UTF-8. Optional account slots take the reel program id when unused.

TagsInstructions, in tag order
0–7InitConfig, ConfigSet, AdminTransfer, AdminAccept, QuoteList, IntegratorSet, PoolSetCap, CalendarSet (admin)
10–14RootCreate, RootUpdate, RootTransfer, RootAccept, HookSave
20–30LaunchCreate, PoolInit, PoolSeed, LaunchDevBuy, LaunchFinalize, LaunchReturn, LaunchAbort, LaunchTransfer, LaunchAccept, LaunchLock, LaunchUnlock
40–48PositionOpen, LiquidityAdd, LiquidityRemove, FeesCollect, PositionSplit, PositionTransfer, PositionAccept, PositionLock, PositionClose
50Swap
60–65LedgerOpen, ClaimsVaultOpen, Claim, BucketCollect, WalletCounterOpen, KotpSettle
70–75AgentRegister, ReviewerCreate, ScoreSet, ReferrerRegister, ReferralLink, ManagedSet
80–83MarketPublish, MarketAdmit, BondDeposit, BondWithdraw

reel-hook has three entry points: Execute (the Token-2022 transfer hook interface), InitializeExtraAccountMetaList (anyone, once per reel mint) and HolderInit (opens a wallet's holding record for Exit Clock).

reel errors

CodeHexName
60000x1770InvalidInstruction
60010x1771InvalidAccount
60020x1772WrongOwner
60030x1773WrongTag
60040x1774MissingSigner
60050x1775NotWritable
60060x1776WrongPda
60070x1777WrongTokenProgram
60080x1778WrongMint
60090x1779WrongVault
60100x177aMathOverflow
60110x177bZeroAmount
60120x177cSlippageExceeded
60130x177dInsufficientLiquidity
60140x177eInvariantViolated
60150x177fUnauthorized
60160x1780PoolNotLive
60170x1781BuysPaused
60180x1782SellsLocked
60190x1783ExactOutDuringGuard
60200x1784BuyCapExceeded
60210x1785WalletCapExceeded
60220x1786GuardAddRefused
60230x1787PrincipalLocked
60240x1788PositionLocked
60250x1789LaunchLocked
60260x178aZapTargetOnly
60270x178bAgentRequired
60280x178cScoreTooLow
60290x178dCpiRefused
60300x178eOracleUnavailable
60310x178fRoundNotOver
60320x1790InvalidParams
60330x1791BlockConflict
60340x1792FeeRoomExceeded
60350x1793MintRejected
60360x1794QuoteNotAllowed
60370x1795DepositCapExceeded
60380x1796Paused
60390x1797RootClosed
60400x1798HookMismatch
60410x1799LaunchState
60420x179aWeightMismatch
60430x179bRetainedAboveCap
60440x179cOpeningOutsideTolerance
60450x179dDevBuyRefused
60460x179eAlreadyExists
60470x179fNotEmpty
60480x17a0InvalidCode
60490x17a1SelfReferral
60500x17a2ManagedStep
60510x17a3Deadline
60520x17a4NothingOwed
60530x17a5MarketBlockInactive
60540x17a6BondLocked
60550x17a7InvalidCalendar

reel-hook errors

CodeHexName
70000x1b58NotTransferring
70010x1b59WrongGuard
70020x1b5aCanonicalOnly
70030x1b5bSellLocked
70040x1b5cWalletCap
70050x1b5dAgentOnly
70060x1b5eInvalidAccount
70070x1b5fWrongPot
70080x1b60MutableOwner

A failed transaction reports custom program error: 0x…; parseCustomError in the SDK turns it into the name.

Events

Events are written with sol_log_data and appear in the logs as Program data: <base64>. The payload is [event id u8, fields…], packed little-endian, with keys as 32 bytes.

IdEventFields
1PoolOpenedpool, launch, base_mint, quote_mint, index, blocks
2Swappool, user, side, mode, amount_in, amount_out, lp_fee, protocol, other, burn, recapture, reserve_base, eff_quote
3Liquiditypool, position, kind (0 add, 1 remove), shares, base, quote
4FeesCollectedpool, position, base, quote
5PositionOwnerposition, from, to, kind (0 start, 1 accept, 2 cancel, 3 split)
6PositionLockedposition, until
7LaunchCreatedlaunch, mint, creator, supply, flags
8LaunchFinalizedlaunch, open_ts, principal_lock_until, retained
9DevBuylaunch, pool, quote_in, base_out, price_before, price_after
10BucketPaidpool, kind, to, amount
11Creditedwallet, mint, category, amount
12Claimedwallet, mint, amount
13Crownedpool, wallet, spend
14RoundSettledpool, round_start, prize × 3, released
15Recapturedpool, user, charge, protocol, trader, pot, lp
16Registrykind (0 root, 1 hook, 2 agent, 3 referrer, 4 link, 5 score, 6 integrator, 7 quote, 8 market), a, b
17LaunchOwnerlaunch, from, to, kind
18LaunchLockedlaunch, beneficiary, until
19ManagedSetpool, pips, until
20ConfigChangedfield, value

Invariants the tests hold

  1. After every instruction, each vault covers what the pool owes from it.
  2. The positions' shares plus the 1,000 locked shares equal the pool's total shares.
  3. A claims vault holds at least what every ledger of its mint is owed.
  4. Fee growth only increases; a collect never pays more than the LPs are owed.
  5. Frozen parameters never change after PoolInit; locks only extend; a permanent lock never releases.
  6. A vault pays only a trader, a position owner, a bucket's fixed recipient, the claims vault, or the burn.
  7. A new token's mint authority is gone after LaunchCreate, and it never had a freeze authority.