Lumia - The RWA Chain
  • What is Lumia Chain?
  • Polygon
    • CDK
    • AggLayer
    • Miden
    • Passport
  • ⛓️Lumia
    • Architecture
    • Roadmap
    • LUMIA Token
      • Token Swap Guide (UI)
      • Token Swap Guide (SmartContract)
    • 普通话 - LUMIA 代币
    • rwaUSD
    • HyperNodes
    • zkProvers
      • zkProver Network (zkN) via Gevolut
    • Sequencer
      • Decentralised Sequencer Network (DCN)
    • Data Availability
      • Validium
      • Volition (Enhanced Validium)
      • What is Avail DA?
        • How does AvailDA Scale?
        • Benefits of AvailDA
      • Lumia DA - Lightclient Nodes
    • Lumia Stream
      • Node Owned Liquidity
      • Liquidity Restaking
    • Interoperability
      • Polygon AggLayer
      • HyperLane
    • KYC
    • Chain & Account Abstraction with Intents
      • Particle Connect on Lumia
    • Real World Assets (RWA) on Lumia
  • 🛠️Build
    • Introduction
      • Accounts and Wallets
      • Setup Metamask with Lumia Chain
      • Bridge to/ from Lumia L2
      • Setup FoxWallet with Lumia Chain
    • Explorers
    • Build Environment
      • RPC
        • RPC Guide
      • Add Lumia Network to MetaMask
      • Testnet Tokens
    • SmartContracts
      • Deployment
        • Hardhat
        • Truffle
      • Verify
        • Hardhat
        • Truffle
      • Interact
      • Relay
      • Web3 Functions
    • On-Chain KYC
    • Oracles
      • API3
      • Supra
      • Commodity Prices
    • Indexers
      • Indexing with TheGraph
      • Indexing with Goldsky
    • zkNode
      • Run Local Validium Node
      • Run an RPC
        • JSON RPC Endpoints
      • Gas Fees
    • DA Lightclient
    • CDK Repos
    • rwaUSD
      • rwaUSD: Overcollateralizing
      • rwaUSD: Bridging
    • FAQs
Powered by GitBook
On this page

Was this helpful?

  1. Build
  2. zkNode

Gas Fees

In Lumia L2, the gas fee is calculated by applying a fixed factor over the L1 gas fee. This price factor is a fixed value that doesn't change often, and its value is based on the rollup's cost to publish transactions to L1. In simple terms, gas prices in L2 will linearly follow gas prices in L1.

The formula for calculating the L2 gas fee is as follows:

𝐿2𝑔𝑎𝑠𝑓𝑒𝑒=𝐿1𝑔𝑎𝑠𝑓𝑒𝑒∗𝐹𝑎𝑐𝑡𝑜𝑟𝐿2{𝑔𝑎𝑠_𝑓𝑒𝑒} = 𝐿1{𝑔𝑎𝑠_𝑓𝑒𝑒} ∗ 𝐹𝑎𝑐𝑡𝑜𝑟L2gasf​ee=L1gasf​ee∗Factor

where:

  • 𝐿2{𝑔𝑎𝑠_𝑓𝑒𝑒} represents the gas fee on Lumia L2

  • 𝐿1{𝑔𝑎𝑠_𝑓𝑒𝑒} represents the gas fee on the Ethereum L1

  • 𝐹𝑎𝑐𝑡𝑜𝑟 is the fixed value that determines the relationship between L1 and L2 gas fees

The L1 fee will vary depending on the number of transactions on the L1 network. If the timing of your transaction is flexible, you can save costs by submitting transactions during periods of lower gas on the L1 (for example, over the weekend).

In the future, Lumia L2 plans to support a congestion mechanism based on EIP-1559, which will make the L2 gas fee dynamic and more responsive to network conditions.

Fetching Gas Price from Lumia L2 RPC Node

To fetch the current gas price on Lumia L2, you can make the following RPC call to the Lumia L2 Sequencer:

curl https://mainnet-rpc.lumia.org \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"method":"eth_gasPrice","params":[],"id":1,"jsonrpc":"2.0"}'

The result of this RPC call will be the hex value of the gas price in wei.

By understanding the relationship between L1 and L2 gas fees and utilizing the provided RPC call, developers and users can make informed decisions about transaction costs and optimize their interactions with the Lumia L2 network.

PreviousJSON RPC EndpointsNextDA Lightclient

Last updated 7 months ago

Was this helpful?

🛠️