feat(oracle): time-aligned deviation against oracle updatedAt - #353
Merged
Conversation
Replaces fetch-time pairwise deviation with a time-aligned variant that snaps each source's price to the more recent SourceTS of the pair (Chainlink's on-chain updatedAt for chainlink, fetch time for the continuously-updating sources). The older source's price is looked up in a 30-min per-source rolling history at the anchor moment. Eliminates the artifact where Chainlink's heartbeat lag was tagged as 'deviation' — a researcher grading oracle quality wants to compare Chainlink against the market at Chainlink's own updatedAt, not at the harness's fetch instant. New metrics: - ocb_oracle_deviation_at_oracle_ts_pct (canonical, headline-feeding) - ocb_oracle_deviation_at_fetch_ts_pct (explicit alias of legacy) - ocb_oracle_alignment_miss_total (alignment-failed pair counter) Legacy ocb_oracle_deviation_pct preserved unchanged for backward compat. Headline ocb_oracle_max_deviation_pct now uses at_oracle_ts with fetch-time fallback during cold start. Methodology recommendation from Coinpaprika data team review. Matches the convention published by Chaos Labs and Risk DAO oracle risk reports.
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.
Public mirror of MobulaFi/mobula-monorepo#XXX. Fix C of the Coinpaprika methodology review.
Replaces fetch-time pairwise deviation with a time-aligned variant. Each source's price is snapped to the more recent SourceTS of the pair (Chainlink updatedAt for chainlink, fetch time for the others), and the older source's price is looked up in a 30-min rolling history.
New metrics:
Legacy ocb_oracle_deviation_pct preserved for backward compat. Headline ocb_oracle_max_deviation_pct now uses at_oracle_ts with fetch-time fallback during cold start. Methodology bullet updated in benchmarks/oracle-deviation.yml.
Matches Chaos Labs / Risk DAO published methodology.