Skip to content

KyneSoftware/validator-costs

Repository files navigation

Ethereum Validator Cost Calculator

A modern Gatsby application built with TypeScript, React, and Tailwind CSS that compares the costs of running your own Ethereum validator versus delegating to staking pools, with real-time data integration.

Features

Real-Time Data Integration

  • ETH Price: Live prices from CoinGecko API with 2-minute caching
  • Staking APR: Derived from live Beaconcha.in staking data using the protocol's issuance curve (annual issuance ≈ 166.32 × √staked ETH), 5-minute caching. When the API is unreachable, defaults assume 40M ETH staked (~2.63% APR)
  • Automatic Refresh: Manual refresh button for latest data

Shared Scenario Settings

  • Stake amount (32 ETH minimum, up to 2,048 ETH per validator since Pectra)
  • ETH price and gross APR, auto-filled from live data and freely overridable
  • Income tax rate (default 30%, set 0 to disable): solo rewards are income at receipt, taxed on the full gross amount with costs not deductible. LST rewards accrue in the token's value — capital gains realized only on sale, which are excluded on both sides. A structural solo-staker headwind. Not tax advice.
  • Both scenarios always use the same stake/price/APR/tax, so the comparison is fair

Solo Validator Calculator

  • Hardware cost analysis ($1,000-$2,000, incl. spares and parts)
  • Annual operating expenses:
    • Electricity costs (based on 30W power consumption)
    • Internet connectivity costs
    • Hardware depreciation (4-year lifespan)
    • Time investment valuation
  • Effective "fee": costs as a % of gross rewards, color-coded against the selected platform's fee
  • Net annual returns (after tax), net APR, and ROI

Delegation/Staking Pool Calculator

  • Support for multiple platforms:
    • Lido (10% fee)
    • Rocket Pool (14% commission)
    • Stakely (4% fee)
    • Coinbase (25% fee)
    • Kraken (15% fee)
  • Net APR after platform fees
  • Liquidity token information

Snail Issuance Simulation

  • Models a proposed issuance-reduction policy: issuance capped at 0.5% of total ETH supply, tapering along a snail-shaped curve to zero at 50% of supply staked
  • Interactive chart comparing staking APR under the current vs. proposed policy
  • Shows the profitability impact on both solo staking and delegation

Comprehensive Analysis

  • Break-Even Analysis: Calculate when solo staking becomes more profitable
  • 10-Year Projection: Visual chart showing cumulative returns
  • Side-by-Side Comparison: Detailed cost breakdown comparison
  • Intelligent Recommendations: Context-aware suggestions based on your inputs

Design

  • Obol Branding: Professional design using official Obol brand colors
  • Dark Mode: Automatic dark mode support with manual toggle
  • Responsive: Mobile-first design with Tailwind CSS
  • Accessible: WCAG-compliant UI components

Technology Stack

  • Framework: Gatsby 5 (Static Site Generation)
  • Language: TypeScript
  • UI Library: React 18
  • Styling: Tailwind CSS with custom Obol theme
  • Font: DM Sans (Obol's official font)
  • APIs:
    • CoinGecko API (ETH price)
    • Beaconcha.in API (staking APR)

Project Structure

validatorcosts/
├── src/
│   ├── components/
│   │   ├── Layout.tsx
│   │   ├── DataBanner.tsx
│   │   ├── InputGroup.tsx
│   │   ├── SoloValidatorInputs.tsx
│   │   ├── DelegationInputs.tsx
│   │   ├── ResultsComparison.tsx
│   │   ├── BreakEvenAnalysis.tsx
│   │   └── PlatformComparison.tsx
│   ├── pages/
│   │   └── index.tsx
│   ├── services/
│   │   ├── calculatorService.ts
│   │   ├── coinGeckoService.ts
│   │   └── beaconchainService.ts
│   ├── types/
│   │   └── calculator.ts
│   └── styles/
│       └── global.css
├── gatsby-config.ts
├── gatsby-browser.tsx
├── gatsby-ssr.tsx
├── tailwind.config.js
├── postcss.config.js
└── tsconfig.json

Getting Started

Prerequisites

  • Node.js 18+ or Node.js 20+
  • npm or yarn

Installation

# Install dependencies
npm install

# Start development server
npm run develop

# Navigate to http://localhost:8000

Development Commands

# Start development server
npm run develop

# Build for production
npm run build

# Serve production build locally
npm run serve

# Clean cache and build artifacts
npm run clean

# Type check
npm run type-check

Default Values

The calculator comes pre-configured with updated default values:

  • Internet Cost: $10/month (updated from $50)
  • Setup Time: 4 hours (updated from 12 hours)
  • Monthly Maintenance: 1 hour (updated from 3 hours)
  • Hardware Cost: $1,500
  • Electricity Rate: $0.18/kWh
  • Hourly Rate: $50

Deployment

Static Hosting (Vercel, Netlify, GitHub Pages)

  1. Build the project:
npm run build
  1. Deploy the public/ folder to your hosting provider

Vercel (Recommended)

# Install Vercel CLI
npm i -g vercel

# Deploy
vercel

Netlify

# Install Netlify CLI
npm i -g netlify-cli

# Deploy
netlify deploy --prod

Customization

Update Brand Colors

Edit tailwind.config.js to customize the color scheme:

theme: {
  extend: {
    colors: {
      obol: {
        green: '#2FE4AB',
        purple: '#9167E4',
        // ... other colors
      }
    }
  }
}

Update Default Values

Edit src/pages/index.tsx to change default calculator parameters:

const [soloParams, setSoloParams] = useState<SoloValidatorParams>({
  hardwareCost: 1500,
  internetCost: 10,
  setupTime: 4,
  // ... other params
});

Add More Platforms

Edit src/services/calculatorService.ts to add more staking platforms:

export function getStakingPlatforms(): StakingPlatform[] {
  return [
    // ... existing platforms
    {
      name: 'New Platform',
      feePercentage: 5,
      minimumStake: 0.01,
      hasLiquidityToken: true,
      liquidityTokenName: 'nETH',
      description: 'Description here',
    },
  ];
}

Browser Compatibility

  • Chrome/Edge 90+
  • Firefox 88+
  • Safari 14+
  • Mobile browsers (iOS Safari, Chrome Mobile)

Performance

  • Bundle Size: ~200KB (gzipped)
  • Time to Interactive: <2 seconds on 4G
  • Lighthouse Score: 95+ (Performance, Accessibility, Best Practices, SEO)
  • API Response: <500ms average

License

MIT License - Open source and available for educational purposes.

Disclaimer

This calculator is for educational and informational purposes only. It provides estimates based on current market data and typical scenarios. Actual costs and returns may vary significantly based on:

  • ETH price volatility
  • Network conditions and staking APR changes
  • Hardware prices and availability
  • Local electricity and internet costs
  • Individual technical expertise and time investment
  • Platform fee changes
  • Regulatory changes

Always conduct thorough research and consider consulting with financial advisors before making staking decisions.

Contributing

Contributions are welcome! Areas for improvement:

  • Additional staking platforms
  • More accurate cost models
  • UI/UX enhancements
  • Performance optimizations
  • Localization/translations

Support

For issues, questions, or suggestions:

  • Review the FAQ section in the application
  • Check the EthStaker community
  • Consult official Ethereum staking documentation

Built with ❤️ for the Ethereum community Powered by Obol Network

About

A vibecoded site to show the economics of solo staking your Ether versus delegation.

Resources

License

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors