← Back to all products

Rollup Economics Sim

$10

Simulate rollup economics — sequencer revenue, DA costs, gas fees, and break-even analysis.

📁 10 files
YAMLTOMLPythonMarkdown

📁 File Structure 10 files

rollup-economics-sim/ ├── README.md ├── config/ │ └── default.yaml ├── pyproject.toml ├── security-notes.md ├── src/ │ └── rollup_economics_sim/ │ ├── __init__.py │ ├── cli.py │ ├── models.py │ ├── simulator.py │ └── visualize.py └── tests/ └── test_simulator.py

📖 Documentation Preview README excerpt

Rollup Economics Sim

Economic simulator for rollup fee markets, sequencer profitability, and break-even analysis.

Price: $9.99 | License: MIT | Category: Tooling | Python: >=3.10


Overview

rollup-economics-sim is a Python simulation toolkit for modeling rollup economics before you deploy. It covers L1 data availability costs, L2 fee market dynamics, sequencer revenue, and profitability under varying traffic and gas price scenarios. Run Monte Carlo simulations to stress-test your fee model or use the break-even calculator to find your minimum viable transaction volume.

Built for rollup teams in the design phase who need to answer: "Will this chain be profitable?"

Features

  • Profitability modeling — Project net revenue as a function of transaction volume, L1 gas prices, and L2 fee parameters
  • L1 cost simulation — Model batch posting costs with configurable blob/calldata mix, batch frequency, and compression
  • L2 fee market modeling — Simulate EIP-1559-style fee markets with base fee dynamics and priority fees
  • Monte Carlo scenarios — Run thousands of randomized scenarios to build confidence intervals around profitability
  • Break-even calculator — Find minimum TPS, average gas price, or batch frequency needed to cover L1 costs
  • Rich terminal reports — Color-coded tables, charts, and summary statistics in your terminal
  • YAML-driven scenarios — Define simulation parameters in config files for reproducibility

Tech Stack

ComponentTechnology
CorePython 3.10+
Numericsnumpy, pandas
Visualizationmatplotlib, rich
ConfigurationYAML, pydantic

Quick Start

Prerequisites

  • Python 3.10+

Install


pip install -e .

# With dev dependencies
pip install -e ".[dev]"

Usage


# Run default profitability simulation
rollup-sim run --config config/default.yaml

# Monte Carlo analysis (1000 scenarios)
rollup-sim monte-carlo --config config/default.yaml --runs 1000

# Break-even calculator
rollup-sim break-even --l1-gas-price 25 --batch-frequency 300


*... continues with setup instructions, usage examples, and more.*

📄 Code Sample .py preview

src/rollup_economics_sim/cli.py # ═══════════════════════════════════════════════════════════════════════════════ # CryptoForge Rollup Kit — Rollup Economics CLI # ═══════════════════════════════════════════════════════════════════════════════ """Command-line interface for the rollup economics simulator.""" from __future__ import annotations from pathlib import Path from typing import Optional import typer import yaml from rich.console import Console from rich.table import Table from rich.panel import Panel from rollup_economics_sim.models import RollupConfig, GasConfig from rollup_economics_sim.simulator import EconomicsSimulator app = typer.Typer( name="rollup-sim", help="Simulate rollup economics: revenue, costs, and profitability", ) console = Console() def _load_config(config_path: Optional[Path]) -> RollupConfig: """Load configuration from YAML file or use defaults.""" if config_path and config_path.exists(): with open(config_path) as f: data = yaml.safe_load(f) gas_data = data.pop("gas_config", {}) gas_config = GasConfig(**gas_data) return RollupConfig(**data, gas_config=gas_config) return RollupConfig() @app.command() def simulate( days: int = typer.Option(30, "--days", "-d", help="Number of days to simulate"), tps: float = typer.Option(50.0, "--tps", "-t", help="Transactions per second"), eth_price: float = typer.Option(3200.0, "--eth-price", help="ETH price in USD"), l1_gas: float = typer.Option(30.0, "--l1-gas", help="L1 gas price in Gwei"), blob_gas: float = typer.Option(1.0, "--blob-gas", help="Blob gas price in Gwei"), use_blobs: bool = typer.Option(True, "--blobs/--no-blobs", help="Use EIP-4844 blobs"), config_file: Optional[Path] = typer.Option(None, "--config", "-c", help="YAML config file"), output: Optional[Path] = typer.Option(None, "--output", "-o", help="Save results to CSV"), # ... 157 more lines ...
Buy Now — $10 Back to Products