Pump Fun with Python
Last updated Jul 5, 2026
313
Stars
87
Forks
0
Issues
+1
Stars/day
Attention Score
88
Language breakdown
Python 100.0%
▸ Files
click to expand
README
pumpfunpy
Python library to trade on pump.fun.
pip install solana==0.36.1 solders==0.23.0
Updated: 9/3/2025
Contact
My Telegram: https://t.me/ALTHEBOT_FATHER
Instructions
Clone the repo and use examplebuy.py or examplesell.py.
If you can - please support my work and donate to: 3pPK76GL5ChVFBHND54UfBMtg36Bsh1mzbQPTbcK89PD
FAQS
What format should my private key be in?
The private key should be in the base58 string format, not bytes.
Why are my transactions being dropped?
You get what you pay for. Don't use the main-net RPC, just spend the money for Helius or Quick Node.
How do I change the fee?
Modify the unitbudget and unitprice values.
Does this code work on devnet?
No.
Example
from solana.rpc.api import Client
from solders.keypair import Keypair # type: ignore
from pump_fun import buy
Configuration
privkey = "base58privstrhere"
rpc = "rpcurlhere"
mintstr = "pumptoken_address"
sol_in = 0.1
slippage = 5
unitbudget = 120000
unitprice = 1000_000
Initialize client and keypair
client = Client(rpc)
payerkeypair = Keypair.frombase58string(privkey)
Execute buy
buy(client, payerkeypair, mintstr, solin, slippage, unitbudget, unit_price)
from solana.rpc.api import Client
from solders.keypair import Keypair # type: ignore
from pump_fun import sell
Configuration
privkey = "base58privstrhere"
rpc = "rpcurlhere"
mintstr = "pumptoken_address"
percentage = 100
slippage = 5
unitbudget = 120000
unitprice = 1000_000
Initialize client and keypair
client = Client(rpc)
payerkeypair = Keypair.frombase58string(privkey)
Execute sell
sell(client, payerkeypair, mintstr, percentage, slippage, unitbudget, unitprice)🔗 More in this category