Skip to content

feat: Operator account fee-reserve & minimum-balance monitoring #552

Description

@joelpeace48-cell

Background & current state

Operator accounts that sign credits/payouts must hold enough XLM for transaction fees and minimum balance. If an operator account runs dry, credits and payouts silently fail with no early warning. There's currently no monitoring of operator account health.

Goal

Monitor operator/signing account balances and surface low-balance alerts (with an optional auto-topup hook) before failures occur.

Technical design

  • A scheduled check (jobRunner) reads operator XLM via Horizon; computes headroom = balance - (base_reserve + fee_buffer).
  • Export operator_xlm_balance + operator_headroom Prometheus metrics; alert below threshold (ties into NEW-044).
  • Optional auto_topup hook: transfer from a treasury account when below threshold (guarded + audited).

Edge cases

  • Multiple operator accounts → monitor each.
  • Horizon unavailable → use cached last value + mark stale.
  • Auto-topup treasury also low → escalate alert, don't loop.

Task breakdown

  • Balance check job + metrics.
  • Threshold config + alert wiring.
  • Optional guarded auto-topup + audit log.
  • Tests for threshold logic + stale handling.

Acceptance criteria

  • A low-balance condition emits an alert before credits/payouts fail.
  • Metrics exported per operator account.

Testing & verification

  • Unit tests of threshold/headroom math; metric presence asserted.

Out of scope

  • Full treasury management UI.

Dependencies / related

  • Feeds NEW-010 payouts, NEW-044 alerts.

Difficulty: medium · Effort: M · stellar + observability

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programarea: backendBackend API (Node/Express)difficulty: mediumModerate complexityenhancementNew feature or requestobservabilityLogs, metrics, tracingstellarStellar/Soroban integration

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