How elliottech/lighter-python works
Lighter is a Python SDK for the zkLighter perpetuals exchange. Its principal workflow is constructing a client, invoking typed REST endpoint classes, and receiving deserialized account, market, or transaction data. The SDK also exposes signed transaction helpers, nonce coordination, websocket streaming, and bridge operations. The graph groups endpoint families rather than enumerating every generated API class. Relationships reflect README statements and SOURCE INDEX references; unsampled endpoint and websocket implementations limit more detailed call-flow claims.
Main entry points: api_client.py API client · signer_client.py Signer client · models Typed models · account_api.py Account endpoints
Components 20
SDK entry points
- Public exports
lighter/__init__.py
REST and data
- Account endpoints
lighter/api/account_api.py - Order endpoints
lighter/api/order_api.py - Referral endpoints
lighter/api/referral_api.py - Other REST families
lighter/api - API client
lighter/api_client.py - HTTP configuration
lighter/configuration.py - REST transport
lighter/rest.py - Response wrapper
lighter/api_response.py - API exceptions
lighter/exceptions.py - Typed models
lighter/models
Trading and signing
- Transaction endpoints
lighter/api/transaction_api.py - Signer client
lighter/signer_client.py - Nonce manager
lighter/nonce_manager.py - Transaction helpers
lighter/transactions - Native signer binaries
lighter/signers
Streaming and bridge
- Bridge endpoints
lighter/api/bridge_api.py - Websocket client
lighter/ws_client.py
Other components
- SDK caller
- Lighter exchange
Connections 28
- SDK caller → Public exports: imports SDK
README.md - Public exports → Account endpoints: exposes
lighter/__init__.py - SDK caller → Account endpoints: requests account data
README.md - Account endpoints → API client: calls
lighter/api/account_api.py - Order endpoints → API client: calls
lighter/api/order_api.py - Transaction endpoints → API client: calls
lighter/api/transaction_api.py - Referral endpoints → API client: calls
lighter/api/referral_api.py - Bridge endpoints → API client: calls
lighter/api/bridge_api.py - Other REST families → API client: uses
lighter/api/account_api.py - API client → HTTP configuration: configures
lighter/api_client.py - API client → REST transport: sends requests
lighter/api_client.py - REST transport → Lighter exchange: HTTP requests
- API client → Response wrapper: returns typed response
lighter/api_client.py - API client → API exceptions: raises
lighter/api_client.py - API client → Typed models: deserializes with
lighter/api_client.py - Account endpoints → Typed models: uses account models
lighter/api/account_api.py - Order endpoints → Typed models: uses market models
lighter/api/order_api.py - Transaction endpoints → Typed models: uses transaction models
lighter/api/transaction_api.py - Bridge endpoints → Typed models: uses bridge models
lighter/api/bridge_api.py - SDK caller → Signer client: creates and submits transactions
README.md - Signer client → Nonce manager: coordinates nonces
lighter/signer_client.py - Nonce manager → Transaction endpoints: fetches next nonce
lighter/nonce_manager.py - Signer client → Transaction helpers: uses transaction helpers
lighter/signer_client.py - Signer client → Native signer binaries: loads native signer
- Signer client → Transaction endpoints: submits transactions
- SDK caller → Websocket client: streams exchange state
README.md - Websocket client → Lighter exchange: opens websocket
- SDK caller → Bridge endpoints: uses bridge operations
lighter/api/bridge_api.py