Expand description
NautilusTrader adapter for the Lighter DEX.
The nautilus-lighter crate provides integration with the Lighter protocol for trading
perpetual futures and spot markets on the Lighter and Robinhood Chain deployments.
§NautilusTrader
NautilusTrader is an open-source, production-grade, Rust-native engine for multi-asset, multi-venue trading systems.
The system spans research, deterministic simulation, and live execution within a single event-driven architecture, providing research-to-live semantic parity.
§Feature Flags
This crate provides feature flags to control source code inclusion during compilation, depending on the intended use case, i.e. whether to provide Python bindings for the nautilus_trader Python package, or as part of a Rust only build.
python: Enables Python bindings from PyO3.extension-module: Builds as a Python extension module.
Python bindings for the Lighter adapter are intentionally scoped to configuration, enums, factory wiring, and integrator revocation. Data and execution clients are consumed directly through the Rust trait surface.
High-precision mode (128-bit value types) is enabled by default.
§Integrator attribution
On Lighter Mainnet, submitted create and modify order transactions from Plus and Premium
accounts carry the NautilusTrader integrator account index in Lighter’s L2TxAttributes. This
helps us gauge real usage of the integration and prioritize ongoing maintenance. Maker and taker
integrator fees are set to zero, so attribution adds no trading cost. All other account tiers,
sessions without an account snapshot, Lighter Testnet, and both Robinhood environments leave
L2TxAttributes empty.
Lighter requires an ApproveIntegrator approval before these attributes can be attached to
Lighter Mainnet orders. During startup, the execution client submits the required zero-fee
approval for a configured Plus or Premium L2 account. Other Lighter account tiers, sessions
without an account snapshot, Lighter Testnet, and Robinhood clients do not submit an approval.
Robinhood Mainnet instead applies the NAUTILUS referral to the account’s public L1 address
during execution-client startup. Application failures log a warning and do not block trading.
Robinhood Testnet does not apply a referral. See the Lighter integration guide
for attribution and revocation details.
Modules§
- common
- Cross-cutting types, constants, and helpers shared across HTTP and WebSocket layers.
- config
- Configuration structures for the Lighter adapter.
- data
- Live data client for the Lighter adapter.
- execution
- Live execution client for the Lighter adapter.
- factories
- Factory functions for creating Lighter clients and components.
- http
- HTTP client surface for Lighter REST endpoints.
- python
- Python bindings from
pyo3. - signing
- Lighter L2 transaction signing.
- websocket
- WebSocket client surface for Lighter streaming endpoints.