Skip to content

Circuit-breaker configuration & observability endpoints#225

Merged
DevMuhdishaq merged 1 commit into
StelTade:mainfrom
MoscowDev:feature/circuit-breaker-configuration
Jul 22, 2026
Merged

Circuit-breaker configuration & observability endpoints#225
DevMuhdishaq merged 1 commit into
StelTade:mainfrom
MoscowDev:feature/circuit-breaker-configuration

Conversation

@MoscowDev

Copy link
Copy Markdown
Contributor

Task Completed

Completed implementation of the Volume-Threshold Circuit Breaker for the emergency recovery workflow.

Summary of Changes

  • Added an admin-only set_circuit_breaker_threshold(window_secs, max_volume) function to configure the circuit breaker's monitoring window and maximum trading volume threshold.

  • Implemented get_circuit_breaker_status() to expose the current breaker state, including:

    • tripped
    • current_volume
    • threshold
    • window
  • Implemented automatic circuit breaker activation when the configured trading volume threshold is exceeded within the specified time window.

  • Integrated the circuit breaker with the existing pause mechanism, ensuring all swaps are automatically paused once the breaker is tripped.

  • Added an admin-only reset_circuit_breaker() function to clear the tripped state and safely resume trading.

  • Emitted a CircuitBreakerTripped event whenever the breaker is activated to improve monitoring and auditability.

  • Added comprehensive tests covering:

    • Volume accumulation across ledger windows.
    • Automatic breaker activation when thresholds are exceeded.
    • Accurate status reporting through get_circuit_breaker_status().
    • Successful admin reset and restoration of trading functionality.

Outcome

The circuit breaker now provides configurable risk controls, automatic protection against abnormal trading volume, real-time visibility into its operational state, secure administrative recovery, and complete event logging for monitoring and auditing.
closes #224

@DevMuhdishaq
DevMuhdishaq merged commit a0419d0 into StelTade:main Jul 22, 2026
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.

Circuit-breaker configuration & observability endpoints

2 participants