Skip to content

fix: raise Maple PoR divergence threshold to 10% + track discrepancy#295

Merged
spalen0 merged 1 commit into
mainfrom
maple-disable
Jun 27, 2026
Merged

fix: raise Maple PoR divergence threshold to 10% + track discrepancy#295
spalen0 merged 1 commit into
mainfrom
maple-disable

Conversation

@spalen0

@spalen0 spalen0 commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

Problem

The Maple Proof of Reserves Divergence Alert has been firing repeatedly:

⚠️ syrupGlobals exceeds PoR by: 7.13% (threshold: 0.1%)

This is a structural timing mismatch, not a real reserve shortfall:

Value Source Update cadence
proofOfReserves.totalCollateralValue (~$2.01B) Third-party attestation (The Network Firm) Periodic snapshot — lags
syrupGlobals.collateralValue (~$2.17B) On-chain / subgraph Near-real-time (per block)

As collateral grows between attestation snapshots, the live on-chain figure runs ahead of the last published PoR snapshot, surfacing as a ~7% "divergence." The alerting direction (on-chain exceeds attestation) is the benign case — the concerning case would be the opposite.

Note: the API exposes no timestamp on either value (introspection disabled; PoRSnapshot returns only totalCollateralValue), so the PoR cadence can't be read directly — hence the logging below to measure it empirically.

Changes

  • Raise PROOF_OF_RESERVES_DIVERGENCE_THRESHOLD from 0.1%10% to tolerate the attestation lag (current ~7% divergence no longer alerts).
  • Log the PoR vs syrupGlobals gap (USD + %) unconditionally every run so we get an hourly time series to track the discrepancy and tighten the threshold once the cadence is understood.
  • Update tests for the new threshold (alert case → 20% divergence; added a 7% sub-threshold no-alert case).

Test plan

  • pytest tests/test_maple_collateral.py — 3 passed

🤖 Generated with Claude Code

The PoR divergence alert was firing on a structural timing mismatch: the
on-chain syrupGlobals collateralValue updates in near-real-time while the
third-party PoR attestation (The Network Firm) is a periodic snapshot that
lags. Growing collateral between attestations made syrupGlobals exceed PoR
by ~7%, well above the old 0.1% threshold.

- Raise PROOF_OF_RESERVES_DIVERGENCE_THRESHOLD 0.1% -> 10%
- Log the PoR/syrupGlobals gap (USD + %) unconditionally each run so we can
  track the discrepancy over time and tighten the threshold later
- Update tests for the new threshold

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@spalen0 spalen0 merged commit 745f543 into main Jun 27, 2026
3 checks passed
@spalen0 spalen0 deleted the maple-disable branch June 27, 2026 04:30
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.

1 participant