Some checks failed
CI / test (push) Has been cancelled
Implement the full autonomous trading agent architecture: - KIS broker with async API, token refresh, leaky bucket rate limiter, and hash key signing - Gemini-powered decision engine with JSON parsing and confidence threshold enforcement - Risk manager with circuit breaker (-3% P&L) and fat finger protection (30% cap) - Evolution engine for self-improving strategy generation via failure analysis - 35 passing tests written TDD-first covering risk, broker, and brain modules - CI/CD pipeline, Docker multi-stage build, and AI agent context docs Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2.3 KiB
2.3 KiB
The Ouroboros - Available Skills & Tools
Development Tools
Run Tests
pytest -v --cov=src --cov-report=term-missing
Run the full test suite with coverage reporting. Must pass before any merge.
Run Specific Test Module
pytest tests/test_risk.py -v
pytest tests/test_broker.py -v
pytest tests/test_brain.py -v
Type Checking
python -m mypy src/ --strict
Linting
ruff check src/ tests/
ruff format src/ tests/
Operational Tools
Start Trading Agent (Development)
python -m src.main --mode=paper
Runs the agent in paper-trading mode (no real orders).
Start Trading Agent (Production)
docker compose up -d ouroboros
Runs the full system via Docker Compose with all safety checks enabled.
View Logs
docker compose logs -f ouroboros
Stream JSON-formatted structured logs.
Run Backtester
python -m src.evolution.optimizer --backtest --days=30
Analyze the last 30 days of trade logs and generate performance metrics.
Evolution Tools
Generate New Strategy
python -m src.evolution.optimizer --evolve
Triggers the evolution engine to:
- Analyze
trade_logs.dbfor failing patterns - Ask Gemini to generate a new strategy
- Run tests on the new strategy
- Create a PR if tests pass
Validate Strategy
pytest tests/ -k "strategy" -v
Run only strategy-related tests to validate a new strategy file.
Deployment Tools
Build Docker Image
docker build -t ouroboros:latest .
Deploy with Docker Compose
docker compose up -d
Health Check
curl http://localhost:8080/health
Database Tools
View Trade Logs
sqlite3 data/trade_logs.db "SELECT * FROM trades ORDER BY timestamp DESC LIMIT 20;"
Export Trade History
sqlite3 -header -csv data/trade_logs.db "SELECT * FROM trades;" > trades_export.csv
Safety Checklist (Pre-Deploy)
pytest -v --cov=srcpasses with >= 80% coverageruff check src/ tests/reports no errors.envfile contains valid KIS and Gemini API keys- Circuit breaker threshold is set to -3.0% or stricter
- Rate limiter is configured for KIS API limits
- Docker health check endpoint responds 200