Skip to content

[CORE] Implement Real-Time Gas & Fee Delta Estimation Engine #588

Description

@mijinummi

Labels: core, high-difficulty, math, evm, soroban
Difficulty: High
Module: libs/gas-evaluator/


🧠 Concept

Construct an execution model that calculates exact gas/fee differences ($\Delta \text{Gas}$) in USD and native gas tokens ($XLM, ETH$) based on identified optimization rules.

⚠️ Problem

Developers often ask: "How much money will fixing this actually save?" Providing precise estimated monetary savings makes audit reports actionable for team decision-makers.

📁 Implementation Scope

  • libs/gas-evaluator/src/evm-opcode-calculator.ts
  • libs/gas-evaluator/src/soroban-resource-calculator.ts
  • libs/gas-evaluator/src/gas-delta-evaluator.ts

🛠️ Requirements

  1. Map Solidity optimization rules to EVM opcode differential tables (e.g., SLOAD [100-2100 gas] vs MWRITE [3 gas]).
  2. Map Soroban rules to Stellar CPU instruction and Ledger read/write byte resource cost schedules.
  3. Fetch real-time token pricing ($ETH, XLM$) via cached pricing service to render estimated annual gas cost savings based on historical contract execution volume.

🎯 Acceptance Criteria

  • Evaluates $\Delta \text{Gas}$ and outputs accurate cost reductions in USD and native token amounts.
  • Supports current 2026 fee schedules for Stellar mainnet and EVM Layer 2 networks.
  • Unit tests verify formula calculations against known manual gas benchmarks.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions