Skip to main content
Version: Endpoint V2 Docs

Transaction Pricing Model

LayerZero's transaction pricing model is designed to fairly distribute costs across the various components that enable secure, reliable cross-chain messaging. Understanding this model helps developers and users make informed decisions about gas allocation and fee optimization.

Why Cross-Chain Pricing is Complex

Traditional blockchain transactions occur within a single network where gas costs are predictable and uniform. Cross-chain messaging introduces unique challenges:

  • Source chains have no knowledge of destination chain state, gas prices, or execution requirements
  • Multiple networks with different native tokens, gas mechanisms, and pricing models must be coordinated
  • Off-chain infrastructure (DVNs and Executors) provides critical services that require compensation
  • Message execution on the destination must be funded upfront from the source chain

LayerZero's pricing model addresses these challenges through a transparent, component-based fee structure.

Four-Component Fee Structure

Every LayerZero transaction consists of four distinct cost elements:

1. Source Chain Transaction

The standard blockchain transaction fee paid to miners/validators on the source network for including your transaction in a block. This follows each chain's native fee mechanism (gas on Ethereum, compute units on Solana, etc.).

2. Security Stack Fees

Payment to your configured Decentralized Verifier Networks (DVNs) for verifying and attesting to your message. These fees:

  • Vary based on your security configuration (number and type of DVNs)
  • Scale with the complexity of verification required
  • Are split among your chosen verifier networks

3. Executor Fees

Compensation to Executors for delivering and executing your message on the destination chain. This covers:

  • Monitoring source chains for new messages
  • Submitting transactions on destination chains
  • Managing the operational infrastructure for reliable delivery

4. Destination Gas Purchase

The cost of purchasing destination chain gas tokens to fund your message execution. This is calculated by converting your specified gas amount from destination pricing to source chain tokens.

Cross-Chain Gas Conversion

Since you pay on the source chain but consume gas on the destination chain, LayerZero workers perform real-time conversion using market prices:

Source Chain Cost=gasUnits×dstGasPrice×dstTokenPricesrcTokenPrice\Large \text{Source Chain Cost} = \text{gasUnits} \times \text{dstGasPrice} \times \frac{\text{dstTokenPrice}}{\text{srcTokenPrice}}

Where:

  • gasUnits: Amount of gas needed on destination chain (e.g., 200,000)
  • dstGasPrice: Gas price on destination chain (e.g., 50 gwei)
  • dstTokenPrice: USD price of destination chain's native token (e.g., $3,000 for ETH)
  • srcTokenPrice: USD price of source chain's native token (e.g., $1.50 for MATIC)

The formula works in two steps:

  1. Calculate destination gas cost: gasUnits × dstGasPrice = cost in destination tokens
  2. Convert to source tokens: Multiply by the price ratio to get equivalent cost in source tokens

Example Scenario

Sending from Polygon (MATIC) to Ethereum (ETH):

  • gasUnits: 200,000 units
  • dstGasPriceWei: 50 gwei
  • dstTokenPrice: ETH = $3,000
  • srcTokenPrice: MATIC = $1.50

Calculation:

Step 1: Calculate gas cost on destination chain
200,000 gas units × 50 gwei = 10,000,000 gwei = 0.01 ETH

Step 2: Convert to source chain tokens using price ratio
0.01 ETH × ($3,000 ETH ÷ $1.50 MATIC) = 0.01 × 2,000 = 20 MATIC

This ensures you pay the correct amount in your source chain's currency to fund execution on any destination chain.

Dynamic Pricing Factors

Several factors influence the final transaction cost:

Chain-Specific Variations

  • Gas mechanisms differ across chains (Ethereum's EIP-1559, Arbitrum's L2 fees, Solana's compute units)
  • Network congestion affects base gas prices
  • Token price volatility impacts cross-chain conversion rates

Security Configuration Impact

  • More DVNs increase verification costs but enhance security
  • Premium DVN services may charge higher fees
  • Custom security thresholds affect overall pricing

Execution Requirements

  • Complex contract logic requires more destination gas
  • Composed messages need additional execution allowances
  • Message size affects processing costs

Fee Estimation and Quotes

LayerZero provides on-chain quote mechanisms that calculate exact fees before message submission:

Quote Components

  • Native fee: Cost in the source chain's native token
  • LZ token fee: Alternative payment option using LayerZero's utility token
  • Real-time pricing: Updates based on current gas prices and token values

Payment Flexibility

Applications can choose between:

  • Native token payment: Using the source chain's gas token (ETH, MATIC, AVAX, etc.)
  • LZ token payment: Using LayerZero's cross-chain utility token for consistent pricing

Gas Profiling Considerations

Destination gas requirements vary significantly based on your application logic:

Typical Gas Ranges

  • Simple token transfers: 60,000-80,000 gas
  • Complex DeFi interactions: 200,000-500,000 gas
  • Multi-step composed operations: 300,000+ gas

Optimization Strategies

  • Profile your contracts on each target chain to understand actual consumption
  • Include gas buffers to account for network-specific variations
  • Test execution paths thoroughly to avoid failed deliveries
  • Monitor gas costs across different chains and adjust allocations accordingly

Best Practices

For Developers

  • Design gas-efficient contracts to minimize destination execution costs
  • Implement proper fee estimation in your application interfaces
  • Consider chain-specific optimizations for frequently used pathways
  • Plan for gas price volatility in your economic models

For Users

  • Understand total cost breakdown before initiating transactions
  • Consider timing transactions during periods of lower network congestion
  • Monitor cross-chain fee patterns to optimize transaction scheduling
  • Plan gas allocations based on the complexity of your destination operations

Economic Alignment

LayerZero's pricing model creates proper economic incentives:

  • Security providers are compensated for verification services
  • Infrastructure operators earn fees for reliable message delivery
  • Gas efficiency is rewarded through lower total costs
  • Fair pricing ensures each pathway pays for its actual resource consumption

This transparent, component-based approach ensures that cross-chain messaging costs reflect the true value provided by each part of the LayerZero ecosystem while maintaining predictable pricing for applications and users.