# Real-Time Deployment Cost Estimates

## Overview

This document provides **real-time, accurate** deployment cost estimates using gas prices from configured APIs in `.env`.

## Current Real-Time Estimate

**Last Updated**: $(date -u +"%Y-%m-%d %H:%M:%S UTC")

Run the following to get the latest estimate:
```bash
./scripts/deployment/calculate-accurate-costs.sh
```

## Gas Price Sources

The system uses the following sources (in order of preference):

1. **ETHEREUM_MAINNET_RPC** - Direct RPC call to Infura Mainnet endpoint
2. **INFURA_GAS_API** - Infura Gas API for suggested gas fees
3. **Default RPC** - Fallback to public RPC endpoint

## Cost Breakdown

### Current Market Conditions

**⚠️ Important**: Current gas prices (~0.08-0.09 gwei) are **extremely low** and unusual. Normal market conditions range from 30-100 gwei.

### At Current Gas Price (~0.08 gwei)

| Item | Gas | Cost (ETH) | Cost (USD) |
|------|-----|------------|------------|
| CCIPWETH9Bridge | 263,000 | ~0.000021 ETH | ~$0.05 |
| CCIPWETH10Bridge | 263,000 | ~0.000021 ETH | ~$0.05 |
| Configuration | 200,000 | ~0.000016 ETH | ~$0.04 |
| **Total** | **726,000** | **~0.00006 ETH** | **~$0.15** |

### At Normal Gas Prices (30-50 gwei)

| Gas Price | Total Cost (ETH) | Total Cost (USD) |
|-----------|------------------|------------------|
| 30 gwei | ~0.02178 ETH | ~$54.46 |
| 50 gwei | ~0.0363 ETH | ~$90.75 |
| 100 gwei | ~0.0726 ETH | ~$181.50 |

## Recommendations

1. **Use Real-Time Estimates**: Run `./scripts/deployment/calculate-accurate-costs.sh` before deployment
2. **Plan for Normal Conditions**: Budget for 30-50 gwei (not current ultra-low prices)
3. **Monitor Gas Prices**: Check gas prices before deploying
4. **Deploy During Low Activity**: Weekends/off-peak hours typically have lower gas

## Scripts

- `./scripts/deployment/get-accurate-gas-price.sh` - Get current gas price
- `./scripts/deployment/calculate-accurate-costs.sh` - Calculate costs with real-time data
- `./scripts/deployment/finalize-cost-estimates.sh` - Update all documentation

## Notes

- Current estimates use real-time data from `.env` configured APIs
- Gas prices fluctuate significantly - always check before deployment
- Current ultra-low prices (~0.08 gwei) are not sustainable
- Plan for normal market conditions (30-50 gwei) for budgeting
