Fee Model

The Fee Model is a module designed to manage and calculate fees for cross-chain operations. This contract allows the contract owner to set default fee configurations for various operations as well as specific configurations for different chains, ensuring accurate and flexible fee calculations.

Key Features

Set Default Fee Configuration

The contract owner can set default fee configurations for different operations. The default configuration includes:

  • Fee rate (expressed in parts per million)

  • Minimum fee

  • Whether the configuration is active

Set Chain-Specific Fee Configuration

In addition to the default configuration, the contract owner can set fee configurations for specific chains. These configurations can override the default settings to provide more precise fee management for specific chains.

Calculate Fees

Based on the configurations, the Fee model contract can calculate the applicable fee for each operation. The calculation logic is as follows:

  • If a chain-specific fee configuration exists, it is used to calculate the fee.

  • If the chain-specific configuration does not exist or is not active, the default configuration is used.

  • If neither configuration is present or active, the fee is zero.

Configuration Management

Setting Default Fee Configuration

Administrators can set default fee configurations for specific operations by calling the setDefaultFeeConfig method. This method accepts the following parameters:

  • Operation type (e.g., Mint, Burn, or Crosschain Request)

  • Fee configuration, including fee rate, minimum fee, and activation status

Setting Chain-Specific Fee Configuration

Administrators can set fee configurations for specific chains by calling the setChainFeeConfig method. This method accepts the following parameters:

  • Operation type

  • Target chain identifier

  • Fee configuration, including fee rate, minimum fee, and activation status

Getting Fees

The getFee method calculates and returns the applicable fee for a specific request. This method automatically prioritizes configurations to ensure accurate fee calculations.

Fee Schedule

Currently, merchant's fee for mint and burn operations is based on a tiered rate design. For detailed rates, please contact inquiry@fbtc.com

Last updated