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.
| Tags | Instructions, in tag order |
|---|---|
| 0–7 | InitConfig, ConfigSet, AdminTransfer, AdminAccept, QuoteList, IntegratorSet, PoolSetCap, CalendarSet (admin) |
| 10–14 | RootCreate, RootUpdate, RootTransfer, RootAccept, HookSave |
| 20–30 | LaunchCreate, PoolInit, PoolSeed, LaunchDevBuy, LaunchFinalize, LaunchReturn, LaunchAbort, LaunchTransfer, LaunchAccept, LaunchLock, LaunchUnlock |
| 40–48 | PositionOpen, LiquidityAdd, LiquidityRemove, FeesCollect, PositionSplit, PositionTransfer, PositionAccept, PositionLock, PositionClose |
| 50 | Swap |
| 60–65 | LedgerOpen, ClaimsVaultOpen, Claim, BucketCollect, WalletCounterOpen, KotpSettle |
| 70–75 | AgentRegister, ReviewerCreate, ScoreSet, ReferrerRegister, ReferralLink, ManagedSet |
| 80–83 | MarketPublish, 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
| Code | Hex | Name |
|---|---|---|
| 6000 | 0x1770 | InvalidInstruction |
| 6001 | 0x1771 | InvalidAccount |
| 6002 | 0x1772 | WrongOwner |
| 6003 | 0x1773 | WrongTag |
| 6004 | 0x1774 | MissingSigner |
| 6005 | 0x1775 | NotWritable |
| 6006 | 0x1776 | WrongPda |
| 6007 | 0x1777 | WrongTokenProgram |
| 6008 | 0x1778 | WrongMint |
| 6009 | 0x1779 | WrongVault |
| 6010 | 0x177a | MathOverflow |
| 6011 | 0x177b | ZeroAmount |
| 6012 | 0x177c | SlippageExceeded |
| 6013 | 0x177d | InsufficientLiquidity |
| 6014 | 0x177e | InvariantViolated |
| 6015 | 0x177f | Unauthorized |
| 6016 | 0x1780 | PoolNotLive |
| 6017 | 0x1781 | BuysPaused |
| 6018 | 0x1782 | SellsLocked |
| 6019 | 0x1783 | ExactOutDuringGuard |
| 6020 | 0x1784 | BuyCapExceeded |
| 6021 | 0x1785 | WalletCapExceeded |
| 6022 | 0x1786 | GuardAddRefused |
| 6023 | 0x1787 | PrincipalLocked |
| 6024 | 0x1788 | PositionLocked |
| 6025 | 0x1789 | LaunchLocked |
| 6026 | 0x178a | ZapTargetOnly |
| 6027 | 0x178b | AgentRequired |
| 6028 | 0x178c | ScoreTooLow |
| 6029 | 0x178d | CpiRefused |
| 6030 | 0x178e | OracleUnavailable |
| 6031 | 0x178f | RoundNotOver |
| 6032 | 0x1790 | InvalidParams |
| 6033 | 0x1791 | BlockConflict |
| 6034 | 0x1792 | FeeRoomExceeded |
| 6035 | 0x1793 | MintRejected |
| 6036 | 0x1794 | QuoteNotAllowed |
| 6037 | 0x1795 | DepositCapExceeded |
| 6038 | 0x1796 | Paused |
| 6039 | 0x1797 | RootClosed |
| 6040 | 0x1798 | HookMismatch |
| 6041 | 0x1799 | LaunchState |
| 6042 | 0x179a | WeightMismatch |
| 6043 | 0x179b | RetainedAboveCap |
| 6044 | 0x179c | OpeningOutsideTolerance |
| 6045 | 0x179d | DevBuyRefused |
| 6046 | 0x179e | AlreadyExists |
| 6047 | 0x179f | NotEmpty |
| 6048 | 0x17a0 | InvalidCode |
| 6049 | 0x17a1 | SelfReferral |
| 6050 | 0x17a2 | ManagedStep |
| 6051 | 0x17a3 | Deadline |
| 6052 | 0x17a4 | NothingOwed |
| 6053 | 0x17a5 | MarketBlockInactive |
| 6054 | 0x17a6 | BondLocked |
| 6055 | 0x17a7 | InvalidCalendar |
reel-hook errors
| Code | Hex | Name |
|---|---|---|
| 7000 | 0x1b58 | NotTransferring |
| 7001 | 0x1b59 | WrongGuard |
| 7002 | 0x1b5a | CanonicalOnly |
| 7003 | 0x1b5b | SellLocked |
| 7004 | 0x1b5c | WalletCap |
| 7005 | 0x1b5d | AgentOnly |
| 7006 | 0x1b5e | InvalidAccount |
| 7007 | 0x1b5f | WrongPot |
| 7008 | 0x1b60 | MutableOwner |
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.
| Id | Event | Fields |
|---|---|---|
| 1 | PoolOpened | pool, launch, base_mint, quote_mint, index, blocks |
| 2 | Swap | pool, user, side, mode, amount_in, amount_out, lp_fee, protocol, other, burn, recapture, reserve_base, eff_quote |
| 3 | Liquidity | pool, position, kind (0 add, 1 remove), shares, base, quote |
| 4 | FeesCollected | pool, position, base, quote |
| 5 | PositionOwner | position, from, to, kind (0 start, 1 accept, 2 cancel, 3 split) |
| 6 | PositionLocked | position, until |
| 7 | LaunchCreated | launch, mint, creator, supply, flags |
| 8 | LaunchFinalized | launch, open_ts, principal_lock_until, retained |
| 9 | DevBuy | launch, pool, quote_in, base_out, price_before, price_after |
| 10 | BucketPaid | pool, kind, to, amount |
| 11 | Credited | wallet, mint, category, amount |
| 12 | Claimed | wallet, mint, amount |
| 13 | Crowned | pool, wallet, spend |
| 14 | RoundSettled | pool, round_start, prize × 3, released |
| 15 | Recaptured | pool, user, charge, protocol, trader, pot, lp |
| 16 | Registry | kind (0 root, 1 hook, 2 agent, 3 referrer, 4 link, 5 score, 6 integrator, 7 quote, 8 market), a, b |
| 17 | LaunchOwner | launch, from, to, kind |
| 18 | LaunchLocked | launch, beneficiary, until |
| 19 | ManagedSet | pool, pips, until |
| 20 | ConfigChanged | field, value |
Invariants the tests hold
- After every instruction, each vault covers what the pool owes from it.
- The positions' shares plus the 1,000 locked shares equal the pool's total shares.
- A claims vault holds at least what every ledger of its mint is owed.
- Fee growth only increases; a collect never pays more than the LPs are owed.
- Frozen parameters never change after
PoolInit; locks only extend; a permanent lock never releases. - A vault pays only a trader, a position owner, a bucket's fixed recipient, the claims vault, or the burn.
- A new token's mint authority is gone after
LaunchCreate, and it never had a freeze authority.