Transaction fees
Inspired by the txfees
module used on Osmosis, Kopi introduces a custom decorator to handle transaction fee calculations. This decorator determines a transaction’s gas fee, but instead of drawing from the gas setting, it uses the fee setting, allowing for the use of alternative denoms.
Transaction fees are calculated using XKP as the base currency. If fees are provided in USDC or kUSD, their value is converted to XKP using the DEX’s spot price. As long as the converted XKP amount meets or exceeds the required fee, the transaction is accepted.
When deducting the fee from the sender’s wallet, the handling depends on the denom:
If the fee is paid in XKP, the funds are sent directly to stakers.
If the fee is paid in another token, the funds are sent to the module’s wallet for collection.
At the end of each block, the module checks the collected balance. If it exceeds a predefined threshold, a portion is used to purchase XKP, which is then distributed to stakers.
Last updated