Skip to content

Conversation

@chapati23
Copy link
Contributor

Description

This PR adds comprehensive monitoring for trading limits in the Broker contract and improves the overall alerting infrastructure.

✨ Features

  • Trading Limits Dashboard Panels - Added three new Grafana panels to visualize trading limit utilization:
    • L0 Short-term limit utilization
    • L1 Medium-term limit utilization
    • Global lifetime limit utilization
image

🐛 Bug Fixes & Improvements

  • Dashboard Organization: Reorganized panel IDs and Y-positions using calculated offsets for better maintainability
  • Enhanced trading mode alert messages with Chainlink data feed links
  • Removed unnecessary TODO comment about scaling bignumbers
  • Improved metric value logging with JSON.stringify for better debugging

How to review

1. Check out this branch locally

git fetch origin
git checkout feat/add-trading-limits

2. Verify Trading Limits Metrics Work

# Build and start the service
pnpm install
pnpm build
pnpm start

Then check the Prometheus endpoint at http://localhost:9090/metrics and verify you see metrics like:

  • Broker_tradingLimitsState_netflow0
  • Broker_tradingLimitsState_netflow1
  • Broker_tradingLimitsState_netflowGlobal
  • Broker_tradingLimitsConfig_limit0
  • Broker_tradingLimitsConfig_limit1
  • Broker_tradingLimitsConfig_limitGlobal

3. Review the Dashboard

The grafana dashboard should have a Trading LImits section now https://clabsmento.grafana.net/d/ee2mj53n58v0ge/aegis-on-chain-metrics?from=now-30m&to=now&orgId=1&timezone=browser

4. Review the Code

Focus on these key areas:

  • Check the new multi-gauge support in metric.ts
  • Verify the new trading limits configuration validation logic

Base automatically changed from feat/more-sepolia-changes to main November 13, 2025 17:01
@chapati23 chapati23 merged commit 01c7dda into main Nov 13, 2025
@chapati23 chapati23 deleted the feat/add-trading-limits branch November 13, 2025 17:09
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.

3 participants