I want to know like how on ethereum chains you can set fee and other functions for only sell, how can that be implemented on solana
-
Solana has constant base fees, and a dynamic priority fees model. Do you want to know how to set priority fees?– Arihant BansalCommented Jan 13 at 6:47
-
Are the Fees collected in Solana or in Tokens? I need a token that collect the fees in Solana not the Tokens, and then transfer to a separate wallet– WillCommented Apr 16 at 17:10
Add a comment
|
1 Answer
You can enable transfer fee for Token2022 using the transfer fee extension with @solana/web3.js
// Instruction to initialize TransferFeeConfig Extension
const initializeTransferFeeConfig =
createInitializeTransferFeeConfigInstruction(
mint, // Mint Account address
transferFeeConfigAuthority.publicKey, // Authority to update fees
withdrawWithheldAuthority.publicKey, // Authority to withdraw fees
feeBasisPoints, // Basis points for transfer fee calculation
maxFee, // Maximum fee per transfer
TOKEN_2022_PROGRAM_ID, // Token Extension Program ID
);
-
2Important to note that this is a feature of the new Token2022 standard (i.e. not SPL, which is what most tokens are today)– McBainCommented Jan 13 at 10:44
-