Skip to main content

sol-feed (Python)

Python client for the Lunar Shadow Labs feed: decoded Solana DEX swaps, launches, migrations, pool creations and liquidity changes on 12 venues, over one WebSocket, in one JSON shape. Market data only.

pip install sol-feed
import asyncio, os
from sol_feed import Feed, ui_amount

async def main():
    async for m in Feed(os.environ["LSL_KEY"], kinds=["swap"], venues=["pump", "pumpswap"]):
        if m["kind"] == "gap":
            print("gap:", m["reason"], m["missed"])   # the only indication that data was missed
            continue
        side = "buy" if m["is_buy"] else "sell"
        print(m["venue"], side, ui_amount(m["base_amount"], m["base_decimals"]), m["base_mint"], m["price"])

asyncio.run(main())

LSL_KEY is the API key on your account page (it is not your Whop license key).

What the client does for you

  • Sends the key as an Authorization: Bearer header (never in the URL).
  • Reconnects with exponential backoff (1 s → 30 s, with jitter) and resumes from the last message it gave you (?since=<epoch>:<seq>), so a short disconnect loses nothing that is still in the server's buffer. Anything that could not be recovered arrives as a gap message.
  • Handles hello and heartbeat internally; you receive events and gaps only.
  • Raises AuthError for an unknown, expired or revoked key and FeedError for a request the server rejects (for example an unknown kind or venue name). Those are not retried.

Options

argument meaning
kinds swap, launch, curve_complete, migration, pool_create, liquidity, mint_update
venues pump, pumpswap, launchlab, meteora_dbc, raydium_v4, raydium_cpmm, raydium_clmm, pancake_v3, orca, meteora_dlmm, meteora_damm_v1, meteora_damm_v2, and token2022 (token-extension updates, the venue of every mint_update)
watch mints, pools or wallets to follow (a wallet matches every event it is the actor of)
url defaults to wss://feed.lunarshadowlabs.com/ws
on_reconnect callable(info) with attempt, delay, reason, called before each reconnect

With no filter at all, the server applies the filter saved on your account page.

Breaking out of async for m in Feed(...) closes the connection. If you keep the iterator from feed.events() in a variable, call await it.aclose() when you are done, or the connection keeps one of your key's connection slots until it is garbage-collected.

ui_amount(amount, decimals) scales a raw amount string to an exact Decimal (amounts are strings because they exceed the integers a float can hold).

The full message reference is at https://lunarshadowlabs.com/docs/.

License

MIT

Metadata

Release files for sol-feed 0.1.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 sol-feed 0.1.0
File Size Uploaded
sol_feed-0.1.0.tar.gz 6.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sol-feed 0.1.0
File Interpreter ABI Platform
sol_feed-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.9 kB

Release files / sol_feed-0.1.0.tar.gz

Download URL sol_feed-0.1.0.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6ac2e3334122680a81eabfbc139de9528607284e98c381e1cc38a28739ee251f
BLAKE2b-256 checksum
How to use checksums
8af29be5bae8a2cf808baa8f02e397073aa1075908f53ce44e406ad887110ebf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / sol_feed-0.1.0-py3-none-any.whl

Download URL sol_feed-0.1.0-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
473c6daad3e2889e0e062574b5a961739addb0a973cf6cd76c32d6e0fb063731
BLAKE2b-256 checksum
How to use checksums
f7b3f4a321477675bd07101f5c56a45421192cf6b1a00e283a7a9d6653351da9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

0.1.1

2 release files

This release

0.1.0 This release

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