1

I'm new to Solana, I just wanted to figure out if the Token22 transfer fee extension can segregate buy tax and sell tax because in Ethereum I guess we could alter the ERC-20 contract by taking the LP address and implementing the logic on that but in Token22 I have I couldn't see any way to introduce sell fees on a token.

I'm aware of the transfer hook program which allows us to implement custom logic around token transfers but that too makes a CPI call to the transfer hook program after all the transfer logic of the token has happened so how could we induce sell tax in it?

enter image description here

I was thinking of a logic for creating transfer fees, and then returning the taxed amount in the same transaction to the user in case of buy methods. I could be wrong with the approach. I came up with the approach as the transfer fee extension is set at the protocol level of the mint account and we cannot alter it.

1 Answer 1

1

Your approach of adding transfer fees and then returning some amount of the fees back to the user is probably the easiest one to implement.

You could do the fee return logic entirely on-chain through a transfer hook program -- your program can store information for things like the buyer and seller, how much was paid, and how much of the fees each side is entitled to.

Then the buyer or seller could go to your program to redeem the correct amount of fees. It's complicated, but certainly doable!

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