Overview
Token-2022 is Solana’s next-generation token program. It supports extensions that add new behaviours to tokens — including a transfer fee extension that automatically deducts a percentage of each transfer. The Umbra SDK fully supports Token-2022 mints, including those with transfer fee extensions.Transfer Fees
When you deposit a Token-2022 token that has a transfer fee configured, the fee is deducted by the Token-2022 program before tokens reach the pool custody account. The SDK accounts for this by:- Fetching the mint account to detect the
TransferFeeConfigextension. - Calling the epoch info provider to determine the current epoch.
- Selecting the applicable fee schedule (Token-2022 supports epoch-based fee changes).
- Computing
actualReceived = amount - transferFee. - Applying Umbra protocol fees on top of
actualReceived.
actualReceived - protocolFees.
Epoch Info Provider
Transfer fee schedule selection requires knowing the current Solana epoch. This is whyepochInfoProvider is part of the IUmbraClient interface — it is fetched once per deposit operation for Token-2022 mints.
For standard SPL tokens (Token program), the epoch info provider is not called.
The provider defaults to an RPC-based implementation constructed from rpcUrl. You can override it if needed:
Fee Calculation
The SDK uses the same fee calculation as the Token-2022 program:feeBasisPoints and maximumFee are read from the epoch-appropriate fee schedule in the mint’s TransferFeeConfig extension.
Note that Token-2022’s BPS divisor is 10,000, while Umbra’s protocol-fee BPS divisor is 16,384 (2^14). Don’t confuse the two.
No Special Configuration Required
You do not need to do anything special to use Token-2022 mints. Simply pass the Token-2022 mint address as you would any other mint:Affected Operations
Transfer fee handling applies to these ATA-source operations:getATAIntoETADirectDepositorFunction— fetches epoch info only when a Token-2022 transfer fee is detected.getATAIntoSelfBurnableStealthPoolNoteCreatorFunction— same.getATAIntoReceiverBurnableStealthPoolNoteCreatorFunction— same.getETAIntoATAWithdrawerFunction— same (the transfer back into an ATA also crosses the Token-2022 boundary).getSelfBurnableStealthPoolNoteIntoATABurnerFunction— same.
epochInfoCommitment option (defaults to "confirmed") to control the commitment level used when fetching the current epoch for fee schedule selection.