├── README.md └── pump_fun_ws ├── pf_mints_ws.py ├── pf_trade_ws.py └── pump_swap_pool_ws.py /README.md: -------------------------------------------------------------------------------- 1 | ## Pump Fun Websocket ## 2 | 3 | Monitors Pump Fun mint, trade events, and Pump Swap Pool creation in real-time via WebSocket, using a WSS URL from providers like Helius or QuickNode. 4 | 5 | This code can be adapted for use in a sniper bot or copy trading bot. 6 | 7 | If you can - please support my work and donate to: 3pPK76GL5ChVFBHND54UfBMtg36Bsh1mzbQPTbcK89PD 8 | 9 | ``` 10 | pip install websocket-client solders construct 11 | ``` 12 | 13 | ## Contact ## 14 | 15 | My services are for hire. Contact me if you need help integrating the code into your own project. 16 | 17 | Telegram: @AL_THE_BOT_FATHER 18 | -------------------------------------------------------------------------------- /pump_fun_ws/pf_mints_ws.py: -------------------------------------------------------------------------------- 1 | import websocket 2 | import json 3 | import base64 4 | from solders.pubkey import Pubkey # type: ignore 5 | import struct 6 | 7 | WSS = "wss://mainnet.helius-rpc.com/?api-key=" 8 | 9 | def parse_event_data(data_hex): 10 | try: 11 | data_bytes = bytes.fromhex(data_hex) 12 | offset = 8 13 | 14 | def read_length_prefixed_string(data, offset): 15 | try: 16 | length = struct.unpack('