feat(peg): OHLC per-minute gauges + worst-case headline metric - #349
Merged
Conversation
Switches stablecoin-peg leaderboard from per-minute median to per-minute max deviation so sub-minute depeg wicks no longer get smoothed away. New metrics alongside existing peg_deviation_bps: - peg_deviation_worst_bps (PRIMARY): per-minute max |price-1| in bps - peg_minute_max_bps / _min_bps / _open_bps / _close_bps: full OHLC bar YAML provider queries swapped to peg_deviation_worst_bps. Legacy peg_deviation_bps gauge retained for backward compat. Methodology recommendation from Coinpaprika data team review.
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Summary
Fix A of the methodology improvements proposed by a Coinpaprika data
team reviewer. Switches stablecoin-peg from per-minute median to
per-minute MAX deviation, so sub-minute depeg wicks (e.g. USDC at $0.87
for 5 seconds during SVB) stop disappearing into the median.
What changed
Harness (Go):
metrics.go:peg_deviation_worst_bps,peg_minute_max_bps,_min_bps,_open_bps,_close_bpsaggregator.gocloseMinuteLocked()now computes OHLC across every venue sample within the 60s bucket and emits all five gauges alongside the existing medianYAML (
benchmarks/stablecoin-peg.yml):peg_deviation_worst_bpsWhat did NOT change
peg_deviation_bps(legacy median) stays live for backward compatTest plan
go build ./...fromharnesses/stablecoin-peg/)/metrics, confirm all 5 new gauges emit non-zero values per stablepeg_deviation_worst_bps >= peg_deviation_bpsfor every minute (max >= median)quantile_over_time(0.99, peg_deviation_worst_bps[24h])returns valid numbers within ~24h of deploy