Skip to content

📊 Merchant Gas Spending Dashboard API #59

@mijinummi

Description

@mijinummi

📌 Overview

Businesses and merchants require visibility into their gas expenditures to monitor costs and optimize transaction strategies. Without structured reporting, tracking multi-chain spending is inefficient and error-prone.

This task introduces a Merchant Gas Spending Dashboard API that aggregates gas usage and provides detailed breakdowns per chain for actionable business insights.


🎯 Objective

Build an API that:

  • Aggregates gas spending for merchants on a monthly basis
  • Provides detailed breakdowns by chain and transaction type
  • Supports multi-chain and multi-wallet tracking
  • Enables reporting for financial planning and cost optimization

🛠 Scope of Work

1️⃣ Monthly Spending Aggregation

  • Collect historical gas usage for merchant wallets:
    • Base fee and priority fee per transaction
    • Gas used per transaction
    • Transaction timestamp
  • Aggregate data by month
  • Compute total gas cost in ETH / native token and USD equivalent

2️⃣ Chain-Level Breakdown

  • Provide per-chain gas spending summaries
  • Include metrics such as:
    • Number of transactions
    • Average gas per transaction
    • Total gas consumed
  • Optionally, include breakdown by transaction type (e.g., transfer, swap, contract call)

3️⃣ API Endpoints

Expose endpoints for merchant reporting:
GET /dashboard/gas-spending?merchantId=&month=
GET /dashboard/gas-spending/:merchantId/detail

Requirements:

  • Input validation (merchant ID, month format)
  • Multi-chain aggregation support
  • Pagination for detailed transaction views
  • JSON response structured for easy front-end visualization

Example response:

{
  "merchantId": "1234",
  "month": "2026-02",
  "totalGasETH": "12.45",
  "totalGasUSD": "4,980.50",
  "chains": [
    {
      "chainId": 1,
      "chainName": "Ethereum",
      "gasETH": "8.12",
      "gasUSD": "3,250.30",
      "transactions": 120
    },
    {
      "chainId": 56,
      "chainName": "BSC",
      "gasETH": "4.33",
      "gasUSD": "1,730.20",
      "transactions": 80
    }
  ]
}

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