block-quote On this pagechevron-down
copy Copy chevron-down
message-pen Fee CalculationTriggerGas (TG) is the standard unit for calculating computational and resource costs in the TriggerX platform. It is the basis for determining task fees, operator rewards, and developer/operator points. This document explains the formulas, parameters, and processes for these calculations.
TriggerGas Allocation
TriggerGas is calculated based on the following components:
1. Execution Time
Execution Time TG = Execution Time (seconds) × 2 \text{Execution Time TG} = \text{Execution Time (seconds)} \times 2 Execution Time TG = Execution Time (seconds) × 2 2. Memory Usage
Memory Usage TG = Memory Usage (MB) 128 × 1 \text{Memory Usage TG} = \frac{\text{Memory Usage (MB)}}{128} \times 1 Memory Usage TG = 128 Memory Usage (MB) × 1 3. Static Complexity
S t a t i c C o m p l e x i t y T G = Static Complexity Size (KB) 1024 × 1 {Static Complexity TG} = \frac{\text{Static Complexity Size (KB)}}{1024} \times 1 St a t i c C o m pl e x i t y TG = 1024 Static Complexity Size (KB) × 1 4. Transaction Simulation
Transaction Simulation TG = 1 \text{Transaction Simulation TG} = 1 Transaction Simulation TG = 1 Fixed Cost TG = 1 \text{Fixed Cost TG}=1 Fixed Cost TG = 1 The total TriggerGas (TG) for a task is calculated as:
Total TG = ( Computation Cost ) × ( Network Scaling Factors ) + 2 \text{Total TG} = (\text{Computation Cost}) \times (\text{Network Scaling Factors}) + 2 Total TG = ( Computation Cost ) × ( Network Scaling Factors ) + 2 where,
Computation Cost:
( Execution Time × 2 ) + ( Memory Usage (MB) 128 × 1 ) + ( Static Complexity (KB) 1024 × 1 ) (\text{Execution Time} \times 2) + \left( \frac{\text{Memory Usage (MB)}}{128} \times 1 \right) + \left( \frac{\text{Static Complexity (KB)}}{1024} \times 1 \right) ( Execution Time × 2 ) + ( 128 Memory Usage (MB) × 1 ) + ( 1024 Static Complexity (KB) × 1 )
Network Scaling Factors:
1 + Count of Validator Nodes 1 + \text{Count of Validator Nodes} 1 + Count of Validator Nodes
Fee Calculation
Task fees are based on the total TriggerGas consumed and TriggerGas's unit price.
Fee (ETH) = Total TG × Price per TG \text{Fee (ETH)} = \text{Total TG} \times \text{Price per TG} Fee (ETH) = Total TG × Price per TG The ETH multiplier value will be determined after the testnet launch; here, Price Per TG is used as an example.
Users will receive TG on the testnet without needing ETH.
Instead of receiving ETH directly, operators will earn points during the testnet phase.
Last updated 10 months ago