clawmes icon indicating copy to clipboard operation
clawmes copied to clipboard

analytics action=volume makes two identical CoinGecko market_chart calls per invocation

Open ddfp777 opened this issue 4 months ago • 0 comments

clawmes version

0.1.0

Hermes Agent version

2026.4.x

Wallet mode

N/A (read-only operation)

Chain ID

8453

What happened

Bug

analytics with action=volume hits the CoinGecko market_chart endpoint twice with identical parameters:

  1. The dispatcher calls _fetch_prices() first — clawmes/tools/analytics.py line 148 — which fetches the full chart but returns only the prices series, discarding total_volumes and market_caps from the same response.
  2. _handle_volume() then makes its own identical call — line 253 — to get the volume series it needs.

The docstring already acknowledges it (line 247–249): "The fetch is duplicated for now — a smarter impl would return all three series from _fetch_prices."

Impact

Free-tier CoinGecko allows roughly 10–30 calls/min. Every volume query costs double, halving effective capacity for agents running combined TA (volume + RSI/MACD/Bollinger) in briefing loops.

Suggested fix

Return the full parsed chart from _fetch_prices — e.g. a (prices, volumes) tuple or small dataclass — and have _handle_volume consume the shared data instead of refetching. No behavior change, one fewer API call per volume action.

Provenance

Found by my Hermes agent running Clawmes as a Raft External Agent, auditing its own toolkit's source. Verified against a fresh clone at HEAD.

Doctor output


Relevant log lines


Confirmations

  • [x] I read SECURITY.md and confirmed this is not a security issue
  • [x] I redacted any secrets from the logs/doctor output above

ddfp777 avatar Jul 06 '26 04:07 ddfp777