How hammad-tayyab/trading-agent-harold-of-hackathon- works
Harold’s principal workflow is an autonomous trading cycle: gather ETH market and Prism news data, derive signals, obtain a structured Groq decision, apply position and risk controls, then request a signed on-chain trade intent and record the outcome. The main source excerpt is incomplete, so some integrations are supported by README documentation rather than inspected call sites; the README’s example launch path is absent from the supplied tree, and this graph uses the actual root-level files. Local persistence and validation attestations are included as distinct audit paths.
Main entry points: Main-Trading_Agent.py Agent orchestrator · validation_client.py Checkpoint attestation · trade_intent.py Intent signer · prism_news.py News sentiment
Components 19
Trading cycle
- Agent orchestrator
Main-Trading_Agent.py - Signal engine
Main-Trading_Agent.py - LLM decision
Main-Trading_Agent.py - Position monitor
Main-Trading_Agent.py
Market intelligence
- Kraken market API
- News sentiment
prism_news.py - Groq LLM
Trust and execution
- Intent signer
trade_intent.py - Contract definitions
contracts.py - Risk Router
- Sepolia network
- Trade execution
Main-Trading_Agent.py - Checkpoint attestation
validation_client.py - Validation registry
State and audit
- Agent state
harold_state.json - Trade log
trades_log.csv - Agent metrics
agent_metrics.json - Checkpoint log
checkpoints.jsonl
Other components
- Autonomous cycle
Connections 24
- Autonomous cycle → Agent orchestrator: starts cycle
- Agent orchestrator → Kraken market API: fetches market data
- Kraken market API → Agent orchestrator: returns prices
- Agent orchestrator → News sentiment: requests news context
- News sentiment → Agent orchestrator: returns sentiment
- Agent orchestrator → Signal engine: builds signals
- Agent orchestrator → LLM decision: requests decision
- LLM decision → Groq LLM: queries model
- Groq LLM → LLM decision: returns JSON
- Agent orchestrator → Position monitor: checks position risk
- Agent orchestrator → Intent signer: submits trade intent
- Intent signer → Contract definitions: uses ABI and domain
- Intent signer → Risk Router: simulates and submits
- Risk Router → Sepolia network: executes contract call
- Agent orchestrator → Trade execution: executes approved trade
- Trade execution → Sepolia network: sends signed transaction
- Agent orchestrator → Checkpoint attestation: posts checkpoint
- Checkpoint attestation → Contract definitions: uses registry ABI
- Checkpoint attestation → Validation registry: posts attestation
- Validation registry → Sepolia network: records on-chain
- Agent orchestrator → Agent state: loads and saves
- Agent orchestrator → Trade log: appends trades
- Agent orchestrator → Agent metrics: updates metrics
- Checkpoint attestation → Checkpoint log: appends checkpoint