Meteora Hooks
MAINNET
02 / Hooks / max-wallet

Max Wallet

A routed buy may not take a wallet's balance of the coin above a cap.

RISKACCESSruntime moduleunaudited
01

Behavior

  • Before a routed buy: denied if the wallet's balance plus the estimated tokens exceeds the cap.
  • After a routed buy: the trade reverts if the observed balance exceeds the cap.
  • Optional window: from market activation or a fixed time, for a set duration (or always).
  • Sells are never affected.
Limitation. Applies to trades routed through Pump Hooks only. A transaction that trades on Pump directly is not affected.
Limitation. The cap is per wallet token account: one person using several wallets, or receiving tokens by transfer, is not limited.
02

Callbacks

ABI v1 · wire values frozen
#CallbackSubscribableDefaultSemantics
0BeforeBuyyes●Routed buy, before the Meteora CPI. Can deny.
1AfterBuyyes●Routed buy, after the Meteora CPI. Sees executed amounts; can still fail the transaction.
2BeforeSell—Routed sell, before the Meteora CPI. Can deny.
3AfterSell—Routed sell, after the Meteora CPI.
4BeforeSwap—Either side, before the Meteora CPI. Can deny.
5AfterSwap—Either side, after the Meteora CPI.
6BeforeLiquidityreservedReserved (wire value 6).
7AfterLiquidityreservedReserved (wire value 7).
8BeforeFeeActionreservedReserved (wire value 8).
9AfterFeeActionreservedReserved (wire value 9).
10OnGraduationreservedReserved (wire value 10).
11OnStrategySignalreservedReserved (wire value 11).
03

Capabilities

granted at install; enforced by the executor
■READ_MARKETRead market config, venue reserves and the trade context
■VETO_ROUTED_SWAPDeny a routed trade in a before-callback (reverts the transaction)
□WRITE_HOOK_STATEPersist its 48-byte slot state on the market
□WRITE_USER_STATEUpdate the trading wallet's per-market state
□AWARD_POINTSCredit XP / points in the wallet's per-market ledger
□TREASURY_SIGNALEmit treasury allocation intents for the strategy vault
□STRATEGY_EXECUTIONBound or request vault strategy execution (TWAP, orders)
□ORACLE_READRead an external oracle account (reserved; not granted in V1)
□EXTERNAL_CPICall an external hook program (reserved; no permissionless CPI hooks in V1)
□EMIT_SIGNALEmit or consume signed strategy signals
04

Config schema

48 bytes · little-endian
FieldTypeOffsetUnitPresetDescription
maxBaseu640base20000000000000Largest balance a routed buy may leave the wallet with
startTsi648timestamp—Start (0 = market activation)
durationSecsu3216seconds86400How long the cap applies (0 = always)
05

Identity

Module ID
10 (0x000a)
Version
v1
Developer
Pump Hooks
Program
91kRNewiED… (built-in)
Priority range
0–999 · default 200
Markets
Meteora DAMM v2 · Meteora DLMM
Source
crates/hook-runtime/src/modules/max_wallet.rs
Verification
source in this repository; reproducible-build verification not yet published
Audit
unaudited
06

Registry

Use in the Composer ›