Skip to content

⚑ Implement Real-Time WebSocket Gas Feed #63

@mijinummi

Description

@mijinummi

πŸ“Œ Overview

Decentralized applications (dApps) require real-time gas price and network data to optimize transactions and improve user experience. Polling APIs is inefficient and introduces latency.

This task introduces a Real-Time WebSocket Gas Feed to push live gas updates to subscribed clients instantly.


🎯 Objective

Build a system that:

  • Provides real-time gas updates via WebSocket
  • Supports subscription to specific chains and transaction types
  • Delivers low-latency updates for dApps and dashboards
  • Enables developers to react to network conditions immediately

πŸ›  Scope of Work

1️⃣ WebSocket Server

  • Implement a WebSocket server endpoint:
    wss://api.gasguard.com/realtime

  • Handle client connections with authentication via API key or JWT

  • Support multiple subscriptions per client (e.g., Ethereum, BSC, Polygon)

  • Manage connection lifecycle (connect, disconnect, reconnect)


2️⃣ Data Feed

  • Provide real-time gas metrics:
    • Base fee and priority fee per chain
    • Gas price trends and volatility
    • Optional: network congestion indicators
  • Push updates at configurable intervals (e.g., every 5–10 seconds)
  • Ensure data consistency and reliability across clients

Example payload:

{
  "chainId": 1,
  "timestamp": 1700000000,
  "gasBaseFee": "32",
  "gasPriorityFee": "2",
  "gasMax": "34",
  "networkStatus": "Normal"
}

Metadata

Metadata

Assignees

Labels

Nest.jsStellar WaveIssues in the Stellar wave programbackendNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions