Skip to main content

Claiming Pump.fun Token Creator Fees

Pump.fun rewards token creators by allowing them to collect a fraction of the fees generated from trading activity on their token. You can use the PumpPortal Lightning or Local Transaction APIs to claim any creator fees from Pump.fun.

Examples below:

Lightning Transaction Examples:

import requests

response = requests.post(url="https://pumpportal.fun/api/trade?api-key=your-api-key-here", data={
"action": "collectCreatorFee",
"priorityFee": 0.000001,
})

data = response.json() # Tx signature or error(s)

Local Transaction Examples:

import requests
from solders.transaction import VersionedTransaction
from solders.keypair import Keypair
from solders.commitment_config import CommitmentLevel
from solders.rpc.requests import SendVersionedTransaction
from solders.rpc.config import RpcSendTransactionConfig

response = requests.post(url="https://pumpportal.fun/api/trade-local", data={
"publicKey": "Your public key here",
"action": "collectCreatorFee",
"priorityFee": 0.000001,
})

keypair = Keypair.from_base58_string("Your base 58 private key here")
tx = VersionedTransaction(VersionedTransaction.from_bytes(response.content).message, [keypair])

commitment = CommitmentLevel.Confirmed
config = RpcSendTransactionConfig(preflight_commitment=commitment)
txPayload = SendVersionedTransaction(tx, config)

response = requests.post(
url="Your RPC Endpoint here - Eg: https://api.mainnet-beta.solana.com/",
headers={"Content-Type": "application/json"},
data=SendVersionedTransaction(tx, config).to_json()
)
txSignature = response.json()['result']
print(f'Transaction: https://solscan.io/tx/{txSignature}')