fix(indexer): publish live hub reserve spots without divergence gate #1526
No reviewers
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
code/cl8y-dex-terraclassic!1526
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/remove-hub-divergence-policy"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Production USTR swaps were failing. Root cause: the
hub-fixed-reference-v1containment stored a fixed USTC-unit reserve ratio per hub ticker and suppressed
any mark whose live ratio diverged more than 10% from it. USTR's on-chain pool
ratio had drifted ~12.4% since the reference was recorded on 2026-10-06, so the
USTR hub mark was suppressed; every route containing USTR failed the local-quote
reference prerequisite with
missing_observations(HTTP 503), and the clientshowed a permanent pricing-pending state.
A 10% band is not a valid assumption for DEX reserve spots. Genuine markets
routinely move more than 10%, and a token can move 100x in minutes. Containment
turned legitimate price discovery into an availability outage, and because the
reference never ratcheted, the market could stay bricked until a manual database
reset.
What changed
indexer::hub_guardand thehub_price_referencesfixed-referencetable (new migration drops it).
refresh_hub_marksnow publishes every fresh, positive reserve spot asobserved. Large or fast price movement is delivered as the new spot, never
suppressed.
priced-leg depth, still fail closed.
live-reserve-spot-v1.divergence_pct/reference_atAPI fields and thefrontend type entries.
checks and Rust tests to the new contract.
Safety retained
anchor still yields no derived spot.
$100independent priced-leg depth floor and exact canonical CW20 identitychecks are unchanged.
>1%movement rechecks. Only the read-only quote path stops blocking on pricemagnitude.
Testing
cargo check --tests(all indexer targets): pass.cargo test --lib: 925 passed, 0 failed, 1 ignored.python3 scripts/qa/check-issue-1391-docs.py: PASS.python3 scripts/qa/test-oracle-safety.py: 7 passed.python3 scripts/qa/test-oracle-lp-consumers.py: 3 passed.bash scripts/qa/test-clunc-custc-lp.sh: OK.updated
api_hub_prices,candle_usd_markandindexer_economic_fee_usdtests type-check and now assert live publication on a large reserve move.