SINAI STANDARD

Router Hook

TransferHook program that chains multiple compliance hooks on a single token

Overview

The Router Hook enables a single Token-2022 mint to enforce multiple compliance features simultaneously. It reads each sub-hook's config account inline (raw byte deserialization) rather than using CPI calls, keeping compute usage within Solana's transaction limits.

Program ID: HHnt7Hfnp2fDftFNCFPqEhebgXGizuqubXqhiEi8C1of

Execution Order

When a transfer is executed, the Router checks sub-hooks in order:

  1. Allowlist Hook — validates source and destination are approved
  2. Tax Hook — logs the transfer for tax collection
  3. Hold Hook — verifies the source wallet's lock-up has expired
  4. Max Balance Hook — ensures destination balance + amount does not exceed the cap

Pass PublicKey.default for any hook you want to skip.

Accounts

RouterConfig PDA

Seeds: ["router-config", mint]

FieldTypeDescription
authorityPubkeyAdmin who can manage the router
mintPubkeyThe token mint
is_activeboolKill switch
allowlist_hook_programPubkeyAllowlist Hook program ID
tax_hook_programPubkeyTax Hook program ID
hold_hook_programPubkeyHold Hook program ID
max_balance_hook_programPubkeyMax Balance Hook program ID

ExtraAccountMetas PDA

Seeds: ["extra-account-metas", mint]

Instructions

InstructionDescription
initializeCreate the router config PDA
initialize_extra_account_metasCreate the ExtraAccountMetas PDA
update_hooksChange sub-hook program addresses
update_authorityTransfer admin rights
toggle_activeEmergency kill switch
executeTransferHook entry point

Design Notes

  • The Router reads sub-hook configs via raw byte deserialization, not CPI
  • This avoids CPI depth limits and keeps compute usage low
  • Each sub-hook must still have its own config and ExtraAccountMetas PDAs initialized
  • The Router's ExtraAccountMetas PDA includes references to all sub-hook accounts

On this page