feat: DEX hub USD for cUSTC/UST1/USTR from largest-liquidity pools #1083
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!1083
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "556-dex-hub-usd"
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?
Summary
hub_pricesranked by humanized USD TVL (reserves, not last print).usd(cUSTC)→ deepest cUSTC/UST1 pool →usd(UST1)→ deepest USTR vs already-priced hub →usd(USTR).protocol-dex-hub-prices) between Global stats and the CEX oracle card. CEX/oracle/pricecatalog stays three tickers;ustr/ust1/custcremain 400.Closes #556
APIs
GET /api/v1/hub-pricesandGET /api/v1/hub-prices/{ticker}(custc|ust1|ustr). Unknown ticker → 400.custc_price_usd,ust1_price_usd,ustr_price_usd(null when unresolved).ustc_price_usdstays the CEX USTC ticker.Ranking (H1–H3, H8)
$100USD TVL default (HUB_USD_TVL_FLOOR); comparison istvl < floor(exact $100 included).uusdas cUSTC-equivalent. Symbol-spoof natives skipped.pair_reservesskipped (book_snapshot_max_staleness_ms). Zero reserves skipped.hub_pricesthen inserts resolved marks — oracle down → empty table, UI—, does not freeze last$1.Guardrails kept
ustr/ust1/custcon CEXOracleTicker.volume_usd.swap_eventsscan on GET (O(1)hub_pricesread).last_pricestays humanclose_price.UST1_LP_USTR_PER_USTCinscripts/rebalance-mint-ust1-lp.shunchanged (sizing only).invertUsd.Docs / skills
skills/AGENTS_INDEXER_HUB_USD.md(H1–H10)docs/indexer-invariants.md,docs/frontend.md,docs/testing.md, oracle + rebalance runbooksAGENTS.md,AGENTS_FRONTEND_PROTOCOL_STATS.md,AGENTS_INDEXER_PAIR_PRICE_USD.md,AGENTS_INDEXER_EXTERNAL_ORACLE.md,AGENTS_FRONTEND_CHARTS_OVERVIEW.md,AGENTS_REBALANCE_MINT_UST1_LP.mdmake verify-issue-556Test plan
make verify-issue-556(docs, ingest greps, indexer libhub_usd+pair_price_usd, integration API/ingest/oracle 400s, frontend RTL, Playwright protocol e2e)make verify-issue-515550522543524dex.cl8y.com/protocolUSTR visible;/oracle/price/ustrstill 400Acceptance (H1–H10)
$12.5 × USTCprice_usduses hub quotes; invert still UI (invertUsd) — Charts/Trade mocked via pairPriceUsd + 524/543 verifies/oracle/price/ustr|ust1|custc400volume_usduses hub; not vFDUSDmake verify-issue-556last_pricestays humanOut of scope (unchanged)
resolve_token_vs_priced_hubexists; API only persistscustc/ust1/ustradded 9 commits
mainda70fed3- Merge branch 'main' into 556-dex-hub-usdCompare with previous version
mentioned in commit
f6a06fcd1ementioned in commit
a932718fe8mentioned in issue #556
mentioned in issue #559
mentioned in issue #551
mentioned in issue #560