LogoLogo
  • Start Here
    • Use Cases
    • Fees
    • Integrated DEXs
    • Submitting an Order
    • Available Tokens
    • Post-Order Analytics
    • Setting Up Notifications
    • Managing DeFi Strategies
    • Smart Order Router (SOR)
    • Terminology
  • Referrals
  • Order Types
    • Dexible's Order Types
      • Segmented Market
      • TWAP
      • Limit
      • Take Profit
      • Stop Loss
      • Trailing Stop
      • Stop Limit
  • DXBL
    • DXBL & Proof of Trade Litepaper
      • Proof of Trade
      • Minting Rate
      • Supply Mechanism
      • Burning $DXBL
      • DXBL Discount
      • Summary
    • DXBL Technical Paper
      • Smart Contract Architecture
      • Design Principles
      • Proxy Pattern
      • Change Process
      • Multisig Approach
      • Configuration
      • Community Vault Contract
      • Dexible Contract
      • DXBL Token Contract
      • Arbitrum Gas
    • DXBL FAQs
      • $DXBL Contract Addresses
      • $DXBL Questions
      • Protocol Mechanics
      • Trader Questions
      • Miscellaneous Questions
    • Terminology
    • Audit & Contract Addresses
  • Support
    • Changelog
    • How to Participate
    • FAQs
  • Miscellaneous
    • Dexible Press Kit
    • 🔗Resource Links
      • Blog
      • Help
      • Academy
    • 🔗Important Links
      • Terms Of Service
      • Privacy Policy
      • Dexible SDK
    • 🔗Community Links
      • Twitter
      • Telegram
      • Discord
      • Youtube
      • Medium
Powered by GitBook
On this page

Was this helpful?

  1. DXBL
  2. DXBL Technical Paper

Arbitrum Gas

PreviousDXBL Token ContractNextDXBL FAQs

Last updated 2 years ago

Was this helpful?

There is a special case when computing gas costs for the Arbitrum network. In Solidity, the normal mechanisms for computing the amount of gas usage do not yet accurately reflect an amount that accounts for the L1 batch gas fees. Future network upgrades are supposed to fix this, but as of writing, the gas usage cannot be estimated using only the gasleft solidity function.

To work around this issue, Dexible deployed an Arbitrum gas price oracle smart contract. This oracle uses the arbOs precompiles and a multiplier to determine the actual gas cost for a transaction. The math is pretty simple:

(u∗p2)+((m∗p1∗s)/1e18)(u*p2)+((m*p1*s)/1e18)(u∗p2)+((m∗p1∗s)/1e18)
  • u is the current L2 gas usage estimate (using gasleft() function)

  • p1 is the current L1 gas price from the arbOs precompiles

  • p2 is the L2 gas price for the transaction

  • m is the multiplier, expressed in 18 decimals

  • s is the size of the transaction's calldata

The multiplier can and likely will be adjusted according to historical gas estimations and especially if the network nodes start accurately reporting gas usage using gasleft() function. As of this writing, the multiplier is 2e17.

This whole thing is a stopgap to protect relays when submitting transactions for traders until nodes accurately report gas usage.