Understanding Whirlpool Fees

When a user performs a swap on a Whirlpool, a % portion of the swap input amount can be taken as a fee for the liquidity providers and pool treasury.

Total Fee

On the protocol, the total fee collected from the user is referred as the fee-rate. It is stored as a hundredths of a basis point on the Whirlpool account.

A 0.01% (1bps) swap fee would equate to a fee_rate value of 100.

swap_fee=input_amountfee_rate/1000000swap\_fee = input\_amount * {fee\_rate} / 1000000

Fee Breakdown

ProtocolFee

The protocol_fee is the fee diverted to a wallet that only the WhirlpoolConfig's collectProtocolFeesAuthority can collect. Often, this is used as the treasury of the protocol hosting the Whirlpools program.

It is stored as a basis point of the total fees collected on the Whirlpool account.. For example, 3% of the total swap fee is diverted to the protocol would have a protocol_fee value of 300.

protocol_fee=swap_feeprotocol_fee_rate/10000protocol\_fee = swap\_fee * protocol\_fee\_rate / 10000

Liquidity Provider Fee

The liquidity providers get all of the remaining fees once the protocol fee is subtracted.

LP_fee=swap_feeprotocol_feeLP\_fee = swap\_fee - protocol\_fee

Managing Pool Fee Rates

You can read more on how to manage the default rate of Whirlpools in your group and individual Whirlpools below.

pageManaging Pool Fees

Last updated