1

I'm getting conflicting answers from multiple sources on this to the point where I've concluded it's practically impossible to create a custom token on Solana that:

  1. Takes a fee from every transfer (e.g. 10%)
  2. Redistributes that fee proportionally to all other holders via updating a reflection equation (e.g. someone who holds 50% of the supply would receive 50% of each fee taken)
  3. Optionally transfers a portion of that fee to a third account (e.g. a liquidity pool to buyback tokens).

Although I'm not exactly sure why this is impossible for points #1 & #2. #3 appears to be possible as far as I'm aware. But for #1 & #2 is it because Transfer Hooks aren't able to modify the original amount sent, while Transfer Fees aren't able to do any complex logic? Or is it because it's simply not possible to override an account's token balance to be formulaic?

1 Answer 1

1

You can do anything in a custom token program, but if you're using token-2022, you won't be able to automatically do everything for the reasons you outline.

  • Transfer hooks can't change the amount sent.
  • Transfer fees only withhold fees.

So if you want to do this with token-2022, your best bet is to create a transfer fee and then build a distribution system. At first, this can be a permissioned job that you run regularly.

If you're feeling up to it, you could also write an on-chain program to run the distribution permissionlessly. That might require a transfer hook to maintain the state of all accounts and eligible distributions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.