Skip to content

docs(lore-0172): USDT/USDC candles close at ~0.14, not ~1.00 - #189

Merged
karczuRF merged 1 commit into
developfrom
docs/0172_usdt-usdc-close-off-peg
Aug 10, 2026
Merged

docs(lore-0172): USDT/USDC candles close at ~0.14, not ~1.00#189
karczuRF merged 1 commit into
developfrom
docs/0172_usdt-usdc-close-off-peg

Conversation

@karczuRF

Copy link
Copy Markdown
Collaborator

Found while verifying the 0165 deploy on prod. USDT was 0165's control asset — the peg arm must not flatten it — and that check passed. But the values it returned are impossible.

Measured

price_usd_series, USDT @ canonical issuer:  method=traded  rows=891  avg_close=0.1923
price_ohlcv_1d, asset_id 111, quote=USDC:   891 candles, avg 0.1923, min 0.0912, max 0.4915
by source:                                  sdex, 132,685 trades, 491,984 USDT volume

Two dollar-pegged assets cannot trade at 0.09–0.49 against each other.

close_usd ≈ close_native is correct — a USDC-quoted candle takes the stablecoin-direct tier, so close_usd = close × $1. The defect is in close itself.

Not caused by 0165

Arm B contributes 0/0 wherever sum(w) > 0, so every one of these values is arithmetically identical to what the old view published. Pre-existing; nobody had looked at USDT.

Two hypotheses tested and falsified — recorded so they aren't re-run

  1. 0139 asset_id collision ❌ — asset_id = 111 resolves to exactly one identity.
  2. Misattributed XLM prices ❌ — 0.142572 vs 0.163999 on the same day; close in magnitude, never equal.

Also a query gotcha worth keeping: price_ohlcv_1d holds one row per source, so a naive join to XLM/USDC fans out ~4× per day.

Measured in passing, and worth carrying to 0139

3,281 asset_ids serve 6,568 natural identities. 0139 currently records the collision as a schema-level suspicion with no blast radius; this is the first measurement I'm aware of.

Why it matters

close_usd is what BE multiplies into TVL. If USDT positions value at ~$0.14 instead of ~$1.00, every USDT-legged pool is understated ~7×. BE's CSV has 102 priceable USDT pools — pools that look healthy and are silently wrong, which is worse than the never-priced ones 0165 just fixed.

⚠️ It also means USDT is not a trustworthy control for peg work until resolved — 0165 used it as one.

The task carries four concrete next probes (writer-side id assignment, raw-trade vs candle agreement, orientation/scaling, other USDT pairs).

Found verifying the 0165 deploy. USDT was 0165's control asset and the kill
switch passed - the peg arm did not flatten it - but the values themselves are
impossible: 891 daily candles, 132,685 trades, ~492k USDT volume, closing at
0.09-0.49 against USDC.

Pre-existing and unchanged by 0165: arm B contributes 0/0 wherever sum(w) > 0,
so every value is arithmetically identical to what the old view published.

Records two falsified hypotheses so they are not re-run - 0139 collision (id 111
resolves to exactly one identity) and misattributed XLM prices (0.142572 vs
0.163999, never equal) - plus the query gotcha that price_ohlcv_1d holds one row
per source, which fans a naive XLM join out ~4x per day.

Also captures a number measured in passing that appears nowhere in 0139: it
affects 3,281 asset_ids across 6,568 identities.
@karczuRF
karczuRF merged commit 2790153 into develop Aug 10, 2026
3 checks passed
@karczuRF
karczuRF deleted the docs/0172_usdt-usdc-close-off-peg branch August 10, 2026 12:08
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