Page cover

Protocol fee

2.5 Protocol fee

DEX Raiden v1.1 includes a 0.25% protocol fee that can be turned on and off. If turned on, this fee would be sent to a feeTo address specified in the factory contract.

A pre-specified address—feeToSetter—can call the setFeeTo function on the DEX Raiden v1.1 factory contract, setting feeTo to a different value. feeToSetter can also call the setFeeToSetter to change the feeToSetter address itself. If the feeTo address is set, the protocol will begin charging a 5-basis-point fee, which is taken as a 1 6 cut of the 30-basis-point fees earned by liquidity providers. That is, traders will continue to pay a 0.30% fee on all trades; 83.3% of that fee (0.25% of the amount traded) will go to liquidity providers, and 16.6% of that fee (0.05% of the amount traded) will go to the feeTo address. Collecting this 0.05% fee at the time of the trade would impose an additional gas cost on every trade.

To avoid this, accumulated fees are collected only when liquidity is deposited or withdrawn. The contract computes the accumulated fees, and mints new liquidity tokens to the fee beneficiary, immediately before any tokens are minted or burned.

Last updated