Meteora Hooks
MAINNET
07 / Benchmarks

Compute, measured.

Compute units of the compiled token-hooks program, measured with Mollusk (one instruction) and LiteSVM (full Token-2022 transfers). Every case below ran and succeeded; each builtin is also checked to reject under a denying config, so a number is never the cost of skipping the check.
01

Token-2022 transfer

mollusk-svm 0.15.1 (unit), litesvm 0.16.0 with bundled Token-2022 11.0 (transaction)
CaseCUOver plain transfer
transfer_checked: Token-2022, no hook1,790—
transfer_checked: token-hooks, empty policy19,349+17,559
transfer_checked: token-hooks, 7 builtins20,188+18,398

The hook adds Token-2022's transfer-hook CPI, extra-account resolution and the policy load. Builtin evaluation itself is small next to that, as the per-builtin table shows.

02

Per builtin (token-hooks Execute)

empty stack 6,798 CU
StackMeasured CUAbove emptyKernel static estimate
allowlist6,937+1392,500
denylist6,943+145300
max-size6,915+117300
spending-limit6,950+152300
time-window6,916+118300
timelock6,906+108300
accounting6,930+132300
credential8,252+1,4541,500
all 8 token builtins9,079+2,2815,800

Static estimates are deliberately conservative upper bounds used for compute budgeting before simulation.

03

Regression gate

tolerance 5%
CaseBaselineCurrentStatus
execute: empty stack6,7986,798unchanged
execute: allowlist6,9376,937unchanged
execute: denylist6,9436,943unchanged
execute: max-size6,9156,915unchanged
execute: spending-limit6,9506,950unchanged
execute: time-window6,9166,916unchanged
execute: timelock6,9066,906unchanged
execute: accounting6,9306,930unchanged
execute: credential8,2528,252unchanged
execute: all 8 token builtins9,0799,079unchanged
transfer_checked: Token-2022, no hook1,7901,790unchanged
transfer_checked: token-hooks, empty policy19,34919,349unchanged
transfer_checked: token-hooks, 7 builtins20,18820,188unchanged
04

Binaries and reproduction

token_hooks.so sha256
969dd56de202ba3e740f6b6aa6875d43406aee7679c4b2522266b49d196b7e36
scripts/build_programs.sh programs/token-hooks
cargo run --release -p hook-bench        # writes bench/results.json and docs/benchmarks/report.md
cargo test --release -p hook-bench       # fails on a >5% regression against bench/baseline.json
pumphooks bench --no-run                 # the table above, in a terminal