{"id":51408869,"url":"https://github.com/dor-rondel/crypto-trading-multiagent-system","last_synced_at":"2026-07-04T13:01:53.340Z","repository":{"id":364111366,"uuid":"1263737940","full_name":"dor-rondel/crypto-trading-multiagent-system","owner":"dor-rondel","description":"A multi-wallet, multi-chain, automated agentic crypto trading platform simulated on testnets","archived":false,"fork":false,"pushed_at":"2026-07-01T20:01:41.000Z","size":514,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-01T22:05:53.532Z","etag":null,"topics":["agentkit","avalanche-avax","ethereum","langraph","solana","sqlite"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dor-rondel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-09T08:14:35.000Z","updated_at":"2026-07-01T20:58:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/dor-rondel/crypto-trading-multiagent-system","commit_stats":null,"previous_names":["dor-rondel/crypto-trading-agent","dor-rondel/crypto-trading-multiagent-system"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dor-rondel/crypto-trading-multiagent-system","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dor-rondel%2Fcrypto-trading-multiagent-system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dor-rondel%2Fcrypto-trading-multiagent-system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dor-rondel%2Fcrypto-trading-multiagent-system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dor-rondel%2Fcrypto-trading-multiagent-system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dor-rondel","download_url":"https://codeload.github.com/dor-rondel/crypto-trading-multiagent-system/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dor-rondel%2Fcrypto-trading-multiagent-system/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35122497,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-04T02:00:05.987Z","response_time":113,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agentkit","avalanche-avax","ethereum","langraph","solana","sqlite"],"created_at":"2026-07-04T13:01:52.682Z","updated_at":"2026-07-04T13:01:53.322Z","avatar_url":"https://github.com/dor-rondel.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Agentic Testnet Trading System\n\n## Overview\n\nThis project is an event-driven, agentic cryptocurrency trading simulation platform built for test networks.\n\nThe system executes simulated trading strategies against:\n\n- **Solana Devnet** (via `solana-py`)\n- **Ethereum Sepolia** (via `AgentKit/CDP`)\n- **Avalanche Fuji** (via `AgentKit/CDP`)\n\nReal market data is used to generate trading signals, while all trade execution occurs on testnets using a **three-wallet USDC strategy** to avoid risking real capital.\n\n---\n\n## Goals\n\n- Evaluate AI-generated trading strategies safely\n- Simulate multi-chain portfolio management\n- Test autonomous trading workflows\n- Support long-running blockchain operations\n- Maintain reproducibility and auditability\n\n---\n\n## Core Technologies\n\n### AI / Workflow\n\n- LangGraph\n- LangChain\n- **Groq** (via LangChain-Groq)\n- **LangSmith** (for observability)\n- **Coinbase AgentKit** (for EVM execution)\n\n### Blockchain\n\n- **Solana Python SDK** (`solana-py`)\n- **Coinbase CDP SDK**\n- **web3.py** (for deterministic validations)\n\n### Infrastructure\n\n- Python 3.12+\n- **SQLite (aiosqlite)** for persistent trade tracking\n\n---\n\n## Architecture\n\n### Multi-Agent Parallel Workflow\n\nThe system uses a decoupled LangGraph architecture to separate reasoning from execution. It utilizes a parallel fan-out structure where specialized subagents provide context to a central aggregator.\n\n![Trading Workflow Graph](graph.png)\n\n#### Workflow Nodes\n\n- **`research_spawner`**: The entry point that fans out into parallel analysis nodes.\n- **Analyst Nodes (`gas`, `news`, `trend`, `performance`, `liquidity`, `correlation`, `whale`, `volatility`)**: Specialized subagents that run in parallel to analyze network fees, macro sentiment, technical indicators, portfolio PnL, pool liquidity, BTC correlations, on-chain whale movements, and market volatility, respectively.\n- **`aggregator`**: Consumes reports from all specialized subagents to generate a final, high-conviction `TradePlan`.\n- **`validator`**: A deterministic node that enforces balance constraints, maximum trade limits, and slippage guardrails.\n- **`executor`**: Dispatches validated actions to chain-specific wallet adapters and records them in the database.\n\n### Background Services\n\n- **Market Watcher (`src/services/market_watcher.py`):** Aggregates price snapshots and triggers the agent loop.\n- **Transaction Monitor (`src/services/transaction_monitor.py`):** A parallel service that polls the blockchain to update the status of `PENDING` trades in SQLite.\n\n---\n\n## Design Principles\n\n### Stateless Non-Blocking Execution\n\nTo handle flaky testnets, the agent loop completes immediately after submitting a transaction. The `TransactionMonitor` handles the asynchronous confirmation, allowing the agent to stay responsive to new signals.\n\n### Singleton Wallet Management\n\nThe `WalletManager` is a singleton ensuring that wallet keys and initialized providers are shared across the application, preventing redundant initialization and race conditions.\n\n### SDK Thread Isolation\n\nCalls to loop-heavy SDKs (like Coinbase AgentKit) are offloaded to separate threads using `asyncio.to_thread` to prevent event loop conflicts.\n\n### Centralized Persistence\n\nAll SQL queries are centralized in `src/persistence/queries.py` and use parameterized queries to prevent injection from LLM-generated rationale strings.\n\n---\n\n## Wallet Management \u0026 Capital\n\n### Three-Wallet Strategy\n\nThe system maintains three distinct wallets, one for each supported chain.\n\n- Each wallet uses **USDC** as its base \"bank\" currency.\n- **Gas Requirements:** Each wallet must be funded with a small amount of the chain's native testnet token (SOL, ETH, or AVAX) to cover gas fees for swaps.\n- Trades are simulated by swapping USDC for the target asset and back.\n\n### Initialization: Two-Stage Polling\n\n1. **Stage 1: Funding Poll:** The main script polls for native/USDC balances. It will wait indefinitely until at least one wallet is funded. Instructions are provided in `WALLETS.md`.\n2. **Stage 2: Market Poll:** Once funds are detected, the system enters its active loop, polling market data providers for signals to trigger the Aggregator Agent.\n\n---\n\n## Development\n\n### Prerequisites\n\n- Python 3.12+\n- [uv](https://github.com/astral-sh/uv)\n- `libffi-dev` (required for `cffi` build)\n\n### Install\n\n```bash\n# Install dependencies and setup virtual environment\nmake install\n```\n\n### Visualization\n\nGenerate a visual map of the trading graph:\n\n```bash\nmake graph\n```\n\n### Run Full System\n\n```bash\nuv run python -m src.workflows.main\n```\n\n### Run Quality Checks\n\n```bash\n# Formatter, Ruff, Pylint (10/10), Mypy, and Pytest\nmake check\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdor-rondel%2Fcrypto-trading-multiagent-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdor-rondel%2Fcrypto-trading-multiagent-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdor-rondel%2Fcrypto-trading-multiagent-system/lists"}