assess-stablecoin-depeg-from-pool-balances
Use when checking whether a stablecoin has depegged, using AMM pool imbalances and cross-venue prices rather than a single ticker. Quantifies deviation and flags thin-liquidity false positives.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 81
- Forks
- 17
01 前言 Front Matter
- name
- assess-stablecoin-depeg-from-pool-balances
- description
- Use when checking whether a stablecoin has depegged, using AMM pool imbalances and cross-venue prices rather than a single ticker. Quantifies deviation and flags thin-liquidity false positives.
02 资源文件 3
- 许可证LICENSE1.0 KB
- 参考文档SOURCE.md368 B
- 参考文档TRUST.auto.yaml2.2 KB
03 SKILL.md 正文
Assess stablecoin depeg from pool balances
A stablecoin depegs when it trades persistently below peg across deep venues; a momentary AMM imbalance is noise, and the real test is whether the imbalance survives arbitrage against deep pools.
Procedure
-
Read a canonical pool's balances (Curve 3pool: index 0 = DAI, 1 = USDC, 2 = USDT):
cast call $CURVE_POOL "balances(uint256)(uint256)" 0 --rpc-url $RPC
-
Compare each balance to the ideal
total/3. Worked example — 3pool ideal 33.33M each: DAI 30.5M, USDC 34.0M, USDT 35.5M. DAI is the odd one out, so it is the candidate depeg. -
Do not use the raw balance ratio: stableswap amplification understates small deviations. Read the marginal rate instead:
cast call $CURVE_POOL "get_dy(int128,int128,uint256)(uint256)" 0 1 1000000000000000000 --rpc-url $RPC
The returned value is DAI-in-USDC for 1e18 DAI; divide by 1e18 for the implied rate.
-
Thresholds: deviation < 0.3% = noise; 0.3–1% = watch, re-check in 15 min; 1–3% = active depeg, cross-check a second venue; > 3% sustained 30 min = treat as broken and price collateral at market.
-
Cross-venue: query at least two of Curve, a Uniswap v3 stable pool, and a CEX mid. A single DEX divergence the CEXs do not echo is a liquidity event, not a peg break.
-
Check contagion: if the depegged coin is borrowable collateral with e-mode LT = 0.93, a depeg triggers cross-asset liquidations. Read the reserve's liquidation threshold.
Pitfalls
- Reading one pool's spot as "the price" — a $2M pool can be moved 1% by a $20k trade.
- Using raw balance ratios in a stableswap pool, which overstates small deviations often by 10x versus
get_dy. - Treating a depeg that only exists on one chain as global; bridged wrappers depeg independently of the canonical asset.
Verification
cast call $CURVE_POOL "get_dy(int128,int128,uint256)(uint256)" 0 1 1000000000000000000 --rpc-url $RPC
Divide the result by 1e18; a value below 0.99 confirms > 1% deviation on that venue.
Report deviation, venues checked, and the get_dy output with the block number.
04 同仓库更多 Skills
recipe-performance
Diagnose a specific MetaMask user flow's real-app performance and Sentry critical-user-flow telemetry with deterministic mm-harness recipes. Use for CUF boundaries, cold/warm/background-resume behavior, latency regressions, lifecycle tags, duplicate or blocking network requests, long tasks, layout/paint cost, screen redraws, React rerenders, or browser trace analysis where tests alone cannot prove the real app.
mexc-spot-websocket
MEXC Spot WebSocket workflows for public streams, protobuf handling, depth maintenance, listen keys, and private streams without exposing API keys.
mexc-spot-rest
MEXC Spot REST workflows for public data, signed account requests, orders, wallet/admin actions, and secure signing without exposing API keys.
mexc-futures-websocket
MEXC Futures WebSocket workflows for public streams, private account/order/position streams, ping/pong, subscriptions, and depth maintenance.
0xklen-version-and-refresh-sanctions-lists
暂无简介
verify-tests-cover-changed-lines
Use when a PR adds code that the existing suite may not exercise. Measures patch coverage — the share of newly changed lines hit by tests — before approving.