Skip to content

feat(spark): SparkLend utilization and Spark governance monitoring#317

Merged
tapired merged 3 commits into
mainfrom
spark
Jul 13, 2026
Merged

feat(spark): SparkLend utilization and Spark governance monitoring#317
tapired merged 3 commits into
mainfrom
spark

Conversation

@spalen0

@spalen0 spalen0 commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

Re-enables and modernizes Spark monitoring:

  • protocols/spark/main.py (rewritten): the old utilization monitor was disabled with a stale 2023 market list. Refreshed to the current 13 active, non-frozen SparkLend mainnet reserves (adds USDS, sUSDS, LBTC, PYUSD; drops now-frozen rETH), restructured to match protocols/aave/main.py, and adds the required run_with_alert wrapper. Alerts at >99% utilization.
  • protocols/spark/proposals.py (new): governance proposals monitor modeled on protocols/maker/proposals.py. The Spark governance portal is backed by Snapshot space sparkfi.eth; the script polls hub.snapshot.org/graphql, alerts (LOW) on new proposals whose voting is still open, and dedupes via the created-timestamp cache. First run seeds the cache without backfilling closed proposals.
  • Wiring: both scripts added to the hourly profile in automation/jobs.yaml; spark card added to monitoring.yaml; README rewritten.

Tenderly alert note

The Spark spell flow goes through Sky governance: plot() is on DSPause 0xbE286431454714F511008713973d3B053A2d38f3 (already covered by the Maker alert) — the PauseProxy 0xBE8E3e3618f7474F8cB1d074A26afFef007E98FB has no plot() function (verified against mainnet bytecode). For Spark-specific coverage, alert on exec() calls to the Spark SubDAO Proxy 0x3300f198988e4C9C63F75dF86De36421f06af8c4.

Deployment

Requires TELEGRAM_TOPIC_ID_SPARK (or TELEGRAM_CHAT_ID_SPARK) on the box, otherwise spark alerts are skipped with "Missing Telegram credentials".

Testing

  • ruff check/format clean; mypy clean on new files
  • full test suite: 646 passed, 6 skipped (includes tests/test_monitoring_config.py validating jobs.yaml/monitoring.yaml consistency)
  • live dry-run of main.py against mainnet: all 13 markets return sane URs (max USDT at 96%)
  • live dry-run of proposals.py: cache seeding, alert formatting, and rerun dedupe verified

🤖 Generated with Claude Code

codex and others added 2 commits July 13, 2026 12:19
- refresh protocols/spark/main.py to current SparkLend reserves (aave-style
  structure, run_with_alert wrapper) and re-enable it hourly
- add protocols/spark/proposals.py polling Snapshot space sparkfi.eth
  (backs https://app.spark.fi/spk/governance) for new open proposals
- document governance flow incl. Tenderly plot() alert on DSPause
- wire into automation/jobs.yaml and monitoring.yaml

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
DAI, sDAI, USDC, sUSDS, and LBTC markets are deprecated on
https://app.spark.fi/markets — stop monitoring their utilization.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@spalen0
spalen0 marked this pull request as ready for review July 13, 2026 12:42
@spalen0
spalen0 requested a review from tapired July 13, 2026 12:42
@tapired
tapired merged commit 113a6c0 into main Jul 13, 2026
3 checks passed
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