Pattern: Taxed Token
Create a token that collects a fee on every transfer — ideal for revenue-share models
Overview
The tax hook collects a percentage of every transfer as a fee, sent to a designated treasury wallet. Useful for real estate revenue share, protocol fees, or regulatory levies.
Implementation
Key Points
taxBpsis in basis points: 100 = 1%, 200 = 2%, etc.maxTaxBpsis a hard cap set at creation that can never be exceeded- Use
addExemptWallets()for market makers, treasury, or liquidity pools - Tax is collected via the Permanent Delegate PDA in a separate step
- Use
toggleActive(false)to temporarily disable tax collection