FCT Gas Fee Calculation
Last updated
Last updated
This section provides a detailed explanation of the formulas used to calculate FCT gas requirements on Facet. It is intended for technical readers who want to understand gas consumption on a transaction basis.
The total amount of FCT consumed (fct gas fee) by a transaction on Facet is determined by the following formula:
Where:
Gas Used: The amount of gas units consumed by the transaction, which depends on the transaction’s complexity (e.g., number of EVM instructions) and the size of calldata.
Base Fee Per Gas: The base fee is dynamically adjusted based on network demand and is set at the start of each block. The formula for adjusting the base fee follows the mechanics of EIP-1559:
Where:
Previous Block Base Fee: The base fee set by the network in the previous block. It serves as the baseline for the current block’s fee calculation, ensuring fee continuity across blocks.
Gas Used in Block: The total amount of gas consumed by all transactions in the previous block. It reflects network demand and helps adjust the base fee dynamically.
Target Gas Used: A protocol-defined target (150M gas units) for gas usage in each block, serving as the desired level of gas consumption to keep the network balanced. If actual gas usage exceeds this target, the base fee increases in the next block, and if it's below the target, the base fee decreases.
Adjustment Factor: This constant (fixed at 12.5%) is used to determine how aggressively the base fee is adjusted based on network demand. The higher the gas usage in the previous block, the more significant the increase in the base fee for the next block.
Those familiar with EIP-1559 will note one key departure: since Facet transactions are already sequenced by L1 validators, there are no additional validators on Facet to reward with a priority (tip) fee. As a result, Facet’s gas calculation only involves the base fee component.