2

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

2
  • Solana has constant base fees, and a dynamic priority fees model. Do you want to know how to set priority fees? Commented 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
    – Will
    Commented Apr 16 at 17:10

1 Answer 1

3

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
 );
2
  • 2
    Important to note that this is a feature of the new Token2022 standard (i.e. not SPL, which is what most tokens are today)
    – McBain
    Commented Jan 13 at 10:44
  • My bad thanks for catching it I edited Commented Jan 13 at 10:51

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.