Skip to main content
This page is about fees on swaps. If you want to earn a share of staking yield by bringing stakers to Powfi, see Referral staking & partner commission. The two mechanisms are separate.
Wallets and aggregators can take a fee on each swap. The fee is paid in the input token, is sent to feeRecipient inside the same transaction, and is charged on top of the swap input.

Usage

The user pays amountIn + fee (exact-in) or maximalTokenInAmount + fee (exact-out on CPMM). The SDK uses the SwapMinOutWithFee / SwapMaxInWithFee (CPMM) or SwapWithoutAccountWithFee (CLMM) scripts when a fee is set.

Validation rules

validateIntegratorFee runs before signing and throws a plain Error if: When the input is a non-ALPH token, the SDK attaches one extra DUST_AMOUNT of ALPH for the fee output. The user pays this dust (0.001 ALPH) on top of amountIn + fee and gas, and it ends up at feeRecipient together with the fee. Include it when you show the user their total cost. Groupless feeRecipient addresses are normalized to the protocol group automatically.