feat(market): per-exchange 24h volume in the hero

The hero's "24H Vol" showed CoinGecko's cross-exchange aggregate even after the
chart/price went per-venue. Capture the per-exchange converted_volume.usd from
the tickers (previously discarded, alongside converted_last) and show the
SELECTED exchange's own 24h volume; fall back to the aggregate when unknown.
Market cap stays aggregate (it's coin-wide, not per-venue).

This is a big real difference — e.g. Ourbit ~$14.3K vs NonKYC ~$253 for DRGX/USDT
— so the header now reflects the venue you're actually looking at.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-12 10:58:50 -05:00
parent a107fda9b8
commit 326192e75e
3 changed files with 14 additions and 3 deletions

View File

@@ -1440,8 +1440,15 @@ static void mktDrawPriceChart(const MktCtx& cx)
sxr -= Layout::spacingMd();
};
if (market.price_usd > 0) {
// Market cap is coin-wide (stays aggregate); 24h volume is per-venue — show the SELECTED
// exchange's own volume when we have it, else the CoinGecko aggregate.
drawStat(TR("market_cap_short"), FormatCompactUSD(market.market_cap));
drawStat(TR("market_vol_short"), FormatCompactUSD(market.volume_24h));
double vol = market.volume_24h;
const auto& exch = *cx.currentExchange;
if (!exch.pairs.empty() && s_mkt.pairIdx < (int)exch.pairs.size()
&& exch.pairs[s_mkt.pairIdx].volumeUsd > 0.0)
vol = exch.pairs[s_mkt.pairIdx].volumeUsd;
drawStat(TR("market_vol_short"), FormatCompactUSD(vol));
}
}