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.
examples: Enables the crate’s example binaries.extension-module: Builds as a Python extension module.fuzz: Enables libFuzzer integration for fuzz targets.high-precision(default): Enables high-precision mode to use 128-bit value types.python: Enables Python bindings from PyO3.
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.
§Integrator attribution
NautilusTrader participates in Lighter’s partner program.
On Lighter Mainnet, create and modify order transactions from the execution client carry the
NautilusTrader integrator account index in L2TxAttributes across all account tiers, including
Standard. Maker and taker integrator fees are zero. 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 L2 account with a non-maker-only API key. Lighter Testnet and both
Robinhood environments 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
- Common HTTP and WebSocket definitions.
- 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.