One demo per engine, run against the real programs.
@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.Recorded runs (LiteSVM)
4 demos, 22 stepsToken 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
- deploy token-hooks + token-wrapper; create the wrapper for a fresh SPL mint with an empty token policy
- initialize hook-registry
- publish builtin allowlist (token)
- install allowlist(recipient = bob) on the wrapped mint
| # | Step | Expected | Status | CU | Outcome |
|---|---|---|---|---|---|
| 1 | ok | ok | 19,793 | alice holds 1000 wrapped; vault holds 1000 | |
| 2 | ok | ok | 21,139 | bob holds 400 wrapped | |
| 3 | rejected | rejected | 23,096 | hook stack rejected: callback 0 entry 0 reason 2 (not allowlisted); carol still holds 0 | |
| 4 | rejected | rejected | 9,226 | Token-2022 refuses the transfer: Program TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb failed: An account required by the instruction is missing | |
| 5 | ok | ok | 19,729 | bob: 0 wrapped, 400 more underlying |
Step 1: Alice wraps 1,000 tokens
alice holds 1000 wrapped; vault holds 1000
Invocations
observed| Depth | Program | CU | Result |
|---|---|---|---|
| 1 | compute-budget | — | success |
| 1 | token-wrapper | 19,643 | success |
| ·2 | token-hooks | 3,973 | success |
| ·2 | spl-token | 105 | success |
| ·2 | token-2022 | 1,534 | success |
Token balances
observed| alice wrapped | 0 → 1000 | 1000 |
| vault | 0 → 1000 | 1000 |
| alice underlying | 1000000 → 999000 | -1000 |
Hook steps
reconstructedNo builtin entries ran (empty stack, or not a token-hooks transfer).
Account diffs
observed| Account | Lamports | Data |
|---|---|---|
| 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)
Provenance: commit 12c2a02, generated 2026-10-20
pnpm --filter @pump-hooks/web export-data
Demo B on devnet
ran 2026-10-20The 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.
| Step | Status | CU | Outcome | Transaction |
|---|---|---|---|---|
| Routed buy for 0.020 SOL (cap is 0.050 SOL) | ok | 85,202 | receipt: spent 0.020 SOL, received 1161855775 base (measured by the router, venue verified: true) | 3N6jD4…exZDix ↗ |
| Routed buy for 0.100 SOL | rejected | 23,010 | hook 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 directly | ok | 58,644 | executed: router hooks do not apply outside the router (received 5802421874 base) | 4WpE1K…SaZftt ↗ |
Setup transactions
- publish builtin max-size (router) in hook-registry 3tBDVX…89HBqd ↗
- create a shared route policy: max-size 0.050 SOL on before_swap (mandatory) 3Q63ui…7Qh3hz ↗
- trader token accounts (idempotent); wrap 0.250 SOL 3qtyBL…GaMZNy ↗
- route policy DCcw…feGn, hook version DWAL…PY12
Recorded from commit ff0896d with pnpm --filter @pump-hooks/demos exec tsx scripts/devnet-router-demo.mts --keypair <admin>.
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.