fix(#522): scale pair tape to human quote-per-base and persist USD #1055
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!1055
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/522-pair-price-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?
Closes #522
Summary
swap_events.price(raw × 10^(decimals_base − decimals_quote)) and USD of 1 human base inswap_events.price_usdvia the #515 catalog (UST1 = $1, cUSTC/USTC, LUNC, USTR = 2.5× USTC).price_usd/*_usd— they no longer passtrades[0].priceas dollars.Scale note: the issue text had
10^(decimals_quote − decimals_base). That exponent is inverted. UST1(6)/USTR(18) raw≈7.97e13becomes human≈79.72only with10^(6−18).Test plan
cd indexer && cargo test --lib pair_price_usd swap_orientationcd indexer && cargo test --test swap_price_human_usd --test swap_price_orientation -- --test-threads=1pairPriceUsd+ Charts/Trade/Limits page testsmake verify-issue-522(pass, then retest pass)Acceptance (#522)
Limit-order mode box on the issue was unchecked; the code path now uses the same USD helper, but it is not live-verified.
Docs / skills
docs/indexer-invariants.mdskills/AGENTS_INDEXER_PAIR_PRICE_USD.md(P522-1–P522-5)AGENTS.md, price chart, limit-order price, UST1 secondary AMM, external oraclemake verify-issue-522Related: #466, #515, #508
Closes #522
marked this merge request as ready
mentioned in issue #522
mentioned in commit
8ff700ee20