sol-parser-sdk-python 0.5.7__tar.gz → 0.5.8__tar.gz

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.
Files changed (88) hide show
  1. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/PKG-INFO +26 -9
  2. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/README.md +24 -7
  3. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/README_CN.md +24 -7
  4. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/pyproject.toml +1 -1
  5. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/__init__.py +10 -0
  6. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/account_dispatcher.py +79 -0
  7. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/account_fillers/meteora.py +10 -2
  8. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/account_fillers/raydium.py +3 -2
  9. sol_parser_sdk_python-0.5.8/sol_parser/account_fillers/raydium_launchlab.py +80 -0
  10. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/accounts/__init__.py +47 -2
  11. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/dex_parsers.py +648 -68
  12. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/event_type_parity.py +4 -0
  13. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/event_types.py +221 -3
  14. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/grpc_instruction_parser.py +85 -26
  15. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/grpc_types.py +12 -0
  16. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/inner_instruction_parser.py +5 -7
  17. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/instructions.py +213 -49
  18. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/log_instr_dedup.py +56 -12
  19. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/merger.py +73 -85
  20. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/parser.py +11 -0
  21. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/pumpfun_fee_enrich.py +2 -0
  22. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/rpc_parser.py +30 -4
  23. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/tests/test_filter_and_account_parity.py +29 -1
  24. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/tests/test_imports_and_inner.py +64 -0
  25. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/tests/test_log_instr_dedup.py +30 -0
  26. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/tests/test_orca_whirlpool_instruction_parity.py +3 -3
  27. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/tests/test_pumpfun_trade_tail.py +12 -0
  28. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/tests/test_pumpfun_v2_parity.py +4 -0
  29. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/tests/test_pumpswap_instruction.py +38 -1
  30. sol_parser_sdk_python-0.5.8/tests/test_pumpswap_upgrade.py +169 -0
  31. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/tests/test_raydium_clmm_instruction_parity.py +5 -4
  32. sol_parser_sdk_python-0.5.8/tests/test_raydium_current_logs.py +41 -0
  33. sol_parser_sdk_python-0.5.7/sol_parser/account_fillers/raydium_launchlab.py +0 -30
  34. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/.env.example +0 -0
  35. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/.gitignore +0 -0
  36. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/examples/meteora_damm_grpc.py +0 -0
  37. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/examples/multi_protocol_grpc.py +0 -0
  38. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/examples/parse_tx_by_signature.py +0 -0
  39. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/examples/pumpfun_quick_test.py +0 -0
  40. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/examples/pumpfun_trade_filter.py +0 -0
  41. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/examples/pumpfun_with_metrics.py +0 -0
  42. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/examples/pumpswap_low_latency.py +0 -0
  43. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/examples/pumpswap_with_metrics.py +0 -0
  44. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/examples/rust_example_utils.py +0 -0
  45. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/scripts/bench_parser.py +0 -0
  46. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/scripts/gen_golden_rust.sh +0 -0
  47. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/account_fillers/__init__.py +0 -0
  48. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/account_fillers/orca.py +0 -0
  49. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/account_fillers/pumpfun.py +0 -0
  50. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/account_fillers/pumpswap.py +0 -0
  51. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/accounts/raydium_orca.py +0 -0
  52. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/accounts/rpc_wallet.py +0 -0
  53. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/accounts/utils.py +0 -0
  54. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/check_migration.py +0 -0
  55. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/clock.py +0 -0
  56. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/common/__init__.py +0 -0
  57. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/entries_decode.py +0 -0
  58. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/env_config.py +0 -0
  59. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/geyser_pb2.py +0 -0
  60. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/geyser_pb2_grpc.py +0 -0
  61. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/grpc/__init__.py +0 -0
  62. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/grpc/geyser_connect.py +0 -0
  63. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/grpc/subscribe_builder.py +0 -0
  64. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/grpc/transaction_meta.py +0 -0
  65. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/grpc_client.py +0 -0
  66. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/instr/__init__.py +0 -0
  67. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/instr_account_utils.py +0 -0
  68. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/json_util.py +0 -0
  69. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/logs/__init__.py +0 -0
  70. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/market.py +0 -0
  71. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/order_buffer.py +0 -0
  72. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/rust_api_inventory.py +0 -0
  73. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/rust_event_json.py +0 -0
  74. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/shredstream_client.py +0 -0
  75. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/shredstream_pb2.py +0 -0
  76. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/shredstream_pb2_grpc.py +0 -0
  77. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/shredstream_pumpfun.py +0 -0
  78. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/solana_storage_pb2.py +0 -0
  79. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/solana_storage_pb2_grpc.py +0 -0
  80. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/u128_parity.py +0 -0
  81. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/sol_parser/verify_discriminators.py +0 -0
  82. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/tests/fixtures/golden_parse_log.json +0 -0
  83. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/tests/test_golden.py +0 -0
  84. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/tests/test_market_helpers.py +0 -0
  85. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/tests/test_order_buffer.py +0 -0
  86. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/tests/test_pump_fees_instruction_parity.py +0 -0
  87. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/tests/test_pumpfun_account_fill.py +0 -0
  88. {sol_parser_sdk_python-0.5.7 → sol_parser_sdk_python-0.5.8}/tests/test_shredstream.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: sol-parser-sdk-python
3
- Version: 0.5.7
3
+ Version: 0.5.8
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
@@ -46,12 +46,6 @@ Description-Content-Type: text/markdown
46
46
  <a href="https://discord.gg/vuazbGkqQE">Discord</a>
47
47
  </p>
48
48
 
49
- > ☕ **Support This Project**
50
- >
51
- > 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!
52
- >
53
- > **Donation Wallet:** `6oW7AXz1yRb57pYSxysuXnMs2aR1ha5rzGzReZ1MjPV8`
54
-
55
49
  ---
56
50
 
57
51
  ## Other language SDKs
@@ -65,8 +59,31 @@ Description-Content-Type: text/markdown
65
59
 
66
60
  ---
67
61
 
62
+ ## What This SDK Is For
63
+
64
+ This is the Python implementation of the FnZero Solana DEX parser SDK for asyncio services, research scripts, indexers, copy-trading systems, sniper pipelines, and backend jobs that need normalized real-time DEX events.
65
+
66
+ | Area | Coverage |
67
+ |------|----------|
68
+ | Parser inputs | Yellowstone gRPC, ShredStream, RPC transactions, encoded transactions, protocol account data |
69
+ | DEX protocols | PumpFun, PumpSwap, Pump Fees, Raydium LaunchLab, Raydium CPMM, Raydium CLMM, Raydium AMM V4, Meteora DAMM v2, Meteora DLMM, Meteora DBC, Orca Whirlpool |
70
+ | Use cases | Real-time DEX event parsing, token launch monitoring, copy trading, sniper bots, analytics notebooks, JSON event pipelines |
71
+ | Runtime | Python 3.10+, asyncio workers, backend services, data pipelines, low-latency bot infrastructure |
72
+
73
+ ---
74
+
68
75
  ## Release notes
69
76
 
77
+ ### v0.5.8
78
+
79
+ - Syncs with Rust **sol-parser-sdk 0.7.3**, including the current PumpFun, PumpSwap, and Pump Fees protocol definitions.
80
+ - Adds Meteora DAMM v2 events: `UpdateDelegatePermission`, `WithdrawDeadLiquidityReward`, `CreateConfig`, `CreateDynamicConfig`.
81
+ - Fixes DAMM v2 `EvtSwap2` full 180-byte layout, three swap modes, transfer fees, reserves, and compounding-fee layout activation slot `406048752`.
82
+ - Routes unified `EvtLiquidityChange` by `change_type` to AddLiquidity / RemoveLiquidity.
83
+ - Adds DLMM mint/user-token/`min_amount_out` context, PumpFun pre/post token & SOL balances, and LaunchLab quote/global/platform account fields.
84
+ - Adds current PumpFun/PumpSwap creator-fee and holder-reward fields across instruction, log, account, gRPC, and JSON event paths.
85
+ - Rejects truncated known PumpSwap trade and CreatePool tails while retaining complete historical layouts.
86
+
70
87
  ### v0.5.6
71
88
 
72
89
  - Adds Meteora DBC log parsing with program-context routing and filter parity.
@@ -92,7 +109,7 @@ Description-Content-Type: text/markdown
92
109
  **From PyPI**
93
110
 
94
111
  ```bash
95
- pip install sol-parser-sdk-python==0.5.7
112
+ pip install sol-parser-sdk-python==0.5.8
96
113
  ```
97
114
 
98
115
  **From source**
@@ -30,12 +30,6 @@
30
30
  <a href="https://discord.gg/vuazbGkqQE">Discord</a>
31
31
  </p>
32
32
 
33
- > ☕ **Support This Project**
34
- >
35
- > 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!
36
- >
37
- > **Donation Wallet:** `6oW7AXz1yRb57pYSxysuXnMs2aR1ha5rzGzReZ1MjPV8`
38
-
39
33
  ---
40
34
 
41
35
  ## Other language SDKs
@@ -49,8 +43,31 @@
49
43
 
50
44
  ---
51
45
 
46
+ ## What This SDK Is For
47
+
48
+ This is the Python implementation of the FnZero Solana DEX parser SDK for asyncio services, research scripts, indexers, copy-trading systems, sniper pipelines, and backend jobs that need normalized real-time DEX events.
49
+
50
+ | Area | Coverage |
51
+ |------|----------|
52
+ | Parser inputs | Yellowstone gRPC, ShredStream, RPC transactions, encoded transactions, protocol account data |
53
+ | DEX protocols | PumpFun, PumpSwap, Pump Fees, Raydium LaunchLab, Raydium CPMM, Raydium CLMM, Raydium AMM V4, Meteora DAMM v2, Meteora DLMM, Meteora DBC, Orca Whirlpool |
54
+ | Use cases | Real-time DEX event parsing, token launch monitoring, copy trading, sniper bots, analytics notebooks, JSON event pipelines |
55
+ | Runtime | Python 3.10+, asyncio workers, backend services, data pipelines, low-latency bot infrastructure |
56
+
57
+ ---
58
+
52
59
  ## Release notes
53
60
 
61
+ ### v0.5.8
62
+
63
+ - Syncs with Rust **sol-parser-sdk 0.7.3**, including the current PumpFun, PumpSwap, and Pump Fees protocol definitions.
64
+ - Adds Meteora DAMM v2 events: `UpdateDelegatePermission`, `WithdrawDeadLiquidityReward`, `CreateConfig`, `CreateDynamicConfig`.
65
+ - Fixes DAMM v2 `EvtSwap2` full 180-byte layout, three swap modes, transfer fees, reserves, and compounding-fee layout activation slot `406048752`.
66
+ - Routes unified `EvtLiquidityChange` by `change_type` to AddLiquidity / RemoveLiquidity.
67
+ - Adds DLMM mint/user-token/`min_amount_out` context, PumpFun pre/post token & SOL balances, and LaunchLab quote/global/platform account fields.
68
+ - Adds current PumpFun/PumpSwap creator-fee and holder-reward fields across instruction, log, account, gRPC, and JSON event paths.
69
+ - Rejects truncated known PumpSwap trade and CreatePool tails while retaining complete historical layouts.
70
+
54
71
  ### v0.5.6
55
72
 
56
73
  - Adds Meteora DBC log parsing with program-context routing and filter parity.
@@ -76,7 +93,7 @@
76
93
  **From PyPI**
77
94
 
78
95
  ```bash
79
- pip install sol-parser-sdk-python==0.5.7
96
+ pip install sol-parser-sdk-python==0.5.8
80
97
  ```
81
98
 
82
99
  **From source**
@@ -30,12 +30,6 @@
30
30
  <a href="https://discord.gg/vuazbGkqQE">Discord</a>
31
31
  </p>
32
32
 
33
- > ☕ **支持本项目**
34
- >
35
- > 本 SDK 完全免费且开源。但维护和持续更新需要消耗大量 AI 算力与 Token。如果这个 SDK 对您的开发有帮助,欢迎每月捐赠任意数量的 SOL,您的支持将帮助这个项目持续运行!
36
- >
37
- > **捐赠钱包:** `6oW7AXz1yRb57pYSxysuXnMs2aR1ha5rzGzReZ1MjPV8`
38
-
39
33
  ---
40
34
 
41
35
  ## 其他语言 SDK
@@ -49,8 +43,31 @@
49
43
 
50
44
  ---
51
45
 
46
+ ## 这个 SDK 适合什么场景
47
+
48
+ 这是 FnZero Solana DEX Parser SDK 的 Python 实现,适合 asyncio 服务、研究脚本、索引器、跟单系统、狙击交易管线和后端任务,把实时链上交易解析成统一的 DEX 事件。
49
+
50
+ | 范围 | 覆盖内容 |
51
+ |------|----------|
52
+ | 解析输入 | Yellowstone gRPC、ShredStream、RPC transactions、encoded transactions、协议账户数据 |
53
+ | DEX 协议 | PumpFun、PumpSwap、Pump Fees、Raydium LaunchLab、Raydium CPMM、Raydium CLMM、Raydium AMM V4、Meteora DAMM v2、Meteora DLMM、Meteora DBC、Orca Whirlpool |
54
+ | 使用场景 | 实时 DEX 事件解析、代币发射监控、跟单交易、狙击机器人、分析脚本、JSON 事件管线 |
55
+ | 运行环境 | Python 3.10+、asyncio worker、后端服务、数据管线、低延迟机器人基础设施 |
56
+
57
+ ---
58
+
52
59
  ## 发布说明
53
60
 
61
+ ### v0.5.8
62
+
63
+ - 与 Rust **sol-parser-sdk 0.7.3** 对齐,覆盖当前 PumpFun、PumpSwap 与 Pump Fees 协议定义。
64
+ - 新增 Meteora DAMM v2:`UpdateDelegatePermission`、`WithdrawDeadLiquidityReward`、`CreateConfig`、`CreateDynamicConfig`。
65
+ - 修复 DAMM v2 `EvtSwap2` 完整 180 字节布局、三种 SwapMode、transfer fee、reserve,以及 compounding-fee 布局激活槽位 `406048752`。
66
+ - 统一 `EvtLiquidityChange` 按 `change_type` 路由为 AddLiquidity / RemoveLiquidity。
67
+ - 补充 DLMM mint/用户 token/`min_amount_out`、PumpFun 交易前后余额、LaunchLab quote/global/platform 账户字段。
68
+ - 在 PumpFun/PumpSwap instruction、log、account、gRPC 与 JSON 事件链路中补齐 creator fee 和 holder reward 字段。
69
+ - 拒绝 PumpSwap trade 与 CreatePool 已知字段的截断尾部,同时兼容完整历史布局。
70
+
54
71
  ### v0.5.6
55
72
 
56
73
  - 新增 Meteora DBC 日志解析,并按当前 program context 做路由与过滤。
@@ -76,7 +93,7 @@
76
93
  **PyPI**
77
94
 
78
95
  ```bash
79
- pip install sol-parser-sdk-python==0.5.7
96
+ pip install sol-parser-sdk-python==0.5.8
80
97
  ```
81
98
 
82
99
  **源码**
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "sol-parser-sdk-python"
3
- version = "0.5.7"
3
+ version = "0.5.8"
4
4
  description = "Solana DEX program log parsing (pure Python, API aligned with sol-parser-sdk)"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -152,6 +152,11 @@ from .event_types import (
152
152
  MeteoraDammV2AddLiquidityEvent,
153
153
  MeteoraDammV2RemoveLiquidityEvent,
154
154
  MeteoraDammV2InitializePoolEvent,
155
+ MeteoraDammV2DynamicFeeParameters,
156
+ MeteoraDammV2UpdateDelegatePermissionEvent,
157
+ MeteoraDammV2WithdrawDeadLiquidityRewardEvent,
158
+ MeteoraDammV2CreateConfigEvent,
159
+ MeteoraDammV2CreateDynamicConfigEvent,
155
160
  MeteoraDbcCurveCompleteEvent,
156
161
  MeteoraDbcInitializePoolEvent,
157
162
  MeteoraDbcSwapEvent,
@@ -432,6 +437,11 @@ __all__ = [
432
437
  "MeteoraDammV2AddLiquidityEvent",
433
438
  "MeteoraDammV2RemoveLiquidityEvent",
434
439
  "MeteoraDammV2InitializePoolEvent",
440
+ "MeteoraDammV2DynamicFeeParameters",
441
+ "MeteoraDammV2UpdateDelegatePermissionEvent",
442
+ "MeteoraDammV2WithdrawDeadLiquidityRewardEvent",
443
+ "MeteoraDammV2CreateConfigEvent",
444
+ "MeteoraDammV2CreateDynamicConfigEvent",
435
445
  "MeteoraDbcCurveCompleteEvent",
436
446
  "MeteoraDbcInitializePoolEvent",
437
447
  "MeteoraDbcSwapEvent",
@@ -209,3 +209,82 @@ def fill_data(
209
209
  return
210
210
  is_pump = raw[9] != 0
211
211
  setattr(data, "is_pump_pool", is_pump)
212
+
213
+
214
+ def _account_index(transaction_pb: Any, meta_pb: Any, account: str) -> Optional[int]:
215
+ if not account or account == "11111111111111111111111111111111":
216
+ return None
217
+ msg = getattr(transaction_pb, "message", None)
218
+ if msg is None:
219
+ return None
220
+ keys: List[str] = []
221
+ for b in getattr(msg, "account_keys", []) or []:
222
+ raw = bytes(b) if not isinstance(b, (bytes, bytearray)) else bytes(b)
223
+ if len(raw) == 32:
224
+ keys.append(base58.b58encode(raw).decode("ascii"))
225
+ for b in getattr(meta_pb, "loaded_writable_addresses", []) or []:
226
+ raw = bytes(b) if not isinstance(b, (bytes, bytearray)) else bytes(b)
227
+ if len(raw) == 32:
228
+ keys.append(base58.b58encode(raw).decode("ascii"))
229
+ for b in getattr(meta_pb, "loaded_readonly_addresses", []) or []:
230
+ raw = bytes(b) if not isinstance(b, (bytes, bytearray)) else bytes(b)
231
+ if len(raw) == 32:
232
+ keys.append(base58.b58encode(raw).decode("ascii"))
233
+ try:
234
+ return keys.index(account)
235
+ except ValueError:
236
+ return None
237
+
238
+
239
+ def _token_balance_raw(t: Any) -> int:
240
+ ui = getattr(t, "ui_token_amount", None)
241
+ if ui is None:
242
+ return 0
243
+ amt = getattr(ui, "amount", None)
244
+ if amt is None:
245
+ return 0
246
+ try:
247
+ return int(str(amt))
248
+ except Exception:
249
+ return 0
250
+
251
+
252
+ def fill_token_balances(event: DexEvent, meta_pb: Any, transaction_pb: Any) -> None:
253
+ """对齐 Rust ``common_filler::fill_token_balances``(PumpFun trade 用户余额)。"""
254
+ if meta_pb is None or transaction_pb is None:
255
+ return
256
+ if event.type not in (
257
+ EventType.PUMP_FUN_TRADE,
258
+ EventType.PUMP_FUN_BUY,
259
+ EventType.PUMP_FUN_SELL,
260
+ EventType.PUMP_FUN_BUY_EXACT_SOL_IN,
261
+ ):
262
+ return
263
+ trade = event.data
264
+ user = getattr(trade, "user", "") or ""
265
+ associated_user = getattr(trade, "associated_user", "") or ""
266
+ user_idx = _account_index(transaction_pb, meta_pb, user)
267
+ if user_idx is not None:
268
+ pre_balances = list(getattr(meta_pb, "pre_balances", []) or [])
269
+ post_balances = list(getattr(meta_pb, "post_balances", []) or [])
270
+ if user_idx < len(pre_balances):
271
+ trade.pre_sol_balance = int(pre_balances[user_idx])
272
+ if user_idx < len(post_balances):
273
+ trade.post_sol_balance = int(post_balances[user_idx])
274
+ token_idx = _account_index(transaction_pb, meta_pb, associated_user)
275
+ if token_idx is None:
276
+ return
277
+ token_idx_u32 = token_idx
278
+ pre = None
279
+ post = None
280
+ for bal in getattr(meta_pb, "pre_token_balances", []) or []:
281
+ if int(getattr(bal, "account_index", -1)) == token_idx_u32:
282
+ pre = _token_balance_raw(bal)
283
+ break
284
+ for bal in getattr(meta_pb, "post_token_balances", []) or []:
285
+ if int(getattr(bal, "account_index", -1)) == token_idx_u32:
286
+ post = _token_balance_raw(bal)
287
+ break
288
+ if pre is not None or post is not None:
289
+ trade.pre_token_balance = pre if pre is not None else 0
290
+ trade.post_token_balance = post if post is not None else 0
@@ -54,8 +54,16 @@ def fill_pools_remove_liquidity_accounts(_e: Any, _get: AccountGetter) -> None:
54
54
  pass
55
55
 
56
56
 
57
- def fill_dlmm_swap_accounts(_e: Any, _get: AccountGetter) -> None:
58
- pass
57
+ def fill_dlmm_swap_accounts(e: Any, get: AccountGetter) -> None:
58
+ z = "11111111111111111111111111111111"
59
+ if not getattr(e, "user_token_in", "") or e.user_token_in == z:
60
+ e.user_token_in = get(4)
61
+ if not getattr(e, "user_token_out", "") or e.user_token_out == z:
62
+ e.user_token_out = get(5)
63
+ if not getattr(e, "token_x_mint", "") or e.token_x_mint == z:
64
+ e.token_x_mint = get(6)
65
+ if not getattr(e, "token_y_mint", "") or e.token_y_mint == z:
66
+ e.token_y_mint = get(7)
59
67
 
60
68
 
61
69
  def fill_dlmm_add_liquidity_accounts(_e: Any, _get: AccountGetter) -> None:
@@ -77,8 +77,9 @@ def fill_clmm_close_position_accounts(e: RaydiumClmmClosePositionEvent, get: Acc
77
77
  e.position_nft_mint = get(1)
78
78
 
79
79
 
80
- def fill_cpmm_swap_accounts(_e: RaydiumCpmmSwapEvent, _get: AccountGetter) -> None:
81
- pass
80
+ def fill_cpmm_swap_accounts(e: RaydiumCpmmSwapEvent, get: AccountGetter) -> None:
81
+ if _empty(e.pool_id):
82
+ e.pool_id = get(3)
82
83
 
83
84
 
84
85
  def fill_cpmm_deposit_accounts(e: RaydiumCpmmDepositEvent, get: AccountGetter) -> None:
@@ -0,0 +1,80 @@
1
+ """RaydiumLaunchlab 账户填充(对齐 ``account_fillers/raydium_launchlab.rs``)。"""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Callable
6
+
7
+ from ..event_types import RaydiumLaunchlabPoolCreateEvent, RaydiumLaunchlabTradeEvent
8
+
9
+ Z = "11111111111111111111111111111111"
10
+ RAYDIUM_LAUNCHLAB_PROGRAM_ID = "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj"
11
+
12
+
13
+ def _empty(s: str) -> bool:
14
+ return not s or s == Z
15
+
16
+
17
+ AccountGetter = Callable[[int], str]
18
+
19
+
20
+ def fill_trade_accounts(e: RaydiumLaunchlabTradeEvent, get: AccountGetter) -> None:
21
+ if _empty(e.user):
22
+ e.user = get(0)
23
+ if _empty(e.pool_state):
24
+ e.pool_state = get(4)
25
+ if _empty(e.global_config):
26
+ e.global_config = get(2)
27
+ if _empty(e.platform_config):
28
+ e.platform_config = get(3)
29
+ if _empty(e.user_base_token):
30
+ e.user_base_token = get(5)
31
+ if _empty(e.user_quote_token):
32
+ e.user_quote_token = get(6)
33
+ if _empty(e.base_vault):
34
+ e.base_vault = get(7)
35
+ if _empty(e.quote_vault):
36
+ e.quote_vault = get(8)
37
+ if _empty(e.base_mint):
38
+ e.base_mint = get(9)
39
+ if _empty(e.quote_mint):
40
+ e.quote_mint = get(10)
41
+ if _empty(e.base_token_program):
42
+ e.base_token_program = get(11)
43
+ if _empty(e.quote_token_program):
44
+ e.quote_token_program = get(12)
45
+
46
+
47
+ def fill_pool_create_accounts(e: RaydiumLaunchlabPoolCreateEvent, get: AccountGetter) -> None:
48
+ if _empty(e.pool_state):
49
+ e.pool_state = get(5)
50
+ if _empty(e.creator):
51
+ e.creator = get(1)
52
+ if _empty(e.payer):
53
+ e.payer = get(0)
54
+ if _empty(e.global_config):
55
+ e.global_config = get(2)
56
+ if _empty(e.platform_config):
57
+ e.platform_config = get(3)
58
+ if _empty(e.base_mint):
59
+ e.base_mint = get(6)
60
+ if _empty(e.quote_mint):
61
+ e.quote_mint = get(7)
62
+ if _empty(e.base_vault):
63
+ e.base_vault = get(8)
64
+ if _empty(e.quote_vault):
65
+ e.quote_vault = get(9)
66
+ # initialize / initialize_v2 use token-program indices 11-12;
67
+ # initialize_with_token_2022 uses 10-11 (detect via program id at end).
68
+ try:
69
+ if get(17) == RAYDIUM_LAUNCHLAB_PROGRAM_ID:
70
+ bi, qi = 11, 12
71
+ elif get(14) == RAYDIUM_LAUNCHLAB_PROGRAM_ID:
72
+ bi, qi = 10, 11
73
+ else:
74
+ return
75
+ except Exception:
76
+ return
77
+ if _empty(e.base_token_program):
78
+ e.base_token_program = get(bi)
79
+ if _empty(e.quote_token_program):
80
+ e.quote_token_program = get(qi)
@@ -42,10 +42,15 @@ TOKEN_ACCOUNT_SIZE = 165
42
42
  NONCE_ACCOUNT_SIZE = 80
43
43
  PUMPFUN_GLOBAL_BODY = 1037
44
44
  PUMPFUN_BONDING_CURVE_BODY = 107
45
+ PUMPFUN_BONDING_CURVE_CREATOR_FEE_BODY = 116
46
+ PUMPFUN_BONDING_CURVE_HOLDER_REWARD_BODY = 117
45
47
  PUMPFUN_GLOBAL_VOLUME_ACCUMULATOR_BODY = 536
46
48
  PUMPFUN_USER_VOLUME_ACCUMULATOR_BODY = 98
47
49
  GLOBAL_CONFIG_BODY = 634
48
- POOL_BODY = 244
50
+ POOL_LEGACY_BODY = 244
51
+ POOL_BOOST_BODY = 253
52
+ POOL_CREATOR_FEE_BODY = 262
53
+ POOL_BODY = 263
49
54
  MAX_PUMPFUN_FEE_TIERS = 64
50
55
  MAX_PUMPFUN_SHAREHOLDERS = 64
51
56
 
@@ -483,6 +488,12 @@ def _parse_pumpfun_bonding_curve_fast(
483
488
  is_cashback_coin = data[o] != 0
484
489
  o += 1
485
490
  quote_mint = read_pubkey_fast(data, o)
491
+ o += 32
492
+ creator_fee_bps = read_u64_fast(data, o) if o + 8 <= len(data) else 0
493
+ o += 8
494
+ can_edit_creator_fee = data[o] != 0 if o < len(data) else False
495
+ o += 1
496
+ is_holder_reward = data[o] != 0 if o < len(data) else False
486
497
  return _account_event(
487
498
  EventType.ACCOUNT_PUMP_FUN_BONDING_CURVE,
488
499
  {
@@ -499,6 +510,9 @@ def _parse_pumpfun_bonding_curve_fast(
499
510
  "is_mayhem_mode": is_mayhem_mode,
500
511
  "is_cashback_coin": is_cashback_coin,
501
512
  "quote_mint": quote_mint,
513
+ "creator_fee_bps": creator_fee_bps,
514
+ "can_edit_creator_fee": can_edit_creator_fee,
515
+ "is_holder_reward": is_holder_reward,
502
516
  },
503
517
  },
504
518
  )
@@ -752,6 +766,18 @@ def _parse_pumpswap_pool_fast(account: AccountData, metadata: EventMetadata) ->
752
766
  o += 32
753
767
  is_mayhem = data[o] != 0
754
768
  is_cashback = data[o + 1] != 0
769
+ o += 2
770
+ virtual_quote_reserves = (
771
+ int.from_bytes(data[o : o + 16], "little", signed=True)
772
+ if len(data) >= POOL_BOOST_BODY
773
+ else 0
774
+ )
775
+ o += 16
776
+ creator_fee_bps = read_u64_fast(data, o) if o + 8 <= len(data) else 0
777
+ o += 8
778
+ can_edit_creator_fee = data[o] != 0 if o < len(data) else False
779
+ o += 1
780
+ is_holder_reward = data[o] != 0 if o < len(data) else False
755
781
  return _account_event(
756
782
  EventType.ACCOUNT_PUMP_SWAP_POOL,
757
783
  {
@@ -770,6 +796,10 @@ def _parse_pumpswap_pool_fast(account: AccountData, metadata: EventMetadata) ->
770
796
  "coin_creator": coin_creator,
771
797
  "is_mayhem_mode": is_mayhem,
772
798
  "is_cashback_coin": is_cashback,
799
+ "virtual_quote_reserves": virtual_quote_reserves,
800
+ "creator_fee_bps": creator_fee_bps,
801
+ "can_edit_creator_fee": can_edit_creator_fee,
802
+ "is_holder_reward": is_holder_reward,
773
803
  },
774
804
  },
775
805
  )
@@ -807,6 +837,13 @@ def parse_pumpfun_bonding_curve(
807
837
  ) -> Optional[DexEvent]:
808
838
  if len(account.data) < 8 + PUMPFUN_BONDING_CURVE_BODY:
809
839
  return None
840
+ body_len = len(account.data) - 8
841
+ if (
842
+ body_len != PUMPFUN_BONDING_CURVE_BODY
843
+ and body_len != PUMPFUN_BONDING_CURVE_CREATOR_FEE_BODY
844
+ and body_len < PUMPFUN_BONDING_CURVE_HOLDER_REWARD_BODY
845
+ ):
846
+ return None
810
847
  if not has_discriminator(account.data, _DISC_PUMPFUN_BONDING_CURVE):
811
848
  return None
812
849
  return _parse_pumpfun_bonding_curve_fast(account, metadata)
@@ -861,7 +898,15 @@ def parse_pumpswap_global_config(account: AccountData, metadata: EventMetadata)
861
898
 
862
899
 
863
900
  def parse_pumpswap_pool(account: AccountData, metadata: EventMetadata) -> Optional[DexEvent]:
864
- if len(account.data) < 8 + POOL_BODY:
901
+ if len(account.data) < 8 + POOL_LEGACY_BODY:
902
+ return None
903
+ body_len = len(account.data) - 8
904
+ if (
905
+ body_len != POOL_LEGACY_BODY
906
+ and body_len != POOL_BOOST_BODY
907
+ and body_len != POOL_CREATOR_FEE_BODY
908
+ and body_len < POOL_BODY
909
+ ):
865
910
  return None
866
911
  if not has_discriminator(account.data, _DISC_POOL):
867
912
  return None