fix: raise Maple PoR divergence threshold to 10% + track discrepancy#295
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Maple Proof of Reserves Divergence Alert has been firing repeatedly:
This is a structural timing mismatch, not a real reserve shortfall:
proofOfReserves.totalCollateralValue(~$2.01B)syrupGlobals.collateralValue(~$2.17B)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;
PoRSnapshotreturns onlytotalCollateralValue), so the PoR cadence can't be read directly — hence the logging below to measure it empirically.Changes
PROOF_OF_RESERVES_DIVERGENCE_THRESHOLDfrom0.1%→10%to tolerate the attestation lag (current ~7% divergence no longer alerts).Test plan
pytest tests/test_maple_collateral.py— 3 passed🤖 Generated with Claude Code