# Table of Contents - [TERMS OF USE | Pump Fun API](#terms-of-use-pump-fun-api) - [Claiming Token Creator Fees | Pump Fun API](#claiming-token-creator-fees-pump-fun-api) - [Getting Started | Pump Fun API](#getting-started-pump-fun-api) - [Lightning Transaction API Docs | Pump Fun API](#lightning-transaction-api-docs-pump-fun-api) - [Fees | Pump Fun API](#fees-pump-fun-api) - [What is PumpPortal? | Pump Fun API](#what-is-pumpportal-pump-fun-api) - [Frequently Asked Questions | Pump Fun API](#frequently-asked-questions-pump-fun-api) - [Create a New Wallet and API Key | Pump Fun API](#create-a-new-wallet-and-api-key-pump-fun-api) - [PumpSwap Data API | Pump Fun API](#pumpswap-data-api-pump-fun-api) - [Jito Bundles | Pump Fun API](#jito-bundles-pump-fun-api) - [Real-time Updates | Pump Fun API](#real-time-updates-pump-fun-api) - [Transaction API Docs | Pump Fun API](#transaction-api-docs-pump-fun-api) - [Real-time Updates | Pump Fun API](#real-time-updates-pump-fun-api) - [Pump.fun Token Creation | Pump Fun API](#pump-fun-token-creation-pump-fun-api) --- # TERMS OF USE | Pump Fun API [Skip to main content](https://pumpportal.fun/legal/#__docusaurus_skipToContent_fallback) On this page TERMS OF USE ============ BY USING PUMPPORTAL SERVICES YOU AGREE TO THE TERMS OF USE \*\*\*\* PumpPortal IS NOT AFFILIATED, AND HAS NO BUSINESS RELATIONSHIP WITH PUMP.FUN OR RAYDIUM. \*\*\*\* PumpPortal, [https://pumpportal.fun](https://pumpportal.fun/) , an application programming interface (the “Interface”). The Interface is software governed by and belongs to PumpPortal. The Interface provides data related to virtual currency exchanges. These Terms of Use and any terms and conditions incorporated herein by reference (collectively, the “Terms”) govern your access to and use of the Interface. You must read the Terms carefully. To make these Terms easier to read: PumpPortal is referred to as “we”, “us” or “our”. “You”, “your” and “user(s)” refers to anybody who accesses or uses, in any way, the Interface. If you are accessing or using the Interface on behalf of a company (such as your employer) or other legal entity, you represent and warrant that you have the authority to bind that entity to these Terms and, in that case, “you”, “your” or “user(s)” will refer to that entity. By accessing, browsing, or otherwise using the Interface, or by acknowledging agreement to the Terms on the Interface, you agree that you have read, understood, and accepted all of the Terms. IMPORTANT NOTE REGARDING ARBITRATION: WHEN YOU AGREE TO THESE TERMS BY USING OR ACCESSING THE INTERFACE, YOU ARE AGREEING TO RESOLVE ANY DISPUTE BETWEEN YOU AND PUMPPORTAL THROUGH BINDING, INDIVIDUAL ARBITRATION RATHER THAN IN COURT. AND YOU AGREE TO A CLASS ACTION WAIVER, BOTH OF WHICH IMPACT YOUR RIGHTS AS TO HOW DISPUTES ARE RESOLVED. 1\. Eligibility[​](https://pumpportal.fun/legal/#1-eligibility "Direct link to 1. Eligibility") ------------------------------------------------------------------------------------------------ General. You may not use the Interface if you are otherwise barred from using the Interface under applicable law. Legality. You are solely responsible for adhering to all laws and regulations applicable to you and your use or access to the Interface. Your use of the Interface is prohibited by and otherwise violate or facilitate the violation of any applicable laws or regulations, or contribute to or facilitate any illegal activity. By using or accessing the Interface, you represent to us that you are not subject to sanctions or otherwise designated on any list of prohibited or restricted parties or excluded or denied persons, including but not limited to the lists maintained by the United Nations Security Council, the European Union or its Member States, or any other government authority. We make no representations or warranties that the information, products, or services provided through our Interface, are appropriate for access or use in other jurisdictions. You are not permitted to access or use our Interface in any jurisdiction or country if it would be contrary to the law or regulation of that jurisdiction or if it would subject us to the laws of, or any registration requirement with, such jurisdiction. We reserve the right to limit the availability of our Interface to any person, geographic area, or jurisdiction, at any time and at our sole and absolute discretion. Prohibited Localities. PumpPortal does not interact with digital wallets located in, established in, or a resident of Myanmar (Burma), Cote D'Ivoire (Ivory Coast), Cuba, Crimea and Sevastopol, Democratic Republic of Congo, Iran, Iraq, Libya, Mali, Nicaragua, Democratic People’s Republic of Korea (North Korea), Somalia, Sudan, Syria, Yemen, Zimbabwe or any other state, country or region that is subject to sanctions enforced by the United States, the United Kingdom or the European Union. You must not use any software or networking techniques, including use of a Virtual Private Network (VPN) to modify your internet protocol address or otherwise circumvent or attempt to circumvent this prohibition." Non-Circumvention. You agree not to access the Interface using any technology for the purposes of circumventing these Terms. 2\. Compliance Obligations[​](https://pumpportal.fun/legal/#2-compliance-obligations "Direct link to 2. Compliance Obligations") --------------------------------------------------------------------------------------------------------------------------------- The Interface may not be available or appropriate for use in all jurisdictions. By accessing or using the Interface, you agree that you are solely and entirely responsible for compliance with all laws and regulations that may apply to you. You further agree that we have no obligation to inform you of any potential liabilities or violations of law or regulation that may arise in connection with your access and use of the Interface and that we are not liable in any respect for any failure by you to comply with any applicable laws or regulations. 3\. Access to the Interface[​](https://pumpportal.fun/legal/#3-access-to-the-interface "Direct link to 3. Access to the Interface") ------------------------------------------------------------------------------------------------------------------------------------ We reserve the right to disable access to the Interface at any time in the event of any breach of the Terms, including without limitation, if we, in our sole discretion, believe that you, at any time, fail to satisfy the eligibility requirements set forth in the Terms. Further, we reserve the right to limit or restrict access to the Interface by any person or entity, or within any geographic area or legal jurisdiction, at any time and at our sole discretion. We will not be liable to you for any losses or damages you may suffer as a result of or in connection with the Interface being inaccessible to you at any time or for any reason. 4\. Your Use of Interface[​](https://pumpportal.fun/legal/#4-your-use-of-interface "Direct link to 4. Your Use of Interface") ------------------------------------------------------------------------------------------------------------------------------ By using or accessing the Interface, you represent and warrant that you understand that there are inherent risks associated with virtual currency, and the underlying technologies including, without limitation, cryptography and blockchain, and you agree that PumpPortal is not responsible for any losses or damages associated with these risks. You specifically acknowledge and agree that the Interface facilitates your interaction with decentralized networks and technology and, as such, we have no control over any blockchain or virtual currencies and cannot and do not ensure that any of your interactions will be confirmed on the relevant blockchain and do not have the ability to effectuate any cancellation or modification requests regarding any of your interactions. Without limiting the foregoing, you specifically understand and hereby represent your acknowledgment of the following: The pricing information data provided through the Interface does not represent an offer, a solicitation of an offer, or any advice regarding, or recommendation to enter into, a transaction with the Interface. The Interface does not act as an agent for any of the users. The Interface does not own or control any of the underlying software through which blockchain networks are formed, and therefore is not responsible for them and their operation. You are solely responsible for reporting and paying any taxes applicable to your use of the Interface. Although it is intended to provide accurate and timely information on the Interface, the Interface or relevant tools may not always be entirely accurate, complete, or current and may also include technical inaccuracies or typographical errors. Accordingly, you should verify all information before relying on it, and all decisions based on information contained on the Interface or relevant tools are your sole responsibility. In order to allow other users to have a full and positive experience of using the Interface you agree that you will not use the Interface in a manner that: Breaches the Terms; Infringes on or violates any copyright, trademark, service mark, patent, right of publicity, right of privacy, or other proprietary or intellectual property rights under the law; Seeks to interfere with or compromise the integrity, security, or proper functioning of any computer, server, network, personal device, or other information technology system, including, but not limited to, the deployment of viruses and denial of service attacks; Attempts, in any manner, to obtain the private key, password, account, or other security information from any other user, including such information about the digital wallet; Decompiles, reverse engineer, or otherwise attempt to obtain the source code or underlying ideas or information of or relating to the Interface; Seeks to defraud us or any other person or entity, including, but not limited to, providing any false, inaccurate, or misleading information in order to unlawfully obtain the property of another; Violates any applicable law, rule, or regulation concerning the integrity of trading markets, including, but not limited to, the manipulative tactics commonly known as spoofing and wash trading; Violates any applicable law, rule, or regulation of the United States or another relevant jurisdiction, including, but not limited to, the restrictions and regulatory requirements imposed by U.S. law; Disguises or interferes in any way with the IP address of the computer you are using to access or use the Interface or that otherwise prevents us from correctly identifying the IP address of the computer you are using to access the Interface; Transmits, exchanges, or is otherwise supported by the direct or indirect proceeds of criminal or fraudulent activity; Contributes to or facilitates any of the foregoing activities. As it has been already stated, we only provide you with the relevant interface and software and neither has control over your interactions with the blockchain nor encourages you to perform any. Any interaction performed by you via the Interface remains your sole responsibility. All information provided in connection with your access and use of the Interface is for informational purposes only and should not be construed as professional advice. You should not take, or refrain from taking, any action based on any information contained in the Interface or any other information that we make available at any time, including, without limitation, blog posts, articles, links to third-party content, news feeds, tutorials, tweets, and videos. Before you make any financial, legal, or other decisions involving the Interface, you should seek independent professional advice from an individual who is licensed and qualified in the area for which such advice would be appropriate. The Terms are not intended to, and do not, create or impose any fiduciary duties on us. To the fullest extent permitted by law, you acknowledge and agree that we owe no fiduciary duties or liabilities to you or any other party and that to the extent any such duties or liabilities may exist at law or in equity, those duties and liabilities are hereby irrevocably disclaimed, waived, and eliminated. You further agree that the only duties and obligations that we owe you are those set forth expressly in the Terms. 5\. Disclaimers[​](https://pumpportal.fun/legal/#5-disclaimers "Direct link to 5. Disclaimers") ------------------------------------------------------------------------------------------------ You understand and agree that the Interface enables access to an online, decentralized, and autonomous protocol and environment, and associated decentralized networks, that are not controlled by PumpPortal. PumpPortal cannot and does not represent or guarantee that any of the information available through the Interface is accurate, reliable, current, complete or appropriate for your needs. The information displayed through the Interface including information about prices is provided by third parties and/or calculated for informational purposes. Your use of any third-party scripts, indicators, ideas, and other content is at your sole risk. You expressly understand and agree that your use of the Interface is at your sole risk. We make and expressly disclaim all representations and warranties, express, implied or statutory, and with respect to the Interface and the code proprietary or open-source, we specifically do not represent and warrant and expressly disclaim any representation or warranty, express, implied or statutory, including without limitation, any representations or warranties of title, non-infringement, merchantability, usage, security, suitability or fitness for any particular purpose, or as to the workmanship or technical coding thereof, or the absence of any defects therein, whether latent or patent. We do not represent or warrant that the Interface, code, and any related information are accurate, complete, reliable, current, or error-free. The Interface is provided on an “as is” and “as available” basis, without warranties of any kind, either express or implied, including, without limitation, implied warranties of merchantability, fitness for a particular purpose, or non-infringement. You acknowledge that no advice, information, or statement that we make should be treated as creating any warranty concerning the Interface. We do not endorse, guarantee, or assume responsibility for any advertisements, offers, or statements made by third parties concerning the Interface. If you lose, mishandle, or have stolen associated virtual currency private keys, you acknowledge that you may not be able to recover associated virtual currency and that PumpPortal is not responsible for such loss. You acknowledge that PumpPortal is not responsible for any loss, damage, or liability arising from your failure to comply with the terms hereunder. By accessing and using the Interface, you represent that you understand the Interface facilitates access to cryptographic and blockchain-based systems which have inherent risks to which you are exposed when using the Interface. You further represent that you have a working knowledge of the usage and intricacies of blockchain-based digital assets, including, without limitation, SPL token standard available on the Solana blockchain. You further understand that the markets for these blockchain-based digital assets are highly volatile due to factors that include, but are not limited to, adoption, speculation, technology, security, and regulation. You acknowledge that the cost and speed of transacting with blockchain-based systems, such as Solana, are variable and may increase or decrease, respectively, drastically at any time. You hereby acknowledge and agree that we are not responsible for any of these variables or risks and cannot be held liable for any resulting losses that you experience while accessing or using the Interface. Accordingly, you understand and agree to assume full responsibility for all of the risks of accessing and using the Interface. The Interface may contain references or links to third-party resources, including, but not limited to, information, materials, products, or services, that we do not own or control. In addition, third parties may offer promotions related to your access and use of the Interface. We do not endorse or assume any responsibility for any such resources or promotions. If you access any such resources or participate in any such promotions, you do so at your own risk, and you understand that the Terms do not apply to your dealings or relationships with any third parties. You expressly relieve us of any and all liability arising from your use of any such resources or participation in any such promotions. 6\. Intellectual Proprietary Rights[​](https://pumpportal.fun/legal/#6-intellectual-proprietary-rights "Direct link to 6. Intellectual Proprietary Rights") ------------------------------------------------------------------------------------------------------------------------------------------------------------ Unless expressly authorized by us, you may not copy, modify, adapt, rent, license, sell, publish, distribute, or otherwise permit any third party to access or use the Interface or any of its contents. Accessing or using the Interface does not constitute a grant to you of any proprietary intellectual property or other rights in the Interface or its contents. You will retain ownership of all intellectual property and other rights in any information and materials you submit through the Interface. However, by uploading such information or materials, you grant us a worldwide, royalty-free, irrevocable license to use, copy, distribute, publish and send this data in any manner in accordance with applicable laws and regulations. You may choose to submit comments, bug reports, ideas, or other feedback about the Interface, including, without limitation, about how to improve the Interface (collectively, “Feedback”). By submitting any Feedback, you agree that we are free to use such Feedback at our discretion and without additional compensation to you, and to disclose such Feedback to third parties (whether on a non-confidential basis or otherwise). If necessary under applicable law, then you hereby grant us a perpetual, irrevocable, non-exclusive, transferable, worldwide license under all rights necessary for us to incorporate and use your Feedback for any purpose. If (i) you satisfy all of the eligibility requirements set forth in the Terms, and (ii) your access to and use of the Interface complies with the Terms, you hereby are granted a single, personal, limited license to access and use the Interface. This license is non-exclusive, non-transferable, and freely revocable by us at any time without notice or cause in our sole discretion. Use of the Interface for any purpose not expressly permitted by the Terms is strictly prohibited. 7\. Indemnification[​](https://pumpportal.fun/legal/#7-indemnification "Direct link to 7. Indemnification") ------------------------------------------------------------------------------------------------------------ You agree to hold harmless, release, defend, and indemnify us and our officers, directors, employees, contractors, agents, affiliates, and subsidiaries from and against all claims, damages, obligations, losses, liabilities, costs, and expenses arising from (a) your access to and use of the Interface; (b) your violation of these Terms, the right of any third party, or any other applicable law, rule, or regulation; and (c) any other party’s access and use of the Interface with your assistance or using any device or account that you own or control. 8\. Limitation of Liability[​](https://pumpportal.fun/legal/#8-limitation-of-liability "Direct link to 8. Limitation of Liability") ------------------------------------------------------------------------------------------------------------------------------------ Under no circumstances shall we or any of our officers, directors, employees, contractors, agents, affiliates, or subsidiaries be liable to you for any indirect, punitive, incidental, special, consequential, or exemplary damages, including (but not limited to) damages for loss of profits, goodwill, use, data, or other intangible property, arising out of or relating to any access to or use of the Interface, nor will we be responsible for any damage, loss, or injury resulting from hacking, tampering, or other unauthorized access to or use of the Interface, or from any access to or use of any information obtained by any unauthorized access to or use of the Interface. We assume no liability or responsibility for any: (a) errors, mistakes, or inaccuracies of content; (b) personal injury or property damage, of any nature whatsoever, resulting from any access to or use of the Interface; (c) unauthorized access to or use of any secure server or database in our control or the use of any information or data stored therein; (d) interruption or cessation of function related to the Interface; (e) bugs, viruses, trojan horses, or the like that may be transmitted to or through the Interface; (f) errors or omissions in, or loss or damage incurred as a result of, the use of any content made available through the Interface; and (g) the defamatory, offensive, or illegal conduct of any third party. Under no circumstances shall we or any of our officers, directors, employees, contractors, agents, affiliates, or subsidiaries be liable to you for any claims, proceedings, liabilities, obligations, damages, losses, or costs in an amount exceeding the greater of (i) the amount you paid to us in exchange for access to and use of the Interface, or (ii) $100.00. This limitation of liability applies regardless of whether the alleged liability is based on contract, tort, negligence, strict liability, or any other basis, and even if we have been advised of the possibility of such liability. Some jurisdictions do not allow the exclusion of certain warranties or the limitation or exclusion of certain liabilities and damages. Accordingly, some of the disclaimers and limitations set forth in the Terms may not apply to you. This limitation of liability shall apply to the fullest extent permitted by law. 9\. Arbitration and Class Action Waiver[​](https://pumpportal.fun/legal/#9-arbitration-and-class-action-waiver "Direct link to 9. Arbitration and Class Action Waiver") ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Binding Arbitration. Except for disputes in which either party seeks to bring an individual action in small claims court or seeks injunctive or other equitable relief for the alleged unlawful use of copyrights, trademarks, trade names, logos, trade secrets or patents, you and the PumpPortal: (a) waive the right to have any and all disputes or claims arising from these Terms, your use or access to the Interface or any other disputes with the PumpPortal (collectively, “Disputes”) resolved in a court; and (b) waive any right to a jury trial. Instead, you and the PumpPortal agree to arbitrate Disputes that are not resolved informally (as described below) through binding arbitration (i.e. the referral of a Dispute to one or more persons charged with reviewing the Dispute and making a final and binding determination to resolve it) instead of having the Dispute decided by a judge or jury in court). No Class Arbitrations, Class Actions or Representative Actions. You and PumpPortal agree that any dispute is personal to you and PumpPortal and that any such dispute will be resolved solely through individual arbitration and will not be brought as a class arbitration, class action, or any other type of representative proceeding. Neither party agrees to class arbitration or to an arbitration in which an individual attempts to resolve a dispute as a representative of another individual or group of individuals. Further, you and the PumpPortal agree that a dispute cannot be brought as a class, or other types of representative action, whether within or outside of arbitration, or on behalf of any other individual or group of individuals. Process. You and PumpPortal agree that each will notify the other, in writing, of any Dispute within thirty (30) days of when it arises so that the parties can attempt, in good faith, to resolve the Dispute informally. Notice to PumpPortal shall be provided by sending an email to [jammysky@proton.me](mailto:jammysky@proton.me) . Your notice must include (1) your name, postal address, and email address; (2) a description of the nature or basis of the Dispute; and (3) the specific action that you are seeking. If you and the PumpPortal cannot resolve the Dispute within thirty (30) days of the PumpPortal receiving the notice, either you or PumpPortal may, as appropriate pursuant to this Section 9, commence an arbitration proceeding. You and PumpPortal agree that any arbitration or claim must be commenced or filed within one (1) year after the Dispute arose; otherwise, you and the PumpPortal agree that the claim is permanently barred (which means that you will no longer have the right to assert a claim regarding the Dispute). Choice of Law. These Terms are governed by and will be construed under the laws of the state of Singapore, without regard to principles of conflict of laws, govern the Terms and any Dispute between you and us. Any Dispute under these Terms shall be finally settled by Binding Arbitration (as defined below). Any unresolved Dispute arising out of or in connection with these Terms shall be referred to and finally resolved by arbitration under the rules of the London Court of International Arbitration (LCIA), which rules are deemed to be incorporated by reference into this Section 9 to the extent they are consistent with it. Any dispute arising from or relating to the subject matter of these Terms shall be finally settled in London, United Kingdom, in English, in accordance with the LCIA Arbitration Rules. Unless we agree otherwise, the arbitrator may not consolidate your claims with those of any other party. Any judgment on the award rendered by the arbitrator may be entered in any court of competent jurisdiction, to the extent a court therein would be deemed to be a court of competent jurisdiction other than any court located in the United States of America. You further agree that the Interface shall be deemed to be based solely in the state of Singapore and that, although the Interface may be available in other jurisdictions, its availability does not give rise to general or specific personal jurisdiction in any forum outside the state of Singapore. Authority of Arbitrator. As limited by these Terms and applicable arbitration rules, the arbitrator will have: (a) the exclusive authority and jurisdiction to make all procedural and substantive decisions regarding a Dispute; and (b) the authority to grant any remedy that would otherwise be available in court. The arbitrator may only conduct an individual arbitration and may not consolidate more than one individual s claims, preside over any type of class or representative proceeding or preside over any proceeding involving more than one individual. 10\. Miscellaneous[​](https://pumpportal.fun/legal/#10-miscellaneous "Direct link to 10. Miscellaneous") --------------------------------------------------------------------------------------------------------- Changes. We may amend any portion of these Terms at any time by posting the revised version of these Terms with an updated revision date. The changes will become effective and shall be deemed accepted by you, the first time you use or access the Interface after the initial posting of the revised Terms and shall apply on a going-forward basis with respect to your use of the Interface including any transactions initiated after the posting date. In the event that you do not agree with any such modification, your sole and exclusive remedy are to terminate your use of the Interface. Entire Agreement. These Terms (and any additional terms, rules, and conditions of participation that may be posted on the website of PumpPortal) constitute the entire agreement with respect to the Interface and supersedes any prior agreements, oral or written. Survival. Upon termination of these Terms for any reason, all rights and obligations of the parties that by their nature are continuing will survive such termination. * [1\. Eligibility](https://pumpportal.fun/legal/#1-eligibility) * [2\. Compliance Obligations](https://pumpportal.fun/legal/#2-compliance-obligations) * [3\. Access to the Interface](https://pumpportal.fun/legal/#3-access-to-the-interface) * [4\. Your Use of Interface](https://pumpportal.fun/legal/#4-your-use-of-interface) * [5\. Disclaimers](https://pumpportal.fun/legal/#5-disclaimers) * [6\. Intellectual Proprietary Rights](https://pumpportal.fun/legal/#6-intellectual-proprietary-rights) * [7\. Indemnification](https://pumpportal.fun/legal/#7-indemnification) * [8\. Limitation of Liability](https://pumpportal.fun/legal/#8-limitation-of-liability) * [9\. Arbitration and Class Action Waiver](https://pumpportal.fun/legal/#9-arbitration-and-class-action-waiver) * [10\. Miscellaneous](https://pumpportal.fun/legal/#10-miscellaneous) --- # Claiming Token Creator Fees | Pump Fun API [Skip to main content](https://pumpportal.fun/creator-fee/#__docusaurus_skipToContent_fallback) On this page Claiming 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. The Lightning Transaction API can now also be used to claim creator fees from Meteora Dynamic Bonding Curves. Examples below: ### Lightning Transaction Examples:[​](https://pumpportal.fun/creator-fee/#lightning-transaction-examples "Direct link to Lightning Transaction Examples:") * Python * JavaScript import requestsresponse = requests.post(url="https://pumpportal.fun/api/trade?api-key=your-api-key-here", data={ "action": "collectCreatorFee", "priorityFee": 0.000001, "pool": "meteora-dbc" # "pump" or "meteora-dbc" "mint": "token CA" # the token for which you are claiming fees # Note: pump.fun claims creator fees all at once, so you do not need to specify "mint"})data = response.json() # Tx signature or error(s) const response = await fetch("https://pumpportal.fun/api/trade?api-key=your-api-key-here", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ "action": "collectCreatorFee", "priorityFee": 0.000001, "pool": "meteora-dbc" // "pump" or "meteora-dbc" "mint": "token CA" // the token for which you are claiming fees // Note: pump.fun claims creator fees all at once, so you do not need to specify "mint" })});const data = await response.json(); // JSON object with tx signature or error(s) ### Local Transaction Examples:[​](https://pumpportal.fun/creator-fee/#local-transaction-examples "Direct link to Local Transaction Examples:") * Python * JavaScript import requestsfrom solders.transaction import VersionedTransactionfrom solders.keypair import Keypairfrom solders.commitment_config import CommitmentLevelfrom solders.rpc.requests import SendVersionedTransactionfrom solders.rpc.config import RpcSendTransactionConfigresponse = 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.Confirmedconfig = 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}') import { VersionedTransaction, Connection, Keypair } from '@solana/web3.js';import bs58 from "bs58";const RPC_ENDPOINT = "Your RPC Endpoint";const web3Connection = new Connection( RPC_ENDPOINT, 'confirmed',);async function sendPortalTransaction(){ const response = await fetch(`https://pumpportal.fun/api/trade-local`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ "publicKey": "Your public key here", "action": "collectCreatorFee", "priorityFee": 0.000001, }) }); if(response.status === 200){ // successfully generated transaction const data = await response.arrayBuffer(); const tx = VersionedTransaction.deserialize(new Uint8Array(data)); const signerKeyPair = Keypair.fromSecretKey(bs58.decode("your-wallet-private-key")); tx.sign([signerKeyPair]); const signature = await web3Connection.sendTransaction(tx) console.log("Transaction: https://solscan.io/tx/" + signature); } else { console.log(response.statusText); // log error }}sendPortalTransaction(); * [Lightning Transaction Examples:](https://pumpportal.fun/creator-fee/#lightning-transaction-examples) * [Local Transaction Examples:](https://pumpportal.fun/creator-fee/#local-transaction-examples) --- # Getting Started | Pump Fun API [Skip to main content](https://pumpportal.fun/trading-api/setup/#__docusaurus_skipToContent_fallback) On this page Getting Started =============== ### Step 1: Generate a Lightning Wallet & API Key[​](https://pumpportal.fun/trading-api/setup/#step-1-generate-a-lightning-wallet--api-key "Direct link to Step 1: Generate a Lightning Wallet & API Key") Tip If you would like to sign and send transactions with your own wallet instead of a Lightning wallet, use the Local Transaction API. Click the button below to generate a new Solana wallet and linked API key. You will then be able to use your API key to trade with the funds in the linked wallet. Create Wallet & API Key Copy Wallet Public Key Copy Wallet Private Key Copy API Key READ ALL THE FOLLOWING BEFORE PROCEEDING: **SECURELY SAVE YOUR PRIVATE KEY**: You can withdraw funds by adding your private key to any Solana wallet software such as Phantom. Anyone with access to your private key can do the same. **SECURELY SAVE YOUR API KEY**: Anyone with your API key can trade using the funds in your wallet. Your keys will disappear upon navigating away from this page OR clicking the button again to create a new API key and wallet. **KEYS CAN NOT BE RECOVERED IF LOST**. ### Step 2: Fund Your Wallet[​](https://pumpportal.fun/trading-api/setup/#step-2-fund-your-wallet "Direct link to Step 2: Fund Your Wallet") Just send any amount of SOL to the address (public key) of the wallet you created above. That's it! You can now trade with the funds in your wallet using the API. Continue the [next page](https://pumpportal.fun/trading-api/) to read how. Tip You may create as many wallets as you like. If you are building a trading service for multiple users, you will probably want to use our API to create a new wallet _per user_. * [Step 1: Generate a Lightning Wallet & API Key](https://pumpportal.fun/trading-api/setup/#step-1-generate-a-lightning-wallet--api-key) * [Step 2: Fund Your Wallet](https://pumpportal.fun/trading-api/setup/#step-2-fund-your-wallet) --- # Lightning Transaction API Docs | Pump Fun API [Skip to main content](https://pumpportal.fun/trading-api/#__docusaurus_skipToContent_fallback) On this page Lightning Transaction API Docs ============================== To buy or sell a Pump.fun token with the funds in your wallet, send a POST request to `https://pumpportal.fun/api/trade?api-key=your-api-key-here` Once the transaction passes a simulation check, a response is sent with the transaction signature or error(s). PumpPortal will attempt to land your transaction using our dedicated Solana nodes, upstream SWQoS providers, and private and public Jito bundle relays. Your request body must contain the following options: * `action`: "buy" or "sell" * `mint`: The contract address of the token you want to trade (this is the text after the '/' in the pump.fun url for the token.) * `amount`: The amount of SOL or tokens to trade. If selling, amount can be a percentage of tokens in your wallet (ex. amount: "100%") * `denominatedInSol`: "true" if amount is SOL, "false" if amount is tokens * `slippage`: The percent slippage allowed * `priorityFee`: Amount used to enhance transaction speed (may be distributed to multiple providers during processing) * `pool`: (optional) Currently 'pump', 'raydium', 'pump-amm', 'launchlab', 'raydium-cpmm', 'bonk', and 'auto' are supported options. Default is 'pump'. * `skipPreflight` : (optional) "false" to simulate the transaction before sending, "true" to skip simulation checks. Default is "true". * `jitoOnly` : (optional) "true" to only send the transaction through Jito. Default is "false". ### Examples[​](https://pumpportal.fun/trading-api/#examples "Direct link to Examples") * Python * JavaScript * CURL import requests response = requests.post(url="https://pumpportal.fun/api/trade?api-key=your-api-key-here", data={ "action": "buy", # "buy" or "sell" "mint": "your CA here", # contract address of the token you want to trade "amount": 100000, # amount of SOL or tokens to trade "denominatedInSol": "false", # "true" if amount is amount of SOL, "false" if amount is number of tokens "slippage": 10, # percent slippage allowed "priorityFee": 0.00005, # amount used to enhance transaction speed "pool": "auto" # exchange to trade on. "pump", "raydium", "pump-amm", "launchlab", "raydium-cpmm", "bonk" or "auto"}) data = response.json() # Tx signature or error(s) const response = await fetch("https://pumpportal.fun/api/trade?api-key=your-api-key-here", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ "action": "buy", // "buy" or "sell" "mint": "your CA here", // contract address of the token you want to trade "amount": 0.01, // amount of SOL or tokens to trade "denominatedInSol": "true", // "true" if amount is SOL, "false" if amount is tokens "slippage": 10, // percent slippage allowed "priorityFee": 0.00005, // amount to use as Jito tip or priority fee "pool": "auto" // exchange to trade on. "pump", "raydium", "pump-amm", "launchlab", "raydium-cpmm", "bonk" or "auto" })});const data = await response.json(); // JSON object with tx signature or error(s) curl -L \-X POST \-H 'Content-Type: application/json' \'https://pumpportal.fun/api/trade?api-key=your-api-key-here' \-d '{"action": "buy","mint": "your CA here","amount": 0.01,"denominatedInSol": "true","slippage": 10,"priorityFee": 0.00005,"pool": "pump"}' * [Examples](https://pumpportal.fun/trading-api/#examples) --- # Fees | Pump Fun API [Skip to main content](https://pumpportal.fun/fees/#__docusaurus_skipToContent_fallback) On this page Fees ==== ### Data API[​](https://pumpportal.fun/fees/#data-api "Direct link to Data API") There is no charge to use the Data API for all trades on the pump.fun bonding curve. After tokens migrate to PumpSwap, trading data is only available to users who subscribe with a PumpPortal API key. For every 10000 PumpSwap trades streamed users will incur a 0.01 SOL charge to the wallet linked to their API key. ### Local Transaction API[​](https://pumpportal.fun/fees/#local-transaction-api "Direct link to Local Transaction API") We take a 0.5% fee on each Local trade. (Note: the fee is calculated before any slippage, so the actual fee amount may not be exactly 0.5% of the final trade value.) ### Lightning Transaction API[​](https://pumpportal.fun/fees/#lightning-transaction-api "Direct link to Lightning Transaction API") We take a 1% fee on each Lightning trade. (Note: the fee is calculated before any slippage, so the actual fee amount may not be exactly 1% of the final trade value.) The above fees do not include Solana network fees, or any fees charged by the Pump.fun bonding curve. * [Data API](https://pumpportal.fun/fees/#data-api) * [Local Transaction API](https://pumpportal.fun/fees/#local-transaction-api) * [Lightning Transaction API](https://pumpportal.fun/fees/#lightning-transaction-api) --- # What is PumpPortal? | Pump Fun API [Skip to main content](https://pumpportal.fun/#__docusaurus_skipToContent_fallback) What is PumpPortal? =================== **A 3rd-Party API for Pump.fun, Raydium, and other DEXs**. We provide low latency data sources and transaction building for the Pump.fun bonding curve and Raydium LPs. Our [Lightning Transaction API](https://pumpportal.fun/trading-api/setup) is designed to be easy to use, so you can start building in minutes: there are no libraries to install and nothing to configure. You just send an HTTPS request and we handle sending the transaction. Lightning transactions are highly optimized to achieve some of lowest latencies possible on Solana. If you need full security and control over your transactions, you can use our [Local Transaction API](https://pumpportal.fun/local-trading-api/trading-api) . Local Transactions builds a transaction that you handle signing and sending yourself with a custom RPC endpoint. --- # Frequently Asked Questions | Pump Fun API [Skip to main content](https://pumpportal.fun/FAQ/#__docusaurus_skipToContent_fallback) On this page Frequently Asked Questions ========================== ### Is PumpPortal Fast?[​](https://pumpportal.fun/FAQ/#is-pumpportal-fast "Direct link to Is PumpPortal Fast?") Of course. All types of trades on PumpPortal average under 1 second to execution. If milliseconds matter for your trading strategy, read on to the next question: ### What is the fastest way to trade on Pump.fun and other DEXs?[​](https://pumpportal.fun/FAQ/#what-is-the-fastest-way-to-trade-on-pumpfun-and-other-dexs "Direct link to What is the fastest way to trade on Pump.fun and other DEXs?") Memecoin sniping is extremely competitive: advanced bots in this space have millions of dollars of infrastructure (Solana nodes all around the world to receive and send data with the lowest possible latency). This being the case, PumpPortal can not guarantee the ability to snipe a coin first or trade before every other bot. If you need speed, you can still use PumpPortal to trade very efficiently by following a few simple recommendations. Following these guidelines the average latency from submitting a transaction to landing onchain can be as low as 1 block . * Use our [Lightning Transaction API](https://pumpportal.fun/trading-api/setup) : The Lighting API achieves some of the fastest transactions on Solana by forwarding trades to the blockchain via many different upstreams at once (upstream SWQoS providers like Helius, and private and public Jito bundle relays, our dedicated Solana nodes, and more.) * Experiment with different priorityFee levels (higher priority fees are necessary under high network load). * Run your code on a server in New York or somewhere in the Eastern US for lowest latency. * Avoid using "pool": "auto" (This option occasionally requires our servers to pull additional pool data which could add up to 100 msec of delay.) ### How fast is the PumpPortal realtime data websocket?[​](https://pumpportal.fun/FAQ/#how-fast-is-the-pumpportal-realtime-data-websocket "Direct link to How fast is the PumpPortal realtime data websocket?") Data from the PumpPortal websocket is at the "processed" commitment level, and will typically be less than 100 msec delayed behind gRPC data if you run a server in New York. If you need faster data you should look into Helius Laserstream or running your own gRPC node. ### What are the rate limits for using PumpPortal API?[​](https://pumpportal.fun/FAQ/#what-are-the-rate-limits-for-using-pumpportal-api "Direct link to What are the rate limits for using PumpPortal API?") Trading and other endpoints are limited at 25 requests per second. Our data websocket has its own limits: Try to handle everything over one connection. You can have practically unlimited subscriptions on a single connection. You can just send new addresses to the connection and they will be added to your existing subscriptions, no need to send the whole list of addresses each time. Don't send over 200 subscription messages per second. Don't subscribe to over 5000 addresses in a single message. If you go over 15 connections they will start getting closed, and if you keep opening them you will get temporarily banned (don't worry, bans expire every hour, so if you make a mistake you can wait a bit and try again). For some reason AI coding agents love to make new connections for every token, so carefully review any AI code that might exceed our limits. ### I sent a transaction that never showed up onchain. What happened?[​](https://pumpportal.fun/FAQ/#i-sent-a-transaction-that-never-showed-up-onchain-what-happened "Direct link to I sent a transaction that never showed up onchain. What happened?") Transactions can fail for many reasons. Make sure you are using an adequately funded wallet, and make sure you follow the examples in our docs EXACTLY to send trade requests correctly. For Local Transactions using a paid RPC connection is recommended for reliability. For Lighting Transactions, setting "skipPreflight": "false" may be helpful for debugging failing transactions. ### What does skipPreflight do?[​](https://pumpportal.fun/FAQ/#what-does-skippreflight-do "Direct link to What does skipPreflight do?") Preflight checks simulate the transaction before sending to the chain, so it's useful for debugging or preventing bad transactions from failing on chain and wasting fees. The biggest downside though, is that preflight checks can throw errors on transactions that are actually fine. This happens a lot when sniping new tokens, and the simulation doesn't have the new token mint yet, so the preflight checks fail even though the transaction would have succeeded on chain. Preflight checks can have between zero and mostly negligible (~50 msec) impact on trade latency depending on how the transaction is routed. TLDR: set skipPreflight: "false" if you need to debug why txns are failing, or to prevent some bad transactions from being sent to the chain. Set skipPreflight: "true" (default) to send transactions straight to the chain with no simulation. ### My transaction failed with the error "Custom Program Error"[​](https://pumpportal.fun/FAQ/#my-transaction-failed-with-the-error-custom-program-error "Direct link to My transaction failed with the error "Custom Program Error"") Top level Solana errors are often vague like this and tell you nothing. Look at the program logs for the transaction (on Solscan scroll all the way to the bottom and click "Show Details"). Often you will find something like "not enough Sol" or "insufficient funds". ### What is Jito? What are bundles? Should I be using them?[​](https://pumpportal.fun/FAQ/#what-is-jito-what-are-bundles-should-i-be-using-them "Direct link to What is Jito? What are bundles? Should I be using them?") You only need to use Jito if you need to bundle multiple transactions together, where each transaction executes in sequence on the blockchain. Our Lighting API is faster and more reliable than public Jito endpoints for single transactions. The most common use case for Jito on Pump.fun is to bundle a token creation with multiple buys of that token. This ensures that the bundled buys execute immediately after creation so they are always the first buys of the token. ### I'm getting these errors from Jito: 429 "Endpoint is globally rate limited"[​](https://pumpportal.fun/FAQ/#im-getting-these-errors-from-jito-429-endpoint-is-globally-rate-limited "Direct link to I'm getting these errors from Jito: 429 "Endpoint is globally rate limited"") You are being rate limited by Jito, not us. Jito public endpoints are often congested and unstable. If you have confirmed that you really do need to use Jito (most traders do not), there are a few ways to resolve this: 1. You can directly contact Jito in their Discord, or they have a form in their docs you can use to request a increased limit: [https://docs.jito.wtf/lowlatencytxnsend/#rate-limits-form](https://docs.jito.wtf/lowlatencytxnsend/#rate-limits-form) 2. You can try multiple times or send requests to multiple Jito regional endpoints to increase the chance of landing a bundle. 3. You can use private Jito bundle endpoint from a provider like Quicknode. ### Is PumpPortal safe? How do PumpPortal Lighting wallets work?[​](https://pumpportal.fun/FAQ/#is-pumpportal-safe-how-do-pumpportal-lighting-wallets-work "Direct link to Is PumpPortal safe? How do PumpPortal Lighting wallets work?") PumpPortal Local Transactions are signed by your code on your device, PumpPortal never has access to your wallet. PumpPortal Lighting wallets are standard Solana keypairs with a public key and a private key. Lightning wallets also provide an API key that is linked to that keypair. The API key contains the wallet private key encrypted with AES-256. When you send a Lighting Transaction it is signed by that encrypted private key in your API key. This way Lighting private keys are never stored on our servers and are safe even if PumpPortal was compromised. It is still YOUR RESPONSIBILITY to take proper precautions with funded wallets. You should always treat any trading wallets as "hot wallets" and never store large amounts of funds there that are not being used for active trading. Be very careful with your code, wallets frequently get drained because someone commits code containing a private key to public Github repo. ### I lost my private key, can you help me?[​](https://pumpportal.fun/FAQ/#i-lost-my-private-key-can-you-help-me "Direct link to I lost my private key, can you help me?") Nope, it's gone. ### Does PumpPortal have a token?[​](https://pumpportal.fun/FAQ/#does-pumpportal-have-a-token "Direct link to Does PumpPortal have a token?") No. ### Is there a Pumpfun devnet API?[​](https://pumpportal.fun/FAQ/#is-there-a-pumpfun-devnet-api "Direct link to Is there a Pumpfun devnet API?") We currently don't provide APIs for devnet or testnet. You can experiment with very small amounts of SOL on Mainnet. ### Do you provide historical Pump.fun token data?[​](https://pumpportal.fun/FAQ/#do-you-provide-historical-pumpfun-token-data "Direct link to Do you provide historical Pump.fun token data?") We only provide live trading data at this time, you would need to pull historical data from an RPC or other source. ### Do you provide Pump.fun livestream data / chat / comments?[​](https://pumpportal.fun/FAQ/#do-you-provide-pumpfun-livestream-data--chat--comments "Direct link to Do you provide Pump.fun livestream data / chat / comments?") No, this data is not onchain, so it is only accessible from the Pump.fun site directly. ### I deployed a token through PumpPortal, but the token address doesn't end in 'pump'.[​](https://pumpportal.fun/FAQ/#i-deployed-a-token-through-pumpportal-but-the-token-address-doesnt-end-in-pump "Direct link to I deployed a token through PumpPortal, but the token address doesn't end in 'pump'.") Our token creation examples show how to generate a random address and use that to create a token. For an address ending in 'pump' you would have to grind for the vanity address ending in 'pump'. Then you would set the 'mint\_keypair' in the token creation examples to that vanity keypair. Here's an example of how to grind vanity keypairs with the Solana CLI: [https://www.quicknode.com/guides/solana-development/getting-started/how-to-create-a-custom-vanity-wallet-address-using-solana-cli](https://www.quicknode.com/guides/solana-development/getting-started/how-to-create-a-custom-vanity-wallet-address-using-solana-cli) ### I got disconnected from the realtime data websocket, what happened?[​](https://pumpportal.fun/FAQ/#i-got-disconnected-from-the-realtime-data-websocket-what-happened "Direct link to I got disconnected from the realtime data websocket, what happened?") Websockets can just disconnect with network instability or when our servers rebalance load, so it's a good idea to have some reconnection logic in place, especially if you need to maintain a connection over a long period of time. * [Is PumpPortal Fast?](https://pumpportal.fun/FAQ/#is-pumpportal-fast) * [What is the fastest way to trade on Pump.fun and other DEXs?](https://pumpportal.fun/FAQ/#what-is-the-fastest-way-to-trade-on-pumpfun-and-other-dexs) * [How fast is the PumpPortal realtime data websocket?](https://pumpportal.fun/FAQ/#how-fast-is-the-pumpportal-realtime-data-websocket) * [What are the rate limits for using PumpPortal API?](https://pumpportal.fun/FAQ/#what-are-the-rate-limits-for-using-pumpportal-api) * [I sent a transaction that never showed up onchain. What happened?](https://pumpportal.fun/FAQ/#i-sent-a-transaction-that-never-showed-up-onchain-what-happened) * [What does skipPreflight do?](https://pumpportal.fun/FAQ/#what-does-skippreflight-do) * [My transaction failed with the error "Custom Program Error"](https://pumpportal.fun/FAQ/#my-transaction-failed-with-the-error-custom-program-error) * [What is Jito? What are bundles? Should I be using them?](https://pumpportal.fun/FAQ/#what-is-jito-what-are-bundles-should-i-be-using-them) * [I'm getting these errors from Jito: 429 "Endpoint is globally rate limited"](https://pumpportal.fun/FAQ/#im-getting-these-errors-from-jito-429-endpoint-is-globally-rate-limited) * [Is PumpPortal safe? How do PumpPortal Lighting wallets work?](https://pumpportal.fun/FAQ/#is-pumpportal-safe-how-do-pumpportal-lighting-wallets-work) * [I lost my private key, can you help me?](https://pumpportal.fun/FAQ/#i-lost-my-private-key-can-you-help-me) * [Does PumpPortal have a token?](https://pumpportal.fun/FAQ/#does-pumpportal-have-a-token) * [Is there a Pumpfun devnet API?](https://pumpportal.fun/FAQ/#is-there-a-pumpfun-devnet-api) * [Do you provide historical Pump.fun token data?](https://pumpportal.fun/FAQ/#do-you-provide-historical-pumpfun-token-data) * [Do you provide Pump.fun livestream data / chat / comments?](https://pumpportal.fun/FAQ/#do-you-provide-pumpfun-livestream-data--chat--comments) * [I deployed a token through PumpPortal, but the token address doesn't end in 'pump'.](https://pumpportal.fun/FAQ/#i-deployed-a-token-through-pumpportal-but-the-token-address-doesnt-end-in-pump) * [I got disconnected from the realtime data websocket, what happened?](https://pumpportal.fun/FAQ/#i-got-disconnected-from-the-realtime-data-websocket-what-happened) --- # Create a New Wallet and API Key | Pump Fun API [Skip to main content](https://pumpportal.fun/create-wallet/#__docusaurus_skipToContent_fallback) On this page Create a New Wallet and API Key =============================== You can programmatically create new Lightning wallets and linked api keys by sending a GET request to: `https://pumpportal.fun/api/create-wallet` ### Examples[​](https://pumpportal.fun/create-wallet/#examples "Direct link to Examples") * Python * JavaScript * CURL import requests response = requests.get(url="https://pumpportal.fun/api/create-wallet") # JSON with keys for a newly generated wallet and the linked API keydata = response.json() const response = await fetch("https://pumpportal.fun/api/create-wallet", { method: "GET",});// JSON Object with keys for a newly generated wallet and the linked API keyconst data = await response.json(); curl -L \-X GET \'https://pumpportal.fun/api/create-wallet' * [Examples](https://pumpportal.fun/create-wallet/#examples) --- # PumpSwap Data API | Pump Fun API [Skip to main content](https://pumpportal.fun/data-api/pump-swap/#__docusaurus_skipToContent_fallback) On this page PumpSwap Data API ================= Accessing PumpSwap data requires a [PumpPortal API key](https://pumpportal.fun/trading-api/setup) and linked wallet funded with at least 0.02 SOL. By streaming PumpSwap data your wallet will incur a charge of 0.01 SOL for every 10000 websocket messages you receive. PumpSwap data is enabled only if you connect to the websocket using the following URL format: `wss://pumpportal.fun/api/data?api-key=your-api-key-here` If the wallet linked to your API key does not contain the minimum balance of SOL, the connection will be restricted to only trades on the bonding curve. ### Examples:[​](https://pumpportal.fun/data-api/pump-swap/#examples "Direct link to Examples:") * Python * JavaScript import asyncioimport websocketsimport jsonasync def subscribe(): uri = "wss://pumpportal.fun/api/data?api-key=your-api-key-here" async with websockets.connect(uri) as websocket: # Subscribing to trades made by accounts payload = { "method": "subscribeAccountTrade", "keys": ["AArPXm8JatJiuyEffuC1un2Sc835SULa4uQqDcaGpAjV"] # array of accounts to watch } await websocket.send(json.dumps(payload)) # Subscribing to trades on tokens payload = { "method": "subscribeTokenTrade", "keys": ["GkyPYa7NnCFbduLknCfBfP7p8564X1VZhwZYJ6CZpump"] # array of token CAs to watch } await websocket.send(json.dumps(payload)) async for message in websocket: print(json.loads(message))# Run the subscribe functionasyncio.get_event_loop().run_until_complete(subscribe()) import WebSocket from 'ws';const ws = new WebSocket('wss://pumpportal.fun/api/data?api-key=your-api-key-here');ws.on('open', function open() { // Subscribing to trades made by accounts payload = { method: "subscribeAccountTrade", keys: ["AArPXm8JatJiuyEffuC1un2Sc835SULa4uQqDcaGpAjV"] // array of accounts to watch } ws.send(JSON.stringify(payload)); // Subscribing to trades on tokens payload = { method: "subscribeTokenTrade", keys: ["GkyPYa7NnCFbduLknCfBfP7p8564X1VZhwZYJ6CZpump"] // array of token CAs to watch } ws.send(JSON.stringify(payload));});ws.on('message', function message(data) { console.log(JSON.parse(data));}); You can also unsubscribe from any data stream in the same way, using the following methods: * `unsubscribeTokenTrade` * `unsubscribeAccountTrade` * [Examples:](https://pumpportal.fun/data-api/pump-swap/#examples) --- # Jito Bundles | Pump Fun API [Skip to main content](https://pumpportal.fun/local-trading-api/jito-bundles/#__docusaurus_skipToContent_fallback) On this page Jito Bundles ============ The Trading API can be used to construct Jito bundles. Build trades as you otherwise would, except the JSON body in your request to PumpPortal should be an _array_ of objects, as shown in the example below. See [Token Creation](https://pumpportal.fun/creation#jito-bundle-examples) for more advanced examples creating tokens with bundles. ### Examples[​](https://pumpportal.fun/local-trading-api/jito-bundles/#examples "Direct link to Examples") * Python * JavaScript import requestsimport base58from solders.transaction import VersionedTransactionfrom solders.keypair import KeypairsignerKeypairs = [ Keypair.from_base58_string("Wallet A base 58 private key here"), Keypair.from_base58_string("Wallet B base 58 private key here") # use up to 5 wallets]response = requests.post( "https://pumpportal.fun/api/trade-local", headers={"Content-Type": "application/json"}, json=[ { "publicKey": str(signerKeypairs[0].pubkey()), "action": "buy", # "buy", "sell", or "create" "mint": "2xHkesAQteG9yz48SDaVAtKdFU6Bvdo9sXS3uQCbpump", "denominatedInSol": "false", "amount": 1000, "slippage": 50, "priorityFee": 0.0001, # priority fee on the first tx is used for jito tip "pool": "pump" }, { "publicKey": str(signerKeypairs[1].pubkey()), "action": "buy", # "buy", "sell", or "create" "mint": "2xHkesAQteG9yz48SDaVAtKdFU6Bvdo9sXS3uQCbpump", "denominatedInSol": "false", "amount": 1000, "slippage": 50, "priorityFee": 0.0001, # priority fee after first tx is ignored "pool": "pump" } # use up to 5 transactions ])if response.status_code != 200: print("Failed to generate transactions.") print(response.reason)else: encodedTransactions = response.json() encodedSignedTransactions = [] txSignatures = [] for index, encodedTransaction in enumerate(encodedTransactions): signedTx = VersionedTransaction(VersionedTransaction.from_bytes(base58.b58decode(encodedTransaction)).message, [signerKeypairs[index]]) encodedSignedTransactions.append(base58.b58encode(bytes(signedTx)).decode()) txSignatures.append(str(signedTx.signatures[0])) jito_response = requests.post( "https://mainnet.block-engine.jito.wtf/api/v1/bundles", headers={"Content-Type": "application/json"}, json={ "jsonrpc": "2.0", "id": 1, "method": "sendBundle", "params": [ encodedSignedTransactions ] } ) for i, signature in enumerate(txSignatures): print(f'Transaction {i}: https://solscan.io/tx/{signature}') import { VersionedTransaction, Connection, Keypair, sendAndConfirmTransaction} from '@solana/web3.js';import bs58 from "bs58";async function sendTransactionBundle(){ const signerKeyPairs = [ Keypair.fromSecretKey(bs58.decode("Wallet A base 58 private key here")), Keypair.fromSecretKey(bs58.decode("Wallet B base 58 private key here")), // use up to 5 wallets ]; const bundledTxArgs = [ { publicKey: signerKeyPairs[0].publicKey.toBase58(), "action": "buy", // "buy", "sell", or "create" "mint": "2xHkesAQteG9yz48SDaVAtKdFU6Bvdo9sXS3uQCbpump", "denominatedInSol": "false", "amount": 1000000, "slippage": 50, "priorityFee": 0.00005, //priority fee on the first tx is used for jito tip "pool": "pump" }, { publicKey: signerKeyPairs[1].publicKey.toBase58(), "action": "buy", // "buy", "sell", or "create" "mint": "2xHkesAQteG9yz48SDaVAtKdFU6Bvdo9sXS3uQCbpump", "denominatedInSol": "false", "amount": 1000000, "slippage": 50, "priorityFee": 0.0, //priority fee after first tx is ignored "pool": "pump" }, // use up to 5 transactions ]; const response = await fetch(`https://pumpportal.fun/api/trade-local`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(bundledTxArgs) }); if(response.status === 200){ // successfully generated transaction const transactions = await response.json(); console.log(transactions); let encodedSignedTransactions = []; let signatures = []; for(let i = 0; i < bundledTxArgs.length; i++){ //decode and sign each tx const tx = VersionedTransaction.deserialize(new Uint8Array(bs58.decode(transactions[i]))); tx.sign([signerKeyPairs[i]]); encodedSignedTransactions.push(bs58.encode(tx.serialize())); signatures.push(bs58.encode(tx.signatures[0])); } try{ const jitoResponse = await fetch(`https://mainnet.block-engine.jito.wtf/api/v1/bundles`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ "jsonrpc": "2.0", "id": 1, "method": "sendBundle", "params": [ encodedSignedTransactions ] }) }); console.log(jitoResponse); } catch(e){ console.error(e.message); } for(let i = 0; i < signatures.length; i++){ console.log(`Transaction ${i}: https://solscan.io/tx/${signatures[i]}`); } } else { console.log(response.statusText); // log error }}sendTransactionBundle(); * [Examples](https://pumpportal.fun/local-trading-api/jito-bundles/#examples) --- # Real-time Updates | Pump Fun API [Skip to main content](https://pumpportal.fun/data-api/bonk-fun-data-api/#__docusaurus_skipToContent_fallback) On this page Real-time Updates ================= Stream real-time trading and token creation data from Bonk by connecting to the PumpPortal Websocket at `wss://pumpportal.fun/api/data`. Once you connect, you can subscribe to different data streams. The following methods are available: * `subscribeNewToken` For token creation events. * `subscribeTokenTrade` For all trades made on specific token(s). * `subscribeAccountTrade` For all trades made by specific account(s). * `subscribeMigration` For subscribing to token migration events. PLEASE ONLY USE ONE WEBSOCKET CONNECTION AT A TIME: You should NOT open a new Websocket connection for every token or account you subscribe to. Instead, you should send any new subscribe messages to the same connection. Clients that repeatedly attempt to open many websocket connections at once may be timed out. Bans expire every hour, so if you accidentally get banned you can fix your code and connect again soon. ### Examples:[​](https://pumpportal.fun/data-api/bonk-fun-data-api/#examples "Direct link to Examples:") * Python * JavaScript import asyncioimport websocketsimport jsonasync def subscribe(): uri = "wss://pumpportal.fun/api/data" async with websockets.connect(uri) as websocket: # Subscribing to token creation events payload = { "method": "subscribeNewToken", } await websocket.send(json.dumps(payload)) # Subscribing to migration events payload = { "method": "subscribeMigration", } await websocket.send(json.dumps(payload)) # Subscribing to trades made by accounts payload = { "method": "subscribeAccountTrade", "keys": ["AArPXm8JatJiuyEffuC1un2Sc835SULa4uQqDcaGpAjV"] # array of accounts to watch } await websocket.send(json.dumps(payload)) # Subscribing to trades on tokens payload = { "method": "subscribeTokenTrade", "keys": ["91WNez8D22NwBssQbkzjy4s2ipFrzpmn5hfvWVe2aY5p"] # array of token CAs to watch } await websocket.send(json.dumps(payload)) async for message in websocket: print(json.loads(message))# Run the subscribe functionasyncio.get_event_loop().run_until_complete(subscribe()) import WebSocket from 'ws';const ws = new WebSocket('wss://pumpportal.fun/api/data');ws.on('open', function open() { // Subscribing to token creation events let payload = { method: "subscribeNewToken", } ws.send(JSON.stringify(payload)); // Subscribing to migration events let payload = { method: "subscribeMigration", } ws.send(JSON.stringify(payload)); // Subscribing to trades made by accounts payload = { method: "subscribeAccountTrade", keys: ["AArPXm8JatJiuyEffuC1un2Sc835SULa4uQqDcaGpAjV"] // array of accounts to watch } ws.send(JSON.stringify(payload)); // Subscribing to trades on tokens payload = { method: "subscribeTokenTrade", keys: ["91WNez8D22NwBssQbkzjy4s2ipFrzpmn5hfvWVe2aY5p"] // array of token CAs to watch } ws.send(JSON.stringify(payload));});ws.on('message', function message(data) { console.log(JSON.parse(data));}); You can also unsubscribe from any data stream in the same way, using the following methods: * `unsubscribeNewToken` * `unsubscribeTokenTrade` * `unsubscribeAccountTrade` * Python * JavaScript import asyncioimport websocketsimport jsonasync def subscribe():uri = "wss://pumpportal.fun/api/data"async with websockets.connect(uri) as websocket: # Subscribing to token creation events payload = { "method": "subscribeNewToken", } await websocket.send(json.dumps(payload)) # Unsubscribing from new token events payload = { "method": "unsubscribeNewToken", } await websocket.send(json.dumps(payload)) async for message in websocket: print(json.loads(message))# Run the subscribe functionasyncio.get_event_loop().run_until_complete(subscribe()) const ws = new WebSocket(`wss://pumpportal.fun/api/data`);ws.on('open', function open() { ws.send(JSON.stringify({ method: "subscribeTokenTrade", keys: ["Bwc4EBE65qXVzZ9ZiieBraj9GZL4Y2d7NN7B9pXENWR2"] })); // unsubscribe after 10 seconds setTimeout(()=>{ ws.send(JSON.stringify({ method: "unsubscribeTokenTrade", keys: ["Bwc4EBE65qXVzZ9ZiieBraj9GZL4Y2d7NN7B9pXENWR2"] })); }, 10000);}); * [Examples:](https://pumpportal.fun/data-api/bonk-fun-data-api/#examples) --- # Transaction API Docs | Pump Fun API [Skip to main content](https://pumpportal.fun/local-trading-api/trading-api/#__docusaurus_skipToContent_fallback) On this page Transaction API Docs ==================== To get a transaction for signing and sending with a custom RPC, send a POST request to `https://pumpportal.fun/api/trade-local` Your request body must contain the following options: * `publicKey`: Your wallet public key * `action`: "buy" or "sell" * `mint`: The contract address of the token you want to trade (this is the text after the '/' in the pump.fun url for the token.) * `amount`: The amount of SOL or tokens to trade. If selling, amount can be a percentage of tokens in your wallet (ex. amount: "100%") * `denominatedInSol`: "true" if amount is SOL, "false" if amount is tokens * `slippage`: The percent slippage allowed * `priorityFee`: Amount to use as priority fee * `pool`: (optional) Currently 'pump', 'raydium', 'pump-amm', 'launchlab', 'raydium-cpmm', 'bonk', and 'auto' are supported options. Default is 'pump'. If your parameters are valid, you will receive a serialized transaction in response. See the examples below for how to send this transaction with Python (Solders) or JavaScript (Web3.js). ### Examples[​](https://pumpportal.fun/local-trading-api/trading-api/#examples "Direct link to Examples") * Python * JavaScript import requestsfrom solders.transaction import VersionedTransactionfrom solders.keypair import Keypairfrom solders.commitment_config import CommitmentLevelfrom solders.rpc.requests import SendVersionedTransactionfrom solders.rpc.config import RpcSendTransactionConfigresponse = requests.post(url="https://pumpportal.fun/api/trade-local", data={ "publicKey": "Your public key here", "action": "buy", # "buy" or "sell" "mint": "token CA here", # contract address of the token you want to trade "amount": 100000, # amount of SOL or tokens to trade "denominatedInSol": "false", # "true" if amount is amount of SOL, "false" if amount is number of tokens "slippage": 10, # percent slippage allowed "priorityFee": 0.005, # amount to use as priority fee "pool": "auto" # exchange to trade on. "pump", "raydium", "pump-amm", 'launchlab', 'raydium-cpmm', 'bonk', or "auto"})keypair = Keypair.from_base58_string("Your base 58 private key here")tx = VersionedTransaction(VersionedTransaction.from_bytes(response.content).message, [keypair])commitment = CommitmentLevel.Confirmedconfig = 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}') import { VersionedTransaction, Connection, Keypair } from '@solana/web3.js';import bs58 from "bs58";const RPC_ENDPOINT = "Your RPC Endpoint";const web3Connection = new Connection( RPC_ENDPOINT, 'confirmed',);async function sendPortalTransaction(){ const response = await fetch(`https://pumpportal.fun/api/trade-local`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ "publicKey": "your-public-key", // Your wallet public key "action": "buy", // "buy" or "sell" "mint": "token-ca-here", // contract address of the token you want to trade "denominatedInSol": "false", // "true" if amount is amount of SOL, "false" if amount is number of tokens "amount": 1000, // amount of SOL or tokens "slippage": 10, // percent slippage allowed "priorityFee": 0.00001, // priority fee "pool": "auto" // exchange to trade on. "pump", "raydium", "pump-amm", 'launchlab', 'raydium-cpmm', 'bonk' or "auto" }) }); if(response.status === 200){ // successfully generated transaction const data = await response.arrayBuffer(); const tx = VersionedTransaction.deserialize(new Uint8Array(data)); const signerKeyPair = Keypair.fromSecretKey(bs58.decode("your-wallet-private-key")); tx.sign([signerKeyPair]); const signature = await web3Connection.sendTransaction(tx) console.log("Transaction: https://solscan.io/tx/" + signature); } else { console.log(response.statusText); // log error }}sendPortalTransaction(); * [Examples](https://pumpportal.fun/local-trading-api/trading-api/#examples) --- # Real-time Updates | Pump Fun API [Skip to main content](https://pumpportal.fun/data-api/real-time/#__docusaurus_skipToContent_fallback) On this page Real-time Updates ================= Stream real-time trading and token creation data by connecting to the PumpPortal Websocket at `wss://pumpportal.fun/api/data`. Once you connect, you can subscribe to different data streams. The following methods are available: * `subscribeNewToken` For token creation events. * `subscribeTokenTrade` For all trades made on specific token(s). * `subscribeAccountTrade` For all trades made by specific account(s). * `subscribeMigration` For subscribing to token migration events. PLEASE ONLY USE ONE WEBSOCKET CONNECTION AT A TIME: You should NOT open a new Websocket connection for every token or account you subscribe to. Instead, you should send any new subscribe messages to the same connection. Clients that repeatedly attempt to open many websocket connections at once may be timed out. Bans expire every hour, so if you accidentally get banned you can fix your code and connect again soon. ### Examples:[​](https://pumpportal.fun/data-api/real-time/#examples "Direct link to Examples:") * Python * JavaScript import asyncioimport websocketsimport jsonasync def subscribe(): uri = "wss://pumpportal.fun/api/data" async with websockets.connect(uri) as websocket: # Subscribing to token creation events payload = { "method": "subscribeNewToken", } await websocket.send(json.dumps(payload)) # Subscribing to migration events payload = { "method": "subscribeMigration", } await websocket.send(json.dumps(payload)) # Subscribing to trades made by accounts payload = { "method": "subscribeAccountTrade", "keys": ["AArPXm8JatJiuyEffuC1un2Sc835SULa4uQqDcaGpAjV"] # array of accounts to watch } await websocket.send(json.dumps(payload)) # Subscribing to trades on tokens payload = { "method": "subscribeTokenTrade", "keys": ["91WNez8D22NwBssQbkzjy4s2ipFrzpmn5hfvWVe2aY5p"] # array of token CAs to watch } await websocket.send(json.dumps(payload)) async for message in websocket: print(json.loads(message))# Run the subscribe functionasyncio.get_event_loop().run_until_complete(subscribe()) import WebSocket from 'ws';const ws = new WebSocket('wss://pumpportal.fun/api/data');ws.on('open', function open() { // Subscribing to token creation events let payload = { method: "subscribeNewToken", } ws.send(JSON.stringify(payload)); // Subscribing to migration events let payload = { method: "subscribeMigration", } ws.send(JSON.stringify(payload)); // Subscribing to trades made by accounts payload = { method: "subscribeAccountTrade", keys: ["AArPXm8JatJiuyEffuC1un2Sc835SULa4uQqDcaGpAjV"] // array of accounts to watch } ws.send(JSON.stringify(payload)); // Subscribing to trades on tokens payload = { method: "subscribeTokenTrade", keys: ["91WNez8D22NwBssQbkzjy4s2ipFrzpmn5hfvWVe2aY5p"] // array of token CAs to watch } ws.send(JSON.stringify(payload));});ws.on('message', function message(data) { console.log(JSON.parse(data));}); You can also unsubscribe from any data stream in the same way, using the following methods: * `unsubscribeNewToken` * `unsubscribeTokenTrade` * `unsubscribeAccountTrade` * Python * JavaScript import asyncioimport websocketsimport jsonasync def subscribe():uri = "wss://pumpportal.fun/api/data"async with websockets.connect(uri) as websocket: # Subscribing to token creation events payload = { "method": "subscribeNewToken", } await websocket.send(json.dumps(payload)) # Unsubscribing from new token events payload = { "method": "unsubscribeNewToken", } await websocket.send(json.dumps(payload)) async for message in websocket: print(json.loads(message))# Run the subscribe functionasyncio.get_event_loop().run_until_complete(subscribe()) const ws = new WebSocket(`wss://pumpportal.fun/api/data`);ws.on('open', function open() { ws.send(JSON.stringify({ method: "subscribeTokenTrade", keys: ["Bwc4EBE65qXVzZ9ZiieBraj9GZL4Y2d7NN7B9pXENWR2"] })); // unsubscribe after 10 seconds setTimeout(()=>{ ws.send(JSON.stringify({ method: "unsubscribeTokenTrade", keys: ["Bwc4EBE65qXVzZ9ZiieBraj9GZL4Y2d7NN7B9pXENWR2"] })); }, 10000);}); * [Examples:](https://pumpportal.fun/data-api/real-time/#examples) --- # Pump.fun Token Creation | Pump Fun API [Skip to main content](https://pumpportal.fun/creation/#__docusaurus_skipToContent_fallback) On this page Pump.fun Token Creation ======================= You can create tokens via the pump.fun API. There is no additional fee for token creation. The standard trading fee is applied to the initial dev buy. Examples below: ### Lightning Transaction Examples:[​](https://pumpportal.fun/creation/#lightning-transaction-examples "Direct link to Lightning Transaction Examples:") * Python * JavaScript import requestsimport jsonfrom solders.keypair import Keypairdef send_create_tx(): # Generate a random keypair for token mint_keypair = Keypair() # Define token metadata form_data = { 'name': 'PPTest', 'symbol': 'TEST', 'description': 'This is an example token created via PumpPortal.fun', 'twitter': 'https://x.com/a1lon9/status/1812970586420994083', 'telegram': 'https://x.com/a1lon9/status/1812970586420994083', 'website': 'https://pumpportal.fun', 'showName': 'true' } # Read the image file with open('./example.png', 'rb') as f: file_content = f.read() files = { 'file': ('example.png', file_content, 'image/png') } # Create IPFS metadata storage metadata_response = requests.post("https://pump.fun/api/ipfs", data=form_data, files=files) metadata_response_json = metadata_response.json() # Token metadata token_metadata = { 'name': form_data['name'], 'symbol': form_data['symbol'], 'uri': metadata_response_json['metadataUri'] } # Send the create transaction response = requests.post( "https://pumpportal.fun/api/trade?api-key=your-api-key", headers={'Content-Type': 'application/json'}, data=json.dumps({ 'action': 'create', 'tokenMetadata': token_metadata, 'mint': str(mint_keypair), 'denominatedInSol': 'true', 'amount': 1, # Dev buy of 1 SOL 'slippage': 10, 'priorityFee': 0.0005, 'pool': 'pump', 'isMayhemMode': 'false' # optional, defaults to false }) ) if response.status_code == 200: # successfully generated transaction data = response.json() print(f"Transaction: https://solscan.io/tx/{data['signature']}") else: print(response.reason) # log errorsend_create_tx() async function sendCreateTx(){ // Generate a random keypair for token const mintKeypair = Keypair.generate(); // Define token metadata const formData = new FormData(); formData.append("file", await fs.openAsBlob("./example.png")), // Image file formData.append("name", "PPTest"), formData.append("symbol", "TEST"), formData.append("description", "This is an example token created via PumpPortal.fun"), formData.append("twitter", "https://x.com/a1lon9/status/1812970586420994083"), formData.append("telegram", "https://x.com/a1lon9/status/1812970586420994083"), formData.append("website", "https://pumpportal.fun"), formData.append("showName", "true"); // Create IPFS metadata storage const metadataResponse = await fetch("https://pump.fun/api/ipfs", { method: "POST", body: formData, }); const metadataResponseJSON = await metadataResponse.json(); // Send the create transaction const response = await fetch(`https://pumpportal.fun/api/trade?api-key=your-api-key`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ "action": "create", "tokenMetadata": { name: metadataResponseJSON.metadata.name, symbol: metadataResponseJSON.metadata.symbol, uri: metadataResponseJSON.metadataUri }, "mint": bs58.encode(mintKeypair.secretKey), "denominatedInSol": "true", "amount": 1, // Dev buy of 1 SOL "slippage": 10, "priorityFee": 0.0005, "pool": "pump", "isMayhemMode": "false" // optional, defaults to false }) }); if(response.status === 200){ // successfully generated transaction const data = await response.json(); console.log("Transaction: https://solscan.io/tx/" + data.signature); } else { console.log(response.statusText); // log error }}sendCreateTx(); ### Local Transaction Examples:[​](https://pumpportal.fun/creation/#local-transaction-examples "Direct link to Local Transaction Examples:") * Python * JavaScript import requestsimport jsonfrom solders.keypair import Keypairfrom solders.transaction import VersionedTransactionfrom solders.keypair import Keypairfrom solders.commitment_config import CommitmentLevelfrom solders.rpc.requests import SendVersionedTransactionfrom solders.rpc.config import RpcSendTransactionConfigdef send_local_create_tx(): signer_keypair = Keypair.from_base58_string('your-base58-private-key') # Generate a random keypair for token mint_keypair = Keypair() # Define token metadata form_data = { 'name': 'PPTest', 'symbol': 'TEST', 'description': 'This is an example token created via PumpPortal.fun', 'twitter': 'https://x.com/a1lon9/status/1812970586420994083', 'telegram': 'https://x.com/a1lon9/status/1812970586420994083', 'website': 'https://pumpportal.fun', 'showName': 'true' } # Read the image file with open('./example.png', 'rb') as f: file_content = f.read() files = { 'file': ('example.png', file_content, 'image/png') } # Create IPFS metadata storage metadata_response = requests.post("https://pump.fun/api/ipfs", data=form_data, files=files) metadata_response_json = metadata_response.json() # Token metadata token_metadata = { 'name': form_data['name'], 'symbol': form_data['symbol'], 'uri': metadata_response_json['metadataUri'] } # Generate the create transaction response = requests.post( "https://pumpportal.fun/api/trade-local", headers={'Content-Type': 'application/json'}, data=json.dumps({ 'publicKey': str(signer_keypair.pubkey()), 'action': 'create', 'tokenMetadata': token_metadata, 'mint': str(mint_keypair.pubkey()), 'denominatedInSol': 'true', 'amount': 1, # Dev buy of 1 SOL 'slippage': 10, 'priorityFee': 0.0005, 'pool': 'pump', 'isMayhemMode': 'false' # optional, defaults to false }) ) tx = VersionedTransaction(VersionedTransaction.from_bytes(response.content).message, [mint_keypair, signer_keypair]) commitment = CommitmentLevel.Confirmed config = RpcSendTransactionConfig(preflight_commitment=commitment) txPayload = SendVersionedTransaction(tx, config) response = requests.post( url="Your RPC endpoint - 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}')send_local_create_tx() import { VersionedTransaction, Connection, Keypair } from '@solana/web3.js';import bs58 from "bs58";const RPC_ENDPOINT = "Your RPC Endpoint";const web3Connection = new Connection( RPC_ENDPOINT, 'confirmed',);async function sendLocalCreateTx(){ const signerKeyPair = Keypair.fromSecretKey(bs58.decode("your-wallet-private-key")); // Generate a random keypair for token const mintKeypair = Keypair.generate(); // Define token metadata const formData = new FormData(); formData.append("file", await fs.openAsBlob("./example.png")), // Image file formData.append("name", "PPTest"), formData.append("symbol", "TEST"), formData.append("description", "This is an example token created via PumpPortal.fun"), formData.append("twitter", "https://x.com/a1lon9/status/1812970586420994083"), formData.append("telegram", "https://x.com/a1lon9/status/1812970586420994083"), formData.append("website", "https://pumpportal.fun"), formData.append("showName", "true"); // Create IPFS metadata storage const metadataResponse = await fetch("https://pump.fun/api/ipfs", { method: "POST", body: formData, }); const metadataResponseJSON = await metadataResponse.json(); // Get the create transaction const response = await fetch(`https://pumpportal.fun/api/trade-local`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ "publicKey": 'your-wallet-public-key', "action": "create", "tokenMetadata": { name: metadataResponseJSON.metadata.name, symbol: metadataResponseJSON.metadata.symbol, uri: metadataResponseJSON.metadataUri }, "mint": mintKeypair.publicKey.toBase58(), "denominatedInSol": "true", "amount": 1, // dev buy of 1 SOL "slippage": 10, "priorityFee": 0.0005, "pool": "pump", "isMayhemMode": "false" // optional, defaults to false }) }); if(response.status === 200){ // successfully generated transaction const data = await response.arrayBuffer(); const tx = VersionedTransaction.deserialize(new Uint8Array(data)); tx.sign([mintKeypair, signerKeyPair]); const signature = await web3Connection.sendTransaction(tx) console.log("Transaction: https://solscan.io/tx/" + signature); } else { console.log(response.statusText); // log error }}sendLocalCreateTx(); ### Jito Bundle Examples:[​](https://pumpportal.fun/creation/#jito-bundle-examples "Direct link to Jito Bundle Examples:") * Python * JavaScript import requestsimport base58from solders.transaction import VersionedTransactionfrom solders.keypair import Keypairdef send_create_tx_bundle(): signerKeypairs = [ Keypair.from_base58_string("Wallet A base 58 private key here"), Keypair.from_base58_string("Wallet B base 58 private key here") # use up to 5 wallets ] # Generate a random keypair for token mint_keypair = Keypair() # Define token metadata form_data = { 'name': 'PPTest', 'symbol': 'TEST', 'description': 'This is an example token created via PumpPortal.fun', 'twitter': 'https://x.com/a1lon9/status/1812970586420994083', 'telegram': 'https://x.com/a1lon9/status/1812970586420994083', 'website': 'https://pumpportal.fun', 'showName': 'true' } # Read the image file with open('./example.png', 'rb') as f: file_content = f.read() files = { 'file': ('example.png', file_content, 'image/png') } # Create IPFS metadata storage metadata_response = requests.post("https://pump.fun/api/ipfs", data=form_data, files=files) metadata_response_json = metadata_response.json() # Token metadata token_metadata = { 'name': form_data['name'], 'symbol': form_data['symbol'], 'uri': metadata_response_json['metadataUri'] } bundledTransactionArgs = [ { 'publicKey': str(signerKeypairs[0].pubkey()), 'action': 'create', 'tokenMetadata': token_metadata, 'mint': str(mint_keypair.pubkey()), 'denominatedInSol': 'false', 'amount': 1000000, # Dev buy of 1000000 tokens 'slippage': 10, 'priorityFee': 0.0005, 'pool': 'pump' }, { "publicKey": str(signerKeypairs[1].pubkey()), "action": "buy", # "buy", "sell", or "create" "mint": str(mint_keypair.pubkey()), "denominatedInSol": "false", "amount": 1000000, "slippage": 50, "priorityFee": 0.0001, # priority fee after first tx is ignored "pool": "pump" } # use up to 5 transactions ] # Generate the bundled transactions response = requests.post( "https://pumpportal.fun/api/trade-local", headers={"Content-Type": "application/json"}, json=bundledTransactionArgs ) if response.status_code != 200: print("Failed to generate transactions.") print(response.reason) else: encodedTransactions = response.json() encodedSignedTransactions = [] txSignatures = [] for index, encodedTransaction in enumerate(encodedTransactions): if bundledTransactionArgs[index]["action"] == "create": signedTx = VersionedTransaction(VersionedTransaction.from_bytes(base58.b58decode(encodedTransaction)).message, [mint_keypair, signerKeypairs[index]]) else: signedTx = VersionedTransaction(VersionedTransaction.from_bytes(base58.b58decode(encodedTransaction)).message, [signerKeypairs[index]]) encodedSignedTransactions.append(base58.b58encode(bytes(signedTx)).decode()) txSignatures.append(str(signedTx.signatures[0])) jito_response = requests.post( "https://mainnet.block-engine.jito.wtf/api/v1/bundles", headers={"Content-Type": "application/json"}, json={ "jsonrpc": "2.0", "id": 1, "method": "sendBundle", "params": [ encodedSignedTransactions ] } ) for i, signature in enumerate(txSignatures): print(f'Transaction {i}: https://solscan.io/tx/{signature}')send_create_tx_bundle() async function sendLocalCreateBundle(){ const signerKeyPairs = [ Keypair.fromSecretKey(bs58.decode("Wallet A base 58 private key here")), Keypair.fromSecretKey(bs58.decode("Wallet B base 58 private key here")), // use up to 5 wallets ]; const mintKeypair = Keypair.generate(); // generates a random keypair for token let tokenMetadata = { name: "TEST", symbol: "AAA", description: "This is an example token created via PumpPortal.fun", twitter: "https://x.com/a1lon9/status/1812970586420994083", telegram: "https://x.com/a1lon9/status/1812970586420994083", website: "https://pumpportal.fun", file: await fs.openAsBlob("./new-moon-face.png"), }; let formData = new FormData(); formData.append("file", tokenMetadata.file), formData.append("name", tokenMetadata.name), formData.append("symbol", tokenMetadata.symbol), formData.append("description", tokenMetadata.description), formData.append("twitter", tokenMetadata.twitter || ""), formData.append("telegram", tokenMetadata.telegram || ""), formData.append("website", tokenMetadata.website || ""), formData.append("showName", "true"); let metadataResponse = await fetch("https://pump.fun/api/ipfs", { method: "POST", body: formData, }); let metadataResponseJSON = await metadataResponse.json(); const bundledTxArgs = [ { "publicKey": signerKeyPairs[0].publicKey.toBase58(), "action": "create", "tokenMetadata": {name: tokenMetadata.name, symbol: tokenMetadata.symbol, uri: metadataResponseJSON.metadataUri}, "mint": mintKeypair.publicKey.toBase58(), "denominatedInSol": "false", "amount": 10000000, "slippage": 10, "priorityFee": 0.0001, // priority fee on the first tx is used for jito tip "pool": "pump" }, { publicKey: signerKeyPairs[1].publicKey.toBase58(), "action": "buy", "mint": mintKeypair.publicKey.toBase58(), "denominatedInSol": "false", "amount": 10000000, "slippage": 10, "priorityFee": 0.00005, // priority fee after first tx is ignored "pool": "pump" }, // use up to 5 transactions ]; const response = await fetch(`https://pumpportal.fun/api/trade-local`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(bundledTxArgs) }); if(response.status === 200){ // successfully generated transactions const transactions = await response.json(); let encodedSignedTransactions = []; let signatures = []; for(let i = 0; i < bundledTxArgs.length; i++){ const tx = VersionedTransaction.deserialize(new Uint8Array(bs58.decode(transactions[i]))); if(bundledTxArgs[i].action === "create"){ // creation transaction needs to be signed by mint and creator keypairs tx.sign([mintKeypair, signerKeyPairs[i]]) } else { tx.sign([signerKeyPairs[i]]); } encodedSignedTransactions.push(bs58.encode(tx.serialize())); signatures.push(bs58.encode(tx.signatures[0])); } try{ const jitoResponse = await fetch(`https://mainnet.block-engine.jito.wtf/api/v1/bundles`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ "jsonrpc": "2.0", "id": 1, "method": "sendBundle", "params": [ encodedSignedTransactions ] }) }); console.log(jitoResponse); } catch(e){ console.error(e.message); } for(let i = 0; i < signatures.length; i++){ console.log(`Transaction ${i}: https://solscan.io/tx/${signatures[i]}`); } } else { console.log(response.statusText); // log error }}sendLocalCreateBundle(); ### Bonk Token Creation Examples:[​](https://pumpportal.fun/creation/#bonk-token-creation-examples "Direct link to Bonk Token Creation Examples:") Create Bonk tokens using the Lightning API: * Python * JavaScript import requestsimport jsonfrom solders.keypair import Keypairdef send_create_tx_bonk(): # Generate a random keypair for token mint_keypair = Keypair() print("Token CA generated. Token address: ") print(mint_keypair.pubkey()) name = "PumpPortalTest" symbol = "PORTAL" # Read the image file with open('./example.png', 'rb') as f: file_content = f.read() files = { 'image': ('example.png', file_content, 'image/png') } # Create IPFS metadata storage img_response = requests.post("https://nft-storage.letsbonk22.workers.dev/upload/img", files=files) img_uri = img_response.text metadata_response = requests.post( "https://nft-storage.letsbonk22.workers.dev/upload/meta", headers={'Content-Type': 'application/json'}, data=json.dumps({ 'createdOn': "https://bonk.fun", 'description': "Test token for PumpPortal.fun", 'image': img_uri, 'name': name, 'symbol': symbol, 'website': "https://pumpportal.fun" }) ) metadata_uri = metadata_response.text # Token metadata token_metadata = { 'name': name, 'symbol': symbol, 'uri': metadata_uri } # Send the create transaction response = requests.post( "https://pumpportal.fun/api/trade?api-key=your-api-key-here", headers={'Content-Type': 'application/json'}, data=json.dumps({ 'action': 'create', 'tokenMetadata': token_metadata, 'mint': str(mint_keypair), 'denominatedInSol': 'true', 'amount': 1, # Dev buy of 1 SOL 'slippage': 10, 'priorityFee': 0.00005, 'pool': 'bonk', 'quoteMint': "USD1ttGY1N17NEEHLmELoaybftRBUSErhqYiQzvEmuB" # default 'So11111111111111111111111111111111111111112' }) ) if response.status_code == 200: # successfully generated transaction data = response.json() print(f"Transaction: https://solscan.io/tx/{data['signature']}") else: print(response.reason) # log errorsend_create_tx_bonk() async function sendCreateTxBonk() { // Generate a random keypair for token const mintKeypair = Keypair.generate(); const name = "PumpPortalTest"; const symbol = "PORTAL"; const formData = new FormData(); formData.append("image", await fs.openAsBlob("./example.png")) // Image file // Create IPFS metadata storage const imgResponse = await fetch("https://nft-storage.letsbonk22.workers.dev/upload/img", { method: "POST", body: formData, }); let imgUri = await imgResponse.text() console.log(imgUri); const metadataResponse = await fetch("https://nft-storage.letsbonk22.workers.dev/upload/meta", { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ createdOn: "https://bonk.fun", description: "Test token for PumpPortal.fun", image: imgUri, name: name, symbol: symbol, website: "https://pumpportal.fun" }), }) let metadataUri = await metadataResponse.text(); console.log(metadataUri); // Get the create transaction const response = await fetch( `https://pumpportal.fun/api/trade?api-key=${pumpPortalAPIKey}`, { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ action: "create", tokenMetadata: { name: name, symbol: symbol, uri: metadataUri, }, mint: bs58.encode(mintKeypair.secretKey), // contract address of the token you want to trade denominatedInSol: "true", // "true" if amount is amount of SOL, "false" if amount is number of tokens amount: 0.5, // amount of SOL or tokens slippage: 5, // percent slippage allowed priorityFee: 0.00005, pool: "bonk", quoteMint: "USD1ttGY1N17NEEHLmELoaybftRBUSErhqYiQzvEmuB" // default 'So11111111111111111111111111111111111111112' }), } ); if (response.status === 200) { // successfully generated transaction const data = await response.json(); console.log("Transaction: https://solscan.io/tx/" + data.signature); } else { console.log(response.statusText); // log error }}sendCreateTxBonk(); * [Lightning Transaction Examples:](https://pumpportal.fun/creation/#lightning-transaction-examples) * [Local Transaction Examples:](https://pumpportal.fun/creation/#local-transaction-examples) * [Jito Bundle Examples:](https://pumpportal.fun/creation/#jito-bundle-examples) * [Bonk Token Creation Examples:](https://pumpportal.fun/creation/#bonk-token-creation-examples) ---