AAGT: Advanced Agentic Trading Framework
A high-performance, production-ready Rust framework for building autonomous trading agents with advanced memory, risk management, and multi-provider support.
System Architecture
AAGT is built on a modular "Brain-Body-Nervous System" architecture designed for high reliability and multi-tenant security.
1. The Brain (Agent & Provider System)
- Pluggable Intelligence: Native support for Anthropic, OpenAI, Gemini, DeepSeek, Moonshot, and OpenRouter via a unified
Providertrait. - Quota Protection: Built-in fuses (
max_history_messages,max_tool_output_chars) to prevent token bloat and control costs. - Context Management: Advanced sliding window history management to keep reasoning sharp and cost-effective.
2. The Memory (Dual-Layer Persistence)
- Context Layer (Short-Term): Atomic, persistent JSON snapshotting with
undocapability. Prevents state corruption during VPS restarts. - Knowledge Layer (Long-Term): Append-only JSONL storage with metadata filtering for secure, multi-user RAG (Retrieval Augmented Generation).
- Isolation Engine: Strict logical and physical data separation between different User IDs and Agent IDs.
3. The Guardrails (Risk & Policy)
- Risk Management: Pluggable safety checks (Transaction limits, Volume caps, Honeypot detection).
- Tool Policies: Fine-grained execution control (Auto-run vs. Requires-Human-Approval).
- Safety: Built on Rust's type-safety and ownership model to prevent common concurrency bugs in high-frequency trading.
4. Integration & Automation
- Strategy Pipeline: Decoupled Detection -> Analysis -> Execution workflow.
- Skill System: Expand agent capabilities via simple Rust functions using the
#[tool]macro. - Notification Bus: Real-time alerts via Telegram, Discord, and Webhooks.
Documentation & API
AAGT follows a strictly decoupled design. For detailed information on specific interfaces, methods, and configurations, please refer to our comprehensive API documentation:
Download / View API Reference (API_REFERENCE.md)
Key API Sections inside the Reference:
- Core Agent API: Building and running agents.
- Memory & Persistence: Managing state and long-term knowledge.
- Risk Control: Implementing trading safety checks.
- Multi-Agent Coordination: Orchestrating multiple expert agents.
Getting Started
use *;
use OpenAI;
async
Support the Project
If you find AAGT useful, consider supporting the developers:
Buy Me a Coffee: https://buymeacoffee.com/undeadundead
Crypto Donations:
- Solana:
9QFKQ3jpBSuNPLZQH1uq5GrJm4RDKue82zeVaXwazcmj - Base:
0x4cf0b79aea1c229dfb1df9e2b40ea5dd04f37969
License
MIT / Apache 2.0
Built with Rust | Production-Ready v0.1.3