GET /volumes/:asset sums base_volume/counter_volume from price_points with no network filter:
WHERE (asset_a = $1 OR asset_b = $1)
AND timestamp >= $2
GROUP BY source
That was harmless while one process indexed one chain. Since #117 the ingesters run one loop per enabled network into the same table, so a dual-network deployment now returns testnet and mainnet volume added together, silently and with no indication in the response.
Surfaced while reworking #95, where the same gap was fixed for /spreads.
What to do
Mirror what /spreads/:asset now does:
- accept
?network=testnet|mainnet, defaulting to activeNetwork;
- reject an unrecognised value with a 400 rather than falling back;
- add
AND network = $n to the query;
- echo the resolved
network in the response body, so a caller can tell what they got.
Worth checking at the same time
Any other route reading price_points directly without a network predicate — /screener, /benchmark and /basket are the likely candidates.
Acceptance criteria
Complexity: Easy
GET /volumes/:assetsumsbase_volume/counter_volumefromprice_pointswith nonetworkfilter:That was harmless while one process indexed one chain. Since #117 the ingesters run one loop per enabled network into the same table, so a dual-network deployment now returns testnet and mainnet volume added together, silently and with no indication in the response.
Surfaced while reworking #95, where the same gap was fixed for
/spreads.What to do
Mirror what
/spreads/:assetnow does:?network=testnet|mainnet, defaulting toactiveNetwork;AND network = $nto the query;networkin the response body, so a caller can tell what they got.Worth checking at the same time
Any other route reading
price_pointsdirectly without a network predicate —/screener,/benchmarkand/basketare the likely candidates.Acceptance criteria
/volumes/:assetreturns only the requested network's volume