Skip to content

feat(lore-0167): complete — usd_rate live on prod, constraint 5 passed, coverage start corrected - #194

Merged
karczuRF merged 3 commits into
developfrom
fix/0167_correct-oracle-coverage-start
Aug 10, 2026
Merged

feat(lore-0167): complete — usd_rate live on prod, constraint 5 passed, coverage start corrected#194
karczuRF merged 3 commits into
developfrom
fix/0167_correct-oracle-coverage-start

Conversation

@karczuRF

Copy link
Copy Markdown
Collaborator

0167 is deployed and populated on prod — and verifying it disproved a number this task had been using as its main argument.

The population worked

Rows 43,514 each for USDC and USDT
method oracle
Pre-2020 rows 0 — the 0086 junk filter did its job
avg rate 1.000271 / 0.99959not 1.0, which is the whole point

The 0141 stale-asset trap was live: target/lambda/oracle-worker/bootstrap was 17 days old with zero usd_rate references. Caught only by checking the artifact before deploying. After rebuild, Lambda LastModified landed 3 minutes after the local build.

The correction

prices.oracle_prices, peg assets, oracle_name='reflector', post-2020:
  rows 87,030   oldest 2026-03-11 14:00:00   newest 2026-08-10 15:45:00

Coverage starts 2026-03-11, not ~2025-09. 43,514 rows per asset over 152 days is 99.4% of a continuous 5-minute cadence, so the worker began in March 2026. The earlier figure was never verified.

It had propagated into six files — 0167, 0168, 0154, 0131, 0088 and the schema overview — all corrected here.

What that changes

  • Real expiry is 202603 ageing out at ~2027-04, not ~2026-10/11 — about six months later than argued.
  • That was the headline reason 0167 jumped the queue ahead of 0172, which is live, wrong data feeding TVL on 102 pools. On the corrected numbers 0172 should have gone first. The work here is correct and unblocks 0168, so nothing is wasted — but the sequencing rested on an unchecked number.
  • The copy has no gap. oracle_name was the one plausible way older readings could have been missed, since the event-decoded path also writes oracle rows. Measured, reflector is the only name present for peg assets — the 87,028 copied rows are everything that exists.

Lesson

The ~2025-09 figure travelled through six files and became the basis for a scheduling decision without anyone running SELECT min(timestamp). It cost one query, and was caught only because the populated table's oldest column disagreed with the task text.

…~2025-09

Measured on prod right after the first snapshot: oracle_prices holds 87,030 peg
rows under oracle_name='reflector', oldest 2026-03-11 14:00:00. 43,514 per asset
over 152 days is 99.4% of a continuous 5-minute cadence, so the worker began in
March 2026. The ~2025-09 figure was never verified.

It had propagated into six files - 0167, 0168, 0154, 0131, 0088 and the schema
overview - and was the headline reason 0167 jumped the queue. The real expiry is
the 202603 partition ageing out at ~2027-04, about six months later than argued.
On the corrected numbers 0172 - live wrong data feeding TVL on 102 pools -
should have gone first. The work here is correct and unblocks 0168, so nothing
is wasted, but the sequencing rested on a number nobody had checked.

The copy itself has no gap: oracle_name was the one plausible way older readings
could have been missed, since the event-decoded path also writes oracle rows.
Measured, reflector is the only name present for peg assets, so the 87,028
copied rows are everything that exists.

Also records the deploy outcome: the 0141 stale-asset trap was live (the on-disk
bootstrap was 17 days old with zero usd_rate references) and was caught only by
checking the artifact before deploying.
…referenced

The previous commit fixed the ~2025-09 dates across six files but its script
aborted before writing 0167's explanatory section, leaving a dangling reference
to a section that did not exist.

Records what was measured (oracle_prices peg coverage starts 2026-03-11, not
~2025-09), the consequence (real expiry ~2027-04, six months later than argued,
so 0172 should have been sequenced first), the confirmation that the copy has no
gap (reflector is the only oracle_name present for peg assets), and the deploy
outcome including the live 0141 stale-artifact near-miss.
…ing on 0116

0154 constraint 5 - the gate before anything prices off usd_rate - PASSED on
prod over 103,016 USDC-quoted daily candles. 9,022 oracle-tier candles reproduce
exactly from the stored rate, which is the question the check asks. 93,849 sit
in the expected flat-$1 peg band, incidentally quantifying what 0168 is worth.

The 145 outliers (0.14%) were chased rather than waved through. They are a
Decimal(38,14) representable-floor artifact: close sits at single-digit
multiples of 1e-14 and every candle loses exactly one ulp (8->7, 10->9, 11->10,
15->14) through a float round-trip, not a rounding rule. Relative error reaches
14.25%, absolute error is 1e-14 per unit. The same error appears against any
rate including enrichment's own, so it is not a rate defect.

Recorded on 0116 as the mirror image of that task's absurdly-large close_usd -
same root (price outside Decimal(38,14)'s usable range), opposite end - with the
warning that a relative-error tolerance over these assets will always look
alarming while the absolute error is negligible.

Two ACs stay [~] deliberately: the ASOF rule is documented at the table but
implemented by its first consumer (0168), and pre-oracle absence is now verified
on real data rather than argued from construction.

Shipped: prices.usd_rate live on ch-prod-01, oracle-worker deployed and
populating, 87,028 rows at method='oracle', averages 1.000271 / 0.99959.
0168 is now a one-expression change.
@karczuRF karczuRF changed the title docs(lore-0167): correct the oracle coverage start — 2026-03-11, not ~2025-09 feat(lore-0167): complete — usd_rate live on prod, constraint 5 passed, coverage start corrected Aug 10, 2026
@karczuRF
karczuRF merged commit ad6fc54 into develop Aug 10, 2026
3 checks passed
@karczuRF
karczuRF deleted the fix/0167_correct-oracle-coverage-start branch August 10, 2026 15:59
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