Pump Hooks
12 / Demos

One demo per engine, run against the real programs.

Each demo builds its transactions with the @pump-hooks/sdk v1 builders and executes them in LiteSVM against the compiled programs: the registry publishes the hook, the engine installs it, and every step shows what the program actually did, including the rejections. Demo B also ran on devnet; its transactions are linked below. Nothing here is on mainnet.
01

Recorded runs (LiteSVM)

4 demos, 22 steps

Token hook: recipient allowlist on a wrapped token

Native for the wrapped Token-2022 mint: every transfer_checked runs the stack. The original SPL token is unaffected; holders opt in by wrapping.

Setup: 4 transactions, all succeeded
  1. deploy token-hooks + token-wrapper; create the wrapper for a fresh SPL mint with an empty token policy
  2. initialize hook-registry
  3. publish builtin allowlist (token)
  4. install allowlist(recipient = bob) on the wrapped mint
#StepExpectedStatusCUOutcome

Step 1: Alice wraps 1,000 tokens

alice holds 1000 wrapped; vault holds 1000

Status
success
Compute units
19,793
Invocations
5
Accounts changed
7

Invocations

observed
DepthProgramCUResult
1compute-budget—success
1token-wrapper19,643success
·2token-hooks3,973success
·2spl-token105success
·2token-20221,534success

Token balances

observed
alice wrapped0 → 10001000
vault0 → 10001000
alice underlying1000000 → 999000-1000

Hook steps

reconstructed

No builtin entries ran (empty stack, or not a token-hooks transfer).

Account diffs

observed
AccountLamportsData
issuer signer-10000
alice wrapped[64,66)
vault[64,66)
alice underlying[64,66)
DLU3…bVas[36,38)
H8Zj…daPx[168,170)
token-policy[104,105)
Logs (18)
Program ComputeBudget111111111111111111111111111111 invoke [1] Program ComputeBudget111111111111111111111111111111 success Program 841vHKyD8HXQKsNSp2A2pzNjDHuFDBu9JPt6xsJc7vbh invoke [1] Program log: Instruction: Wrap Program FZBBkQQamgfMCAoNk6PAdZi9nYZGMsGw9gDyTMNC3v54 invoke [2] Program log: Instruction: CheckOperation Program FZBBkQQamgfMCAoNk6PAdZi9nYZGMsGw9gDyTMNC3v54 consumed 3973 of 1391943 compute units Program FZBBkQQamgfMCAoNk6PAdZi9nYZGMsGw9gDyTMNC3v54 success Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2] Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 105 of 1385712 compute units Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success Program TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb invoke [2] Program log: Instruction: MintTo Program TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb consumed 1534 of 1383244 compute units Program TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb success Program data: C3+RH86GSYLvqxBxGSR5xCoujO7RbfZIBJ07S2940Y/sVqjlpNinV0IWj0oJildgRisrjN6tMv2W7mmNF7jFoO5aGlnjd9F26AMAAAAAAADoAwAAAAAAAOgDAAAAAAAA6AMAAAAAAAA= Program 841vHKyD8HXQKsNSp2A2pzNjDHuFDBu9JPt6xsJc7vbh consumed 19643 of 1399850 compute units Program 841vHKyD8HXQKsNSp2A2pzNjDHuFDBu9JPt6xsJc7vbh success
Provenance: commit 12c2a02, generated 2026-10-20
Commit
Generated
2026-10-20T18:38:59.813Z
Runtime
LiteSVM (node, litesvm 1.6.1) with the compiled .so files
hook_registry.so sha256
2b594e9133007ce2aa02e5a2ee779f0f90bfc704aa0b3240e2fd7add71b19250
token_hooks.so sha256
969dd56de202ba3e740f6b6aa6875d43406aee7679c4b2522266b49d196b7e36
token_wrapper.so sha256
d37cdbe6acab5c349bbc42ece5b86fe37219cb73fd69d8ec2a2bfde7f401c067
hook_router.so sha256
f9f6df8b562c5fca657da3192307de70b51d206d15daa82429408e06a6e3fc38
hooks_core.so sha256
e38e6eff6b735fd65e15b635b3086707738df656cfc916991186dd51b2224ef5
smart_accounts.so sha256
b6191cff8282f9c1874f7959a0c809ab51695ce5533a103feeb618cc21d1df28
fixtures/pump_amm.so (dumped from devnet) sha256
494d2257ed4a9a2bc3eb210b22cdb5058d77e17f1ba5095b636e96c86b1fd4ef
fixtures/pump.so (dumped from devnet) sha256
bcee35d3eeb158090dd08764a8c5c03a2852c3cee553a0ce61dd5482469a5ec7
fixtures/pump_fees.so (dumped from devnet) sha256
446db24678fa22700d8eda86c48ba361b325a084e319c0c66f780c953520b317
pnpm --filter @pump-hooks/web export-data
02

Demo B on devnet

ran 2026-10-20

The same max-size route policy, created on the devnet deployment of hook-router with the hook published in hook-registry, trading the devnet PumpSwap pool 9Nhd…tdmZ. The rejected buy was sent without preflight so its failure is recorded on chain.

StepStatusCUOutcomeTransaction
Routed buy for 0.020 SOL (cap is 0.050 SOL)ok85,202receipt: spent 0.020 SOL, received 1161855775 base (measured by the router, venue verified: true)3N6jD4…exZDix ↗
Routed buy for 0.100 SOLrejected23,010hook stack rejected: callback 2 entry 0 reason 8 (amount exceeds size cap) hook_reason 0; trader base balance unchanged (true)66nbX2…ucPVGN ↗
Same 0.100 SOL buy sent to PumpSwap directlyok58,644executed: router hooks do not apply outside the router (received 5802421874 base)4WpE1K…SaZftt ↗
Setup transactions

Recorded from commit ff0896d with pnpm --filter @pump-hooks/demos exec tsx scripts/devnet-router-demo.mts --keypair <admin>.

03

Run it yourself

scripts/build_programs.sh && scripts/dump_programs.sh   # router demo needs the PumpSwap fixtures
pnpm -r --filter "./packages/**" build
pumphooks demo                 # all four; or: pumphooks demo token|router|pool|account [--json]
pnpm --filter @pump-hooks/demos test

The router demo uses PumpSwap binaries dumped from devnet and a cloned devnet pool. Its last step calls PumpSwap directly to show that router hooks are bypassable: PumpSwap has no native hooks.