Skip to content

fix(maple): handle broken poolCollaterals, add PoR divergence check#292

Merged
spalen0 merged 2 commits into
mainfrom
fix/maple-collateral-por
Jun 24, 2026
Merged

fix(maple): handle broken poolCollaterals, add PoR divergence check#292
spalen0 merged 2 commits into
mainfrom
fix/maple-collateral-por

Conversation

@spalen0

@spalen0 spalen0 commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

Maple's poolCollaterals GraphQL resolver currently fails on unregistered native assets (PT_sUSDE, PT_USR), causing a recurring warning. This PR stops fetching the broken field and replaces the lost monitoring with:

  • Proof-of-Reserves divergence check — cross-checks proofOfReserves.totalCollateralValue against syrupGlobals.collateralValue and alerts at ≥0.1% divergence.
  • Unknown collateral asset detection — uses collateralDisclosure { asset } to alert on newly disclosed assets not in ASSET_RISK_SCORES.
  • Errors routed to dedicated errors channel — GraphQL skip/failure messages now go to the errors topic instead of the Maple alert group.
  • README + risk scores updated for the currently disclosed collateral set.

Changes

  • protocols/maple/collateral.py:
    • Remove poolCollaterals from the GraphQL query; rename fetch_collateral_data() to fetch_pools_data().
    • Remove per-asset weighted risk score calculation (no working data source).
    • Add fetch_proof_of_reserves() and check_proof_of_reserves().
    • Add fetch_collateral_disclosure() and check_unknown_collateral_assets().
    • Update ASSET_RISK_SCORES with newly disclosed assets.
  • protocols/maple/README.md:
    • Document PoR divergence and unknown-asset checks.
    • Remove obsolete per-asset risk score line; fix collateralization ratio threshold to 135%.

spalen0 added 2 commits June 24, 2026 18:50
- Stop querying poolCollaterals resolver which fails on unregistered native assets (PT_sUSDE/PT_USR).

- Add Proof-of-Reserves vs syrupGlobals collateral divergence check (0.1% threshold).

- Detect new collateral assets via collateralDisclosure when values are unavailable.

- Route GraphQL skip alerts to dedicated errors channel.

- Update ASSET_RISK_SCORES and README for currently disclosed collateral.
@spalen0 spalen0 merged commit c4d97fb into main Jun 24, 2026
3 checks passed
@spalen0 spalen0 deleted the fix/maple-collateral-por branch June 24, 2026 17:22
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