Skip to content

Fee oracle: EIP-1559 suggestions from feeHistory + L2 gas oracles #71

Description

@koko1123

Motivation

Wallet auto-fills gas naively (eth_gasPrice / eth_maxPriorityFeePerGas). Real senders want percentile-based EIP-1559 suggestions, and L2 users need the L1 data fee (OP Stack GasPriceOracle, Arbitrum ArbGasInfo) or their cost estimates are simply wrong.

Scope

New src/fee_oracle.zig:

  • suggestFees(provider, speed: enum{slow, standard, fast}) !{max_fee, max_priority} from eth_feeHistory reward percentiles + next-base-fee projection
  • OP Stack: getL1Fee(tx_bytes) via the predeploy at 0x420...0F
  • Arbitrum: ArbGasInfo.getPricesInWei at 0x6c
  • Wire into Wallet as an opt-in

Pointers

provider.feeHistory already exists; chain registry (chains/) knows which L2 is which; predeploy calls go through contract.zig.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is neededl2L2 chain support

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions