Skip to main content

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').

  1. Exchanges are perp and spot. Market ids are the venue's numeric market_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's asset_id ('3' is USDC).
  2. 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.
  3. 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, LIMIT and POST_ONLY orders, and every cancellation method. Order ids are client order indexes.
  4. Perpetual fees, margin and funding are in USDC. Spot fees are charged in the asset a fill delivers, so spot rules().fee_asset is None and each Trade.fee names it.
  5. 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.

Metadata

Release files for tribulnation-lighter 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tribulnation-lighter 0.2.0
File Size Uploaded
tribulnation_lighter-0.2.0.tar.gz 18.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tribulnation-lighter 0.2.0
File Interpreter ABI Platform
tribulnation_lighter-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 42.2 kB

Release files / tribulnation_lighter-0.2.0.tar.gz

Download URL tribulnation_lighter-0.2.0.tar.gz
Size 18.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8597712093bfe57939b6060c9831c50f28cdada8f8d8973f91ab6966e5e3cd91
BLAKE2b-256 checksum
How to use checksums
f9b30622543abaa949d3dc4d1fff1d51fc0bca83e427fbfd4f53ba814121a68c
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 29, 2026.

Transparency log

Release files / tribulnation_lighter-0.2.0-py3-none-any.whl

Download URL tribulnation_lighter-0.2.0-py3-none-any.whl
Size 23.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8309b38485ac94184b795aaa91b6c2c02fab574b04babbe25fe9f99cd5883356
BLAKE2b-256 checksum
How to use checksums
36a01d859632ae14b4884a26fa53c40df1e8a57c1b87b1ab879e24687a9fe2f4
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 29, 2026.

Transparency log

Release history Release notifications | RSS feed

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page