{"id":50496032,"url":"https://github.com/0xfnzero/sol-parser-sdk-python","last_synced_at":"2026-06-02T07:03:05.416Z","repository":{"id":349401755,"uuid":"1202140993","full_name":"0xfnzero/sol-parser-sdk-python","owner":"0xfnzero","description":"High-performance Python library for parsing Solana DEX events in real-time via Yellowstone gRPC","archived":false,"fork":false,"pushed_at":"2026-05-14T23:55:26.000Z","size":272,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-15T00:40:56.908Z","etag":null,"topics":["aydium-launchpad","bonk","copy-trading-bot","fnzero","grpc","jito","letsbonk","pumpfun","pumpswap","raydium","raydium-launchlab","shreds","shredstream","sniper","streaming","swqos","yellowstone","yellowstonegrpc"],"latest_commit_sha":null,"homepage":"https://fnzero.dev","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xfnzero.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-05T16:47:31.000Z","updated_at":"2026-05-14T23:55:29.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/0xfnzero/sol-parser-sdk-python","commit_stats":null,"previous_names":["0xfnzero/sol-parser-sdk-python"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/0xfnzero/sol-parser-sdk-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xfnzero%2Fsol-parser-sdk-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xfnzero%2Fsol-parser-sdk-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xfnzero%2Fsol-parser-sdk-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xfnzero%2Fsol-parser-sdk-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xfnzero","download_url":"https://codeload.github.com/0xfnzero/sol-parser-sdk-python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xfnzero%2Fsol-parser-sdk-python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33810343,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-02T02:00:07.132Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aydium-launchpad","bonk","copy-trading-bot","fnzero","grpc","jito","letsbonk","pumpfun","pumpswap","raydium","raydium-launchlab","shreds","shredstream","sniper","streaming","swqos","yellowstone","yellowstonegrpc"],"created_at":"2026-06-02T07:03:03.847Z","updated_at":"2026-06-02T07:03:05.397Z","avatar_url":"https://github.com/0xfnzero.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003ch1\u003e⚡ Sol Parser SDK - Python\u003c/h1\u003e\n    \u003ch3\u003e\u003cem\u003eHigh-performance Solana DEX event parser for Python\u003c/em\u003e\u003c/h3\u003e\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cstrong\u003eHigh-performance Python library for parsing Solana DEX events in real-time via Yellowstone gRPC\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://pypi.org/project/sol-parser-sdk-python/\"\u003e\n        \u003cimg src=\"https://img.shields.io/pypi/v/sol-parser-sdk-python.svg\" alt=\"PyPI\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/0xfnzero/sol-parser-sdk-python/blob/main/LICENSE\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/license-MIT-blue.svg\" alt=\"License\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Python-3776AB?style=for-the-badge\u0026logo=python\u0026logoColor=white\" alt=\"Python\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Solana-9945FF?style=for-the-badge\u0026logo=solana\u0026logoColor=white\" alt=\"Solana\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/gRPC-4285F4?style=for-the-badge\u0026logo=grpc\u0026logoColor=white\" alt=\"gRPC\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"./README_CN.md\"\u003e中文\u003c/a\u003e |\n    \u003ca href=\"./README.md\"\u003eEnglish\u003c/a\u003e |\n    \u003ca href=\"https://fnzero.dev/\"\u003eWebsite\u003c/a\u003e |\n    \u003ca href=\"https://t.me/fnzero_group\"\u003eTelegram\u003c/a\u003e |\n    \u003ca href=\"https://discord.gg/vuazbGkqQE\"\u003eDiscord\u003c/a\u003e\n\u003c/p\u003e\n\n\u003e ☕ **Support This Project**\n\u003e\n\u003e This SDK is completely free and open source. However, maintaining and continuously updating it requires significant AI computing resources and token consumption. If this SDK helps with your development, consider making a monthly SOL donation — any amount is appreciated and helps keep this project alive!\n\u003e\n\u003e **Donation Wallet:** `6oW7AXz1yRb57pYSxysuXnMs2aR1ha5rzGzReZ1MjPV8`\n\n---\n\n## Other language SDKs\n\n| Language | Repository |\n|----------|------------|\n| Rust | [sol-parser-sdk](https://github.com/0xfnzero/sol-parser-sdk) |\n| Node.js | [sol-parser-sdk-nodejs](https://github.com/0xfnzero/sol-parser-sdk-nodejs) |\n| Python | [sol-parser-sdk-python](https://github.com/0xfnzero/sol-parser-sdk-python) |\n| Go | [sol-parser-sdk-golang](https://github.com/0xfnzero/sol-parser-sdk-golang) |\n\n---\n\n## Release notes\n\n### v0.5.6\n\n- Adds Meteora DBC log parsing with program-context routing and filter parity.\n- Adds Raydium CLMM/CPMM and Orca account parsers and exports.\n- Fixes default no-filter RPC/Yellowstone instruction parsing so it no longer behaves like an empty include-only filter.\n- Merges RPC ALT loaded writable/readonly keys into the full instruction account table.\n- Skips ShredStream/RPC instruction parsing early for account-only or empty include-only filters.\n\n### v0.5.5\n\n- Aligns ShredStream parsing with Rust/Node.js/Go for low-latency static-account paths.\n- Uses default pubkey placeholders for V0 ALT-loaded instruction accounts instead of dropping the instruction.\n- Adds discriminator fallback when the ShredStream outer program id is ALT-loaded.\n- Fixes Pump.fun ShredStream create/create_v2 fallback to use instruction-order accounts.\n- Improves Pump.fun v2 short-account parsing, event-type filtering, and multi-protocol routing parity.\n\n---\n\n## How to use\n\n### 1. Install\n\n**From PyPI**\n\n```bash\npip install sol-parser-sdk-python==0.5.6\n```\n\n**From source**\n\n```bash\ngit clone https://github.com/0xfnzero/sol-parser-sdk-python\ncd sol-parser-sdk-python\npip install -e .\npip install grpcio grpcio-tools protobuf base58 python-dotenv\n```\n\n### 2. Environment (Yellowstone gRPC examples)\n\nAt the **package root** (next to `pyproject.toml`):\n\n```bash\ncp .env.example .env\n# Set GRPC_URL (or GRPC_ENDPOINT) and GRPC_AUTH_TOKEN or GRPC_TOKEN\n```\n\nRun examples from that directory so `.env` is picked up (same idea as the Node.js package).\n\n**CLI overrides:** `--grpc-url` / `-g`, `--grpc-token` / `--token` (also `--grpc-url=https://host:443`). **Rust-compatible names:** `GRPC_AUTH_TOKEN` (same as [sol-parser-sdk](https://github.com/0xfnzero/sol-parser-sdk) examples), `GRPC_ENDPOINT` (alias for URL). **Legacy env:** `GEYSER_ENDPOINT` / `GEYSER_API_TOKEN`. **Precedence:** CLI \u003e `GRPC_URL` / `GRPC_ENDPOINT` \u003e `GEYSER_*` \u003e defaults; token: CLI \u003e `GRPC_AUTH_TOKEN` \u003e `GRPC_TOKEN` \u003e `GEYSER_API_TOKEN`. Explicit shell `export` wins over `.env`; `python-dotenv` does not overwrite existing variables.\n\nHelpers: `sol_parser.env_config` (`parse_grpc_credentials`, `require_grpc_env`, `parse_shredstream_url`, …), re-exported from `sol_parser`.\n\n### 3. Smoke test\n\n```bash\npython examples/pumpfun_quick_test.py\n```\n\nRequires `GRPC_URL` (or `GRPC_ENDPOINT`) and (for most providers) `GRPC_AUTH_TOKEN` or `GRPC_TOKEN` in `.env` or the environment. You can pass credentials on the command line instead; see step 2.\n\n### 4. Minimal gRPC subscribe + parse\n\n```python\nimport asyncio\nimport os\n\nimport base58\n\nfrom sol_parser import parse_logs_only\nfrom sol_parser.grpc_client import YellowstoneGrpc\nfrom sol_parser.grpc_types import Protocol, SubscribeCallbacks, transaction_filter_for_protocols\n\nasync def main():\n    endpoint = (\n        os.environ.get(\"GRPC_URL\", \"\").strip()\n        or os.environ.get(\"GRPC_ENDPOINT\", \"\").strip()\n        or os.environ.get(\"GEYSER_ENDPOINT\", \"solana-yellowstone-grpc.publicnode.com:443\")\n    )\n    token = (\n        os.environ.get(\"GRPC_AUTH_TOKEN\", \"\").strip()\n        or os.environ.get(\"GRPC_TOKEN\", \"\").strip()\n        or os.environ.get(\"GEYSER_API_TOKEN\", \"\")\n    )\n\n    client = YellowstoneGrpc(endpoint)\n    if token:\n        client.set_x_token(token)\n    await client.connect()\n\n    filter_ = transaction_filter_for_protocols([Protocol.PUMP_FUN, Protocol.PUMP_SWAP])\n    filter_.vote = False\n    filter_.failed = False\n\n    def on_update(update):\n        if update.transaction is None or update.transaction.transaction is None:\n            return\n        tx_info = update.transaction.transaction\n        slot = update.transaction.slot\n        logs = tx_info.log_messages\n        if not logs:\n            return\n        sb = bytes(tx_info.signature) if tx_info.signature else b\"\"\n        sig = base58.b58encode(sb).decode(\"ascii\") if len(sb) == 64 else \"\"\n        events = parse_logs_only(\n            logs, sig, slot, None, subscribe_tx_info=tx_info\n        )  # tx_info from gRPC update — fills accounts from instruction keys\n        for ev in events:\n            print(ev)\n\n    sub = await client.subscribe_transactions(\n        filter_,\n        SubscribeCallbacks(on_update=on_update, on_error=print, on_end=lambda: None),\n    )\n    print(\"subscribed\", sub.id)\n\n    try:\n        await asyncio.Event().wait()\n    except KeyboardInterrupt:\n        pass\n    await client.disconnect()\n\nasyncio.run(main())\n```\n\n**Lighter path:** `parse_logs_only(logs, …)` only needs log messages from the update (no full wire transaction).\n\n### 5. ShredStream (HTTP — not Yellowstone gRPC)\n\nPython includes a native ShredStream client (`ShredStreamClient`, `ShredStreamConfig`) plus the same env/CLI helpers as Node (`parse_shredstream_url`: `SHREDSTREAM_URL` / `SHRED_URL`, `--url` / `-u` / `--endpoint=`). Install the optional extra with `pip install 'sol-parser-sdk-python[shredstream]'`. ShredStream uses its own endpoint, **not** `GRPC_URL`.\n\nThe Python ShredStream hot path uses static account keys only. V0 ALT-loaded instruction accounts are represented with default pubkey placeholders, and ALT-loaded outer program ids are parsed best-effort by discriminator. Inner CPI/log-only events still require the Yellowstone/RPC paths.\n\n---\n\n## Examples\n\nFrom the **package root** after `pip install -e .`. Run with `python examples/\u003cfile\u003e.py`. Scripts are written to mirror the **output layout and env names** of [sol-parser-sdk/examples](https://github.com/0xfnzero/sol-parser-sdk/tree/main/examples) (Rust); streaming uses `subscribe_transactions` + `parse_logs_only` with the same program IDs as `TransactionFilter::for_protocols` in Rust.\n\n| Description | Run command | Source |\n|-------------|-------------|--------|\n| **PumpFun** | | |\n| PumpFun trade filtering | `python examples/pumpfun_trade_filter.py` | [pumpfun_trade_filter.py](https://github.com/0xfnzero/sol-parser-sdk-python/blob/main/examples/pumpfun_trade_filter.py) |\n| PumpFun events + metrics | `python examples/pumpfun_with_metrics.py` | [pumpfun_with_metrics.py](https://github.com/0xfnzero/sol-parser-sdk-python/blob/main/examples/pumpfun_with_metrics.py) |\n| Quick PumpFun connection test | `python examples/pumpfun_quick_test.py` | [pumpfun_quick_test.py](https://github.com/0xfnzero/sol-parser-sdk-python/blob/main/examples/pumpfun_quick_test.py) |\n| **PumpSwap** | | |\n| PumpSwap ultra-low latency | `python examples/pumpswap_low_latency.py` | [pumpswap_low_latency.py](https://github.com/0xfnzero/sol-parser-sdk-python/blob/main/examples/pumpswap_low_latency.py) |\n| PumpSwap events + metrics | `python examples/pumpswap_with_metrics.py` | [pumpswap_with_metrics.py](https://github.com/0xfnzero/sol-parser-sdk-python/blob/main/examples/pumpswap_with_metrics.py) |\n| **Meteora DAMM** | | |\n| Meteora DAMM V2 events | `python examples/meteora_damm_grpc.py` | [meteora_damm_grpc.py](https://github.com/0xfnzero/sol-parser-sdk-python/blob/main/examples/meteora_damm_grpc.py) |\n| **Multi-protocol** | | |\n| Subscribe to every program in Rust `Protocol` / `program_ids` | `python examples/multi_protocol_grpc.py` | [multi_protocol_grpc.py](https://github.com/0xfnzero/sol-parser-sdk-python/blob/main/examples/multi_protocol_grpc.py) |\n| **Utility** | | |\n| Parse tx by signature (HTTP RPC; not gRPC). `TX_SIGNATURE` / `RPC_URL` or `SOLANA_RPC_URL` in `.env` or `--sig` / `--rpc`. | `python examples/parse_tx_by_signature.py` | [parse_tx_by_signature.py](https://github.com/0xfnzero/sol-parser-sdk-python/blob/main/examples/parse_tx_by_signature.py) |\n\n**Env:** gRPC examples need **`GRPC_URL`** or **`GRPC_ENDPOINT`**, plus **`GRPC_AUTH_TOKEN`** or **`GRPC_TOKEN`** (or legacy `GEYSER_*`). See **`.env.example`**.\n\n---\n\n## Protocols\n\nPumpFun, PumpSwap, Raydium AMM V4 / CLMM / CPMM, Orca Whirlpool, Meteora DAMM V2 / DLMM, Raydium LaunchLab (see `sol_parser/`).\n\n---\n\n## Useful exports\n\n- `parse_logs_only` — log-based DEX events from gRPC log messages.\n- `format_dex_event_json` / `dex_event_to_jsonable` — pretty-print `DexEvent` as indented JSON (one field per line); `repr(ev)` is the default dataclass single-line form, not JSON.\n- `YellowstoneGrpc` — async Yellowstone gRPC client (`connect`, `subscribe_transactions`, `disconnect`).\n- `now_micros` — microsecond clock (same role as Rust `sol_parser_sdk::core::now_micros`).\n- `transaction_filter_for_protocols` / `program_ids_for_protocols` / `account_filter_for_protocols` — same program IDs as Rust `Protocol` + `for_protocols` in `grpc/filter.rs`.\n- `parse_grpc_credentials` / `require_grpc_env` — load `.env` + env + CLI (aligned with [sol-parser-sdk-nodejs](https://github.com/0xfnzero/sol-parser-sdk-nodejs) `grpc_env`).\n\n---\n\n## Advanced\n\n### Custom gRPC endpoint\n\n```python\nimport os\n\nfrom sol_parser.grpc_client import YellowstoneGrpc\n\nendpoint = os.environ.get(\"GRPC_URL\") or os.environ.get(\"GRPC_ENDPOINT\") or os.environ.get(\n    \"GEYSER_ENDPOINT\", \"solana-yellowstone-grpc.publicnode.com:443\"\n)\ntoken = (\n    os.environ.get(\"GRPC_AUTH_TOKEN\")\n    or os.environ.get(\"GRPC_TOKEN\")\n    or os.environ.get(\"GEYSER_API_TOKEN\", \"\")\n)\nclient = YellowstoneGrpc(endpoint)\nif token:\n    client.set_x_token(token)\n```\n\n### Create + buy detection\n\n`parse_logs_only` can detect create-and-buy patterns from program logs; see the PumpFun examples.\n\n---\n\n## Project structure\n\n```\nsol-parser-sdk-python/\n├── sol_parser/\n│   ├── grpc_client.py          # YellowstoneGrpc (async connect / subscribe)\n│   ├── env_config.py           # GRPC_URL, .env, CLI helpers (Node parity)\n│   ├── clock.py                # now_micros()\n│   ├── grpc_types.py           # TransactionFilter, SubscribeCallbacks, for_protocols helpers, …\n│   ├── parser.py               # parse_logs_only, …\n│   ├── geyser_pb2.py           # Generated proto (Yellowstone)\n│   └── …\n├── examples/\n│   ├── pumpfun_trade_filter.py\n│   ├── pumpfun_quick_test.py\n│   └── …\n├── .env.example\n└── pyproject.toml\n```\n\n---\n\n## Development\n\n```bash\npip install -e \".[dev]\"\npytest tests/\n```\n\n---\n\n## License\n\nMIT — https://github.com/0xfnzero/sol-parser-sdk-python\n\n---\n\n## Contact\n\n- **Repository**: https://github.com/0xfnzero/sol-parser-sdk-python  \n- **Website**: https://fnzero.dev/  \n- **Telegram**: https://t.me/fnzero_group  \n- **Discord**: https://discord.gg/vuazbGkqQE  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xfnzero%2Fsol-parser-sdk-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xfnzero%2Fsol-parser-sdk-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xfnzero%2Fsol-parser-sdk-python/lists"}