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 and Robinhood Mainnet, create and modify order transactions carry the
deployment-specific NautilusTrader integrator account index in L2TxAttributes across all
account tiers, including Standard. Maker and taker integrator fees are zero. Both testnets omit
integrator attributes.
Lighter requires an ApproveIntegrator approval before these attributes can be attached to
mainnet orders. During startup, each mainnet execution client submits the required zero-fee
approval for a configured L2 account with a non-maker-only API key. Both testnets skip approval.
During startup on either mainnet, when account details are available, the execution client
attempts to apply the NAUTILUS referral code to the account’s public L1 address using the
configured L2 API key. The call is best effort with a 10-second timeout, and failures do not block
trading.
Selecting either mainnet opts the account into this attribution to support NautilusTrader
development.
Both testnets skip referral attribution.
Lighter Mainnet’s referral program offers eligible referred users a 10% trading fee discount, paid as rebates. The venue determines referral acceptance and eligibility.
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.