SINAI STANDARD

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

import { AksumKit, TaxManager } from "@sinai-standard/sdk";
 
const token = await kit.createToken({
  name: "Revenue Share Token",
  symbol: "RST",
  decimals: 6,
  supply: 100_000_000,
  hooks: {
    tax: {
      bps: 200,                  // 2% transfer tax
      maxBps: 1000,              // hard cap at 10%
      vault: treasuryPubkey,     // where taxes go
    },
  },
});
 
const tax = new TaxManager(taxProgram, token.mint);
await tax.initialize(issuer.publicKey, 200, 1000, treasuryPubkey);
await tax.initializeExtraAccountMetas(issuer.publicKey);
 
// Exempt market makers from tax
await tax.addExemptWallets(issuer.publicKey, [
  marketMaker.publicKey,
]);
 
// Every transfer now deducts 2% to the treasury
// 1,000,000 tokens transferred -> 20,000 sent to treasury

Key Points

  • taxBps is in basis points: 100 = 1%, 200 = 2%, etc.
  • maxTaxBps is 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

On this page