Module 13: Adapters & ExtensionsIntegrating with new venues, data sources, and extending system capabilities
1. Adapter Architecture
Adapters serve as the bridge between the system core and external venues. Adhering to the Hexagonal Architecture (Module 03), the core engine remains agnostic to any specific exchange or market data source.
flowchart LR
subgraph core["🔷 NautilusTrader Core"]
direction TB
de["DataEngine"]
ee["ExecutionEngine"]
end
subgraph ports["📌 Ports & Adapters"]
direction LR
binance["Binance"]
ib["Interactive Brokers"]
custom["Custom Adapter"]
end
core ==> ports
style core fill:#0f1419,stroke:#4fc3f7,stroke-width:2px
style ports fill:#0f1419,stroke:#ab47bc,stroke-width:1px
2. Supported Integrations in the 2026-03-25 Snapshot (15 total)
| Adapter | Asset Class | Supported Features | Notes |
|---|---|---|---|
| Binance | Crypto Exchange (CEX) | Market data + execution | Stable integration with broad spot and derivatives coverage. |
| BitMEX | Crypto Exchange (CEX) | Market data + execution | Focused on perpetuals and futures. |
| Bybit | Crypto Exchange (CEX) | Market data + execution | Supports spot, derivatives, and Unified Trading Accounts. |
| Deribit | Crypto Exchange (CEX) | Market data + execution | Best known for crypto options and derivatives. |
| Kraken | Crypto Exchange (CEX) | Market data + execution | Stable venue coverage across spot and futures workflows. |
| OKX | Crypto Exchange (CEX) | Market data + execution | Covers spot, derivatives, and options workflows. |
| AX Exchange | Perpetuals Exchange | Market data + execution | Beta integration in the 2026-03-25 snapshot. |
| Architect | Brokerage (multi-venue) | Planned multi-venue brokerage support | Listed as planned in the official integrations index. |
| dYdX | Crypto Exchange (DEX) | Market data + execution | Decentralized derivatives venue. |
| Hyperliquid | Crypto Exchange (DEX) | Market data + execution | High-performance on-chain perpetuals venue. |
| Polymarket | Prediction Market (DEX) | Market data + execution | Event-contract venue with a specialized market model. |
| Interactive Brokers | Brokerage (multi-venue) | Market data + execution | Broad coverage across equities, futures, options, and FX. |
| Databento | Data Provider | Historical + live market data | Professional-grade data adapter with no execution layer. |
| Tardis | Crypto Data Provider | Historical market data | Specialized crypto data provider with broad exchange coverage. |
| Betfair | Sports Betting Exchange | Market data + execution | Includes the domain-specific BettingInstrument. |
This table follows the official integrations index in the 2026-03-25 NautilusTrader snapshot. Sandbox is not a native integration; it is an execution environment. AX Exchange and Architect are separate entries, with AX Exchange listed as a beta perpetuals venue and Architect listed as a planned multi-venue brokerage integration.
3. Internal Adapter Architecture
Each adapter typically consists of the following components:
flowchart LR
subgraph clients["🔌 Client Implementations"]
direction TB
dc["DataClient<br />(WebSocket)"]
ec["ExecutionClient<br />(REST API)"]
end
subgraph internal["🧩 Internal Mechanisms"]
direction TB
config["Configuration Mapping"]
parsers["Data Parsers"]
end
clients ==> internal
style clients fill:#0f1419,stroke:#4fc3f7,stroke-width:1px
style internal fill:#0f1419,stroke:#ab47bc,stroke-width:1px
4. Custom Actor & System Extensions
In addition to trading strategies, you can use Actors to extend system functionality:
Data Ingestors
Build custom Actors to collect data from third-party APIs (e.g., news, social media) and publish it to the MessageBus.
Notification Services
Create an Actor to listen to trading events and dispatch Telegram/Email notifications when orders fill or stop-loss logic triggers.
Performance Monitoring
Create an Actor to subscribe to all order events, calculating and displaying strategy performance metrics in real time.
Custom Indicators
When built-in indicators are insufficient, inherit from the Indicator base class to implement custom technical indicators.
from nautilus_trader.common.actor import Actor
from nautilus_trader.config import ActorConfig
class AlertActorConfig(ActorConfig, frozen=True):
"""Configuration for the alert Actor"""
instrument_id: InstrumentId
price_threshold: float # Price threshold to trigger the alert
class AlertActor(Actor):
"""Dispatches notifications when the price exceeds the threshold"""
def __init__(self, config: AlertActorConfig):
super().__init__(config)
self.instrument_id = config.instrument_id
self.threshold = config.price_threshold
def on_start(self):
# Subscribe to quote updates
self.subscribe_quote_ticks(self.instrument_id)
def on_quote_tick(self, tick):
if tick.ask_price.as_double() > self.threshold:
self.log.warning(f"⚠️ THRESHOLD BREACH: Price exceeded {self.threshold}!")
# Add Telegram/Email notification logic here
5. Extension Points Overview
| Extension Point | Base Class | Purpose |
|---|---|---|
| Trading Strategy | Strategy | Implements trading logic. |
| Generic Components | Actor | Non-order-routing generalized logic (monitoring, notifications, data ingestion). |
| Data Client | DataClient | Connects to new market data sources. |
| Execution Client | ExecutionClient | Connects to new exchange execution APIs. |
| Technical Indicators | Indicator | Custom technical indicator calculations. |
| Matching Model | FillModel | Custom backtest matching and slippage logic. |
6. Interactive Exercises
Design an Actor that logs a warning when a strategy’s open position PnL exceeds 5% of the account balance. What data must it subscribe to, and what cache states must it read?
Design Logic:
on_start:self.subscribe_quote_ticks(instrument_id)# Subscribe to quote updates
on_quote_tick:unrealized = self.portfolio.unrealized_pnl(instrument_id)account = self.cache.account(account_id)balance = account.balance_total(Currency.from_str("USDT"))pnl_ratio = abs(unrealized / balance)if pnl_ratio > 0.05:
self.log.warning(f"⚠️ Position PnL exceeds 5%: {pnl_ratio:.1%}")
💡 Architectural Insights:
- Actors cannot route orders; they are meant for monitoring, coordination, and notifications.
- If automatic position liquidation is required, it should be implemented within a
Strategy. - Implement a cooldown period to prevent redundant alerts during high volatility.
Which adapter would you choose for the following scenarios?
- You want to trade US equities and futures.
- You want to trade BTC perpetuals with competitive fee tiers.
- You want to run backtests using historical crypto tick data.
- You want to trade BTC options.
- Interactive Brokers ← Broadest coverage of traditional markets.
- Bybit or Binance ← Both support perpetuals with competitive fee tiers.
- Tardis ← Dedicated historical crypto data provider covering 30+ exchanges.
- Deribit ← The largest crypto options exchange.
Tardis (Data) + Deribit (Execution) = Backtesting with historical data + live trading execution.
You want to create a “VWAP Deviation” indicator that calculates the percentage deviation of the current price from the VWAP. Which base class should you inherit from, and what methods must be implemented?
Design:
- Inherit from the
Indicatorbase class. - Implement the
handle_bar(bar)method. - Internal State Management:
cumulative_volume += bar.volumecumulative_value += bar.close * bar.volumevwap = cumulative_value / cumulative_volumeself.value = (bar.close - vwap) / vwap * 100
- Reset Method:
reset()to clear cumulative values.
💡 Custom indicators are highly versatile:
You can build custom indicators and use them in strategies the same way you use the built-in indicators.
7. Module Key Takeaways
- Hexagonal Architecture ensures that integrating new adapters requires no modifications to the core code.
- 16 Officially Supported Adapters cover cryptocurrencies, traditional finance, DeFi, sports betting, prediction markets, and market data providers.
- Actors: Generic components for logic that does not involve order routing.
- 6 Extension Points: Strategy, Actor, DataClient, ExecutionClient, Indicator, and FillModel.
- Each adapter encapsulates configurations, data clients, execution clients, and data parsers.
You now have a comprehensive understanding of NautilusTrader’s architecture, core components, strategy development, and deployment workflows.
Recommended Next Steps:
- Start hands-on practice with the
ema_cross.pyexample. - Run your first strategy through the backtest engine.
- Join the NautilusTrader community and explore advanced topics in the official documentation.