sol-parser-sdk-python 0.5.14__py3-none-any.whl → 0.5.16__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sol_parser/__init__.py +2 -0
- sol_parser/event_type_parity.py +1 -0
- sol_parser/event_types.py +5 -0
- sol_parser/grpc_instruction_parser.py +4 -2
- sol_parser/grpc_types.py +3 -2
- sol_parser/inner_instruction_parser.py +3 -3
- sol_parser/instructions.py +9 -0
- sol_parser/raw_instruction.py +77 -0
- sol_parser/rpc_parser.py +4 -3
- sol_parser/shredstream_client.py +13 -0
- {sol_parser_sdk_python-0.5.14.dist-info → sol_parser_sdk_python-0.5.16.dist-info}/METADATA +41 -15
- {sol_parser_sdk_python-0.5.14.dist-info → sol_parser_sdk_python-0.5.16.dist-info}/RECORD +14 -13
- {sol_parser_sdk_python-0.5.14.dist-info → sol_parser_sdk_python-0.5.16.dist-info}/WHEEL +0 -0
- {sol_parser_sdk_python-0.5.14.dist-info → sol_parser_sdk_python-0.5.16.dist-info}/entry_points.txt +0 -0
sol_parser/__init__.py
CHANGED
|
@@ -513,6 +513,8 @@ from .pump_upgrade import PumpFunPostCompleteBuyEvent, PumpFunSweepBondingCurveF
|
|
|
513
513
|
__all__ += ['decode_pump_multi_hop_intent','PumpFunPostCompleteBuyEvent','PumpFunSweepBondingCurveFeeEvent','PumpFunCompleteEvent','PumpSwapSweepPoolFeeEvent']
|
|
514
514
|
|
|
515
515
|
from .pump_routes import PumpRouteHop, PumpRouteIntentEvent
|
|
516
|
+
from .raw_instruction import RawInstructionEvent, RawInstructionDex, RawInstructionDexType
|
|
517
|
+
__all__ += ["RawInstructionEvent", "RawInstructionDex", "RawInstructionDexType"]
|
|
516
518
|
from .shredstream_client import parse_shred_transaction, parse_shred_transaction_with_loaded_addresses, parse_shred_transaction_best_effort
|
|
517
519
|
|
|
518
520
|
__all__ += ["PumpRouteHop", "PumpRouteIntentEvent", "parse_shred_transaction", "parse_shred_transaction_with_loaded_addresses", "parse_shred_transaction_best_effort"]
|
sol_parser/event_type_parity.py
CHANGED
sol_parser/event_types.py
CHANGED
|
@@ -1816,6 +1816,11 @@ def to_typed_event(event: dict) -> Optional[TypedDexEvent]:
|
|
|
1816
1816
|
values={name:(_get_str(data,name) if typ=='pubkey' else _get_int(data,name)) for name,typ in fields}
|
|
1817
1817
|
return cls(metadata=meta,**values)
|
|
1818
1818
|
|
|
1819
|
+
if event_type == EventType.RAW_INSTRUCTION:
|
|
1820
|
+
from .raw_instruction import RawInstructionEvent, RawInstructionDex
|
|
1821
|
+
return RawInstructionEvent(metadata=meta, dexes=[RawInstructionDex(**d) for d in data.get('dexes', [])], program_id=data['program_id'],
|
|
1822
|
+
instruction_index=int(data['instruction_index']), accounts=list(data['accounts']),
|
|
1823
|
+
account_indices=list(data['account_indices']), instruction_data=list(data['instruction_data']))
|
|
1819
1824
|
if event_type == EventType.PUMP_ROUTE_INTENT:
|
|
1820
1825
|
from .pump_routes import PumpRouteHop, PumpRouteIntentEvent
|
|
1821
1826
|
return PumpRouteIntentEvent(metadata=meta,kind=data['kind'],program=data['program'],
|
|
@@ -19,6 +19,7 @@ from .grpc_types import (
|
|
|
19
19
|
event_type_filter_allows_instruction_parsing,
|
|
20
20
|
)
|
|
21
21
|
from .inner_instruction_parser import parse_inner_instruction
|
|
22
|
+
from .instructions import clear_pump_instruction_execution_amounts
|
|
22
23
|
from .instructions import (METEORA_DLMM_PROGRAM_ID, PUMPFUN_PROGRAM_ID, PUMPSWAP_PROGRAM_ID,
|
|
23
24
|
parse_inner_compiled_instruction_if_supported, parse_instruction_unified)
|
|
24
25
|
from .merger import try_merge_dex_events
|
|
@@ -395,6 +396,7 @@ def parse_instructions_enhanced_from_parsed(
|
|
|
395
396
|
ev = parse_instruction_unified(
|
|
396
397
|
data, accounts, signature, slot, tx_index, block_time_us, grpc_us, filter, pid
|
|
397
398
|
)
|
|
399
|
+
ev = clear_pump_instruction_execution_amounts(ev)
|
|
398
400
|
if ev:
|
|
399
401
|
result.append((i, None, 1, False, ev))
|
|
400
402
|
|
|
@@ -404,7 +406,7 @@ def parse_instructions_enhanced_from_parsed(
|
|
|
404
406
|
pid = get_key_b58(inner_ix.program_id_index)
|
|
405
407
|
data = bytes(inner_ix.data)
|
|
406
408
|
accounts = [get_key_b58(b) for b in bytes(inner_ix.accounts)]
|
|
407
|
-
ev = parse_inner_compiled_instruction_if_supported(
|
|
409
|
+
ev = clear_pump_instruction_execution_amounts(parse_inner_compiled_instruction_if_supported(
|
|
408
410
|
data,
|
|
409
411
|
accounts,
|
|
410
412
|
signature,
|
|
@@ -414,7 +416,7 @@ def parse_instructions_enhanced_from_parsed(
|
|
|
414
416
|
grpc_us,
|
|
415
417
|
filter,
|
|
416
418
|
pid,
|
|
417
|
-
) or parse_inner_instruction(
|
|
419
|
+
)) or parse_inner_instruction(
|
|
418
420
|
data,
|
|
419
421
|
pid,
|
|
420
422
|
_meta_dict(signature, slot, tx_index, block_time_us, grpc_us, recent_bh),
|
sol_parser/grpc_types.py
CHANGED
|
@@ -48,6 +48,7 @@ class EventType(str, Enum):
|
|
|
48
48
|
RAYDIUM_LAUNCHLAB_POOL_CREATE = "RaydiumLaunchlabPoolCreate"
|
|
49
49
|
RAYDIUM_LAUNCHLAB_MIGRATE_AMM = "RaydiumLaunchlabMigrateAmm"
|
|
50
50
|
PUMP_ROUTE_INTENT = "PumpRouteIntent"
|
|
51
|
+
RAW_INSTRUCTION = "RawInstruction"
|
|
51
52
|
# PumpFun
|
|
52
53
|
PUMP_FUN_TRADE = "PumpFunTrade"
|
|
53
54
|
PUMP_FUN_BUY = "PumpFunBuy"
|
|
@@ -313,7 +314,7 @@ RAYDIUM_LAUNCHLAB_FILTER_TYPES = (
|
|
|
313
314
|
EventType.RAYDIUM_LAUNCHLAB_MIGRATE_AMM,
|
|
314
315
|
)
|
|
315
316
|
INSTRUCTION_EVENT_TYPES = (
|
|
316
|
-
EventType.PUMP_ROUTE_INTENT,
|
|
317
|
+
EventType.PUMP_ROUTE_INTENT, EventType.RAW_INSTRUCTION,
|
|
317
318
|
*PUMPFUN_FILTER_TYPES,
|
|
318
319
|
*PUMP_FEES_EVENT_TYPES,
|
|
319
320
|
*PUMPSWAP_FILTER_TYPES,
|
|
@@ -460,7 +461,7 @@ def all_event_types() -> List[EventType]:
|
|
|
460
461
|
EventType.ACCOUNT_ORCA_TICK_ARRAY,
|
|
461
462
|
EventType.ACCOUNT_ORCA_FEE_TIER,
|
|
462
463
|
EventType.ACCOUNT_ORCA_WHIRLPOOLS_CONFIG,
|
|
463
|
-
EventType.PUMP_ROUTE_INTENT,
|
|
464
|
+
EventType.PUMP_ROUTE_INTENT, EventType.RAW_INSTRUCTION,
|
|
464
465
|
]
|
|
465
466
|
|
|
466
467
|
|
|
@@ -280,13 +280,13 @@ def parse_inner_instruction(
|
|
|
280
280
|
if program_id_b58 == PUMPFUN_PROGRAM_ID:
|
|
281
281
|
if filter is not None and not event_type_filter_includes_pumpfun(filter):
|
|
282
282
|
return None
|
|
283
|
-
if disc16 == _PUMPFUN_INNER_TRADE:
|
|
283
|
+
if disc16 == _PUMPFUN_INNER_TRADE or (disc16[:8] == _EVENT_CPI_PREFIX and disc16[8:] == _PUMPFUN_INNER_TRADE[:8]):
|
|
284
284
|
ev = parse_trade_from_data(inner, meta_d, is_created_buy)
|
|
285
285
|
return emit(ev if ev.is_valid() else None)
|
|
286
|
-
if disc16 == _PUMPFUN_INNER_CREATE:
|
|
286
|
+
if disc16 == _PUMPFUN_INNER_CREATE or (disc16[:8] == _EVENT_CPI_PREFIX and disc16[8:] == _PUMPFUN_INNER_CREATE[:8]):
|
|
287
287
|
ev = parse_create_from_data(inner, meta_d)
|
|
288
288
|
return emit(ev if ev.is_valid() else None)
|
|
289
|
-
if disc16 == _PUMPFUN_INNER_MIGRATE:
|
|
289
|
+
if disc16 == _PUMPFUN_INNER_MIGRATE or (disc16[:8] == _EVENT_CPI_PREFIX and disc16[8:] == _PUMPFUN_INNER_MIGRATE[:8]):
|
|
290
290
|
ev = parse_migrate_from_data(inner, meta_d)
|
|
291
291
|
return emit(ev if ev.is_valid() else None)
|
|
292
292
|
return None
|
sol_parser/instructions.py
CHANGED
|
@@ -76,6 +76,15 @@ PUMPSWAP_FEES_PROGRAM_ID = "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ"
|
|
|
76
76
|
PUMP_FEES_PROGRAM_ID = PUMPSWAP_FEES_PROGRAM_ID
|
|
77
77
|
|
|
78
78
|
|
|
79
|
+
def clear_pump_instruction_execution_amounts(event: Optional[DexEvent]) -> Optional[DexEvent]:
|
|
80
|
+
"""RPC/gRPC compiled arguments are limits, not observed execution amounts."""
|
|
81
|
+
if event is not None and isinstance(event.data, PumpFunTradeEvent):
|
|
82
|
+
event.data.sol_amount = 0
|
|
83
|
+
event.data.token_amount = 0
|
|
84
|
+
event.data.quote_amount = 0
|
|
85
|
+
return event
|
|
86
|
+
|
|
87
|
+
|
|
79
88
|
def _d(*xs: int) -> int:
|
|
80
89
|
return struct.unpack("<Q", bytes(xs))[0]
|
|
81
90
|
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"""Lossless outer instructions, without inferred CPI or trade semantics."""
|
|
2
|
+
from enum import Enum
|
|
3
|
+
from dataclasses import dataclass, field
|
|
4
|
+
from typing import Optional
|
|
5
|
+
from .event_types import DexEventBase
|
|
6
|
+
|
|
7
|
+
INFRASTRUCTURE_PROGRAMS = frozenset(["11111111111111111111111111111111","TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA","TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb","ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL","ComputeBudget111111111111111111111111111111","MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr","Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo","AddressLookupTab1e1111111111111111111111111","Vote111111111111111111111111111111111111111","Ed25519SigVerify111111111111111111111111111","KeccakSecp256k11111111111111111111111111111","Secp256r1SigVerify1111111111111111111111111"])
|
|
8
|
+
|
|
9
|
+
class RawInstructionDexType(str, Enum):
|
|
10
|
+
"""Stable DEX identifiers; serialized as the original strings."""
|
|
11
|
+
PUMPFUN = "pumpfun"
|
|
12
|
+
PUMPSWAP = "pumpswap"
|
|
13
|
+
RAYDIUM_LAUNCHLAB = "raydium_launchlab"
|
|
14
|
+
RAYDIUM_CPMM = "raydium_cpmm"
|
|
15
|
+
RAYDIUM_CLMM = "raydium_clmm"
|
|
16
|
+
RAYDIUM_AMM_V4 = "raydium_amm_v4"
|
|
17
|
+
ORCA_WHIRLPOOL = "orca_whirlpool"
|
|
18
|
+
METEORA_POOLS = "meteora_pools"
|
|
19
|
+
METEORA_DAMM_V2 = "meteora_damm_v2"
|
|
20
|
+
METEORA_DLMM = "meteora_dlmm"
|
|
21
|
+
METEORA_DBC = "meteora_dbc"
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@dataclass
|
|
25
|
+
class RawInstructionDex:
|
|
26
|
+
"""DEX program reference, not proof of CPI execution or a pool layout."""
|
|
27
|
+
dex_type: RawInstructionDexType
|
|
28
|
+
program_id: str
|
|
29
|
+
pool: Optional[str] = None
|
|
30
|
+
|
|
31
|
+
def __post_init__(self):
|
|
32
|
+
# Normalize JSON strings and reject unsupported identifiers.
|
|
33
|
+
self.dex_type = RawInstructionDexType(self.dex_type)
|
|
34
|
+
|
|
35
|
+
@dataclass
|
|
36
|
+
class RawInstructionEvent(DexEventBase):
|
|
37
|
+
dexes: list[RawInstructionDex] = field(default_factory=list)
|
|
38
|
+
program_id: str = ''
|
|
39
|
+
instruction_index: int = 0
|
|
40
|
+
# Original order including duplicates. None denotes an unresolved ALT key.
|
|
41
|
+
accounts: list[Optional[str]] = field(default_factory=list)
|
|
42
|
+
account_indices: list[int] = field(default_factory=list)
|
|
43
|
+
instruction_data: list[int] = field(default_factory=list)
|
|
44
|
+
|
|
45
|
+
def raw_instruction_dexes(program, accounts):
|
|
46
|
+
from . import instructions as program_ids
|
|
47
|
+
return [RawInstructionDex(name, getattr(program_ids, pid)) for name, pid, _ in _DEX_PROGRAMS
|
|
48
|
+
if program == getattr(program_ids, pid) or getattr(program_ids, pid) in accounts]
|
|
49
|
+
|
|
50
|
+
_DEX_PROGRAMS = [
|
|
51
|
+
(RawInstructionDexType.PUMPFUN, "PUMPFUN_PROGRAM_ID", "PumpFunTrade"),
|
|
52
|
+
(RawInstructionDexType.PUMPSWAP, "PUMPSWAP_PROGRAM_ID", "PumpSwapTrade"),
|
|
53
|
+
(RawInstructionDexType.RAYDIUM_LAUNCHLAB, "RAYDIUM_LAUNCHLAB_PROGRAM_ID", "RaydiumLaunchlabTrade"),
|
|
54
|
+
(RawInstructionDexType.RAYDIUM_CPMM, "RAYDIUM_CPMM_PROGRAM_ID", "RaydiumCpmmSwap"),
|
|
55
|
+
(RawInstructionDexType.RAYDIUM_CLMM, "RAYDIUM_CLMM_PROGRAM_ID", "RaydiumClmmSwap"),
|
|
56
|
+
(RawInstructionDexType.RAYDIUM_AMM_V4, "RAYDIUM_AMM_V4_PROGRAM_ID", "RaydiumAmmV4Swap"),
|
|
57
|
+
(RawInstructionDexType.ORCA_WHIRLPOOL, "ORCA_WHIRLPOOL_PROGRAM_ID", "OrcaWhirlpoolSwap"),
|
|
58
|
+
(RawInstructionDexType.METEORA_POOLS, "METEORA_POOLS_PROGRAM_ID", "MeteoraPoolsSwap"),
|
|
59
|
+
(RawInstructionDexType.METEORA_DAMM_V2, "METEORA_DAMM_V2_PROGRAM_ID", "MeteoraDammV2Swap"),
|
|
60
|
+
(RawInstructionDexType.METEORA_DLMM, "METEORA_DLMM_PROGRAM_ID", "MeteoraDlmmSwap"),
|
|
61
|
+
(RawInstructionDexType.METEORA_DBC, "METEORA_DBC_PROGRAM_ID", "MeteoraDbcSwap"),
|
|
62
|
+
]
|
|
63
|
+
|
|
64
|
+
def raw_instruction_matches_filter(dexes, filter):
|
|
65
|
+
from .grpc_types import EventType
|
|
66
|
+
if filter is None:
|
|
67
|
+
return True
|
|
68
|
+
if EventType.RAW_INSTRUCTION in (getattr(filter, "exclude_types", None) or ()):
|
|
69
|
+
return False
|
|
70
|
+
included = getattr(filter, "include_only", None)
|
|
71
|
+
if included is not None and EventType.RAW_INSTRUCTION in included:
|
|
72
|
+
return True
|
|
73
|
+
if not dexes:
|
|
74
|
+
return included is None
|
|
75
|
+
return any(dex.dex_type == name and (included is None or EventType(event) in included)
|
|
76
|
+
and filter.should_include(EventType(event))
|
|
77
|
+
for dex in dexes for name, _, event in _DEX_PROGRAMS)
|
sol_parser/rpc_parser.py
CHANGED
|
@@ -11,6 +11,7 @@ import base58
|
|
|
11
11
|
from .dex_parsers import DexEvent
|
|
12
12
|
from .grpc_types import EventTypeFilter, EventType, event_type_filter_allows_instruction_parsing
|
|
13
13
|
from .inner_instruction_parser import parse_inner_instruction
|
|
14
|
+
from .instructions import clear_pump_instruction_execution_amounts
|
|
14
15
|
from .instructions import (
|
|
15
16
|
METEORA_DLMM_PROGRAM_ID,
|
|
16
17
|
PUMPFUN_PROGRAM_ID,
|
|
@@ -386,7 +387,7 @@ def _parse_rpc_instruction(
|
|
|
386
387
|
program_id,
|
|
387
388
|
)
|
|
388
389
|
if ev:
|
|
389
|
-
return ev
|
|
390
|
+
return clear_pump_instruction_execution_amounts(ev)
|
|
390
391
|
return parse_inner_instruction(
|
|
391
392
|
data,
|
|
392
393
|
program_id,
|
|
@@ -402,9 +403,9 @@ def _parse_rpc_instruction(
|
|
|
402
403
|
is_created_buy,
|
|
403
404
|
)
|
|
404
405
|
|
|
405
|
-
return parse_instruction_unified(
|
|
406
|
+
return clear_pump_instruction_execution_amounts(parse_instruction_unified(
|
|
406
407
|
data, accounts, signature, slot, tx_index, block_time_us, grpc_recv_us, filter, program_id
|
|
407
|
-
)
|
|
408
|
+
))
|
|
408
409
|
|
|
409
410
|
|
|
410
411
|
def convert_rpc_to_grpc(
|
sol_parser/shredstream_client.py
CHANGED
|
@@ -133,6 +133,8 @@ def _should_parse_shred_instructions(filter: Optional[EventTypeFilter]) -> bool:
|
|
|
133
133
|
|
|
134
134
|
|
|
135
135
|
def _parse_decoded_shred(tx, keys, signature, slot, tx_index, recv_us, filter, best_effort=False):
|
|
136
|
+
from .raw_instruction import RawInstructionEvent, INFRASTRUCTURE_PROGRAMS, raw_instruction_dexes, raw_instruction_matches_filter
|
|
137
|
+
from .grpc_types import EventType
|
|
136
138
|
from .pump_routes import may_parse_route, parse_route
|
|
137
139
|
from .grpc_types import EventMetadata
|
|
138
140
|
if not _should_parse_shred_instructions(filter):
|
|
@@ -150,6 +152,17 @@ def _parse_decoded_shred(tx, keys, signature, slot, tx_index, recv_us, filter, b
|
|
|
150
152
|
mayhem |= m
|
|
151
153
|
out = []
|
|
152
154
|
for index, (pid, data, indices) in enumerate(instructions):
|
|
155
|
+
unknown = pid and pid not in _UNKNOWN_PROGRAM_CANDIDATES and pid not in INFRASTRUCTURE_PROGRAMS
|
|
156
|
+
explicit_raw = filter is not None and EventType.RAW_INSTRUCTION in (getattr(filter, 'include_only', None) or ())
|
|
157
|
+
dexes = raw_instruction_dexes(pid, [keys[i] if i < len(keys) else None for i in indices]) if unknown or explicit_raw else []
|
|
158
|
+
if pid and (unknown or explicit_raw) and raw_instruction_matches_filter(dexes, filter):
|
|
159
|
+
out.append(DexEvent(EventType.RAW_INSTRUCTION, RawInstructionEvent(
|
|
160
|
+
metadata=EventMetadata(signature=signature, slot=slot, tx_index=tx_index, grpc_recv_us=recv_us, recent_blockhash=msg['recentBlockhash']),
|
|
161
|
+
dexes=dexes, program_id=pid, instruction_index=index,
|
|
162
|
+
accounts=[keys[i] if i < len(keys) else None for i in indices],
|
|
163
|
+
account_indices=list(indices), instruction_data=list(data))))
|
|
164
|
+
if unknown:
|
|
165
|
+
continue
|
|
153
166
|
resolved = pid is not None and all(i < len(keys) for i in indices)
|
|
154
167
|
if not resolved and not best_effort:
|
|
155
168
|
continue
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: sol-parser-sdk-python
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.16
|
|
4
4
|
Summary: Solana DEX program log parsing (pure Python, API aligned with sol-parser-sdk)
|
|
5
5
|
Requires-Python: >=3.10
|
|
6
6
|
Requires-Dist: base58>=2.0
|
|
@@ -21,6 +21,32 @@ Requires-Dist: solders==0.26.0; extra == 'simulation'
|
|
|
21
21
|
Description-Content-Type: text/markdown
|
|
22
22
|
|
|
23
23
|
<div align="center">
|
|
24
|
+
|
|
25
|
+
## v0.5.16 — DEX-scoped RawInstruction and typed DEX identifiers
|
|
26
|
+
|
|
27
|
+
Raw instructions now respect DEX subscriptions using programs referenced by each instruction. `RawInstructionDexType` provides typed identifiers with unchanged JSON strings. Unknown router layouts do not establish pool addresses, trade direction, or method versions.
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## v0.5.16 — Pump execution replay
|
|
31
|
+
|
|
32
|
+
Current Anchor TradeEvent CPI decoding is supported alongside the historical encoding. RPC/gRPC instruction budgets and minimum outputs remain in instruction fields. Execution fields `sol_amount`, `quote_amount`, and `token_amount` come from execution events; without logs or event CPIs they remain zero (unavailable, not a proven zero fill).
|
|
33
|
+
|
|
34
|
+
Run `.venv/bin/python examples/pump_execution_replay.py` from this repository to replay real transactions fetched on 2026-10-19 offline. The example prints full/no-log/truncated-log results. Append a recent signature for online replay. Set `SOLANA_RPC_URL` for your RPC; transaction v1 is supported.
|
|
35
|
+
|
|
36
|
+
The current Delta sell signature is `4ARos3Yq1SMNE3izDpy9YdKrRgMmD7UCDxvnVrBRaGCJHiifPHSmQWc4DPfjUaEUcxS7puGmEN64K7EZdeXLJaj2` (slot 458542546). The dated fixture also includes Rapid create/buy, BuyV3, and PumpSwap buy with their full signatures and slots. Older five-combination multi-hop fixtures are retained as regression tests, not labeled as new mainnet captures.
|
|
37
|
+
|
|
38
|
+
## v0.5.16 — raw Shred instructions
|
|
39
|
+
|
|
40
|
+
Default Shred parsing emits `RawInstruction` for unsupported third-party programs, including Rapid/Delta, without inferring direction, amounts, or internal buy methods. Infrastructure programs (System, Token, ATA, ComputeBudget, etc.) are omitted by default. Supported official DEX parsers are unchanged; official Pump/PumpSwap multi-hop instructions retain `PumpRouteIntent`.
|
|
41
|
+
|
|
42
|
+
The payload contains `program_id`, `instruction_index`, `accounts`, `account_indices`, `instruction_data`, and transaction metadata. Account order and duplicates are preserved. Unresolved ALT addresses are null/None, with original indices retained; supply cached loaded addresses or a resolver. No hot-path RPC is performed. Data is copied verbatim without requiring a known layout.
|
|
43
|
+
|
|
44
|
+
Run `uv run python examples/raw_instruction_filter.py` to compare PumpFun-only, Raydium CPMM-only, and all-raw subscriptions against signed offline transactions; the output includes `dexes`.
|
|
45
|
+
|
|
46
|
+
Without a filter, unknown third-party instructions are returned. Broad trade/swap filters (for example `PumpFunTrade` or `RaydiumCpmmSwap`) also return raw instructions associated with that DEX; direction-specific filters do not infer a buy or sell. Explicit `RawInstruction` selects all outer instructions only when no protocol restriction is set; streamer protocol restrictions always apply. Excluding `RawInstruction` wins. `dex_type` uses the public `RawInstructionDexType` enum (typed string constants in Go); JSON values remain unchanged, such as `"pumpfun"` and `"raydium_cpmm"`. `dexes` contains `{ dex_type, program_id, pool }` for each recognized DEX program targeted or referenced by this instruction, not other instructions in the transaction. Multi-DEX wrappers retain every association. Unknown or unresolved ALT references cannot satisfy a DEX subscription. `pool` is currently null: an unknown wrapper layout cannot establish the pool account. A program reference is not proof of an executed CPI. Raw callbacks are not fills.
|
|
47
|
+
|
|
48
|
+
Wrapper adapter functions remain explicit compatibility helpers only; default Shred parsing does not call them. The released-version history below describes previous behavior.
|
|
49
|
+
|
|
24
50
|
<h1>⚡ Sol Parser SDK - Python</h1>
|
|
25
51
|
<h3><em>High-performance Solana DEX event parser for Python</em></h3>
|
|
26
52
|
</div>
|
|
@@ -60,11 +86,11 @@ Parser SDK language versions and related Rust SDKs:
|
|
|
60
86
|
|
|
61
87
|
| Language | Repository | Description | Version |
|
|
62
88
|
|----------|------------|-------------|---------|
|
|
63
|
-
| Rust | [sol-parser-sdk](https://github.com/0xfnzero/sol-parser-sdk) | Solana DEX transaction and account event parsing | `v0.7.
|
|
64
|
-
| Node.js | [sol-parser-sdk-nodejs](https://github.com/0xfnzero/sol-parser-sdk-nodejs) | TypeScript/JavaScript for Node.js | `v0.5.
|
|
65
|
-
| Python | [sol-parser-sdk-python](https://github.com/0xfnzero/sol-parser-sdk-python) | Async/await native support | `v0.5.
|
|
66
|
-
| Go | [sol-parser-sdk-golang](https://github.com/0xfnzero/sol-parser-sdk-golang) | Go transaction and account event parsing | `v0.5.
|
|
67
|
-
| **Rust** | [sol-shred-sdk](https://github.com/0xfnzero/sol-shred-sdk) | Raw Solana shred decoding and ShredStream DEX event parsing | `v4.0.
|
|
89
|
+
| Rust | [sol-parser-sdk](https://github.com/0xfnzero/sol-parser-sdk) | Solana DEX transaction and account event parsing | `v0.7.17` |
|
|
90
|
+
| Node.js | [sol-parser-sdk-nodejs](https://github.com/0xfnzero/sol-parser-sdk-nodejs) | TypeScript/JavaScript for Node.js | `v0.5.23` |
|
|
91
|
+
| Python | [sol-parser-sdk-python](https://github.com/0xfnzero/sol-parser-sdk-python) | Async/await native support | `v0.5.16` |
|
|
92
|
+
| Go | [sol-parser-sdk-golang](https://github.com/0xfnzero/sol-parser-sdk-golang) | Go transaction and account event parsing | `v0.5.16` |
|
|
93
|
+
| **Rust** | [sol-shred-sdk](https://github.com/0xfnzero/sol-shred-sdk) | Raw Solana shred decoding and ShredStream DEX event parsing | `v4.0.8` |
|
|
68
94
|
| **Rust** | [sol-trade-sdk](https://github.com/0xfnzero/sol-trade-sdk) | Solana DEX trade construction and transaction execution | `v6.0.2` |
|
|
69
95
|
|
|
70
96
|
---
|
|
@@ -156,7 +182,7 @@ This is the Python implementation of the FnZero Solana DEX parser SDK for asynci
|
|
|
156
182
|
**From PyPI**
|
|
157
183
|
|
|
158
184
|
```bash
|
|
159
|
-
pip install sol-parser-sdk-python==0.5.
|
|
185
|
+
pip install sol-parser-sdk-python==0.5.16
|
|
160
186
|
```
|
|
161
187
|
|
|
162
188
|
**From source**
|
|
@@ -272,18 +298,18 @@ From the **package root** after `pip install -e .`. Run with `python examples/<f
|
|
|
272
298
|
| Description | Run command | Source |
|
|
273
299
|
|-------------|-------------|--------|
|
|
274
300
|
| **PumpFun** | | |
|
|
275
|
-
| 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) | `v0.5.
|
|
276
|
-
| 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) | `v0.5.
|
|
277
|
-
| 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) | `v0.5.
|
|
301
|
+
| 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) | `v0.5.16` |
|
|
302
|
+
| 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) | `v0.5.16` |
|
|
303
|
+
| 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) | `v0.5.16` |
|
|
278
304
|
| **PumpSwap** | | |
|
|
279
|
-
| 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) | `v0.5.
|
|
280
|
-
| 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) | `v0.5.
|
|
305
|
+
| 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) | `v0.5.16` |
|
|
306
|
+
| 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) | `v0.5.16` |
|
|
281
307
|
| **Meteora DAMM** | | |
|
|
282
|
-
| 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) | `v0.5.
|
|
308
|
+
| 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) | `v0.5.16` |
|
|
283
309
|
| **Multi-protocol** | | |
|
|
284
|
-
| 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) | `v0.5.
|
|
310
|
+
| 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) | `v0.5.16` |
|
|
285
311
|
| **Utility** | | |
|
|
286
|
-
| 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) | `v0.5.
|
|
312
|
+
| 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) | `v0.5.16` |
|
|
287
313
|
|
|
288
314
|
**Env:** gRPC examples need **`GRPC_URL`** or **`GRPC_ENDPOINT`**, plus **`GRPC_AUTH_TOKEN`** or **`GRPC_TOKEN`** (or legacy `GEYSER_*`). See **`.env.example`**.
|
|
289
315
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
sol_parser/__init__.py,sha256=
|
|
1
|
+
sol_parser/__init__.py,sha256=DB52eD4ZNMpjx3MA_f3MCB87WfDiYovJU7pIgtH8Nfk,17707
|
|
2
2
|
sol_parser/account_dispatcher.py,sha256=WgWD0833ArPtXuRGMO7_URDxPhLaCcnHc-e8RNeGCJI,19947
|
|
3
3
|
sol_parser/block_meta.py,sha256=LuJ4oy6xvRmFjSIUDUG9k4Dg7q9l2xW9z35wYJdBmCw,854
|
|
4
4
|
sol_parser/check_migration.py,sha256=PsRE_Zhnw2g_iaP_iYtlGsQutE2w_FsaZIP4GPeN8-o,537
|
|
@@ -6,16 +6,16 @@ sol_parser/clock.py,sha256=RHF99qMerKvEsT55krkftIh-uqy_uTzpgdKCqKBMDmA,278
|
|
|
6
6
|
sol_parser/dex_parsers.py,sha256=eOigBKLpMQGZT_3dJwq18niDhY0fSGJrULDx_TGNC8Q,146032
|
|
7
7
|
sol_parser/entries_decode.py,sha256=MOhGadNxWLerxBhGvuNatoWa2hzw2MXVz9NmNUhWvS8,3665
|
|
8
8
|
sol_parser/env_config.py,sha256=Lw0SdZuy_MvUaVkyFxS0qPBgMzR9UBbxbN0CVz8nxg4,7296
|
|
9
|
-
sol_parser/event_type_parity.py,sha256=
|
|
10
|
-
sol_parser/event_types.py,sha256=
|
|
9
|
+
sol_parser/event_type_parity.py,sha256=G2drUpg-YDtRSzIp1zGUkVheVzfCGely3H9Uw46bqGE,4543
|
|
10
|
+
sol_parser/event_types.py,sha256=ShFAho7xGcfrtHMtkQVJlLO8L1YHeYY6bVvk4atPofE,98858
|
|
11
11
|
sol_parser/geyser_pb2.py,sha256=Hq66wmWxXD2jSbSVQW7vmBRB7nWmR1DuYDMQ6nKgl3o,20123
|
|
12
12
|
sol_parser/geyser_pb2_grpc.py,sha256=ASPmZsCNvyCzt_j4IrhKjSacWUNLVuAiLfpjmyd-2Qc,15322
|
|
13
13
|
sol_parser/grpc_client.py,sha256=fusMuSJsTPEUxgobdeimQ7s3Hu9n0bD8pIH7rEL40jM,37370
|
|
14
|
-
sol_parser/grpc_instruction_parser.py,sha256
|
|
15
|
-
sol_parser/grpc_types.py,sha256=
|
|
16
|
-
sol_parser/inner_instruction_parser.py,sha256=
|
|
14
|
+
sol_parser/grpc_instruction_parser.py,sha256=-aO5t2lMjeqePw-wR17DbkcMeCco-NU2NiqYOnSjObM,17274
|
|
15
|
+
sol_parser/grpc_types.py,sha256=bp-bsoZDWMeT44hFYJ64ksr_geeNMa_KzEKJdvGlvW8,41481
|
|
16
|
+
sol_parser/inner_instruction_parser.py,sha256=TtBAWx7WKw4pGOm1gwXDWNSfwuTko8cZ9_HryAYodCI,21911
|
|
17
17
|
sol_parser/instr_account_utils.py,sha256=MY8bgoIDiv2yJKeWxqhpfKc3pV4xUFTcYKnSXtnQMWc,1990
|
|
18
|
-
sol_parser/instructions.py,sha256=
|
|
18
|
+
sol_parser/instructions.py,sha256=j5hLBo4cduoXDu8n1ICQfc0k9tAJ3wSPJj5kWsL0KXw,88747
|
|
19
19
|
sol_parser/json_util.py,sha256=y7uCaOwmtkJtvCHx3R8ff5YxwAhTvWBTZ-duFtNRNLc,2274
|
|
20
20
|
sol_parser/liquidity_snapshot.py,sha256=kk5vC3oaOZeVoU1q4wquxRbCOWorq-fSMrNVe6BdxwU,3621
|
|
21
21
|
sol_parser/log_instr_dedup.py,sha256=gn0dWaJOrSOczKhp25mmpz7BH7A9Gemsoho7ZIa09_A,18152
|
|
@@ -26,10 +26,11 @@ sol_parser/parser.py,sha256=aSDbsbnUqBHEJ6UMdnZIuR-01fWs4_GxUwTJ3vQ0GXU,11906
|
|
|
26
26
|
sol_parser/pump_routes.py,sha256=U7FWxZYyP860jUZh5F8YKAoauki-hgmfu2DNDjEcplM,4868
|
|
27
27
|
sol_parser/pump_upgrade.py,sha256=BnVB8PVHfPtILBOlI29nbXABihVuXZUO82Yw6upFhRM,5212
|
|
28
28
|
sol_parser/pumpfun_fee_enrich.py,sha256=NHC_chCv2wuaOW5taYG8R6M1bu8cmdxcLf8cjSfo7Kc,4688
|
|
29
|
-
sol_parser/
|
|
29
|
+
sol_parser/raw_instruction.py,sha256=SmihBlAjEAxJ3XucvX2Yuw2ij9UIo9pHZT00cyOSToM,4017
|
|
30
|
+
sol_parser/rpc_parser.py,sha256=-e6IIyZQdmz-BUZiKZ5NBdcOphueIGelZTw-hXO_PpU,26022
|
|
30
31
|
sol_parser/rust_api_inventory.py,sha256=V5Bx1M3GT-ku_vj_kD6lnbqWExv1K_A00PrmhCFfRec,2257
|
|
31
32
|
sol_parser/rust_event_json.py,sha256=7hho9TGfSOQjHev_8uRa4YHU1hrEsW1RfwcU9qHYz1o,1649
|
|
32
|
-
sol_parser/shredstream_client.py,sha256=
|
|
33
|
+
sol_parser/shredstream_client.py,sha256=6JeIyTiva6BjwCn6KUgc2TaSsKPvWsQhyzsCaCqO_ak,12788
|
|
33
34
|
sol_parser/shredstream_pb2.py,sha256=BMrgCTcvRu5sY_QG1nj5AhWK9RL1fqF9Ga0xYihQfio,1703
|
|
34
35
|
sol_parser/shredstream_pb2_grpc.py,sha256=zfRJaDj-76Gbr6tC3x4gFOz6Xpu2fmJFWWcTOTmyIXs,3013
|
|
35
36
|
sol_parser/shredstream_pumpfun.py,sha256=agTryEilG7c9Ttlek2-d2fyhzwGHIKrUD9YMAJjvXfk,11187
|
|
@@ -59,7 +60,7 @@ sol_parser/grpc/subscribe_builder.py,sha256=xH9NZ1Lp-7AQKcgxoqyE0PrB3vdOqnScm_Ht
|
|
|
59
60
|
sol_parser/grpc/transaction_meta.py,sha256=NmIffIQ1_OIfWGjy6JY-f8pIK5ucjDZXXJryjnlgoQs,5894
|
|
60
61
|
sol_parser/instr/__init__.py,sha256=0_Ky8KpVEoXzxszHcHLTuY2SDsJwu0uAF2Q0wMY1e-c,503
|
|
61
62
|
sol_parser/logs/__init__.py,sha256=e1cbhbCNeXy-NZvVsYCpGksBpZf4NJBLmdlky06og-U,349
|
|
62
|
-
sol_parser_sdk_python-0.5.
|
|
63
|
-
sol_parser_sdk_python-0.5.
|
|
64
|
-
sol_parser_sdk_python-0.5.
|
|
65
|
-
sol_parser_sdk_python-0.5.
|
|
63
|
+
sol_parser_sdk_python-0.5.16.dist-info/METADATA,sha256=hGtIsJ7kovycnbuyr3l3kAwY6Qjg-izxEy_qaxaDAus,24350
|
|
64
|
+
sol_parser_sdk_python-0.5.16.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
65
|
+
sol_parser_sdk_python-0.5.16.dist-info/entry_points.txt,sha256=ZGXRb-2jBdc56d8PCAZFiJBLTAzUKFeHPohysJnKVbA,206
|
|
66
|
+
sol_parser_sdk_python-0.5.16.dist-info/RECORD,,
|
|
File without changes
|
{sol_parser_sdk_python-0.5.14.dist-info → sol_parser_sdk_python-0.5.16.dist-info}/entry_points.txt
RENAMED
|
File without changes
|