Show HN: HashTrade – Open-source LLM trading agent with episodic memory

I built HashTrade — an open-source autonomous trading agent that treats an LLM as a non-parametric decision function conditioned on episodic memory, rather than encoding strategy as code.

The core idea: instead of writing if/else trading logic, you give an LLM three tools (exchange access, memory, UI control) and let it form strategy through accumulated experience. The agent wakes on a variable 5→10→20→25 min cycle, reads its past notes, fetches market data, reasons about what to do, and optionally executes trades. Every decision and outcome is logged to an append-only JSONL file that becomes its long-term memory.

Technical details:

- Built on Strands Agents (AWS) with CCXT for 100+ exchange support - 3 tools only: use_ccxt (28 actions — market data, orders, arbitrage detection), history (persistent memory), interface (dynamic UI) - Variable-interval scheduler to avoid detectable timing patterns in order flow - Fire-and-forget WebSocket streaming for sub-second dashboard latency - Supports Claude, GPT-4o, Ollama (local), and Bedrock — auto-detected - PWA frontend in vanilla JS, no framework dependencies - Client-side credential isolation — API keys never leave the browser - Recursive credential redaction prevents keys from leaking into LLM context

The interesting emergent behavior: early wake cycles are conservative ("observing BTC at $67k, noting support level"). After a few days of accumulated memory, the agent starts referencing its own past observations to form trading theses ("last 3 times we saw this pattern, price bounced — going long"). The policy improves not through fine-tuning but through growing context.

I wrote a paper formalizing this as a Memory-Conditioned Markov Decision Process if anyone's interested in the theory: the key insight is that the effective policy is non-stationary even with fixed model parameters, because the growing memory changes the attention distribution at each step.

Setup: pip install hashtrade && hashtrade

Live demo at hashtrade.ai, code at github.com/mertozbas/hashtrade. Apache 2.0.

Would love feedback on the architecture — especially the tradeoff between soft risk constraints (enforced via system prompt) vs. hard tool-level enforcement.


Comments URL: https://news.ycombinator.com/item?id=47108700

Points: 1

# Comments: 1