SINAI STANDARD

Tax Hook

TransferHook program for automated transfer fees with Permanent Delegate collection

Overview

The Tax Hook validates and logs transfers during the TransferHook CPI, then collects taxes in a separate instruction using the Permanent Delegate PDA. This two-step design keeps the transfer CPI within compute limits.

Program ID: ACJXvcH4uaBfBwSwcVG48zJ177ydEvtCqGRMKXv53goZ

Tax Collection Flow

  1. During execute (TransferHook CPI): validates the transfer and logs the amount
  2. During collect_tax (separate call): uses the Permanent Delegate to transfer tax to the vault

Accounts

TaxConfig PDA

Seeds: ["tax-config", mint]

FieldTypeDescription
authorityPubkeyAdmin who can update settings
mintPubkeyThe token mint
tax_vaultPubkeyDestination for collected taxes
tax_bpsu16Current tax rate in basis points
max_tax_bpsu16Hard cap (immutable after creation)
is_activeboolKill switch
exempt_countu32Number of exempt wallets
exempt_walletsVec<Pubkey>Tax-exempt addresses

TaxDelegate PDA

Seeds: ["tax-delegate", mint]

The Permanent Delegate authority used to collect taxes post-transfer.

ExtraAccountMetas PDA

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

Instructions

InstructionDescription
initializeCreate the tax config PDA
initialize_extra_account_metasCreate the ExtraAccountMetas PDA
update_tax_rateChange tax rate (capped by max_tax_bps)
update_tax_vaultChange tax collection wallet
add_exempt_walletsExempt wallets from tax
remove_exempt_walletsRemove exemptions
update_authorityTransfer admin rights
toggle_activeEmergency kill switch
executeTransferHook entry point
collect_taxCollect taxes via Permanent Delegate

On this page