kopi.money
  • Welcome
  • Introduction
    • The Kopi Money Market
    • What is a crypto wallet
    • What is a DEX?
    • Strategies to maximize earnings
    • Tokenomics
  • Using Kopi
    • Connect your wallet
  • How to trade
  • How to place orders
  • Using arbitrage
  • Working with automations
  • Essentials
    • Trade execution
    • kCoins
    • Lending
    • Borrowing
    • Fees & Protocol Income
    • Interest rates
    • Liquidations
    • Adding new tokens to the DEX
  • Tokenfactory
    • Factory tokens
    • Liquidity pool
    • Vesting
    • Offers
  • Technical details
    • Constant product
    • Prices
  • Liquidity
  • Epochs
  • Running a node
  • Transaction fees
Powered by GitBook
On this page

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.

PreviousRunning a node

Last updated 22 days ago