post-merge: deploy !362–!366 and wire portfolio P&L USD to hub prices #560
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#560
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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
!1080–!1084 are on
main(Android Chrome connect, trader volume USD, portfolio P&L scale, DEX hub USD, zap floors). CI was not green (ci_quota_exceeded). Several issue AC items are manual/ops, and one code gap appeared only after stacking #551 on #556.Code follow-up (blocking for honest USD P&L)
After !1083, indexer Charts/Trade
price_usdandvolume_usduse hub_prices (USTR is market-priced, not2.5 ×USTC)./portfolioand/trader/:addrTotal realized P&L still convert human base via frontendquoteTokenUsdintraderPositionDisplay.ts:$12.5 ×USTCThat disagrees with H1–H3. Per-pair human token amounts from #551 are fine. Header USD should read
GET /api/v1/hub-prices(same source as Protocol DEX card), omit unpriced hubs (not$0), and keep CEX/oracle/price/ustras 400.Out of scope here: tape Amount in/out/Price (#557).
Deploy / migrate
npm ciso !1080 cosmes patch applies).20260818140000_traders_total_volume_usd.sql(#553)20260818180000_hub_prices.sql(#556)GET /api/v1/hub-prices, overview additive hub fields, tradertotal_volume_usd.Manual AC still open on closed issues
dex.cl8y.com/chartsVolume (USD) is not10,000,000T/portfoliorows human + labeled; header not unitless38.29M/protocolDEX hub card shows USTR;/oracle/price/ustrstill 400Cannot Subat msg index 3Verify (after deploy)
make verify-issue-554553551556559(local)marked as related to #551
marked as related to #553
marked as related to #554
marked as related to #556
marked as related to #559
marked as related to #557
mentioned in issue #554
mentioned in issue #553
mentioned in issue #551
mentioned in issue #556
mentioned in issue #559
Review extras to include in this issue (beyond hub P&L + deploy):
N/Anot—(PnlValue). Align to P551-5.—.backfill_swap_volume_usdso trader lifetime USD includes hub-priced legs.HUB_*_ADDRESSin prod/LocalTerra indexer env. Fix stale/protocolone-liner indocs/frontend.md(hub card omitted).Production smoke after indexer + frontend redeploy
Checked
https://indexer.dex.cl8y.comandhttps://dex.cl8y.com(Playwright Chromium, 5 parallel page loads). Localmake verify-issue-*was not re-run.Indexer ingest
GET /api/v1/hub-pricescustc/ust1/ustr. Metadata says DEX marks, not CEX. CORSAccess-Control-Allow-Origin: https://dex.cl8y.com.GET /api/v1/hub-prices/{custc,ust1,ustr}GET /api/v1/oracle/price/ustr(andust1)Supported: ustc, lunc, vfdusdcustc_price_usd,ust1_price_usd,ustr_price_usdplusustc_price_usdGET /api/v1/traders/leaderboard?sort=total_volume_usdtotal_volume_usdpopulated (null only for unpriced activity).HUB_*_ADDRESSsource_pair+tvl_usd(not a null/empty snapshot).Snapshot around this check (USD marks, not settlement):
terra1cepr…cw55f, TVL ~$5.8k) — not $1terra16vxr…5hgqy, TVL$5.1k) — not$0.0118)2.5 ×USTC (Overview USD: 24h ~$1.12k, 7d/30d ~$1.72k. Mixed-unit
total_volume_24hremains API-only.Trader lifetime USD looks backfilled enough to be usable (top
total_volume_usd~$1.23k / 1172 trades; USTR-heavy wallets show ~$167 / $113 rather than raw 18-dec sums). One idle/unpriced row correctly returns JSONnull.Manual AC table
/chartsVolume tab sorted by USD:$1.226K,$166.7,$113.0,$96.55, … unpriced—. No10,000,000Tin that column.38.29M.terra12z8v…sdtjj3: net/cost/PnL labeled (+38.29 UST1,9.869 CORAL,20.00 UST1). Mixed 6/18-decterra1hu4z…q5k2lv:9.297 USTRnot a T-compact raw. Header Total Volume (USD)$96.55/$166.7./portfolioneeds a connected wallet (sameTraderSummaryStats)./protocolDEX hub prices card shows cUSTC / UST1 / USTR with$marks and source-pair rows. CEX tabs are USTC / LUNC / vFDUSD only (no USTR tab)./oracle/price/ustrstill 400./poolone-sided Add / Withdraw cards render (pool-one-sided-add, submit gated on Connect wallet). No funded columbus-5 wallet here, so UST1/cUSTC 5% Add →Cannot Subat msg index 3 was not re-tried on-chain.Tape Amount in/out still prints
10,000,000T/9,297,048Ton USTR legs (example:USTR → UST1onterra1hu4z…). That is #557, out of scope here. Charts Volume (USD) is the #553 surface and is fine.Code follow-up still open (hub P&L)
Header Total realized P&L is USD, but it still uses frontend
quoteTokenUsd(UST1 = $1, USTR = 2.5 × USTC), notGET /api/v1/hub-prices.Live:
terra12z8v…priced rows are +38.29 UST1 → header+$38(“Priced pairs only”). Hub UST1 ~$0.976 would be ~$37. EMBER/CORAL omitted (unpriced), not$0.Also still true vs extras on this issue:
N/A(PnlValuenull), not — (P551-5).Residual QA
/portfolio+/traderrealized P&L USD to hub prices (omit unpriced hubs; keep CEX/oracle/price/ustras 400).mentioned in merge request !1090
Code follow-up implemented in !1090 (
fix/560-hub-pnl-usd).Done (code)
/portfolio+/traderrealized P&L USD toGET /api/v1/hub-prices(never$1/2.5×; unpriced omitted; CEX/oracle/price/ustrunused)PnlValue), notN/Askills/AGENTS_FRONTEND_HUB_PNL.md,make verify-issue-560(5/5, retested)Not done (ops / device / out of scope)
npm ci) so production picks this upHUB_*_ADDRESSalready confirmed in an earlier production smoke notebackfill_swap_volume_usdafter hub migrate (#553 extra)10,000,000T) remains #557Post-merge note (!1090 on main). Code follow-up P560-1–P560-6 is merged (hub-priced header P&L, Best/Worst —, missing asset rows kept). This issue stays open for ops.
Still required:
npm ci) so production header uses hub UST1 (~$0.976), not$1.hub_prices/total_volume_usdmigrations are not live.terra12z8v…) — header USD ≈ hub UST1 × human P&L.mentioned in issue #573
marked as related to #573
Sanity after stack: frontend hub P&L tests PASS. Indexer cargo rungs FAIL on this agent VM (root-owned
indexer/targetlock files). Same chown as #557. Ops items in the issue body are unchanged.mentioned in commit
f2b2929f37Verification (worktree
verify/560-hub-pnl→main@f2b2929f)Re-ran P560 in a git worktree from
origin/main. Code path from !1090 is already onmain; this pass added skill/docs crosslinks so volume/oracle agents do not reintroduce$1/2.5×header P&L.Local
make verify-issue-560quoteTokenUsdpegs; CEXustrunused (P560-1 / P560-3)Postgres-only infra (
make setup-indexer-postgres). First docs grep failed because of a single-quotedgrep -Einsidebash -c; fixed and re-ran — 5/5.Production smoke (
dex.cl8y.com/indexer.dex.cl8y.com) 2026-08-20Coolify frontend rebuild is live (bundle includes
useProtocolHubPricesQuery+traderUsdMarksFromHub; HTMLlast-modified2026-08-19 12:06 UTC).GET /api/v1/hub-pricesGET /api/v1/oracle/price/ustrand/ust1Supported: ustc, lunc, vfdusdcustc_price_usd,ust1_price_usd,ustr_price_usd)$1→ ~$96. EMBER omitted, not$0.N/A/protocolDEX hub card/charts24h Volume (USD)10,000,000Ton that stripDocs landed on main
/protocolone-liner now includes the DEX hub card + #560 header P&L (review extra from this issue).skills/AGENTS_FRONTEND_TRADER_VOLUME_USD.md,skills/AGENTS_INDEXER_EXTERNAL_ORACLE.md.scripts/qa/verify-issue-560.shgreps those links.Checklist to re-verify
make verify-issue-560GET /api/v1/hub-prices(never$1/2.5×)$0; pending → —; empty →$0/oracle/price/ustrstays 400; trader/portfolio do not call itN/A; fees —npm ci) — production header matches hubhub_pricesingest livemake verify-issue-554553551556559(local stacked suite — not re-run this pass; #560 frontend tests overlap #551)Cannot Subat msg index 3)Leaving open. P560-1–P560-6 and the Coolify/hub production smoke pass. Remaining issue-body / comment ACs are device QA (#554) and live zap (#559), plus the stacked
make verify-issue-*list above. Tape Amount in/out compactTremains #557 (out of scope).Real-device QA (Android 16, Chrome) — #554 UI verified working; residual failure is Lunc Dash WC v1, not the DEX
The #519/#554 reporter retested on Android 16 Chrome against production
dex.cl8y.com(bundleindex-Bqd2luvk.js, wallet chunkwallet-terra-DhLsGGzr.js), 2026-08-19 ~16:45 UTC. Two runs: a two-device QR attempt (hung), then the same-device "Open" deep-link path as intended. Recordings reviewed frame-by-frame.DEX side: passes the #554 acceptance criteria
The mobile connect sheet is now correct on-device:
luncdash://wallet_connectdeep link and the Lunc Dash app actually opens (splash → wallet home). This is the exact flow that failed pre-#554.Residual failure is in Lunc Dash (WalletConnect v1), wallet-side
After the app opens, Lunc Dash shows "Ready to Connect", spins, and then throws its own error:
So the pairing request reaches the wallet, but the WC session never settles and Lunc Dash times out. Lunc Dash uses WalletConnect v1 with its own bridge
https://walletconnect.luncdash.com. I probed it during the failure window:GET /hello→Hello World, this is Relay Server v1.0.0HTTP/1.1 101 Switching Protocols(Sec-WebSocket-Acceptreturned)The relay is reachable, yet the v1 handshake still doesn't complete — consistent with the deprecated WC v1 stack. "Session timeout" is emitted by the wallet, not the dApp.
Suggested next steps (not DEX code)
AGENTS_FRONTEND_WALLETCONNECT_MOBILE.md/ QA template — the DEX already exposes Keplr as a WALLETCONNECT row, and v2 avoids the dead v1 bridge.walletConnectPairing/ the cosmes patch for this.Happy to have the reporter retest the Keplr Mobile path if that would help close the manual matrix.
mentioned in issue #589
mentioned in issue #656
mentioned in issue #657
mentioned in issue #666
mentioned in merge request !1178
mentioned in merge request !1179