Pump Hooks
02 / Hooks / holder-xp

Holder XP

An on-chain loyalty ledger earned through routed buys and holding, with anti-wash rules.

REWARDSruntime moduleunaudited
01

Behavior

  • XP is earned on routed buys only, never on sells.
  • Buy XP vests after a hold period; selling before vesting forfeits the unvested XP, so buy/sell loops earn nothing.
  • Per-trade cap, minimum trade size and a daily cap per wallet.
  • Optional holding XP on min(balance at last checkpoint, balance now) × elapsed time.
Limitation. XP is a ledger entry, not a token and not a claim on fees.
Limitation. Two wallets that each hold at both of their own checkpoints can overlap holding intervals; caps bound the effect (threat model T20).
02

Callbacks

ABI v1 · wire values frozen
#CallbackSubscribableDefaultSemantics
0BeforeBuy—Routed buy, before the Pump CPI. Can deny.
1AfterBuyyes●Routed buy, after the Pump CPI. Sees executed amounts; can still fail the transaction.
2BeforeSell—Routed sell, before the Pump CPI. Can deny.
3AfterSellyes●Routed sell, after the Pump CPI.
4BeforeSwap—Either side, before the Pump CPI. Can deny.
5AfterSwap—Either side, after the Pump 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
perTradeCapQuoteu640lamports10 SOLQuote above this per trade earns nothing extra
xpPerSolu328xp100XP per 1 SOL of routed buy
vestSecsu3212seconds3600Hold period before buy XP vests
dailyCapu3216xp10000XP per wallet per day
holdXpPerDayu3220xp—XP per day for holding
holdCapBaseu6424base—Balance that earns the full holding XP
minTradeQuoteu6432lamports0.01 SOLTrades below this earn no XP
05

Identity

Module ID
4 (0x0004)
Version
v1
Developer
Pump Hooks
Program
91kRNewiED… (built-in)
Priority range
2000–2999 · default 2100
Markets
bonding-curve · pumpswap
Source
crates/hook-runtime/src/modules/holder_xp.rs
Verification
source in this repository; reproducible-build verification not yet published
Audit
unaudited
06

Registry

Install on a Pump market ›