lighter-sdk 0.1.1

Rust SDK for interacting with the Lighter exchange over REST, WebSocket, and signer-backed transaction flows.
Documentation

lighter-rust

lighter-rust is an independently maintained Rust client for the Lighter exchange. The Cargo package published from this repository is lighter-sdk.

This repository is open-source work done independently and is not affiliated with, maintained by, or endorsed by Lighter.

lighter-sdk provides:

  • a signer-backed transaction client
  • REST API access
  • WebSocket streaming
  • nonce management helpers

[!WARNING] This repository was written with AI assistance and does not have complete feature or test coverage. Treat it as a useful starting point rather than a fully hardened SDK. If you plan to depend on it heavily, developing from your own fork may be the safest way to use it.

PRs or feature requests are welcome.

Install

[dependencies]
lighter-sdk = "0.1"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }

Examples

The public usage examples live in the examples/ directory and are intended to be the primary source of truth:

Run them with:

cargo run --example public_rest
cargo run --example quickstart
cargo run --example skip_nonce_order

The signer-backed examples expect:

  • LIGHTER_HOST
  • LIGHTER_SIGNER_LIB_PATH
  • LIGHTER_ACCOUNT_INDEX
  • LIGHTER_API_KEY_INDEX
  • LIGHTER_API_PRIVATE_KEY

Signer Installation

lighter-sdk does not ship the signer shared library inside the crate package. Install the signer separately from the lighter-go releases or build it from source with the lighter-go justfile.

Supported runtime lookup order:

  1. Config::with_signer_lib_path(...)
  2. LIGHTER_SIGNER_LIB_PATH
  3. next to the current executable, or in signers/ next to it
  4. the current working directory, or ./signers

Supported library filenames:

  • macOS arm64: lighter-signer-darwin-arm64.dylib
  • Linux amd64: lighter-signer-linux-amd64.so
  • Linux arm64: lighter-signer-linux-arm64.so
  • Windows amd64: lighter-signer-windows-amd64.dll

Compatibility

lighter-sdk Tested signer source Notes
0.1.1 lighter-go Shared library release/build source
0.1.0 lighter-go Initial standalone release

Reference ports used while building this crate:

SDK Repository
Go reference signer lighter-go
Python reference SDK lighter-python

Development

Local validation:

cargo fmt --check
cargo clippy --all-targets -- -D warnings
cargo test
cargo test --examples
cargo doc --no-deps
./scripts/check-package.sh
cargo publish --dry-run

For a manual publish checklist, see RELEASE.md.

There is also an ignored smoke test for validating an external signer:

LIGHTER_SIGNER_LIB_PATH=/path/to/signer \
LIGHTER_SDK_SMOKE_HOST=your-lighter-host \
LIGHTER_SDK_SMOKE_PRIVATE_KEY=... \
LIGHTER_SDK_SMOKE_API_KEY_INDEX=0 \
LIGHTER_SDK_SMOKE_ACCOUNT_INDEX=0 \
cargo test signer_client_smoke -- --ignored