Skip to content

feat(oracle): time-aligned deviation against oracle updatedAt - #353

Merged
Flotapponnier merged 1 commit into
devfrom
feat/oracle-time-aligned-deviation
Jun 9, 2026
Merged

feat(oracle): time-aligned deviation against oracle updatedAt#353
Flotapponnier merged 1 commit into
devfrom
feat/oracle-time-aligned-deviation

Conversation

@Flotapponnier

Copy link
Copy Markdown
Collaborator

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:

  • ocb_oracle_deviation_at_oracle_ts_pct (canonical)
  • ocb_oracle_deviation_at_fetch_ts_pct (explicit alias of legacy)
  • ocb_oracle_alignment_miss_total

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.

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.
@Flotapponnier
Flotapponnier merged commit 739a035 into devJun 9, 2026
1 check failed
@Flotapponnier
Flotapponnier deleted the feat/oracle-time-aligned-deviation branch June 9, 2026 21:42
Sign up for freeto 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

@Flotapponnier