SOLSTACKBlog
← All guides

Token Creation & Minting

How to Add a Transfer Fee to Your Solana Token

How Token-2022's TransferFeeConfig extension works — the fee is withheld and collected on-chain, not just "agreed to" — and what to decide before you set one.

2026-09-20·6 min read·Verified against mainnet-beta

A transfer fee — sometimes called a "tax token" mechanic — takes a cut of every transfer and routes it somewhere the creator controls, usually to fund liquidity, rewards, or a treasury. On Solana, this isn't something a token creator bolts on with off-chain tracking; it's a real protocol-level extension, TransferFeeConfig, enforced by the Token-2022 program itself.

How it actually works on-chain

TransferFeeConfig is set once at mint creation and defines two numbers: a fee in basis points (1 bp = 0.01%) and an optional maximum fee per transfer, capped in the token's base units. Every transfer through the Token-2022 program then automatically withholds that percentage — the sender doesn't need to do anything different, and there's no way to transfer around the fee, because the program itself enforces it at the instruction level.

Here's the part that trips people up: the withheld amount doesn't go straight to a wallet. It accumulates inside the recipient's own token account, in a separate withheld-amount field, until someone with the fee authority calls a harvest instruction to sweep it out. This two-step design (withhold, then harvest) exists so the transfer instruction itself doesn't need to know or trust an external collection address — it's a deliberate security boundary.

The three numbers you're actually setting

  • Fee basis points. 100 bps = 1% of every transfer. Most tax tokens sit somewhere between 1–5%; higher discourages trading activity, since every hop costs more.
  • Maximum fee. A hard cap in the token's base units, regardless of transfer size — without one, a single enormous transfer could withhold an enormous absolute amount even at a modest percentage.
  • Fee authority. The keypair allowed to change the fee rate later, and the withdraw authority allowed to harvest and move the accumulated fees. These can be the same key or split — splitting them means whoever can adjust the rate isn't automatically whoever can withdraw funds, which is a meaningful trust separation for a multi-person team.

What this means for holders

Anyone receiving this token gets slightly less than the sender sent, every time, automatically — including on DEX swaps, since the fee is enforced by the token program regardless of what application is calling the transfer instruction. This needs to be visible to your holders; a transfer fee that isn't clearly disclosed reads as a red flag, since it means every trade is quietly worth less than the displayed price implies. Token Safety Check-style tooling flags live transfer-fee extensions specifically because of this.

Decide the fee authority setup before you mint

Because the fee rate and collection are governed by an on-chain authority, this is a permanence decision much like mint or freeze authority: whoever holds the fee authority when you're done can change or revoke it. If you want a fixed, predictable fee forever, plan to revoke or lock the fee authority once you've set the rate you intend to keep. If you expect to tune the rate over time — start high, taper down as liquidity matures, for instance — keep it and disclose that plan.

Building it

Solstack's Token-2022 Creator sets TransferFeeConfig as part of the same transaction that creates the mint — enter the fee percentage and (optionally) a maximum fee, and it's enforced from the token's very first transfer. Full walkthrough, including how it interacts with the other Token-2022 extensions, is in the Token-2022 Creator docs.