Skip to content

Feat: add GET /auth/pool-stats/aggregate endpoint#9

Open
mukama wants to merge 4 commits intotetherto:developfrom
mukama:feat/pool-stats-aggregate
Open

Feat: add GET /auth/pool-stats/aggregate endpoint#9
mukama wants to merge 4 commits intotetherto:developfrom
mukama:feat/pool-stats-aggregate

Conversation

@mukama
Copy link
Contributor

@mukama mukama commented Feb 12, 2026

Summary

  • Add GET /auth/pool-stats/aggregate endpoint with aggregated pool stats (balance, hashrate, workerCount, revenueBTC)
  • Support range param for aggregation period (daily/weekly/monthly)
  • Support pool param for filtering to a specific pool
  • Aligned with API v2 spec: removed snapshotCount

Example Queries

Daily (default):

/auth/pool-stats/aggregate?start=1735689600000&end=1770898000000

Weekly:

/auth/pool-stats/aggregate?start=1735689600000&end=1770898000000&range=weekly

Monthly:

/auth/pool-stats/aggregate?start=1735689600000&end=1770898000000&range=monthly

Filtered to a specific pool:

/auth/pool-stats/aggregate?start=1735689600000&end=1770898000000&pool=my-pool-tag

Combined — weekly, specific pool:

/auth/pool-stats/aggregate?start=1735689600000&end=1770898000000&range=weekly&pool=my-pool-tag

Add pool stats aggregate API endpoint that fetches pool stats history
and transactions, processes daily stats and revenue, and aggregates
by period (daily/weekly/monthly) with optional pool filtering.
Align pool stats aggregate endpoint with API v2 spec which does not
include snapshotCount in the response.
…regate

tail-log returns empty for type=minerpool. Switch to ext-data with
transactions key which has daily revenue and hashrate data. Also fix
changed_balance handling (values are BTC, not satoshis).
@mukama mukama changed the base branch from main to develop February 13, 2026 10:21

for (const tx of txs) {
if (!tx) continue
if (poolFilter && tx.username !== poolFilter) continue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pool name filter needs to be used in the rpc worker type, tx username is the account id.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants