Files
smom-dbis-138/docs/guides/CONSERVATIVE_GAS_PRICE_METHODOLOGY.md
defiQUG 1fb7266469 Add Oracle Aggregator and CCIP Integration
- Introduced Aggregator.sol for Chainlink-compatible oracle functionality, including round-based updates and access control.
- Added OracleWithCCIP.sol to extend Aggregator with CCIP cross-chain messaging capabilities.
- Created .gitmodules to include OpenZeppelin contracts as a submodule.
- Developed a comprehensive deployment guide in NEXT_STEPS_COMPLETE_GUIDE.md for Phase 2 and smart contract deployment.
- Implemented Vite configuration for the orchestration portal, supporting both Vue and React frameworks.
- Added server-side logic for the Multi-Cloud Orchestration Portal, including API endpoints for environment management and monitoring.
- Created scripts for resource import and usage validation across non-US regions.
- Added tests for CCIP error handling and integration to ensure robust functionality.
- Included various new files and directories for the orchestration portal and deployment scripts.
2025-12-12 14:57:48 -08:00

65 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Conservative Gas Price Methodology
## Overview
All deployment cost estimates use a **conservative approach** that ensures sufficient funds are available even during gas price fluctuations.
## Method: 2.5x Highest Price
The system:
1. Fetches gas prices from **MetaMask** (via ETHEREUM_MAINNET_RPC)
2. Fetches gas prices from **Etherscan** (via ETHERSCAN_API_KEY)
3. Compares both and selects the **highest**
4. Applies a **2.5x multiplier** for safety margin
## Formula
```
Conservative Gas Price = MAX(MetaMask Gas, Etherscan Gas) × 2.5
```
## Example
If:
- MetaMask reports: 0.10 gwei
- Etherscan reports: 0.097 gwei
- Highest: 0.10 gwei
- Conservative: 0.10 × 2.5 = **0.25 gwei**
## Fallback
If no gas prices can be retrieved from either source, the system uses **2.5 gwei** as a fallback.
## Benefits
1. **Safety Margin**: 2.5x multiplier accounts for gas price spikes
2. **Multiple Sources**: Uses both MetaMask and Etherscan for accuracy
3. **Dynamic Cap**: Adapts to current market conditions
4. **Realistic Estimates**: Uses actual market prices as baseline
## Usage
```bash
# Get conservative gas price (2.5x highest)
./scripts/deployment/get-conservative-gas-price.sh
# Calculate costs with conservative estimates
./scripts/deployment/calculate-conservative-costs.sh
# Update all documentation
./scripts/deployment/update-all-cost-estimates.sh
```
## API Keys Required
- `ETHERSCAN_API_KEY` - For Etherscan Gas API v2
- `ETHEREUM_MAINNET_RPC` - For MetaMask gas price (Infura endpoint)
## Notes
- Conservative estimates may be higher than actual costs
- This ensures sufficient funds are always available
- Actual deployment costs may be 20-40% lower than conservative estimates
- The 2.5x multiplier provides a safety buffer for unexpected gas spikes
- System adapts to current market conditions (not a fixed cap)