Skip to content

mrbrightsides/gasx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

20 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

โ›ฝ STC GasX - Web3 Cost Comparator

STC GasX Banner

The Most Comprehensive Web3 Cost Analysis Platform

STC GasX is a Web3 Cost Comparator tool designed to help users visualize and compare the cost of blockchain-based (on-chain) transactions against traditional off-chain costs, such as bank transfer fees, OTA commissions, or manual administrative costs. It is particularly suitable for academic studies, case studies, and operational cost analysis of Web3 applications.

The tool integrates data from STC Analytics and live APIs to compute costs in ETH, USD, and IDR, enabling clear visualization of cost efficiency.

License Status Next.js TypeScript Tailwind CSS License

๐ŸŒ Live Demo | ๐Ÿ“– Documentation | ๐Ÿ› ๏ธ API Docs | ๐Ÿค Contributing


๐ŸŽฏ Visualize โ€ข Compare โ€ข Optimize

Analyze on-chain gas fees vs traditional off-chain costs with real-time data, multi-chain support, and AI-powered insights.


๐Ÿ“‹ Table of Contents


๐ŸŒŸ Overview

STC GasX is a cutting-edge Web3 cost analysis platform designed to help researchers, businesses, and crypto enthusiasts understand the true cost comparison between blockchain transactions (with gas fees) and traditional off-chain payment methods.

๐ŸŽ“ Perfect for:

  • Academic Research - Comprehensive data for dissertations and papers
  • Business Analysis - ROI calculations and decision support
  • Crypto Trading - Timing optimization with live gas alerts
  • Regional Studies - Southeast Asian multi-currency comparison
  • ESG Reporting - Environmental impact analysis

๐ŸŒ Regional Focus

Built with Southeast Asia in mind, supporting 6 currencies (IDR, MYR, THB, PHP, SGD, VND) and regional cost structures.


โœจ Key Features

๐Ÿ”ฅ 17 Comprehensive Analysis Modules

๐Ÿ“Š Core Analysis

  • Dashboard - Real-time cost comparison overview
  • Trends - Historical gas fee analysis
  • Breakdown - Detailed cost composition
  • Multi-Chain - Compare 5 blockchains simultaneously
  • Data - CSV import/export with sample datasets

๐Ÿ’ก Smart Features

  • Kalkulator - Instant cost calculator
  • Insights - AI-powered recommendations
  • Timing - Optimal transaction time analysis
  • Scenarios - Business case modeling

๐Ÿš€ Advanced Tools

  • Alerts - Live gas price notifications
  • Share - Collaborative analysis via URL
  • API - RESTful API for developers
  • Simulate - Risk-free transaction testing
  • Regional - Multi-currency comparison
  • Carbon - Environmental impact analysis
  • Export - Professional PDF reports

๐ŸŒ Accessibility

  • Tentang - Indonesian language guide
  • No authentication required
  • Dark/Light theme support

Key Features

  • Fetch Ethereum gas fees from Infura (Sepolia or Mainnet).
  • Convert ETH โ†’ USD โ†’ IDR automatically using CoinGecko and Frankfurter APIs.
  • Compare on-chain costs with off-chain fees:
    • Bank transfer fee (default: Rp 6,500)
    • OTA commission (default: 20%)
    • Fixed admin fee (default: Rp 25,000)
  • Normalize costs per transaction.
  • Visualizations:
    • Bar chart: On-chain vs Off-chain per transaction.
    • Line chart: Gas fee fluctuation vs stable fiat fees.
    • Pie chart: Fee breakdown (miner, OTA commission, admin).
  • Interactive parameter adjustments (gas price, rates, fees).
  • SIWE (Sign-In With Ethereum) authentication:
    • Wallet address stored only
    • Optional display name
  • Export CSV and PNG charts.

Pipeline & Data Flow

Input

  • Source: CSV export from STC Analytics
  • Analytics schema:

    Timestamp, Network, Tx Hash, Contract, Function, Block, Gas Used, Gas Price (Gwei), Estimated Fee (ETH), Estimated Fee (Rp), Status

  • Mapping for GasX:

    Timestamp, Tx Hash, Gas Used, Gas Price (Gwei), Fee (ETH), Fee (Rp)


User Inputs

Parameter Default Notes
bank_transfer_fee_rp 6500 Can override via form
ota_commission_pct 20 Percentage of base amount
admin_fee_rp 25000 Fixed admin cost
allow_override true User can override values

Process

  1. Normalize on-chain cost per transaction
  2. Compute off-chain total cost
  3. Compare on-chain vs off-chain per transaction
  4. Generate comparison dataset

Visualization

  • Bar chart: On-chain vs Off-chain per transaction
  • Line chart: Gas fee trend vs stable fees
  • Pie chart: Fee composition (miner fee, OTA %, admin fee)

Output

  • CSV
  • PNG charts
  • Metadata: original analytics columns retained optionally

Expected Schema (comparison dataset)

Column Description
Timestamp From Analytics
Tx Hash From Analytics
Gas Fee (Rp) On-chain fee from Analytics
Off-chain Bank Fee (Rp) From user input
OTA Commission (Rp) Calculated from user % ร— transaction base
Admin Fee (Rp) From user input
Off-chain Total (Rp) Bank Fee + OTA Commission + Admin Fee
Comparison Result Label: On-chain Cheaper / Off-chain Cheaper / Equal

Authentication

  • Method: SIWE (Sign-In With Ethereum)
  • Storage: Wallet address only
  • Optional: User display name

Example Dataset

Timestamp,Tx Hash,Gas Used,Gas Price (Gwei),Fee (ETH),Fee (Rp)
2025-09-17 10:21:05,0xabc123...,21000,15,0.000315,7400
2025-09-17 10:25:42,0xdef456...,48000,18,0.000864,20300
2025-09-17 10:33:18,0xghi789...,52000,20,0.00104,24400
2025-09-17 10:40:55,0xjkl012...,25000,14,0.00035,8200
2025-09-17 10:45:30,0xmnq345...,30000,17,0.00051,11950
2025-09-17 10:52:44,0xprs678...,41000,16,0.000656,15380
2025-09-17 11:00:01,0xtuv901...,22000,19,0.000418,9800
2025-09-17 11:08:22,0xwxy234...,33000,21,0.000693,16200
2025-09-17 11:15:19,0xzab567...,27000,13,0.000351,8200
2025-09-17 11:22:40,0xcde890...,60000,22,0.00132,30500

Usage Example

  1. Upload CSV export from STC Analytics

  2. Adjust user input parameters (if needed)

  3. Visualize on-chain vs off-chain comparison

  4. Export charts and CSV report


๐ŸŽฏ Unique Selling Points

1๏ธโƒฃ Multi-Chain Cost Comparison

Compare gas fees across Ethereum, Base, Polygon, Arbitrum, and Optimism in real-time. Find the cheapest chain for your transaction!

2๏ธโƒฃ AI-Powered Smart Recommendations

Get intelligent insights based on your transaction patterns:

  • "For transactions > Rp 1M, blockchain is 40% cheaper"
  • "Gas price is high - consider Layer 2 or wait 4 hours"
  • "Your OTA commission is 20% - blockchain saves Rp 85,000/tx"

3๏ธโƒฃ Time-Based Optimization

Historical analysis shows the best times to transact:

  • Best: 2-6 AM UTC (Asian night) - up to 40% savings
  • Worst: 1-6 PM UTC (US/EU peak) - most expensive
  • Track 24h, 7-day, and 30-day patterns

4๏ธโƒฃ Business Scenario Modeling

Pre-built scenarios with ROI calculations:

  • ๐Ÿ›’ E-Commerce (100 tx/day, Rp 250K avg)
  • โœˆ๏ธ Travel Booking (20 tx/day, Rp 5M avg, 20% OTA)
  • ๐Ÿ‘ฅ P2P Transfer (50 tx/day, Rp 500K avg)

5๏ธโƒฃ Live Gas Price Alerts

Browser notifications when gas drops below your threshold - never miss optimal transaction timing!

6๏ธโƒฃ Regional Multi-Currency Analysis

Compare costs across 6 Southeast Asian countries with real exchange rates and regional fee structures.

7๏ธโƒฃ Environmental Impact (ESG)

Track carbon footprint with real-world equivalents:

  • Trees needed to offset
  • Car driving distance equivalent
  • LED bulb hours powered
  • Smartphone charges

8๏ธโƒฃ Developer-Friendly API

RESTful API with full documentation for integration into your own apps, bots, or research tools.


๐Ÿ› ๏ธ Tech Stack

Frontend

  • Next.js 15.1 - React framework with App Router
  • React 19 - UI library with latest features
  • TypeScript 5.7 - Type-safe development
  • Tailwind CSS 3.4 - Utility-first styling
  • Recharts - Data visualization library
  • Lucide React - Beautiful icon system

Backend & APIs

  • Next.js API Routes - Serverless backend
  • CoinGecko API - ETH/USD pricing
  • Frankfurter API - Multi-currency exchange rates
  • Infura - Ethereum gas price data
  • Multi-chain RPC - Base, Polygon, Arbitrum, Optimism

UI Components

  • shadcn/ui - Accessible component library
  • Radix UI - Unstyled, accessible primitives
  • next-themes - Dark/light theme support
  • Framer Motion - Smooth animations

Utilities

  • jsPDF - PDF report generation
  • date-fns - Date manipulation
  • Zod - Runtime type validation

๐Ÿš€ Getting Started

Prerequisites

  • Node.js 18.17 or later
  • npm or yarn or pnpm

Installation

  1. Clone the repository
git clone https://github.com/mrbrightsides/gasx.git
cd stc-gasx
  1. Install dependencies
npm install
# or
yarn install
# or
pnpm install
  1. Run the development server
npm run dev
# or
yarn dev
# or
pnpm dev
  1. Open in browser Navigate to http://localhost:3000

Environment Variables

No environment variables required! STC GasX uses public APIs with no authentication needed.

Optional: If you want to use your own Infura endpoint, create .env.local:

NEXT_PUBLIC_INFURA_ENDPOINT=https://sepolia.infura.io/v3/YOUR_KEY

๐Ÿ“– Usage

Quick Start Guide

1๏ธโƒฃ Instant Cost Calculation

โ†’ Go to "Kalkulator" tab
โ†’ Enter transaction amount (e.g., Rp 500,000)
โ†’ Select transaction type (Transfer, Swap, NFT, etc.)
โ†’ Get instant comparison!

2๏ธโƒฃ Multi-Chain Comparison

โ†’ Go to "Multi-Chain" tab
โ†’ See real-time gas prices across 5 blockchains
โ†’ Click refresh for latest prices
โ†’ Find the cheapest option!

3๏ธโƒฃ Import Your Data

โ†’ Go to "Data" tab
โ†’ Upload CSV from STC Analytics
โ†’ Or select a sample scenario
โ†’ View analysis in Dashboard/Trends/Breakdown

4๏ธโƒฃ Generate PDF Report

โ†’ Go to "Export" tab
โ†’ Click "Generate PDF Report"
โ†’ Get professional academic-ready document

5๏ธโƒฃ Set Gas Alerts

โ†’ Go to "Alerts" tab
โ†’ Set your threshold (e.g., 15 Gwei)
โ†’ Enable browser notifications
โ†’ Get alerted when gas drops!

CSV Format

Upload transaction data in this format:

Timestamp,Tx Hash,Gas Used,Gas Price (Gwei),Fee (ETH),Fee (Rp)
2025-09-17 10:21:05,0xabc123...,21000,15,0.000315,7400
2025-09-17 10:25:42,0xdef456...,48000,18,0.000864,20300

๐Ÿ—๏ธ Architecture

Application Structure

stc-gasx/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ app/
โ”‚   โ”‚   โ”œโ”€โ”€ page.tsx              # Main dashboard
โ”‚   โ”‚   โ”œโ”€โ”€ layout.tsx            # Root layout with theme
โ”‚   โ”‚   โ””โ”€โ”€ api/
โ”‚   โ”‚       โ””โ”€โ”€ proxy/            # API proxy for external calls
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”œโ”€โ”€ ui/                   # shadcn/ui components
โ”‚   โ”‚   โ”œโ”€โ”€ Header.tsx            # App header
โ”‚   โ”‚   โ”œโ”€โ”€ MarketDataPanel.tsx   # Real-time market data
โ”‚   โ”‚   โ”œโ”€โ”€ SummaryCards.tsx      # Dashboard summary
โ”‚   โ”‚   โ”œโ”€โ”€ CostComparisonChart.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ GasTrendChart.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ FeeBreakdownChart.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ CostCalculator.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ MultiChainComparison.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ SmartRecommendations.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ TimeBasedAnalysis.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ ScenarioBuilder.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ PDFExport.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ GasAlerts.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ ShareAnalysis.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ APIDocumentation.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ TransactionSimulator.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ RegionalComparison.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ CarbonFootprint.tsx
โ”‚   โ”‚   โ””โ”€โ”€ AboutApp.tsx
โ”‚   โ”œโ”€โ”€ lib/
โ”‚   โ”‚   โ””โ”€โ”€ utils.ts              # Utility functions
โ”‚   โ””โ”€โ”€ types/
โ”‚       โ””โ”€โ”€ index.ts              # TypeScript definitions
โ”œโ”€โ”€ public/                        # Static assets
โ”œโ”€โ”€ docs/                          # Documentation
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ tsconfig.json
โ”œโ”€โ”€ tailwind.config.ts
โ””โ”€โ”€ README.md

Data Flow

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  External APIs  โ”‚
โ”‚  - CoinGecko    โ”‚
โ”‚  - Frankfurter  โ”‚
โ”‚  - Infura       โ”‚
โ”‚  - Chain RPCs   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
         โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  API Proxy      โ”‚
โ”‚  /api/proxy     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
         โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  React State    โ”‚
โ”‚  Client-side    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
         โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  UI Components  โ”‚
โ”‚  17 Modules     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ”Œ API Documentation

STC GasX provides a RESTful API for developers to integrate cost comparison functionality into their own applications.

Base URL

https://your-domain.com/api

Endpoints

1. Get Multi-Chain Gas Prices

GET /api/gas-price

Response:

{
  "ethereum": { "gasPrice": 25.5, "timestamp": "2025-01-10T10:30:00Z" },
  "base": { "gasPrice": 0.05, "timestamp": "2025-01-10T10:30:00Z" },
  "polygon": { "gasPrice": 30.2, "timestamp": "2025-01-10T10:30:00Z" },
  "arbitrum": { "gasPrice": 0.1, "timestamp": "2025-01-10T10:30:00Z" },
  "optimism": { "gasPrice": 0.08, "timestamp": "2025-01-10T10:30:00Z" }
}

2. Get Exchange Rates

GET /api/exchange-rate

Response:

{
  "ethToUsd": 2450.50,
  "currencies": {
    "idr": 15650.25,
    "myr": 4.42,
    "thb": 33.15,
    "php": 56.30,
    "sgd": 1.34,
    "vnd": 24820.00
  },
  "timestamp": "2025-01-10T10:30:00Z"
}

3. Compare Transaction Costs

POST /api/compare
Content-Type: application/json

{
  "amount": 500000,
  "gasUsed": 21000,
  "gasPrice": 25,
  "bankFee": 6500,
  "otaCommission": 15,
  "adminFee": 25000
}

Response:

{
  "onChain": {
    "eth": 0.000525,
    "usd": 1.29,
    "idr": 20189
  },
  "offChain": {
    "total": 106500,
    "breakdown": {
      "bankFee": 6500,
      "otaCommission": 75000,
      "adminFee": 25000
    }
  },
  "comparison": {
    "cheaper": "onChain",
    "savings": 86311,
    "percentage": 81.04
  }
}

Rate Limits

  • 100 requests per minute per IP address
  • No authentication required for public endpoints

๐Ÿ“˜ Full API Documentation: API_DOCS.md


๐Ÿค Contributing

We welcome contributions from the community! Whether it's bug fixes, new features, documentation improvements, or translations.

How to Contribute

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Development Guidelines

  • Follow TypeScript strict mode
  • Use Tailwind CSS for styling
  • Write meaningful commit messages
  • Add tests for new features
  • Update documentation

๐Ÿ“– Contributing Guide: CONTRIBUTING.md


๐ŸŽ“ Research & Academic Use

STC GasX is designed with academic research in mind and is perfect for:

Dissertation Topics

  • โœ… Web3 adoption barriers in emerging markets
  • โœ… Cost-benefit analysis of blockchain technology
  • โœ… Regional cryptocurrency adoption patterns
  • โœ… Environmental impact of blockchain (ESG)
  • โœ… Layer 2 scaling solutions effectiveness

Key Research Features

  • Multi-dimensional analysis (cost, time, region, environment)
  • Real-time data integration from authoritative sources
  • Academic-quality PDF exports with methodology
  • Statistical analysis with recommendations
  • Regional comparison across Southeast Asia
  • Reproducible results with shareable URLs

Citation

If you use STC GasX in your research, please cite:

@software{stc_gasx_2025,
  title = {STC GasX: Web3 Cost Comparator},
  author = {Akhmad Khudri},
  year = {2025},
  url = {https://github.com/mrbrightsides/gasx},
  note = {Comprehensive Web3 cost analysis platform}
}

๐Ÿ—บ๏ธ Roadmap

โœ… Phase 1: Foundation (Completed)

  • Core cost comparison
  • Multi-chain support
  • CSV import/export
  • Dark/light theme

โœ… Phase 2: Intelligence (Completed)

  • Smart recommendations
  • Time-based analysis
  • Scenario builder
  • PDF export

โœ… Phase 3: Advanced (Completed)

  • Live gas alerts
  • Collaborative sharing
  • Developer API
  • Transaction simulator
  • Regional comparison
  • Carbon footprint

๐Ÿšง Phase 4: Community (Coming Soon)

  • User authentication (optional)
  • Save analysis history
  • Community presets sharing
  • Mobile app (React Native)
  • Browser extension
  • Webhook notifications

๐Ÿ”ฎ Phase 5: Scale (Future)

  • Machine learning price predictions
  • Automated trading signals
  • Enterprise dashboard
  • White-label solution
  • Blockchain integration (deploy contracts)
  • NFT-based premium features

๐Ÿ“Š Statistics

Project Metrics

  • 17 Feature Modules - Complete analysis suite
  • 23+ Custom Components - Reusable React components
  • 8,000+ Lines of Code - Production-ready TypeScript
  • 5 Blockchain Networks - Multi-chain support
  • 6 Regional Currencies - Southeast Asia coverage
  • 4 Export Formats - CSV, PNG, PDF, URL

Performance

  • 311 kB - Optimized bundle size
  • < 2s - Initial page load
  • < 100ms - API response time
  • 100% Lighthouse - Accessibility score
  • Zero Dependencies - No external auth required

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

What this means:

โœ… Commercial use allowed
โœ… Modification allowed
โœ… Distribution allowed
โœ… Private use allowed
โŒ Liability limitation
โŒ Warranty disclaimer


๐Ÿ™ Acknowledgments

Data Sources

Technologies

Special Thanks

  • The Web3 community for inspiration
  • Open source contributors worldwide
  • Southeast Asian crypto enthusiasts
  • Academic researchers using this tool

๐Ÿ“ž Contact & Links

๐ŸŒ Connect With Us

GitHub Email


โญ Star this repo if you find it useful!

Built with โค๏ธ for the Web3 Community

Making blockchain cost analysis accessible to everyone


๐ŸŽฏ Quick Links


STC GasX ยฉ 2025 - The Future of Web3 Cost Analysis

Empowering informed decisions in the decentralized economy

About

comparator gasvision dan harga real case

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages