Skip to content

Add per-IP connection limits to SSE endpoint #349

@ogazboiz

Description

@ogazboiz

Join our community: https://t.me/+DOylgFv1jyJlNzM0

Description

Stream stats endpoint (GET /events/stats) reports total connections but there is no per-user stream summary — how much has been streamed in, out, and how much is currently claimable across all active streams.

What Needs to Happen

  • Add GET /v1/users/{address}/summary endpoint:
    • totalStreamsCreated, totalStreamedOut (sum of withdrawn amounts on outgoing)
    • totalStreamedIn (sum of withdrawn amounts on incoming)
    • currentClaimable (sum of claimable across all active incoming streams)
    • activeOutgoingCount, activeIncomingCount
  • Useful for the dashboard stats cards and profile page
  • Cache result for 30 seconds (hot path)

Files

  • backend/src/routes/v1/stream.routes.ts
  • backend/src/controllers/stream.controller.ts

Acceptance Criteria

  • Endpoint returns accurate sums
  • Cached for 30s to reduce DB load
  • Works for addresses with no streams (all zeros)

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbackendBackend related tasks

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions