AI-native plugin trading framework with full cost modeling.
Nexus is a modular, plugin-driven algorithmic trading platform designed for steady portfolio growth. It treats transaction costs, taxes, slippage, and spread as first-class citizens — not afterthoughts — ensuring strategies that backtest well also perform in production.
Nexus is built on a five-layer architecture where every component is independently scalable and replaceable:
| Layer | Purpose | Key Components |
|---|---|---|
| Presentation | Web dashboard & API consumers | React UI, WebSocket streams |
| API Gateway | Orchestration & auth | FastAPI, JWT/RBAC, rate limiting |
| Core Engine | Trade execution & risk | Order manager, cost model, risk engine |
| Plugin System | Strategy marketplace | SDK, registry, sandboxed runtime |
| Data Layer | Storage & market feeds | TimescaleDB, PostgreSQL, Redis |
Interactive architecture diagrams are available in docs/architecture/.
Strategies are self-contained plugins that implement the IStrategy interface. Developers have complete freedom in their implementation — fixed algorithms, neural networks, LLM calls, or any hybrid combination. The engine only cares about the signals that come out.
from nexus_sdk import IStrategy, Signal
class MyStrategy(IStrategy):
def evaluate(self, portfolio, market, costs):
# Your logic here — anything goes
return [Signal.buy("AAPL", weight=0.7)]Every strategy runs identically across all three modes:
- Backtest — Historical simulation with full cost model
- Paper Trade — Live market data, simulated execution
- Live Trade — Real money, real broker, same interface
The ICostModel is passed directly into every strategy's evaluate() call. Strategies can (and should) factor in commissions, spread, slippage, taxes (FIFO/LIFO), wash sale rules, and dividend withholding before emitting signals.
- Docker & Docker Compose
- Python 3.11+
- Node.js 20+
- Git
# Clone the repository
git clone https://github.com/your-org/nexus-trade-engine.git
cd nexus-trade-engine
# Start infrastructure (Postgres, TimescaleDB, Redis)
docker compose up -d
# Install engine dependencies
cd engine
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
# Run database migrations
python -m alembic upgrade head
# Seed sample market data
python ../scripts/seed_data.py
# Start the engine
uvicorn main:app --reload --port 8000# In a separate terminal — start the frontend
cd frontend
npm install
npm run devpip install nexus-trade-sdk
# or from source:
cd sdk && pip install -e .nexus-trade-engine/
├── engine/ # Core trading engine (FastAPI)
│ ├── core/ # Order management, portfolio, risk
│ │ └── execution/ # Backtest / Paper / Live backends
│ ├── plugins/ # Plugin SDK, registry, sandbox
│ ├── data/ # Market data feeds & providers
│ ├── events/ # Pub/sub event bus
│ ├── api/ # REST & WebSocket routes
│ └── db/ # Models, migrations, session
├── sdk/ # Installable SDK for strategy devs
│ └── nexus_sdk/ # IStrategy, Signal, types, testing
├── strategies/ # Example strategy plugins
│ └── examples/ # Reference implementations
├── frontend/ # React dashboard
├── tests/ # Test suite
├── scripts/ # DB init, data seeding, utilities
├── docs/ # Architecture docs & diagrams
└── docker-compose.yml # Infrastructure stack
- Install the SDK:
pip install nexus-trade-sdk - Create a manifest file (
strategy.manifest.yaml) - Implement the
IStrategyinterface - Test locally with the backtest runner
- Publish to the marketplace
See the Plugin Developer Guide for full documentation.
| Component | Technology |
|---|---|
| Engine | Python 3.11, FastAPI, Celery |
| Database | PostgreSQL 16, TimescaleDB |
| Cache | Redis 7 |
| Frontend | React 18, Vite, Tailwind CSS |
| Task Queue | Celery + Redis broker |
| Containerization | Docker, Docker Compose |
| Testing | pytest, pytest-asyncio |
- Core architecture scaffold
- Plugin SDK v1.0
- Backtest engine with full cost model
- Paper trading with live data feeds
- React dashboard MVP
- Strategy marketplace
- Live broker integration (Alpaca, IBKR)
- Multi-asset support (crypto, forex, options)
MIT License — see LICENSE for details.