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:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user