Discover MCPs & agents
Loading MCPs and agents…
Loading MCPs and agents…
AstraQuant | Autonomous crypto trading system with multi-LLM council, deterministic Python risk gates & OKX execution · 多大模型与确定性代码风控量化交易系统
GitHub checked 751h ago - refresh overdue
AstraQuant combines large language models (macro, technical, and microstructure analysis) with deterministic Python risk management and OKX-native conditional order execution.
Preview · Quick Start · Referral · Architecture · Market Factors · Risk Control · Deploy · Code Map
Quant Trading Workstation![]() | Chain-of-Thought (CoT) Decision Drawer![]() |
Execution Risk Control Center![]() | Multi-Model Committee Board![]() |
Prompt Engineering Studio![]() | Closed-Loop Self-Evolution Hub![]() |
LLM Gateway & Thinking Config![]() | System Governance & Admin Overview![]() |
Security & Credential Plaza![]() | Factor Telemetry Table![]() |
git clone https://github.com/0xethanq/astra-quant-agent.git && cd astra-quant-agent
./setup.sh # Interactive onboarding wizard (recommended)
# Container launch: ./deploy/docker-start.sh | Bare-metal: ./deploy/install.sh && ./start.sh
| Service Surface | Local Access URL | Role & Purpose |
|---|---|---|
| Trading Workstation | http://localhost:8080/trading | Real-time position HUD & factor telemetry |
| Admin Control Plane | http://localhost:8080/admin/login | Risk settings, prompt studio, API keys |
| API Documentation | http://localhost:8080/docs | OpenAPI schema & endpoint specifications |
Fail-Closed Default: AstraQuant boots in paper trading mode (
demo) by default. Live execution is physically blocked until exchange credentials are provided and validated via read-only balance snapshots.
Trading API Compatibility Notice: AstraQuant's autonomous execution engine only supports OKX native API. Binance and Gate.io are community partner links provided solely for registration discounts and fee rebates; our automated trading system does not support direct API execution on other exchanges.
| Exchange | Role & Compatibility | Referral Link | Code | Special Note |
|---|---|---|---|---|
| OKX | Native Trading Supported (Official Engine Target) | Register on OKX | 48039151 | Supports new accounts & dormant accounts (inactive > 180 days) |
| Binance | Partner Promotion Only (No API Trading) | Register on Binance | CPA_00N8UVQ2OG | Exclusive fee rebate link; not supported by trading engine |
| Gate.io | Partner Promotion Only (No API Trading) | Register on Gate | MCHDBKYF | Exclusive fee rebate link; not supported by trading engine |
AstraQuant executes on a 15-minute trading cycle across four decoupled boundaries:
1. Market Ingestion & Factors ──> CVD, Orderbook Imbalance (OBI), Funding Rate, Options IV Skew, VWAP
2. Multi-Model Council (LLMs) ──> Macro, Trend, and Microstructure seats analyze & synthesize order intent
3. Python Physical Risk Gates ──> Sizing clamps, R:R floor verification, same-direction cap, circuit breaker
4. OKX Execution & Cloud OCO ──> Passive BBO Maker limits, scale-out TP legs, and 100% cloud stop-loss
Rather than relying purely on lagging indicators, AstraQuant continuously calculates derivative market metrics:
| Dimension | Key Metrics | Role in Strategy |
|---|---|---|
| Order Flow & Taker Delta | Cumulative Volume Delta (CVD) Divergence, Whale Taker Flow | Identifies aggressive buying or selling absorbing passive liquidity |
| Orderbook Microstructure | Order Book Imbalance (OBI), Top-20 L2 Depth Asymmetry | Measures instantaneous book liquidity and bid/ask resistance |
| Settlement & Open Interest | Funding Rate Velocity, Open Interest (OI) Acceleration | Gauges leverage crowding and liquidation vulnerability |
| Volatility Surface | Implied Volatility (IV) Skew, Max Pain Strike Distance | Evaluates market tail-risk expectations and institutional hedging |
| Structural Benchmarks | Volume-Weighted Average Price (VWAP ±1σ / ±2σ), VPVR POC | Locates institutional fair-value zones and mean-reversion boundaries |
| Trend & Momentum | MACD Histogram Velocity & Acceleration, ADX Vector | Distinguishes trend continuation from exhaustion chop |
Risk rules are enforced strictly by Python code (scripts/risk_constants.py). Baseline parameters:
| Parameter | Baseline Value | Description |
|---|---|---|
| Max Concurrent Positions | 6 positions | Upper limit of active open positions across all instruments |
| Max Same-Direction Positions | 4 positions | Prevents directional over-exposure during market-wide correlated moves |
| Max Single-Asset Margin | Equity × 30% | Prevents concentration risk in a single coin |
| Intraday Drawdown Breaker | min(150 USDT, Equity × 5%) | Halts new entries for 24h if daily drawdown threshold is breached |
| Dynamic Leverage Clamp | 2.0x – 5.0x | Clamped to instrument ATR and liquidity limits |
| Minimum Reward:Risk (R:R) | R:R ≥ 2.0 | Prohibits low-expectancy trades; requires favorable risk-reward |
| Time Invalidation Stop | 4.0 hours | Closes stagnant positions that fail to expand within the expected window |
| Cloud Stop-Loss Coverage | 100% | Every position is covered by exchange-side cloud conditional orders |
💡 Cloud Server Security Group & Port Notice: When deploying on a cloud VPS (AWS, GCP, DigitalOcean, Alibaba Cloud, etc.), verify inbound firewall rules in your cloud console:
- 8080 (TCP Inbound): AstraQuant Trading Workstation & Admin Plane;
- 22 (TCP Inbound): SSH remote access and server operations;
- 443 (TCP Outbound): OKX V5 REST API & LLM gateway connectivity.
⚠️ API Security Redline: OKX API Key requires only Read and Trade permissions. Never enable Withdrawal permissions. IP binding to your static server IP is strongly advised.
| Mode | Host Prerequisites | Highlights & Target | Recommendation |
|---|---|---|---|
| Docker Compose (Recommended) | Docker & Docker Compose | Zero host dependency, auto multi-stage build, supervised watchdog | ⭐⭐⭐⭐⭐ |
| Bare Metal Linux / macOS | Python 3.11+ (python3-venv), Node.js 18+, Git | Local source development and memory-constrained environments | ⭐⭐⭐ |
git clone https://github.com/0xethanq/astra-quant-agent.git && cd astra-quant-agent
./setup.sh # Interactive CLI onboarding wizard
./deploy/docker-start.sh # Builds and launches backend & gateway daemons
docker compose ps # Check container health
git clone https://github.com/0xethanq/astra-quant-agent.git && cd astra-quant-agent
sh deploy/install.sh # Installs Python environment & dependencies
./setup.sh # Prepares .env configuration
cd frontend && npm install && npm run build && cd ..
./start.sh # Starts control plane on http://0.0.0.0:8080
# Tier 0: Core Quant & Execution Gates (~20s)
.venv/bin/pytest tests/trading tests/venues tests/risk tests/backtest -n auto -q
# Tier 1: Multi-Model & Frontend Integration Gates (~60s)
.venv/bin/pytest tests/llm tests/ui tests/core -n auto -q
cd frontend && npm run build && npx vue-tsc --noEmit && node --test tests/*.test.mjs && cd ..
# Tier 2: Architectural Audit & Invariant Gates (~90s)
.venv/bin/pytest tests/audit tests/extraction tests/ops -n auto -q
This repository has never contained an
OPENCODE.md. Authoritative architectural entry points:
| Domain | Specification Document | Key Scope |
|---|---|---|
| Architecture Overview | docs/STRUCTURE_OVERVIEW.md | Layered architecture and subsystem directory layout |
| Backend Layering | astra_backend/README.md | Backend layering (L0 Facade / L1 Wiring / L2 Routes / L3 Domain / L4 Subpackages) |
| Runtime Scripts & Daemons | scripts/README.md | Runtime scripts & daemons (38 root-level scripts, daemons, and scheduling mechanics) |
| Prompt Engineering | docs/PROMPT_GUIDE.md | JSON-only prompt library, 8 semantic slots, council doctrines |
| Failure Semantics | docs/FAILURE_SEMANTICS.md | Real-world failure post-mortems and defensive invariants |
| Beijing Time Contract | docs/BEIJING_TIME_CONTRACT.md | Unified UTC+8 financial accounting and settlement foundation |
| Frontend Architecture | frontend/src/components/admin/README.md | Frontend components & state (Vue 3, composables, stores) |
| Standalone Deployment | STANDALONE.md | Environment configuration and host-native execution |
| Disaster Recovery | RECOVERY_GUIDE.md | Emergency liquidation and state recovery playbooks |
| Observability | deploy/observability/README.md | Prometheus metrics scraping and Grafana dashboards |
Continuous Governance Gates:
| Gate | Scope & Protection |
|---|---|
tests/audit/test_directory_docs_current.py | Ensures all modules are registered in __init__.py and documented |
tests/core/test_readme_baseline_numbers.py | Keeps test count baselines aligned with actual test suites |
tests/audit/test_doc_paths_are_committed.py | Ensures all source paths referenced in documentation exist and are tracked |
astra (packages astra_backend, astra_gateway; configuration prefix ASTRA_*)Three historical markers are intentionally preserved to protect live production state and open positions (tests/audit/test_brand_strings_are_consistent.py):
t-r20sl* / t-r20tp*: Open orders placed prior to namespace upgrade remain live on exchange matching engines. Preserved so cloud ratchets maintain tracking; new orders use astrasl / astratp.R20GCM2 + NUL: Historic backups must remain decryptable. New archives use ASTRAGCM.cpa.r20.cn in test fixtures: The maintainer's internal DNS gateway for upstream LLM routing, not a repository namespace.AstraQuant officially links to and endorses the LINUX DO (linux.do) open-source community.
demo) before committing live capital.AstraQuant is distributed under the GNU Affero General Public License v3.0 (AGPL-3.0) with the Commons Clause Condition v1.0 and Anti-Scam Addendum.
GitHub checked 88h ago - refresh overdue. Recently viewed repositories target hourly refresh.