Lighter SDK
Perpetual and spot Market support for Lighter, built on
typed-lighter. Install with pip install tribulnation-lighter.
from tribulnation.lighter import LighterMarket
async with LighterMarket.new(public=True) as venue:
perp = await venue.perp_exchange('perp')
market = await perp.market('1') # BTC
book = await market.depth(levels=5)
Account and trading methods need an API key registered for the account:
venue = LighterMarket.new(account_index=476, api_key_index=4, api_private_key='0x…')
With no arguments, the client reads LIGHTER_ACCOUNT_INDEX, LIGHTER_API_KEY_INDEX and
LIGHTER_API_PRIVATE_KEY (LIGHTER_TESTNET_* with network='testnet').
- Exchanges are
perpandspot. Market ids are the venue's numericmarket_id('0'ETH and'1'BTC perpetuals,'2048'ETH/USDC spot on mainnet): the ids orders are signed with. Symbols are API metadata only, and ids differ between networks. Asset ids are the venue'sasset_id('3'is USDC). - Public data: discovery, tickers, rules, REST depth (the top 250 orders per side,
summed per price), a shared full-book stream, candles in the six SDK intervals,
perpetual index,
perp_stats, next funding and hourly funding-rate history. - Account and trading: fees (the account's fee ticks, in parts per million), order
queries, open orders, trade history and streams with fees, positions, collateral,
available notional, funding payments,
MARKET,LIMITandPOST_ONLYorders, and every cancellation method. Order ids are client order indexes. - Perpetual fees, margin and funding are in USDC. Spot fees are charged in the asset a
fill delivers, so spot
rules().fee_assetisNoneand eachTrade.feenames it. - Perpetual collateral covers cross and isolated positions. Spot collateral supports unified accounts only.
See Lighter Market for account
configuration through MarketSDK and venue-specific semantics.
Release files for tribulnation-lighter 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tribulnation_lighter-0.1.0.tar.gz | 18.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tribulnation_lighter-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 41.9 kB
Release files / tribulnation_lighter-0.1.0.tar.gz
| Download URL | tribulnation_lighter-0.1.0.tar.gz |
|---|---|
| Size | 18.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2ad6ccde426a673bbafc486e91fe2501395e05ac2ce5b7e001e6bac13c6b9f1a
|
|
BLAKE2b-256 checksum How to use checksums |
4fb52c1a9837083c6a5a9fb6282100e3ec6e3fb69e87ee970a64e7b428eda2a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency logRelease files / tribulnation_lighter-0.1.0-py3-none-any.whl
| Download URL | tribulnation_lighter-0.1.0-py3-none-any.whl |
|---|---|
| Size | 23.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e719b6ecaf951dcb477b6b8b08ddb1068e0479304e73859d9e4725a1a085a9bc
|
|
BLAKE2b-256 checksum How to use checksums |
2ff294a22fa9d4a0fee4def474bd8c65aa1bd8d57aa9260dff1a98cbc1933408
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency log