learning-examples/listen_new_direct_full_details.py
script demonstrates how to capture the new token’s name, symbol, mint address, user (creator), bonding curve address, and associated bonding curve address—no methods like blockSubscribe extra RPC calls like getTransaction are required.
There’s difference in speed in how blockSubscribe
and logsSubscribe
work. Also, blockSubscribe
is available on all Chainstack plans, but with other providers, it may not be available on the free tier plans or even lower tier paid plans.
There is also difference in how blockSubscribe
and logsSubscribe
work, hence this article and example.
blockSubscribe
— extracts and decodes transactions as the are streamed in the blocks produced. And the script in the bot decodes them on the fly. This means that we get all the necessary data to do our sniping using the blockSubscribe
method.logsSubscribe
— only prints the pump.fun program logs, in our case—for token mints. The problem is we can get and decode from the logs the new token’s name, symbol, mint address, user (creator), and bonding curve address. But the logs do not contain the associated bonding curve address, which we need to do a sniping/buying transaction.learning-examples/listen_new_direct_full_details.py
script solves the issue by computing the associated bonding curve address from the bonding curve address on the fly and prints it. This way it makes it possible to snipe tokens on pump.fun using the logsSubscribe
method only. which in general has better availability across providers and may work faster for you.
PUMP_PROGRAM
).
Instruction: Create
event, the script looks at the Program data:
line in the logs.
Pubkey.find_program_address()
.
logsSubscribe
, you can get new token details almost immediately, which is especially handy if you want to “snipe” tokens the moment they are created.
config.py
file that includes your WebSocket endpoint (WSS_ENDPOINT
).logsSubscribe
to monitor logs referencing the pump.fun program ID.
Program data:
lines.
Program data:
and extracts:
getTransaction
. This approach is ideal if you want to immediately act on the new token creation events in your trading or monitoring workflows.
logsSubscribe
alone, you can get the essential details for any new pump.fun token almost instantly.
See also: