Showing preview only (763K chars total). Download the full file or copy to clipboard to get everything.
Repository: pump-fun/pump-public-docs
Branch: main
Commit: 7de0b959fa2b
Files: 17
Total size: 742.1 KB
Directory structure:
gitextract_dpl0nx5y/
├── .gitignore
├── README.md
├── docs/
│ ├── BREAKING_FEE_RECIPIENT.md
│ ├── FAQ.md
│ ├── FEE_PROGRAM_README.md
│ ├── PUMP_CASHBACK_README.md
│ ├── PUMP_CREATOR_FEE_README.md
│ ├── PUMP_PROGRAM_README.md
│ ├── PUMP_SWAP_CREATOR_FEE_README.md
│ ├── PUMP_SWAP_README.md
│ └── PUMP_SWAP_SDK_README.md
└── idl/
├── pump.json
├── pump.ts
├── pump_amm.json
├── pump_amm.ts
├── pump_fees.json
└── pump_fees.ts
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
.idea
================================================
FILE: README.md
================================================
# pump-public-docs
[Pump fee program docs](docs/FEE_PROGRAM_README.md)
## Other documentation
- [Pump Program](docs/PUMP_PROGRAM_README.md)
- [PumpSwap](docs/PUMP_SWAP_README.md)
- [PumpSwap SDK](docs/PUMP_SWAP_SDK_README.md)
- [Pump Program creator fee update](docs/PUMP_CREATOR_FEE_README.md)
- [PumpSwap creator fee update](docs/PUMP_SWAP_CREATOR_FEE_README.md)
- [FAQ](docs/FAQ.md)
---
### One-Time Creator Reward Distribution Policy
This update only affects fee-sharing configuration. Trading instructions are unchanged and do not require an upgrade.
**TLDR:** After the first configuration, reward distribution is locked and cannot be changed.
What changed:
- Reward distribution can be configured **only once**.
- You can configure it using either `updateFeeShares` or `updateSharingConfigWithSocialRecipients`.
- After it is configured, it is **locked** and cannot be changed again.
What did **not** change:
- Buy and sell instructions are unchanged.
Migration/compatibility notes:
- Reward distributions created before this policy are treated as final (locked).
- `RevokeFeeSharingAuthority` and `TransferFeeSharingAuthority` are no longer supported.
- If you are unsure whether a reward distribution is still editable, call `isSharingConfigEditable`.
## GitHub Recipient and Social Fee PDA Requirements
If you are adding a **GitHub recipient** as a fee recipient in sharing config, make sure to initialize the social fee pda before adding it as a recipient. Use one of these methods:
```ts
import {
Platform,
PUMP_SDK,
} from "@pump-fun/pump-sdk";
// 1) Update an existing sharing config
await PUMP_SDK.updateSharingConfigWithSocialRecipients({
authority,
mint,
currentShareholders,
newShareholders: [
{ address: authority, shareBps: 7000 },
{ userId: "1234567", platform: Platform.GitHub, shareBps: 3000 },
],
});
// 2) Create sharing config + set social recipients in one flow
// - Use pool for graduated coins or null for ungraduated
await PUMP_SDK.createSharingConfigWithSocialRecipients({
creator,
mint,
pool,
newShareholders: [
{ address: creator, shareBps: 7000 },
{ userId: "1234567", platform: Platform.GitHub, shareBps: 3000 },
],
});
```
Method selection:
- `updateSharingConfigWithSocialRecipients`: use when sharing config already exists.
- `createSharingConfigWithSocialRecipients`: use for first-time setup (creates config, then updates shares).
> **Important:** Reward split can be setup once and once only by calling either `updateFeeShares` or `updateSharingConfigWithSocialRecipients`. Double-check final recipients and `shareBps` before submitting.
✅ Checklist
- [ ] The GitHub user must be able to log in to claim fees. **GitHub organizations are not supported** for social fee recipients; adding an organization account can result in fees being permanently lost.
- [ ] Only `Platform.GitHub` is supported. Any attempt to use a different platform value can result in the coin being banned or **fees lost**.
- [ ] Fees in a GitHub vault can only be claimed by the linked GitHub user, and only through Pump.fun (web or mobile). You are responsible for directing users to claim there; we do not support any claim flow outside our apps.
- [ ] You have initialized the social fee recipient pda by using one of the above helper or `createSocialFeePda`
---
# ⚠️ Breaking Change Announcement — Bonding Curve and Pump Swap Programs on 12:00 UTC, 11 November 2025
---
### Mayhem program id:
`MAyhSmzXzV1pTf7LsNkrNwkWKTo4ougAJ1PPg47MD4e`
### Mayhem fee recipients ( Use any one randomly ):
`GesfTA3X2arioaHp8bbKdjG9vJtskViWACZoYvxp4twS`
`4budycTjhs9fD6xw62VBducVTNgMgJJ5BgtKq7mAZwn6`,
`8SBKzEQU4nLSzcwF4a74F2iaUDQyTfjGndn6qUWBnrpR`,
`4UQeTP1T39KZ9Sfxzo3WR5skgsaP6NZa87BAkuazLEKH`,
`8sNeir4QsLsJdYpc9RZacohhK1Y5FLU3nC5LXgYB4aa6`,
`Fh9HmeLNUMVCvejxCtCL2DbYaRyBFVJ5xrWkLnMH6fdk`,
`463MEnMeGyJekNZFQSTUABBEbLnvMTALbT6ZmsxAbAdq`,
`6AUH3WEHucYZyC61hqpqYUWVto5qA5hjHuNQ32GNnNxA`
---
## 1. Changes Summary
1. **BondingCurve and Pool struct size increase**
The `bondingCurve` account now needs to be at least **82 bytes** in size (was 81 earlier) and the `pool` structure needs to be **244 bytes** (was 243 earlier).
This is because of a new field called `is_mayhem_mode` on both structs which is a boolean.
If the account lengths are insufficient, the buy and sell instruction will handle the size extension under the hood, no change needed on your end.
2. **New instruction to create tokens called `create_v2`**
This instruction will use the **Token2022 program** for token creations and to host the metadata, instead of Metaplex.
3. **New fee recipient requirement for mayhem mode coins**
For coins which have `is_mayhem_mode = true` (on both the bonding curve and pool), the fee recipient that should be passed must be changed.
---
## 2. What This Means to You
### 1️⃣ Introducing `create_v2`
We will move to a new standard of token creation with a new instruction called `create_v2`.
This instruction will use the **Token2022 program** for minting tokens and managing metadata, replacing the legacy Metaplex approach.
The original `create` instruction will also be active and will be **deprecated** at a later time (to be announced).
| Index | Account | Change needed | Seeds |
| ----- | ------ | ----- | ----- |
| 1 | Mint | None | - |
| 2 | Mint Authority | None | "mint-authority" + PUMP_PROGRAM_ID |
| 3 | Bonding Curve | None | "bonding-curve" + mint + PUMP_PROGRAM_ID |
| 4 | Associated Bonding Curve | Token account should now be owned by Token 2022 instead of Legacy Token | Token 2022 owned token account of Bonding curve account |
| 5 | Global | None | "global" + PUMP_PROGRAM_ID |
| 6 | User | None | - |
| 7 | System Program | None | - |
| 8 | Token Program | Pass Token 2022 instead of Legacy Token program | - |
| 9 | Associated Token Program | None | - |
| 10 | Mayhem Program ID | New Static account: `MAyhSmzXzV1pTf7LsNkrNwkWKTo4ougAJ1PPg47MD4e`| - |
| 11 | Global Params | New Static account: `13ec7XdrjF3h3YcqBTFDSReRcUFwbCnJaAQspM4j6DDJ`| "global-params" + MAYHEM_PROGRAM_ID |
| 12 | Sol Vault | New Static account: `BwWK17cbHxwWBKZkUYvzxLcNQ1YVyaFezduWbtm2de6s` | "sol-vault" + MAYHEM_PROGRAM_ID |
| 13 | Mayhem State | New Account: dependent on the mint | "mayhem-state" + mint + MAYHEM_PROGRAM_ID |
| 14 | Mayhem Token Vault | New Account: Token 2022 owned token account of Sol vault account | - |
#### Key Points about trading `create_v2` coins:
- The **associated bonding curve account** will be owned by the **Token2022 program**, not the legacy token program.
- The **user token account** should also be derived with Token2022 instead of the legacy token program.
- There is a **new boolean instruction parameter** for `create_v2` called `is_mayhem_mode`.
- Pass the token2022 program instead of the legacy token program.
- All coins previously (and in the future) created with the `create` instruction and owned by the legacy token program will have `is_mayhem_mode` as **false** and cannot be changed.
This means you do not have to handle fee recipients differently for such coins, and existing trade instructions will work as they are.
---
### :two: Fee Recipient for Mayhem Mode Coins
Any new coin created with `create_v2` can have `is_mayhem_mode` as **true** or **false**.
- If it’s **false**, the trade accounts required do not change.
- If it’s **true**, you need to **pass a different fee_recipient** for both buys and sells.
#### Fee recipient details:
- **Pump Swap:** 10th account → should be **Mayhem fee recipient**
- **Bonding Curve:** 2nd account → should be **Mayhem fee recipient**
The **Protocol Fee Recipient Token Account** at **account index 11** of Pump Swap should be the **WSOL token account of Mayhem fee recipient**.
This new fee recipient for mayhem mode coins can be found from:
- The **Global** account on **Bonding Curve**, and the **GlobalConfig** account on **Pump Swap**,
as any one of the fields in: `reserved_fee_recipient` and `reserved_fee_recipients`
---
## 3. Summary of Action Items
| Change | Action Required |
|---------|----------------|
| Introduction of `create_v2` | Update creation flow to use `create_v2` instruction with Token2022 program |
| Fee recipient handling for `is_mayhem_mode = true` coins | Pass **Mayhem fee recipient** as the fee recipient at specified account indexes (Pump Swap: 10, Bonding Curve: 2). Ensure protocol fee token account (index 11) is the WSOL account of Mayhem fee recipient for pump swap |
---
### ✅ Checklist
- [ ] Migrate to `create_v2` for new tokens
- [ ] For mints owned by token2022, ensure you're passing the right associated bonding curve, user token account and token program
- [ ] Handle `is_mayhem_mode = true` by setting the correct fee recipient
- [ ] Confirm fee recipient WSOL token account configuration
---
> ⚙️ **Summary:**
> - `create_v2` introduces Token2022-based token creation and optional mayhem mode.
> - Mayhem mode coins require a different fee recipient (**Mayhem fee recipient**) configured per program indices.
### Please use the devnet program of the bonding curve and pump swap to test coin creations with the new instruction and trading such coins. They're updated to what will go live on mainnet.
================================================
FILE: docs/BREAKING_FEE_RECIPIENT.md
================================================
# Program Upgrade
Hi. We will be doing a breaking program upgrade on April 28th, 16:00 UTC, to both the pump bonding curve program and the pump swap amm program. In order to make sure your integrations do not break please see the instructions below:
## These are 8 new fee recipients ( common for both programs )
```text
5YxQFdt3Tr9zJLvkFccqXVUwhdTWJQc1fFg2YPbxvxeD
9M4giFFMxmFGXtc3feFzRai56WbBqehoSeRE5GK7gf7
GXPFM2caqTtQYC2cJ5yJRi9VDkpsYZXzYdwYpGnLmtDL
3BpXnfJaUTiwXnJNe7Ej1rcbzqTTQUvLShZaWazebsVR
5cjcW9wExnJJiqgLjq7DEG75Pm6JBgE1hNv4B2vHXUW6
EHAAiTxcdDwQ3U4bU6YcMsQGaekdzLS3B5SmYo46kJtL
5eHhjP8JaYkz83CWwvGU2uMUXefd3AazWGx4gpcuEEYD
A7hAgCzFw14fejgCp387JUJRMNyz4j89JKnhtKU8piqW
```
## As part of this change,
- Bonding curve: A new account is required to be added in buys and sells
- AMM: 2 new accounts required to be added in buys and sells
All accounts till bonding-curve-v2 and pool-v2 remain the same, no change needed
## Bonding Curve
- Add any one of the 8 new fee recipients at the end of the buy and sell instructions.
- This new account should be added AFTER the bonding-curve-v2 account for both buys and sells.
- Account needs to be mutable
- Buy instructions should have 18 accounts in total
- Sell instruction should have 16 accounts for non cashback coins
- Sell instruction should have 17 accounts for cashback coins
## Pump swap ( AMM )
- Add 2 new accounts in this order at the end:
- One of the 8 fee recipients. ( Second last account, readonly)
- Quote mint ATA for fee recipient. ( Last account, mutable )
- These 2 new accounts should be added AFTER the pool-v2 account for both buys and sells for coins that graduate from bonding curve.
- Even if the coin is not a bonding curve coin, the 2 new accounts are necessary to be added.
- Buy instructions should have 26 accounts for non cashback coins.
- Buy instructions should have 27 accounts non cashback coins
- Sell instructions should have 24 accounts for non cashback coins.
- Sell instructions should have 26 accounts for cashback coins.
## Both SDKs are updated to reflect the upcoming change.
- `@pump-fun/pump-sdk@1.33.0`: https://www.npmjs.com/package/@pump-fun/pump-sdk
- `@pump-fun/pump-swap-sdk@1.15.0`: https://www.npmjs.com/package/@pump-fun/pump-swap-sdk
## Devnet
The new accounts can be passed before the program upgrade happens on Monday. The devnet programs are updated with the upcoming change, here are a few example transactions:
### Bonding curve
- https://solscan.io/tx/3iRpvjc41MJYH1g6T1xSjphCqi3PoqZGAZrFxveKxx8hZQDyJyWy8C9FQLbtRt97h9m51tDrLVCAedrVxgVgEPWg?cluster=devnet
- https://solscan.io/tx/59myh9VnJSwpDn7j5c8FuU1Nx3JN7wXs8WyX9CXABJoDPDYyCDeQvW96ugFzUWQiHG1K6TKAUNNcV2EZXUwtQizM?cluster=devnet
- https://solscan.io/tx/4iBEotkjLdNAsGxmLjM7E1cwLB8eTEH4BeUZHkthpHBF6ei69vef9vg4FK8jGKnwJUK8FT3DHqRtYn4Rijc6n3sn?cluster=devnet
### Amm
- https://solscan.io/tx/235fuAQcDZXL8CMRuGf7iqMYpkHX95cAXW8Kqh5yVDEPs7zN7K8yRkuji1j6vkAg4ybBQbvQ4HKGaLexR3p9xWm7?cluster=devnet
- https://solscan.io/tx/jqZAviLnwV7cyBtNzz7DTPB3xSyj2ZTkSAWtUKWKrjXeAkTKM16zsH3J2FbZQtXY4mCsVntVe1C6qnnNVYNDAfP?cluster=devnet
- https://solscan.io/tx/2MJZMr86BdoNKDRpzAZSyQ8k782ZcNo1gaqse5raFzeWKERkdnr7B9iknSKJRSWGiUzXnsRT5m9CZpouvjbZnhrA?cluster=devnet
- https://solscan.io/tx/2FDkzZ4WzKN3FMLuffz61JLMGpJ1Q9oGydyJp14xttgYaMZM5rZQiXnBkaSGTadCaP7EhjQw2peLGWskk8YaRS5s?cluster=devnet
================================================
FILE: docs/FAQ.md
================================================
# Frequently Asked Questions
## How to optimize buy / sell CU limit?
Each buy / sell instruction used CUs depend on all the inputs of the instruction:
- `user` pubkey, through the `associated_user` PDA bump seed derivation.
- `mint` pubkey, through the `bonding_curve`, `associated_bonding_curve`, `associated_user` PDA bump seed derivation.
- `creator` pubkey, through the `creator_vault` PDA bump seed derivation.
- for buy, the `amount` and `max_sol_cost` inputs are logged as part of instruction execution, so bigger values consume
more CUs to log than smaller values.
- for sell inputs, it's similar.
As an example, for the
tx https://solscan.io/tx/5frph8gBFyX7ayBmqntvwpTPwzZ8aF4kdfJAvC52Li2iDnnaRwtmcZP839Cm4YQUFx7GzsUUStCfAy3hAG69ir4u:
```Rust
let mint = Pubkey::from_str("Coyj3LtKn1BNSgWc9HsGK5SKoGfEoDaymig4wrN6pump").unwrap();
assert_eq!(
Pubkey::find_program_address(&[b"bonding-curve", mint.as_ref()], &pump::ID).1,
255
);
```
The `bonding_curve` bump seed for mint `Coyj3LtKn1BNSgWc9HsGK5SKoGfEoDaymig4wrN6pump` is `255`.
While for the
tx https://solscan.io/tx/5xozUcJFvRj4ySpE2epSSs95ySxs6cLjs1rV2uaFNkFgsEMBZW53VUa2uc3CVQLVJRYxfQ5JoSzZLiUvAgM4GEJM:
```Rust
let mint = Pubkey::from_str("3cLSxG6eXcCD9NSMawkhUcrvVCUC8KHKHMCxx6bhpump").unwrap();
assert_eq!(
Pubkey::find_program_address(&[b"bonding-curve", mint.as_ref()], &pump::ID).1,
251
);
```
The `bonding_curve` bump seed for mint `3cLSxG6eXcCD9NSMawkhUcrvVCUC8KHKHMCxx6bhpump` is `251`.
So it is not possible to compute the used CUs without first simulating the buy / sell tx before submission and adding a
buffer of 1% to the simulated CUs, because buy instruction executes a bit more code when the bonding curve completes on
that buy.
But since tx simulation before buy / sell slows down tx submission and can increase the chances for slippage errors, it
is recommended to use a static big enough CU limit like `100_000`.
================================================
FILE: docs/FEE_PROGRAM_README.md
================================================
Hello. We pushed again the update to both Pump and PumpSwap programs which adds the 2 new additional accounts on buy / sell.
On Monday, September 1, 20:00 UTC, these 2 accounts will become mandatory and the programs fee structure will change from the existing one to a dynamic fee structure depending on the current market cap of the coin in lamports. This new fee structure applies only to:
- Pump bonding curves
- PumpSwap canonical pools, where a canonical pool is defined as a pool whose `pool.creator` (NOT `pool.coinCreator`) is defined as:
```Typescript
export function isPumpPool(
baseMint: PublicKey,
poolCreator: PublicKey,
): boolean {
return pumpPoolAuthorityPda(baseMint)[0].equals(poolCreator);
}
```
The new fee structure code is present in both our Typescript SDKs:
- https://www.npmjs.com/package/@pump-fun/pump-sdk?activeTab=code
- https://www.npmjs.com/package/@pump-fun/pump-swap-sdk?activeTab=code
The market cap in lamports for bonding curve is computed as follows:
```Typescript
export function bondingCurveMarketCap({
mintSupply,
virtualSolReserves,
virtualTokenReserves,
}: {
mintSupply: BN;
virtualSolReserves: BN;
virtualTokenReserves: BN;
}): BN {
if (virtualTokenReserves.isZero()) {
throw new Error("Division by zero: virtual token reserves cannot be zero");
}
return virtualSolReserves.mul(mintSupply).div(virtualTokenReserves);
}
```
The market in lamports for a PumpSwap canonical pool is:
```Typescript
export function poolMarketCap({
baseMintSupply,
baseReserve,
quoteReserve,
}: {
baseMintSupply: BN;
baseReserve: BN;
quoteReserve: BN;
}): BN {
if (baseReserve.isZero()) {
throw new Error(
"Division by zero: pool base token reserves cannot be zero",
);
}
return quoteReserve.mul(baseMintSupply).div(baseReserve);
}
```
For bonding curve program, the fee bps for protocol and creator fees will be computed using the following logic:
```Typescript
export function computeFeesBps({
global,
feeConfig,
mintSupply,
virtualSolReserves,
virtualTokenReserves,
}: {
global: Global;
feeConfig: FeeConfig | null;
mintSupply: BN;
virtualSolReserves: BN;
virtualTokenReserves: BN;
}): CalculatedFeesBps {
if (feeConfig != null) {
const marketCap = bondingCurveMarketCap({
mintSupply,
virtualSolReserves,
virtualTokenReserves,
});
return calculateFeeTier({
feeTiers: feeConfig.feeTiers,
marketCap,
});
}
return {
protocolFeeBps: global.feeBasisPoints,
creatorFeeBps: global.creatorFeeBasisPoints,
};
}
/// rust reference: pump-fees-math::calculate_fee_tier()
export function calculateFeeTier({
feeTiers,
marketCap,
}: {
feeTiers: FeeTier[];
marketCap: BN;
}): Fees {
const firstTier = feeTiers[0];
if (marketCap.lt(firstTier.marketCapLamportsThreshold)) {
return firstTier.fees;
}
for (const tier of feeTiers.slice().reverse()) {
if (marketCap.gte(tier.marketCapLamportsThreshold)) {
return tier.fees;
}
}
return firstTier.fees;
}
```
A similar logic will be used for PumpSwap canonical pools too:
```Typescript
export function computeFeesBps({
globalConfig,
feeConfig,
creator,
baseMintSupply,
baseMint,
baseReserve,
quoteReserve,
tradeSize,
}: {
globalConfig: GlobalConfig;
feeConfig: FeeConfig | null;
creator: PublicKey;
baseMintSupply: BN;
baseMint: PublicKey;
baseReserve: BN;
quoteReserve: BN;
tradeSize: BN;
}): Fees {
if (feeConfig != null) {
const marketCap = poolMarketCap({
baseMintSupply,
baseReserve,
quoteReserve,
});
return getFees({
feeConfig,
isPumpPool: isPumpPool(baseMint, creator),
marketCap,
tradeSize,
});
}
return {
lpFeeBps: globalConfig.lpFeeBasisPoints,
protocolFeeBps: globalConfig.protocolFeeBasisPoints,
creatorFeeBps: globalConfig.coinCreatorFeeBasisPoints,
};
}
/// rust reference: pump-fees::get_fees()
function getFees({
feeConfig,
isPumpPool,
marketCap,
}: {
feeConfig: FeeConfig;
isPumpPool: boolean;
marketCap: BN;
tradeSize: BN;
}): Fees {
if (isPumpPool) {
return calculateFeeTier({
feeTiers: feeConfig.feeTiers,
marketCap,
});
} else {
return feeConfig.flatFees;
}
}
/// rust reference: pump-fees-math::calculate_fee_tier()
export function calculateFeeTier({
feeTiers,
marketCap,
}: {
feeTiers: FeeTier[];
marketCap: BN;
}): Fees {
const firstTier = feeTiers[0];
if (marketCap.lt(firstTier.marketCapLamportsThreshold)) {
return firstTier.fees;
}
for (const tier of feeTiers.slice().reverse()) {
if (marketCap.gte(tier.marketCapLamportsThreshold)) {
return tier.fees;
}
}
return firstTier.fees;
}
```
We will use the following fee tiers starting from Monday:

In order to avoid possible issues created by the new fee structure, until you make sure it's implemented correctly, you can increase the slippage tolerance on buy / sell instructions as a temporary mitigation.
If you implement the fee logic correctly, any future change to the fee tiers structure above should not affect your code.
================================================
FILE: docs/PUMP_CASHBACK_README.md
================================================
## Overview
Cashback Rewards allows token creators to create coins with "cashback" enabled which redirects the creator fee to the users. Each user would get the creator fee on their swap volume as cashback rather than paying that fee to the coin creator.
This is a backwards compatible change, so if you do not update to the latest IDsL/SDKs it will work but cashback will not be enabled.
## Integration
You can also use our Typescript SDKs for easier integration:
- [Pump SDK](https://www.npmjs.com/package/@pump-fun/pump-sdk)
- Latest version is `1.28.0`
- [PumpSwap SDK](https://www.npmjs.com/package/@pump-fun/pump-swap-sdk)
- Latest version is `1.14.0`
## Changes to Instructions
Cashback is only given to the user if the buy/sell instruction appends the proper remaining accounts.
If the coin traded is a cashback coin but the cashback remaining accounts are now added, then the creator fee will
go to the creator as it normally would.
### Bonding Curve Buy Instructions
No change. Cashback is handled automatically if the coin has cashback enabled.
### Bonding Curve Sell Instruction
Expects the `UserVolumeAccumulator` PDA for the Pump program at the 0th index in the remaining accounts with `isWritable: true`
### Pump Swap Buy Instruction
Expects the WSOL associated token account of the `UserVolumeAccumulator` for the Pump AMM program (this is different than same account for the Pump program) at the 0th index of the remaining accounts.
### Pump Swap Sell Instruction
Expects the WSOL associated token account of the `UserVolumeAccumulator` for the Pump AMM program (this is different than same account for the Pump program) at the 0th index of the remaining accounts.
Expects the `UserVolumeAccumulator` for the Pump AMM Program (used to derive the WSOL ATA above) at the 1st index of the remaining accounts.
### Create V2
New parameter expected for `create_v2` instruction which is an `OptionBool` to define whether the coin has cashback enabled or not.
In typescript this is a tuple, so it would look like `[true]`.
### Bonding Curve Claim Cashback
New `claim_cashback` instruction for the Pump program.
No parameters needed. It transfers native lamports from the `UserVolumeAccumulator` to the user.
### Pump Swap Claim Cashback
New `claim_cashback` instruction for the Pump AMM program.
No parameters needed. It transfers WSOL from the WSOL ATA of the `UserVolumeAccumulator` to the user's WSOL ATA.
The user's WSOL ATA is expected to exist before hand, so use "create idempotent associated token account" instruction before the claim instruction if need be.
## Account Changes
### Bonding Curve
New `is_cashback_coin: bool` field on the `BondingCurve` account.
## Reading Unclaimed Cashback
It is important to note that there is an `UserVolumeAccumulator` account for both the Pump (bonding curve) program and Pump Swap (AMM) program.
They share a seed `"user_volume_accumulator"` with the program ID being the only difference in its seeds.
Example of deriving the `UserVolumeAccumulator` for Pump program. Simply pass the `PUMP_AMM_PROGRAM_ADDRESS` instead to derive the `UserVolumeAccumulator` for Pump AMM.
```typescript
import {
getAddressEncoder,
getProgramDerivedAddress,
getUtf8Encoder,
} from "@solana/kit";
const addressEncoder = getAddressEncoder();
const utf8Encoder = getUtf8Encoder();
export const USER_ACCUMULATOR_SEED = utf8Encoder.encode(
"user_volume_accumulator",
);
export const NATIVE_MINT_ADDRESS = address(
"So11111111111111111111111111111111111111112",
);
export function getUserAccumulatorPda(
walletAddress: Address,
programAddress: Address = PUMP_PROGRAM_ADDRESS,
) {
return getProgramDerivedAddress({
programAddress,
seeds: [USER_ACCUMULATOR_SEED, addressEncoder.encode(walletAddress)],
});
}
export async function getUserAccumulatorCashbackPda(
walletAddress: Address,
programAddress: Address = PUMP_PROGRAM_ADDRESS,
): Promise<ProgramDerivedAddress> {
const [userAccumulatorPda] = await getUserAccumulatorPda(
walletAddress,
programAddress,
);
return findAssociatedTokenPda({
mint: NATIVE_MINT_ADDRESS,
owner: userAccumulatorPda,
tokenProgram: TOKEN_PROGRAM_ADDRESS,
});
}
```
The cashback on Pump AMM is collected in the WSOL ATA of the `UserVolumeAccumulator` for the Pump AMM program (use the PUMP_AMM_PROGRAM_ADDRESS when deriving the PDA).
But in the Pump program (bonding curve / PUMP_PROGRAM_ADDRESS) the cashback is in native lamports in the `UserVolumeAccumulator` itself (not a WSOL ATA) and transferred as native lamports to the user's wallet (not a WSOL ATA).
This is because Pump AMM uses WSOL whereas the Pump program uses native lamports for swaps.
To read unclaimed cashback for bonding curve / Pump program:
**Read the lamports of the `UserVolumeAccumulator` for the Pump program minus the rent exempt lamports needed to keep the account open.**
To read unclaimed cashback for pump swap / Pump AMM program:
**Read the token balance of the WSOL ATA of the `UserVolumeAccumulator` for the Pump AMM program.**
================================================
FILE: docs/PUMP_CREATOR_FEE_README.md
================================================
Pump program will have a breaking upgrade to add support for coin creator fees. Each swap on a not-yet-completed
bonding curve will send a fee to a coin creator vault account, apart from the already existing protocol fee.
`BondingCurve` accounts will be extended to `150` bytes to support future protocol updates, including this one. So
you need to prepend an `extendAccount(bondingCurve)` instruction to your buy / sell txs if the
`bondingCurveAccountInfo.dataLen < 150`.
`buy` and `sell` instructions will be modified in the following way:
- the currently unused `Buy::rent` account (instruction account index `10`) will become `Buy::creator_vault` account.
- the currently unused `Sell::associated_token_program` account (instruction account index `8`) will become
`Sell::creator_vault` account.
Both `Buy::creator_vault` and `Sell::creator_vault` accounts are PDA accounts with the following definition:
```rust
#[account(
mut,
seeds = [
b"creator-vault",
bonding_curve.creator.as_ref()
],
bump
)]
pub creator_vault: AccountInfo<'info >,
```
So the creator_vault PDA is dependent on a new `BondingCurve::creator` field. The updated `BondingCurve` struct will
look like this:
```rust
#[account]
pub struct BondingCurve {
pub virtual_token_reserves: u64,
pub virtual_sol_reserves: u64,
pub real_token_reserves: u64,
pub real_sol_reserves: u64,
pub token_total_supply: u64,
pub complete: bool,
pub creator: Pubkey, // new creator field
}
```
There is also another change in fee calculation. There will be a new `Global::creator_fee_basis_points` field, which
will be used in computing the creator fee. The new `Global` struct will look like this:
```rust
#[account]
pub struct Global {
pub initialized: bool,
pub authority: Pubkey,
pub fee_recipient: Pubkey,
pub initial_virtual_token_reserves: u64,
pub initial_virtual_sol_reserves: u64,
pub initial_real_token_reserves: u64,
pub token_total_supply: u64,
pub fee_basis_points: u64,
pub withdraw_authority: Pubkey,
pub enable_migrate: bool,
pub pool_migration_fee: u64,
pub creator_fee_basis_points: u64, // new creator fee bps field
pub fee_recipients: [Pubkey; 7],
pub set_creator_authority: Pubkey,
}
```
Currently, the `Global::creator_fee_basis_points` field is set to `0`. But you can start using the new fee calculation
logic from now to be ready for the creator fee update. The latest version of our Typescript SDK includes the updated fee
logic: [Pump SDK](https://www.npmjs.com/package/@pump-fun/pump-sdk) (including the source code of the SDK).
These functions do not include slippage in their calculations, but the slippage needs to be applied to sol amount for
both `buy` and `sell` instructions. Instructions which allow slippage for coin amount will be added to the Pump program
in the future.
All non-completed bonding curves will start receiving creator fees on swaps after the coin creator fee update is
deployed and `Global::creator_fee_basis_points` is set something else apart from `0`.
The `BondingCurve::creator` parameter will be populated from:
- the `creator` argument passed to `create` instruction for newly created coins. So be careful what `creator` pubkey
you pass to the `create` instruction, as that pubkey will receive all the creator fees for that coin.
- the Metaplex creator metadata for coins which have it, by using the `set_metaplex_creator` instruction. You can
include
this instruction in your transactions, but it's not needed, as our backend service will listen for `TradeEvent`s and
will set the `BondingCurve::creator` dynamically for coins missing it.
- our coins storage for coins created in the past and don't have Metaplex creator metadata. The backend service will
listen for `TradeEvent`s and will set the `BondingCurve::creator` dynamically for coins missing it using the admin
`set_creator` instruction.
The fees accumulated in a creator vault account can be transferred to the creator's wallet using the
`collectCreatorFee(creator)` instruction. The `creator` needs to sign the transaction including this instruction.
The currently deployed Pump program on [Mainnet](https://solscan.io/account/6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P)
is backwards-compatible with the new update, so you can start using the new IDL from now, to be ready and not experience
any downtime when the creator fee update gets released.
We already updated the Devnet program, so you have time until Monday to implement the changes above. Ideally, the
same code should work on both the creator fee update on Devnet and the current Mainnet program, before we update Pump
program on Mainnet to the creator fee update.
We are also trying to release the Pump program Typescript SDK by Monday, so you can use it. The
[bondingCurve.ts](bondingCurve.ts) file is part of the upcoming Pump program Typescript SDK.
## Coin creator fees update
We will deploy a breaking update to both Pump and PumpSwap (Pump AMM) programs to add support for coin creator fees on
Mainnet on Monday, May 12, 11:00 AM UTC.
On Devnet, both programs have already been updated to support coin creator fees.
Who will receive coin creator fees?
- all non-completed Pump bonding curves;
- all canonical PumpSwap pools will. Canonical PumpSwap pools are pools created by Pump program `migrate` instruction
for completed bonding curves.
Who will not receive coin creator fees?
- coins already migrated to Raydium, as that program is not under our control.
- normal PumpSwap pools which are not created by Pump program `migrate` instruction.
You should start by using the latest IDL files for both programs from the [idl](idl) directory. They are
backwards-compatible with current programs deployed on Mainnet, so you can start using them now.
You can also use our Typescript SDKs for easier integration:
- [Pump SDK](https://www.npmjs.com/package/@pump-fun/pump-sdk)
- [PumpSwap SDK](https://www.npmjs.com/package/@pump-fun/pump-swap-sdk)
If you implement and test the changes described in these two documents on Devnet before the creator fee upgrade, you
should not experience any downtime. Ideally, you should use exactly the same code for both Devnet and Mainnet, before
we update the programs on Mainnet.
================================================
FILE: docs/PUMP_PROGRAM_README.md
================================================
# Pump program
Pump program allows creating SPL coins that are instantly tradeable on a bonding curve without having to seed liquidity.
When the coin hits a certain market cap the liquidity from the bonding curve is migrated to PumpSwap (an AMM on Solana).
The LP tokens received from the PumpSwap pool are then burnt.
The bonding curve formula is based on Uniswap V2 and uses synthetic x and y reserves to ensure that there is liquidity
for the coin.
Pump program is deployed at address `6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P` on
both [Mainnet](https://solscan.io/account/6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P)
and [Devnet](https://solscan.io/account/6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P?cluster=devnet).
## State
### Global
The global configuration of the program is stored in the only `Global` account, whose address is
`4wTV1YmiEkRvAtNtsSGPtUrqRYQMe5SKy2uB4Jjaxnjf` (PDA-derived from `["global"]` seeds). The content of this account
can be examined
on [Mainnet Solscan](https://solscan.io/account/4wTV1YmiEkRvAtNtsSGPtUrqRYQMe5SKy2uB4Jjaxnjf#accountData):
```json
{
"initialized": {
"type": "bool",
"data": true
},
"authority": {
"type": "pubkey",
"data": "FFWtrEQ4B4PKQoVuHYzZq8FabGkVatYzDpEVHsK5rrhF"
},
"fee_recipient": {
"type": "pubkey",
"data": "62qc2CNXwrYqQScmEdiZFFAnJR262PxWEuNQtxfafNgV"
},
"initial_virtual_token_reserves": {
"type": "u64",
"data": "1073000000000000"
},
"initial_virtual_sol_reserves": {
"type": "u64",
"data": "30000000000"
},
"initial_real_token_reserves": {
"type": "u64",
"data": "793100000000000"
},
"token_total_supply": {
"type": "u64",
"data": "1000000000000000"
},
"fee_basis_points": {
"type": "u64",
"data": "100"
},
"withdraw_authority": {
"type": "pubkey",
"data": "39azUYFWPz3VHgKCf3VChUwbpURdCHRxjWVowf5jUJjg"
},
"enable_migrate": {
"type": "bool",
"data": true
},
"pool_migration_fee": {
"type": "u64",
"data": "15000001"
},
"creator_fee": {
"type": "u64",
"data": "0"
},
"fee_recipients": {
"type": {
"array": [
"pubkey",
7
]
},
"data": [
"7VtfL8fvgNfhz17qKRMjzQEXgbdpnHHHQRh54R9jP2RJ",
"7hTckgnGnLQR6sdH7YkqFTAA7VwTfYFaZ6EhEsU3saCX",
"9rPYyANsfQZw3DnDmKE3YCQF5E8oD89UXoHn9JFEhJUz",
"AVmoTthdrX6tKt4nDjco2D775W2YK3sDhxPcMmzUAmTY",
"CebN5WGQ4jvEPvsVU4EoHEpgzq1VV7AbicfhtW4xC9iM",
"FWsW1xNtWscwNmKv6wVsU1iTzRN6wmmk3MjxRP5tT7hz",
"G5UZAVbAf46s7cKWoyKu8kYTip9DGTpbLZ2qa9Aq69dP"
]
}
}
```
- The `initialized` field is set to `true` and never used.
- The `authority` pubkey is the authority which can update the global configuration.
- The `fee_recipient` pubkey is one of the 8 fee_recipients which can be used by `buy` / `sell` instructions, together
with the other 7 `Global::fee_recipients` pubkeys.
- The `initial_virtual_token_reserves`, `initial_virtual_sol_reserves`, `initial_real_token_reserves` and
`token_total_supply` fields are used as the initial parameters for the bonding curve of each newly created coin.
- The `fee_basis_points == 100 bps` represents the fee in bps transferred to the `fee_recipient` account on `buy` /
`sell` instructions.
- The `withdraw_authority` pubkey is the authority which can call the deprecated `withdraw` instruction.
- The `enable_migrate` flag is used to enable the new `migrate` instruction and disable the deprecated `withdraw`
instruction. Currently, it is set to `true`.
- The `pool_migration_fee` are the minimum lamports necessary to pay for all accounts created during `migrate`
instruction. It is currently set the minimum of `15000001`, less than `MAX_MIGRATE_FEES == 15_000_000`, which
represents
the maximum cost of all accounts created during a `migrate` instruction.
- The `creator_fee` is set to `0` and is not used.
### Bonding curve
Each coin has an associated bonding curve account, which is PDA-derived from `["bonding-curve", mint]` seeds. An example
bonding curve account can be found
at https://solscan.io/account/EsmVk4MTsoT71JFaRM5DWFZboKpMQjfY6EYzAgUuksXw#accountData:
```json
{
"virtual_token_reserves": {
"type": "u64",
"data": "1072999999992855"
},
"virtual_sol_reserves": {
"type": "u64",
"data": "30000000013"
},
"real_token_reserves": {
"type": "u64",
"data": "793099999992855"
},
"real_sol_reserves": {
"type": "u64",
"data": "13"
},
"token_total_supply": {
"type": "u64",
"data": "1000000000000000"
},
"complete": {
"type": "bool",
"data": false
}
}
```
- The `virtual_token_reserves`, `virtual_sol_reserves`, `real_token_reserves` and `token_total_supply` fields are
initialized on coin creation to the corresponding values from `Global` account. The initial `real_sol_reserves` is set
to `0`.
- On each `buy` operation, `virtual_sol_reserves` and `real_sol_reverses` increase with the same lamports amount
according to
the bonding curve formula, while `virtual_token_reserves` and `real_token_reserves` decrease with the same coin
amount.
- On each `sell` operation, `virtual_sol_reserves` and `real_sol_reverses` decrease with the same lamports amount
according to
the bonding curve formula, while `virtual_token_reserves` and `real_token_reserves` increase with the same coin
amount.
- The `complete` field is initially set to `false`. It is set to `true` at the end of a `buy` instruction, when
`real_token_reserves == 0`, so there are no more real tokens left in the bonding curve.
## Instructions
- `create(user, name, symbol, uri, creator)` allows a `user` to create a new coin with the given `name`, `symbol` and
`uri`. The `creator` pubkey is the creator which will be added to the mint Metaplex metadata `creators` array,
together with the provided `name`, `symbol` and `uri`.
- In general, `user` and `creator` are the same pubkey, but they can be different, for example, on the
`free coin creation` flow, when the first coin buyer also creates the coin on-chain. In this case, `creator`
pubkey is the original coin creator, while `user` pubkey is the first buyer. This is also the reason why `creator`
pubkey is not required to be a signer for this instruction, as the original creator cannot sign the tx of the
first coin buyer.
- `buy(user, associated_user, mint, amount, max_sol_cost)` allows a `user` to buy the exact `amount` of coins from the
bonding curve of the given `mint`, using at most `max_sol_cost` lamports.
- `sell(user, associated_user, mint, amount, min_sol_output)` allows a `user` to sell the exact `amount` of coins to
the bonding curve of the given `mint`, receiving at least `min_sol_output` lamports.
- `withdraw(withdraw_authority, mint)` is a now-disabled instruction which allowed the `withdraw_authority` pubkey to
withdraw the liquidity of a completed bonding curve and migrate it to Raydium from an off-chain server.
- `migrate(user, mint)` allows any `user` to migrate the liquidity of a completed bonding curve of the given `mint` to
PumpSwap AMM. A completed bonding curve is a bonding curve with `complete == true` and `real_token_reserves == 0`. The
`migrate` instruction is idempotent, meaning that running it on a completed and migrated bonding curve does nothing.
It is also permisionless, so anyone can migrate a completed bonding curve.
- `extend_account(user, account)` allows anyone to extend the data size of any program-owned account (`Global` or
`BondingCurve`) in order to allow adding new fields to the existing account types.
- `initialize(user, global)` initialized the sole `Global` account on Pump program deployment and can be executed by
anyone. The first pubkey which successfully executes `initialize` is the one which sets the `Global::authority` field.
This instruction cannot be called more than once because the second time it is called, the `Global` account already
exists.
- `update_global_authority(global, authority, new_authority)` allows the current `Global::authority` to update the
`Global::authority` field to a new pubkey.
- `set_params(global, authority)` allows updating all the `Global` account fields, apart from `Global::authority`, which
is updated using `update_global_authority` instruction.
================================================
FILE: docs/PUMP_SWAP_CREATOR_FEE_README.md
================================================
PumpSwap (Pump AMM) program will have a breaking upgrade to add support for coin creator fees. Each swap on canonical
Pump pools will send a fee to a coin creator vault account, apart from the already existing lp fee and protocol fee.
Canonical Pump pools are pools which have a `Pool::creator` defined as a Pump program PDA with the following seeds:
```rust
pub fn pump_pool_authority_pda(base_mint: &Pubkey) -> Pubkey {
let (pump_pool_authority, _) = Pubkey::find_program_address(
&[b"pool-authority", base_mint.as_ref()],
&Pubkey::from_str("6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P").unwrap(),
);
pump_pool_authority
}
```
Canonical Pump pools are pools created by Pump program `migrate` instruction for completed bonding curves.
`Pool` accounts will be extended to `300` bytes to support future protocol updates, including this one. So
you need to prepend an `extendAccount(pool)` instruction to your buy / sell txs if the `pool.dataLen < 300`.
Both `buy` and `sell` instructions will be need to append two new inputs accounts (input account indexes `17` and `18`):
```rust
#[account(
mut,
associated_token::mint = quote_mint,
associated_token::authority = coin_creator_vault_authority,
associated_token::token_program = quote_token_program,
)]
pub coin_creator_vault_ata: InterfaceAccount<'info, TokenAccount>,
#[account(
seeds = [
b"creator_vault",
pool.coin_creator.as_ref()
],
bump
)]
pub coin_creator_vault_authority: AccountInfo<'info >,
```
So the `coin_creator_vault_authority` PDA is dependent on a new `Pool::coin_creator` field. The updated `Pool` struct
will look like this:
```rust
#[account]
pub struct Pool {
pub pool_bump: u8,
pub index: u16,
pub creator: Pubkey,
pub base_mint: Pubkey,
pub quote_mint: Pubkey,
pub lp_mint: Pubkey,
pub pool_base_token_account: Pubkey,
pub pool_quote_token_account: Pubkey,
pub lp_supply: u64,
pub coin_creator: Pubkey, // new coin creator field, set only for canonical pools, otherwise set to Pubkey::default()
}
```
There is also another change in fee calculation. There will be a new `GlobalConfig::coin_creator_fee_basis_points`
field, which will be used in computing the coin creator fee. The new `GlobalConfig` struct will look like this:
```rust
#[account]
pub struct GlobalConfig {
pub admin: Pubkey,
pub lp_fee_basis_points: u64,
pub protocol_fee_basis_points: u64,
pub disable_flags: u8,
pub protocol_fee_recipients: [Pubkey; 8],
pub coin_creator_fee_basis_points: u64, // new coin creator fee bps field
}
```
Currently, the `GlobalConfig::coin_creator_fee_basis_points` field is set to `0`. But you can start using the new fee
calculation logic from now to be ready for the coin creator fee update. The latest `@pump-fun/pump-swap-sdk` NPM package
version contains all the updates for coin creator fee support:
[PumpSwap SDK](https://www.npmjs.com/package/@pump-fun/pump-swap-sdk) (including the source code of the SDK).
All Pump canonical pools will start receiving coin creator fees on each swap after the coin creator fee update is
deployed and `GlobalConfig::coin_creator_fee_basis_points` is set something else apart from `0`.
The `Pool::coin_creator` parameter will be populated from:
- the new `coin_creator` argument passed to `create_pool` instruction for newly created canonical Pump pools. Otherwise,
the new `coin_creator` argument is ignored.
- the `base_mint` Metaplex creator metadata or `BondingCurve::creator`, by using the `set_creator` instruction. You can
include this instruction in your transactions, but it's not needed, as our backend service will listen for `BuyEvent`s
and `SellEvent`s and will set the `Pool::coin_creator` dynamically for canonical pools missing it.
The fees accumulated in a creator vault ATA can be transferred to any token account of the coin creator using the
`PumpAmmSdk.collectCoinCreatorFee(coinCreator)` instruction. The `coinCreator` needs to sign the transaction including
this instruction.
The currently deployed PumpSwap program
on [Mainnet](https://solscan.io/account/pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA)
is backwards-compatible with the new update, so you can start using the new IDL from now, to be ready and not experience
any downtime when the coin creator fee update gets released.
We already updated the Devnet program, so you have time until Monday to implement the changes above. Ideally, the
same code should work on both the creator fee update on Devnet and the current Mainnet program, before we update
PumpSwap program on Mainnet to the coin creator fee update.
================================================
FILE: docs/PUMP_SWAP_README.md
================================================
# PumpSwap (Pump AMM) program
PumpSwap program is a constant-product AMM deployed at address `pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA` on
both [Mainnet](https://solscan.io/account/pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA)
and [Devnet](https://solscan.io/account/pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA?cluster=devnet).
## State
### GlobalConfig
The global configuration of the program is stored in the only `GlobalConfig` account, whose address is
`ADyA8hdefvWN2dbGGWFotbzWxrAvLW83WG6QCVXvJKqw` (PDA-derived from `["global_config"]` seeds). The content of this account
can be examined
on [Mainnet Solscan](https://solscan.io/account/ADyA8hdefvWN2dbGGWFotbzWxrAvLW83WG6QCVXvJKqw#accountData):
```json
{
"admin": {
"type": "pubkey",
"data": "FFWtrEQ4B4PKQoVuHYzZq8FabGkVatYzDpEVHsK5rrhF"
},
"lp_fee_basis_points": {
"type": "u64",
"data": "20"
},
"protocol_fee_basis_points": {
"type": "u64",
"data": "5"
},
"disable_flags": {
"type": "u8",
"data": 0
},
"protocol_fee_recipients": {
"type": {
"array": [
"pubkey",
8
]
},
"data": [
"62qc2CNXwrYqQScmEdiZFFAnJR262PxWEuNQtxfafNgV",
"7VtfL8fvgNfhz17qKRMjzQEXgbdpnHHHQRh54R9jP2RJ",
"7hTckgnGnLQR6sdH7YkqFTAA7VwTfYFaZ6EhEsU3saCX",
"9rPYyANsfQZw3DnDmKE3YCQF5E8oD89UXoHn9JFEhJUz",
"AVmoTthdrX6tKt4nDjco2D775W2YK3sDhxPcMmzUAmTY",
"FWsW1xNtWscwNmKv6wVsU1iTzRN6wmmk3MjxRP5tT7hz",
"G5UZAVbAf46s7cKWoyKu8kYTip9DGTpbLZ2qa9Aq69dP",
"JCRGumoE9Qi5BBgULTgdgTLjSgkCMSbF62ZZfGs84JeU"
]
}
}
```
- The `admin` pubkey is the pubkey authorized to update the `GlobalConfig` account.
- The `lp_fee_basis_points == 20 bps` and `protocol_fee_basis_points == 5 bps` are the fees charged by the AMM for each
`buy` / `sell` instruction. No fees are charged on `deposit` / `withdraw` instruction.
- The `disable_flags` is a bitmask that can be used to disable certain instructions. Currently, it is not used.
- The `protocol_fee_recipients` is an array of 8 pubkeys which receive the protocol fees on each `buy` /
`sell` instruction. Any of the 8 pubkeys can be used in a `buy` / `sell` instruction and it is recommended to randomly
choose a different one for each `buy` / `sell` instruction to improve program tx throughput.
### Pool
Each pool is represented by a `Pool` account, which is PDA-derived from the
`["pool", index, creator, baseMint, quoteMint]` seeds. An example Pool account data can be found
at https://solscan.io/account/GseMAnNDvntR5uFePZ51yZBXzNSn7GdFPkfHwfr6d77J#accountData:
```json
{
"pool_bump": {
"type": "u8",
"data": 254
},
"index": {
"type": "u16",
"data": "0"
},
"creator": {
"type": "pubkey",
"data": "9XDYTfQKwW8sHPqnFdUreMmtmffmkHVPGTNV2e3LKxNW"
},
"base_mint": {
"type": "pubkey",
"data": "7LSsEoJGhLeZzGvDofTdNg7M3JttxQqGWNLo6vWMpump"
},
"quote_mint": {
"type": "pubkey",
"data": "So11111111111111111111111111111111111111112"
},
"lp_mint": {
"type": "pubkey",
"data": "6dpnPD6UWDw5hbJEuPQwnCCMba1JYwHANKuL6GQ6otAH"
},
"pool_base_token_account": {
"type": "pubkey",
"data": "5jMpkf4JF4noHftLgNKyPNh6roVfPSGSjuEk3U4eLKRa"
},
"pool_quote_token_account": {
"type": "pubkey",
"data": "43DVcZR4kQFjh4Xm2i3DcneRxNjZp7HMud8yDrJWrDr8"
},
"lp_supply": {
"type": "u64",
"data": "4193388284800"
}
}
```
- The `pool_bump` is the bump seed used to derive the pool PDA.
- The `index` is the index of the pool, which is used to derive the pool PDA. PumpSwap pools created using Pump program
`migrate` instruction use a `CANONONICAL_POOL_INDEX == 0`.
- The `creator` is the pubkey of the pool creator, which is also used to derive the pool PDA.
- The `base_mint` and `quote_mint` are the mint addresses of the base and quote tokens of the pool.
- The `lp_mint` is the mint address of the LP token, which is used to represent the liquidity of the pool. The LP mint
address can also be PDA-derived from the `["pool_lp_mint", pool_key]` seeds, but it is stored in `Pool` account for
simpler pubkey equality checks on PumpSwap program instructions.
- The `pool_base_token_account` and `pool_quote_token_account` are the ATAs (associated token accounts) of
the base and quote mints of the `pool` account, respectively. They again could be PDA-derived from the `pool`,
`base_mint` and `quote_mint` pubkeys, but they are stored in the `Pool` account for easier pubkey equality checks on
PumpSwap program instructions.
- The `lp_supply` is the total supply of the `lp_mint` without burns and lock-ups. This means that if someone deposits
into the pool, then they burn their `lp_mint` tokens, the `Pool::lp_supply` will still reflect the original supply
of the `lp_mint`. This way, the pool differentiates between `lp_mint` tokens burnt by users directly and those burnt
by the `withdraw` instruction.
## Instructions
It supports the following Anchor program instructions:
- `create_pool(index, creator, baseMint, quoteMint, baseIn, quoteIn)`.
- This allows creating a new AMM pool for the`(baseMint, quoteMint)` pair.
- The `poolId` is PDA-derived from the tuple `(index, creator, baseMint, quoteMint)`. The `index` allows the same
`creator` to create multiple pools for the same `(baseMint, quoteMint)` pair.
- The `creator` is the pubkey of the pool creator and also the payer for pool creation costs.
- `baseIn` and `quoteIn` are the initial amounts of `baseMint` and `quoteMint` tokens to be deposited into the pool,
and they determine the initial pool price.
- The `creator` also receives some `lpMint` tokens, which represent the initial liquidity of the pool. These
`lpMint` tokens can be later used to `withdraw` liquidity from the pool.
- Liquidity instructions:
- `deposit(pool, user, lpTokenOut, maxBaseIn, maxQuoteIn)` allows a `user` to deposit at most `maxBaseIn` and
`maxQuoteIn` tokens into the `pool` in order to get exactly `lpTokenOut` tokens in return.
- `withdraw(pool, user, lpTokenIn, minBaseOut, minQuoteOut)` allows a `user` to withdraw at least `minBaseOut` and
`minQuoteOut` tokens from the `pool` by burning exactly `lpTokenIn` tokens in return.
- Swap instructions:
- `buy(pool, user, baseOut, maxQuoteIn)` allows a `user` to buy exactly `baseOut` tokens from the `pool` by paying
at most `maxQuoteIn` tokens.
- `sell(pool, user, baseIn, minQuoteOut)` allows a `user` to sell exactly `baseIn` tokens to the `pool` to receive
at least `minQuoteOut` tokens.
- Utility instructions:
- `extend_account(user, account)` allows any user to extend the data array of a program-owned account (
`GlobalConfig` or `Pool` account) to allow for future fields to be added to those account types.
- Admin instructions (can be executed only to `GlobalConfig::admin` pubkey):
- `create_config(hardcoded_admin, global_config)` allows creating the sole `GlobalConfig` account on initial
PumpSwap program deployment. The `hardcoded_admin` is a hardcoded pubkey into PumpSwap program itself, which is
allowed to create the `GlobalConfig` account and will initialize `GlobalConfig::admin` to the `hardcoded_admin`
pubkey. This instruction can be run only once, because it will fail the second time, since `GlobalConfig` already
exists.
- `disable(admin, disable_create_pool, disable_deposit, disable_withdraw, disable_buy, disable_sell)` allows the
`admin` to globally disable any Pump Swap operation.
- `update_admin(admin, new_admin, global_config)` allows the `admin` to update the `GlobalConfig::admin` pubkey to a
new one.
- `update_fee_config(admin, lp_fee_basis_points, protocol_fee_basis_points, protocol_fee_recipients)` allows the
`admin` to update the `GlobalConfig::lp_fee_basis_points`, `GlobalConfig::protocol_fee_basis_points` and
`GlobalConfig::protocol_fee_recipients`.
## Mapping PumpSwap SDK methods to Anchor instructions
- `PumpAmmAdminSdk.createPoolInstructions(index, creator, baseMint, quoteMint, baseIn, quoteIn)` returns a
`create_pool(index, creator, baseMint, quoteMint, baseIn, quoteIn)` instruction.
- `PumpAmmAdminSdk.depositInstructions(pool, user, lpTokenOut, slippage)` returns a
`deposit(pool, user, lpTokenOut, maxBaseIn, maxQuoteIn)` instruction, where `maxBaseIn` and `maxQuoteIn` are computed
using `lpTokenOut`, `slippage` and the current pool balances.
- `PumpAmmAdminSdk.withdrawInstructions(pool, user, lpTokenIn, slippage)` returns a
`withdraw(pool, user, lpTokenIn, minBaseOut, minQuoteOut)` instruction, where `minBaseOut` and `minQuoteOut` are
computed using `lpTokenIn`, `slippage` and the current pool balances.
- `PumpAmmInternalSdk.buyBaseInput(pool, user, baseOut, slippage)` returns a `buy(pool, user, baseOut, maxQuoteIn)`
instruction, where `maxQouteIn` is computed using `baseOut`, `slippage` and the current pool balances.
- `PumpAmmInternalSdk.buyQuoteInput(pool, user, quote, slippage)` returns a `buy(pool, user, baseOut, maxQuoteIn)`
instruction, where `baseOut` is computed using `quote`, `slippage` and the current pool balances and `maxQuoteIn`
is `quote` scaled with `slippage`.
- `PumpAmmInternalSdk.sellBaseInput(pool, user, baseIn, slippage)` returns a `sell(pool, user, baseIn, minQuoteOut)`
instruction, where `minQuoteOut` is computed using `baseIn`, `slippage` and the current pool balances.
- `PumpAmmInternalSdk.sellQuoteInput(pool, user, quote, slippage)` returns a `sell(pool, user, baseIn, minQuoteOut)`
instruction, where `baseIn` is computed using `quote`, `slippage` and the current pool balances and
`minQuoteOut` is `quote` scaled with `slippage`.
- `PumpAmmSdk.swapBaseInstructions(pool, user, base, slippage, direction)` calls either
`PumpAmmInternalSdk.buyBaseInput(pool, user, base, slippage)` (`if (direction == "quoteToBase")`) or
`PumpAmmInternalSdk.sellBaseInput(pool, user, base, slippage)` (`if (direction == "baseToQuote")`).
- `PumpAmmSdk.swapQuoteInstructions(pool, user, quote, slippage, direction)` calls either
`PumpAmmInternalSdk.buyQuoteInput(pool, user, quote, slippage)` (`if (direction == "quoteToBase")`) or
`PumpAmmInternalSdk.sellQuoteInput(pool, user, quote, slippage)` (`if (direction == "baseToQuote")`).
## PumpSwap SDK autocomplete UI helpers
Each Anchor instruction has a set of corresponding autocomplete methods that can be used to autocomplete the UI inputs:
- `PumpAmmSdk.createAutocompleteInitialPoolPrice(initialBase, initialQuote)` is used to display the initial pool price
based on the initial `base` and `quote` inputs on pool creation.
- `PumpAmmSdk.depositAutocompleteQuoteAndLpTokenFromBase(pool, base, slippage)` is used to autocomplete the
corresponding `quote` and `lpToken` values in the UI when the `base` input changes on deposit UI.
- `PumpAmmSdk.depositAutocompleteBaseAndLpTokenFromQuote(pool, quote, slippage)` is used to autocomplete the
corresponding `base` and `lpToken` values in the UI when the `quote` input changes on deposit UI.
- `PumpAmmSdk.swapAutocompleteBaseFromQuote(pool, quote, slippage, swapDirection)` is used to autocomplete the
corresponding `base` value in the UI when the `quote` input changes on swap UI.
- `PumpAmmSdk.swapAutocompleteQuoteFromBase(pool, base, slippage, swapDirection)` is used to autocomplete the
corresponding `quote` value in the UI when the `base` input changes on swap UI.
- `PumpAmmSdk.swapAutocompleteBaseFromQuote(pool, quote, slippage, swapDirection)` calls either
`PumpAmmInternalSdk.buyAutocompleteBaseFromQuote(pool, quote, slippage)` (`if (swapDirection == "quoteToBase")`) or
`PumpAmmInternalSdk.sellAutocompleteBaseFromQuote(pool, quote, slippage)` (`if (swapDirection == "baseToQuote")`).
- `PumpAmmSdk.swapAutocompleteQuoteFromBase(pool, base, slippage, swapDirection)` calls either
`PumpAmmInternalSdk.buyAutocompleteQuoteFromBase(pool, base, slippage)` (`if (swapDirection == "quoteToBase")`) or
`PumpAmmInternalSdk.sellAutocompleteQuoteFromBase(pool, base, slippage)` (`if (swapDirection == "baseToQuote")`).
- `PumpAmmSdk.withdrawAutoCompleteBaseAndQuoteFromLpToken(pool, lpToken, slippage)` is used to autocomplete the
corresponding `base` and `quote` values in the UI when the `lpToken` input changes on withdraw UI.
================================================
FILE: docs/PUMP_SWAP_SDK_README.md
================================================
# Pump SDK
The SDK is structured as follows:
- `PumpAmmSdk` is the high level SDK, useful for UI integrations.
- `PumpAmmInternalSdk` is the low level SDK, useful for programmatic integrations, allowing full customization of instructions.
- `PumpAmmAdminSdk` is the SDK which allows access to admin-protected instructions.
## Create pool
To create a `(base, quote)` pool, you need to call:
`const createPoolInstructions = await pumpAmmSdk.createPoolInstructions(index, creator, baseMint, quoteMint, baseIn, quoteIn)`.
On UI, you can use `const initialPoolPrice = pumpAmmSdk.createAutocompleteInitialPoolPrice(initialBase, initialQuote)` to display
the initial pool price based on the initial `base` and `quote` inputs.
## Deposit
For depositing into a `(quote, base)` pool:
- when the `base` input changes, you need to call
`const {quote, lpToken} = await pumpAmmSdk.depositAutocompleteQuoteAndLpTokenFromBase(pool, base, slippage)` in order to
autocomplete the corresponding `quote` and `lpToken` values in the UI.
- when the `quote` input changes, you need to call
`const {base, lpToken} = await pumpAmmSdk.depositAutocompleteBaseAndLpTokenFromQuote(pool, quote, slippage)` in order to
autocomplete the corresponding `base` and `lpToken` values in the UI.
No matter which input is changed, when hitting deposit, you need to call
`const depositInstructions = await pumpAmmSdk.depositInstructions(pool, lpToken, slippage, user)`
to build the AMM deposit instruction, because `lpToken` is the only fixed input required by the `deposit` instruction.
## Swap
By default, the UI will display a `(quote, base)` pool like this:
Quote on first line, base on second line, with an ⬇️ from quote to base.
By default, you swap `quote` tokens for `base` tokens.
The arrow `swapDirection` can be either `quoteToBase` (⬇️, default)
or `baseToQuote` (⬆️).
```
(USDC, SOL) pool:
- USDC (quote)
- ⬇️
- SOL (base)
```
- If `quote` input changes, you call
`const base = await pumpAmmSdk.swapAutocompleteBaseFromQuote(pool, quote, slippage, swapDirection)`.
- If `base` input changes, you call
`const quote = await pumpAmmSdk.swapAutocompleteQuoteFromBase(pool, base, slippage, swapDirection)`.
No matter which input is changed, when hitting swap, you can call
`const swapInstructions = await pumpAmmSdk.swapBaseInstructions(pool, base, slippage, swapDirection, user)` or
`const swapInstructions = await pumpAmmSdk.swapBaseInstructions(pool, quote, slippage, swapDirection, user)` to
build the AMM swap instructions.
The `swapDirection` can be toggled in the UI either by making the arrow point upward or by swapping the base and quote
tokens positions.
```
(USDC, SOL) pool
- USDC (quote)
- ⬆️
- SOL (base)
```
## Withdraw
For withdrawing from a `(base, quote)` pool, you can use:
`const withdrawInstructions = await pumpAmmSdk.withdrawInstructions(pool, lpToken, slippage, user)`.
In the UI, you can use `const {base, quote} = pumpAmmSdk.withdrawAutocompleteBaseAndQuoteFromLpToken(pool, lpToken, slippage)`
to autocomplete the `base` and `quote` displayed amounts based on the `lpToken` input.
================================================
FILE: idl/pump.json
================================================
{
"address": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P",
"metadata": {
"name": "pump",
"version": "0.1.0",
"spec": "0.1.0",
"description": "Created with Anchor"
},
"instructions": [
{
"name": "admin_set_creator",
"docs": [
"Allows Global::admin_set_creator_authority to override the bonding curve creator"
],
"discriminator": [
69,
25,
171,
142,
57,
239,
13,
4
],
"accounts": [
{
"name": "admin_set_creator_authority",
"signer": true,
"relations": [
"global"
]
},
{
"name": "global",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
103,
108,
111,
98,
97,
108
]
}
]
}
},
{
"name": "mint"
},
{
"name": "bonding_curve",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
98,
111,
110,
100,
105,
110,
103,
45,
99,
117,
114,
118,
101
]
},
{
"kind": "account",
"path": "mint"
}
]
}
},
{
"name": "event_authority",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
95,
95,
101,
118,
101,
110,
116,
95,
97,
117,
116,
104,
111,
114,
105,
116,
121
]
}
]
}
},
{
"name": "program"
}
],
"args": [
{
"name": "creator",
"type": "pubkey"
}
]
},
{
"name": "admin_set_idl_authority",
"discriminator": [
8,
217,
96,
231,
144,
104,
192,
5
],
"accounts": [
{
"name": "authority",
"signer": true,
"relations": [
"global"
]
},
{
"name": "global",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
103,
108,
111,
98,
97,
108
]
}
]
}
},
{
"name": "idl_account",
"writable": true
},
{
"name": "system_program",
"address": "11111111111111111111111111111111"
},
{
"name": "program_signer",
"pda": {
"seeds": []
}
},
{
"name": "event_authority",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
95,
95,
101,
118,
101,
110,
116,
95,
97,
117,
116,
104,
111,
114,
105,
116,
121
]
}
]
}
},
{
"name": "program"
}
],
"args": [
{
"name": "idl_authority",
"type": "pubkey"
}
]
},
{
"name": "admin_update_token_incentives",
"discriminator": [
209,
11,
115,
87,
213,
23,
124,
204
],
"accounts": [
{
"name": "authority",
"writable": true,
"signer": true,
"relations": [
"global"
]
},
{
"name": "global",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
103,
108,
111,
98,
97,
108
]
}
]
}
},
{
"name": "global_volume_accumulator",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
103,
108,
111,
98,
97,
108,
95,
118,
111,
108,
117,
109,
101,
95,
97,
99,
99,
117,
109,
117,
108,
97,
116,
111,
114
]
}
]
}
},
{
"name": "mint"
},
{
"name": "global_incentive_token_account",
"writable": true,
"pda": {
"seeds": [
{
"kind": "account",
"path": "global_volume_accumulator"
},
{
"kind": "account",
"path": "token_program"
},
{
"kind": "account",
"path": "mint"
}
],
"program": {
"kind": "const",
"value": [
140,
151,
37,
143,
78,
36,
137,
241,
187,
61,
16,
41,
20,
142,
13,
131,
11,
90,
19,
153,
218,
255,
16,
132,
4,
142,
123,
216,
219,
233,
248,
89
]
}
}
},
{
"name": "associated_token_program",
"address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
},
{
"name": "system_program",
"address": "11111111111111111111111111111111"
},
{
"name": "token_program"
},
{
"name": "event_authority",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
95,
95,
101,
118,
101,
110,
116,
95,
97,
117,
116,
104,
111,
114,
105,
116,
121
]
}
]
}
},
{
"name": "program"
}
],
"args": [
{
"name": "start_time",
"type": "i64"
},
{
"name": "end_time",
"type": "i64"
},
{
"name": "seconds_in_a_day",
"type": "i64"
},
{
"name": "day_number",
"type": "u64"
},
{
"name": "pump_token_supply_per_day",
"type": "u64"
}
]
},
{
"name": "buy",
"docs": [
"Buys tokens from a bonding curve."
],
"discriminator": [
102,
6,
61,
18,
1,
218,
235,
234
],
"accounts": [
{
"name": "global",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
103,
108,
111,
98,
97,
108
]
}
]
}
},
{
"name": "fee_recipient",
"writable": true
},
{
"name": "mint"
},
{
"name": "bonding_curve",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
98,
111,
110,
100,
105,
110,
103,
45,
99,
117,
114,
118,
101
]
},
{
"kind": "account",
"path": "mint"
}
]
}
},
{
"name": "associated_bonding_curve",
"writable": true,
"pda": {
"seeds": [
{
"kind": "account",
"path": "bonding_curve"
},
{
"kind": "account",
"path": "token_program"
},
{
"kind": "account",
"path": "mint"
}
],
"program": {
"kind": "const",
"value": [
140,
151,
37,
143,
78,
36,
137,
241,
187,
61,
16,
41,
20,
142,
13,
131,
11,
90,
19,
153,
218,
255,
16,
132,
4,
142,
123,
216,
219,
233,
248,
89
]
}
}
},
{
"name": "associated_user",
"writable": true
},
{
"name": "user",
"writable": true,
"signer": true
},
{
"name": "system_program",
"address": "11111111111111111111111111111111"
},
{
"name": "token_program"
},
{
"name": "creator_vault",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
99,
114,
101,
97,
116,
111,
114,
45,
118,
97,
117,
108,
116
]
},
{
"kind": "account",
"path": "bonding_curve.creator",
"account": "BondingCurve"
}
]
}
},
{
"name": "event_authority",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
95,
95,
101,
118,
101,
110,
116,
95,
97,
117,
116,
104,
111,
114,
105,
116,
121
]
}
]
}
},
{
"name": "program",
"address": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"
},
{
"name": "global_volume_accumulator",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
103,
108,
111,
98,
97,
108,
95,
118,
111,
108,
117,
109,
101,
95,
97,
99,
99,
117,
109,
117,
108,
97,
116,
111,
114
]
}
]
}
},
{
"name": "user_volume_accumulator",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
117,
115,
101,
114,
95,
118,
111,
108,
117,
109,
101,
95,
97,
99,
99,
117,
109,
117,
108,
97,
116,
111,
114
]
},
{
"kind": "account",
"path": "user"
}
]
}
},
{
"name": "fee_config",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
102,
101,
101,
95,
99,
111,
110,
102,
105,
103
]
},
{
"kind": "const",
"value": [
1,
86,
224,
246,
147,
102,
90,
207,
68,
219,
21,
104,
191,
23,
91,
170,
81,
137,
203,
151,
245,
210,
255,
59,
101,
93,
43,
182,
253,
109,
24,
176
]
}
],
"program": {
"kind": "account",
"path": "fee_program"
}
}
},
{
"name": "fee_program",
"address": "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ"
}
],
"args": [
{
"name": "amount",
"type": "u64"
},
{
"name": "max_sol_cost",
"type": "u64"
},
{
"name": "track_volume",
"type": {
"defined": {
"name": "OptionBool"
}
}
}
]
},
{
"name": "buy_exact_sol_in",
"docs": [
"Given a budget of spendable SOL, buy at least min_tokens_out tokens.",
"Fees are deducted from spendable_sol_in.",
"",
"# Quote formulas",
"Where:",
"- total_fee_bps = protocol_fee_bps + creator_fee_bps (creator_fee_bps is 0 if no creator)",
"- floor(a/b) = a / b (integer division)",
"- ceil(a/b) = (a + b - 1) / b",
"",
"SOL → tokens quote",
"To calculate tokens_out for a given spendable_sol_in:",
"1. net_sol = floor(spendable_sol_in * 10_000 / (10_000 + total_fee_bps))",
"2. fees = ceil(net_sol * protocol_fee_bps / 10_000) + ceil(net_sol * creator_fee_bps / 10_000) (creator_fee_bps is 0 if no creator)",
"3. if net_sol + fees > spendable_sol_in: net_sol = net_sol - (net_sol + fees - spendable_sol_in)",
"4. tokens_out = floor((net_sol - 1) * virtual_token_reserves / (virtual_sol_reserves + net_sol - 1))",
"",
"Reverse quote (tokens → SOL)",
"To calculate spendable_sol_in for a desired number of tokens:",
"1. net_sol = ceil(tokens * virtual_sol_reserves / (virtual_token_reserves - tokens)) + 1",
"2. spendable_sol_in = ceil(net_sol * (10_000 + total_fee_bps) / 10_000)",
"",
"Rent",
"Separately make sure the instruction's payer has enough SOL to cover rent for:",
"- creator_vault: rent.minimum_balance(0)",
"- user_volume_accumulator: rent.minimum_balance(UserVolumeAccumulator::LEN)"
],
"discriminator": [
56,
252,
116,
8,
158,
223,
205,
95
],
"accounts": [
{
"name": "global",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
103,
108,
111,
98,
97,
108
]
}
]
}
},
{
"name": "fee_recipient",
"writable": true
},
{
"name": "mint"
},
{
"name": "bonding_curve",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
98,
111,
110,
100,
105,
110,
103,
45,
99,
117,
114,
118,
101
]
},
{
"kind": "account",
"path": "mint"
}
]
}
},
{
"name": "associated_bonding_curve",
"writable": true,
"pda": {
"seeds": [
{
"kind": "account",
"path": "bonding_curve"
},
{
"kind": "account",
"path": "token_program"
},
{
"kind": "account",
"path": "mint"
}
],
"program": {
"kind": "const",
"value": [
140,
151,
37,
143,
78,
36,
137,
241,
187,
61,
16,
41,
20,
142,
13,
131,
11,
90,
19,
153,
218,
255,
16,
132,
4,
142,
123,
216,
219,
233,
248,
89
]
}
}
},
{
"name": "associated_user",
"writable": true
},
{
"name": "user",
"writable": true,
"signer": true
},
{
"name": "system_program",
"address": "11111111111111111111111111111111"
},
{
"name": "token_program"
},
{
"name": "creator_vault",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
99,
114,
101,
97,
116,
111,
114,
45,
118,
97,
117,
108,
116
]
},
{
"kind": "account",
"path": "bonding_curve.creator",
"account": "BondingCurve"
}
]
}
},
{
"name": "event_authority",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
95,
95,
101,
118,
101,
110,
116,
95,
97,
117,
116,
104,
111,
114,
105,
116,
121
]
}
]
}
},
{
"name": "program",
"address": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"
},
{
"name": "global_volume_accumulator",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
103,
108,
111,
98,
97,
108,
95,
118,
111,
108,
117,
109,
101,
95,
97,
99,
99,
117,
109,
117,
108,
97,
116,
111,
114
]
}
]
}
},
{
"name": "user_volume_accumulator",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
117,
115,
101,
114,
95,
118,
111,
108,
117,
109,
101,
95,
97,
99,
99,
117,
109,
117,
108,
97,
116,
111,
114
]
},
{
"kind": "account",
"path": "user"
}
]
}
},
{
"name": "fee_config",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
102,
101,
101,
95,
99,
111,
110,
102,
105,
103
]
},
{
"kind": "const",
"value": [
1,
86,
224,
246,
147,
102,
90,
207,
68,
219,
21,
104,
191,
23,
91,
170,
81,
137,
203,
151,
245,
210,
255,
59,
101,
93,
43,
182,
253,
109,
24,
176
]
}
],
"program": {
"kind": "account",
"path": "fee_program"
}
}
},
{
"name": "fee_program",
"address": "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ"
}
],
"args": [
{
"name": "spendable_sol_in",
"type": "u64"
},
{
"name": "min_tokens_out",
"type": "u64"
},
{
"name": "track_volume",
"type": {
"defined": {
"name": "OptionBool"
}
}
}
]
},
{
"name": "claim_cashback",
"discriminator": [
37,
58,
35,
126,
190,
53,
228,
197
],
"accounts": [
{
"name": "user",
"writable": true
},
{
"name": "user_volume_accumulator",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
117,
115,
101,
114,
95,
118,
111,
108,
117,
109,
101,
95,
97,
99,
99,
117,
109,
117,
108,
97,
116,
111,
114
]
},
{
"kind": "account",
"path": "user"
}
]
}
},
{
"name": "system_program",
"address": "11111111111111111111111111111111"
},
{
"name": "event_authority",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
95,
95,
101,
118,
101,
110,
116,
95,
97,
117,
116,
104,
111,
114,
105,
116,
121
]
}
]
}
},
{
"name": "program",
"address": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"
}
],
"args": []
},
{
"name": "claim_token_incentives",
"discriminator": [
16,
4,
71,
28,
204,
1,
40,
27
],
"accounts": [
{
"name": "user"
},
{
"name": "user_ata",
"writable": true,
"pda": {
"seeds": [
{
"kind": "account",
"path": "user"
},
{
"kind": "account",
"path": "token_program"
},
{
"kind": "account",
"path": "mint"
}
],
"program": {
"kind": "const",
"value": [
140,
151,
37,
143,
78,
36,
137,
241,
187,
61,
16,
41,
20,
142,
13,
131,
11,
90,
19,
153,
218,
255,
16,
132,
4,
142,
123,
216,
219,
233,
248,
89
]
}
}
},
{
"name": "global_volume_accumulator",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
103,
108,
111,
98,
97,
108,
95,
118,
111,
108,
117,
109,
101,
95,
97,
99,
99,
117,
109,
117,
108,
97,
116,
111,
114
]
}
]
}
},
{
"name": "global_incentive_token_account",
"writable": true,
"pda": {
"seeds": [
{
"kind": "account",
"path": "global_volume_accumulator"
},
{
"kind": "account",
"path": "token_program"
},
{
"kind": "account",
"path": "mint"
}
],
"program": {
"kind": "const",
"value": [
140,
151,
37,
143,
78,
36,
137,
241,
187,
61,
16,
41,
20,
142,
13,
131,
11,
90,
19,
153,
218,
255,
16,
132,
4,
142,
123,
216,
219,
233,
248,
89
]
}
}
},
{
"name": "user_volume_accumulator",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
117,
115,
101,
114,
95,
118,
111,
108,
117,
109,
101,
95,
97,
99,
99,
117,
109,
117,
108,
97,
116,
111,
114
]
},
{
"kind": "account",
"path": "user"
}
]
}
},
{
"name": "mint",
"relations": [
"global_volume_accumulator"
]
},
{
"name": "token_program"
},
{
"name": "system_program",
"address": "11111111111111111111111111111111"
},
{
"name": "associated_token_program",
"address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
},
{
"name": "event_authority",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
95,
95,
101,
118,
101,
110,
116,
95,
97,
117,
116,
104,
111,
114,
105,
116,
121
]
}
]
}
},
{
"name": "program",
"address": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"
},
{
"name": "payer",
"writable": true,
"signer": true
}
],
"args": []
},
{
"name": "close_user_volume_accumulator",
"discriminator": [
249,
69,
164,
218,
150,
103,
84,
138
],
"accounts": [
{
"name": "user",
"writable": true,
"signer": true
},
{
"name": "user_volume_accumulator",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
117,
115,
101,
114,
95,
118,
111,
108,
117,
109,
101,
95,
97,
99,
99,
117,
109,
117,
108,
97,
116,
111,
114
]
},
{
"kind": "account",
"path": "user"
}
]
}
},
{
"name": "event_authority",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
95,
95,
101,
118,
101,
110,
116,
95,
97,
117,
116,
104,
111,
114,
105,
116,
121
]
}
]
}
},
{
"name": "program"
}
],
"args": []
},
{
"name": "collect_creator_fee",
"docs": [
"Collects creator_fee from creator_vault to the coin creator account"
],
"discriminator": [
20,
22,
86,
123,
198,
28,
219,
132
],
"accounts": [
{
"name": "creator",
"writable": true
},
{
"name": "creator_vault",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
99,
114,
101,
97,
116,
111,
114,
45,
118,
97,
117,
108,
116
]
},
{
"kind": "account",
"path": "creator"
}
]
}
},
{
"name": "system_program",
"address": "11111111111111111111111111111111"
},
{
"name": "event_authority",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
95,
95,
101,
118,
101,
110,
116,
95,
97,
117,
116,
104,
111,
114,
105,
116,
121
]
}
]
}
},
{
"name": "program"
}
],
"args": []
},
{
"name": "create",
"docs": [
"Creates a new coin and bonding curve."
],
"discriminator": [
24,
30,
200,
40,
5,
28,
7,
119
],
"accounts": [
{
"name": "mint",
"writable": true,
"signer": true
},
{
"name": "mint_authority",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
109,
105,
110,
116,
45,
97,
117,
116,
104,
111,
114,
105,
116,
121
]
}
]
}
},
{
"name": "bonding_curve",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
98,
111,
110,
100,
105,
110,
103,
45,
99,
117,
114,
118,
101
]
},
{
"kind": "account",
"path": "mint"
}
]
}
},
{
"name": "associated_bonding_curve",
"writable": true,
"pda": {
"seeds": [
{
"kind": "account",
"path": "bonding_curve"
},
{
"kind": "const",
"value": [
6,
221,
246,
225,
215,
101,
161,
147,
217,
203,
225,
70,
206,
235,
121,
172,
28,
180,
133,
237,
95,
91,
55,
145,
58,
140,
245,
133,
126,
255,
0,
169
]
},
{
"kind": "account",
"path": "mint"
}
],
"program": {
"kind": "const",
"value": [
140,
151,
37,
143,
78,
36,
137,
241,
187,
61,
16,
41,
20,
142,
13,
131,
11,
90,
19,
153,
218,
255,
16,
132,
4,
142,
123,
216,
219,
233,
248,
89
]
}
}
},
{
"name": "global",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
103,
108,
111,
98,
97,
108
]
}
]
}
},
{
"name": "mpl_token_metadata",
"address": "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"
},
{
"name": "metadata",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
109,
101,
116,
97,
100,
97,
116,
97
]
},
{
"kind": "const",
"value": [
11,
112,
101,
177,
227,
209,
124,
69,
56,
157,
82,
127,
107,
4,
195,
205,
88,
184,
108,
115,
26,
160,
253,
181,
73,
182,
209,
188,
3,
248,
41,
70
]
},
{
"kind": "account",
"path": "mint"
}
],
"program": {
"kind": "account",
"path": "mpl_token_metadata"
}
}
},
{
"name": "user",
"writable": true,
"signer": true
},
{
"name": "system_program",
"address": "11111111111111111111111111111111"
},
{
"name": "token_program",
"address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
},
{
"name": "associated_token_program",
"address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
},
{
"name": "rent",
"address": "SysvarRent111111111111111111111111111111111"
},
{
"name": "event_authority",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
95,
95,
101,
118,
101,
110,
116,
95,
97,
117,
116,
104,
111,
114,
105,
116,
121
]
}
]
}
},
{
"name": "program"
}
],
"args": [
{
"name": "name",
"type": "string"
},
{
"name": "symbol",
"type": "string"
},
{
"name": "uri",
"type": "string"
},
{
"name": "creator",
"type": "pubkey"
}
]
},
{
"name": "create_v2",
"docs": [
"Creates a new spl-22 coin and bonding curve."
],
"discriminator": [
214,
144,
76,
236,
95,
139,
49,
180
],
"accounts": [
{
"name": "mint",
"writable": true,
"signer": true
},
{
"name": "mint_authority",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
109,
105,
110,
116,
45,
97,
117,
116,
104,
111,
114,
105,
116,
121
]
}
]
}
},
{
"name": "bonding_curve",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
98,
111,
110,
100,
105,
110,
103,
45,
99,
117,
114,
118,
101
]
},
{
"kind": "account",
"path": "mint"
}
]
}
},
{
"name": "associated_bonding_curve",
"writable": true,
"pda": {
"seeds": [
{
"kind": "account",
"path": "bonding_curve"
},
{
"kind": "account",
"path": "token_program"
},
{
"kind": "account",
"path": "mint"
}
],
"program": {
"kind": "const",
"value": [
140,
151,
37,
143,
78,
36,
137,
241,
187,
61,
16,
41,
20,
142,
13,
131,
11,
90,
19,
153,
218,
255,
16,
132,
4,
142,
123,
216,
219,
233,
248,
89
]
}
}
},
{
"name": "global",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
103,
108,
111,
98,
97,
108
]
}
]
}
},
{
"name": "user",
"writable": true,
"signer": true
},
{
"name": "system_program",
"address": "11111111111111111111111111111111"
},
{
"name": "token_program",
"address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
},
{
"name": "associated_token_program",
"address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
},
{
"name": "mayhem_program_id",
"writable": true,
"address": "MAyhSmzXzV1pTf7LsNkrNwkWKTo4ougAJ1PPg47MD4e"
},
{
"name": "global_params",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
103,
108,
111,
98,
97,
108,
45,
112,
97,
114,
97,
109,
115
]
}
],
"program": {
"kind": "const",
"value": [
5,
42,
229,
215,
167,
218,
167,
36,
166,
234,
176,
167,
41,
84,
145,
133,
90,
212,
160,
103,
22,
96,
103,
76,
78,
3,
69,
89,
128,
61,
101,
163
]
}
}
},
{
"name": "sol_vault",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
115,
111,
108,
45,
118,
97,
117,
108,
116
]
}
],
"program": {
"kind": "const",
"value": [
5,
42,
229,
215,
167,
218,
167,
36,
166,
234,
176,
167,
41,
84,
145,
133,
90,
212,
160,
103,
22,
96,
103,
76,
78,
3,
69,
89,
128,
61,
101,
163
]
}
}
},
{
"name": "mayhem_state",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
109,
97,
121,
104,
101,
109,
45,
115,
116,
97,
116,
101
]
},
{
"kind": "account",
"path": "mint"
}
],
"program": {
"kind": "const",
"value": [
5,
42,
229,
215,
167,
218,
167,
36,
166,
234,
176,
167,
41,
84,
145,
133,
90,
212,
160,
103,
22,
96,
103,
76,
78,
3,
69,
89,
128,
61,
101,
163
]
}
}
},
{
"name": "mayhem_token_vault",
"writable": true
},
{
"name": "event_authority",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
95,
95,
101,
118,
101,
110,
116,
95,
97,
117,
116,
104,
111,
114,
105,
116,
121
]
}
]
}
},
{
"name": "program"
}
],
"args": [
{
"name": "name",
"type": "string"
},
{
"name": "symbol",
"type": "string"
},
{
"name": "uri",
"type": "string"
},
{
"name": "creator",
"type": "pubkey"
},
{
"name": "is_mayhem_mode",
"type": "bool"
},
{
"name": "is_cashback_enabled",
"type": {
"defined": {
"name": "OptionBool"
}
}
}
]
},
{
"name": "distribute_creator_fees",
"docs": [
"Distributes creator fees to shareholders based on their share percentages",
"The creator vault needs to have at least the minimum distributable amount to distribute fees",
"This can be checked with the get_minimum_distributable_fee instruction"
],
"discriminator": [
165,
114,
103,
0,
121,
206,
247,
81
],
"accounts": [
{
"name": "mint",
"relations": [
"sharing_config"
]
},
{
"name": "bonding_curve",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
98,
111,
110,
100,
105,
110,
103,
45,
99,
117,
114,
118,
101
]
},
{
"kind": "account",
"path": "mint"
}
]
}
},
{
"name": "sharing_config",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
115,
104,
97,
114,
105,
110,
103,
45,
99,
111,
110,
102,
105,
103
]
},
{
"kind": "account",
"path": "mint"
}
],
"program": {
"kind": "const",
"value": [
12,
53,
255,
169,
5,
90,
142,
86,
141,
168,
247,
188,
7,
86,
21,
39,
76,
241,
201,
44,
164,
31,
64,
0,
156,
81,
106,
164,
20,
194,
124,
112
]
}
}
},
{
"name": "creator_vault",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
99,
114,
101,
97,
116,
111,
114,
45,
118,
97,
117,
108,
116
]
},
{
"kind": "account",
"path": "bonding_curve.creator",
"account": "BondingCurve"
}
]
}
},
{
"name": "system_program",
"address": "11111111111111111111111111111111"
},
{
"name": "event_authority",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
95,
95,
101,
118,
101,
110,
116,
95,
97,
117,
116,
104,
111,
114,
105,
116,
121
]
}
]
}
},
{
"name": "program",
"address": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"
}
],
"args": [],
"returns": {
"defined": {
"name": "DistributeCreatorFeesEvent"
}
}
},
{
"name": "extend_account",
"docs": [
"Extends the size of program-owned accounts"
],
"discriminator": [
234,
102,
194,
203,
150,
72,
62,
229
],
"accounts": [
{
"name": "account",
"writable": true
},
{
"name": "user",
"signer": true
},
{
"name": "system_program",
"address": "11111111111111111111111111111111"
},
{
"name": "event_authority",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
95,
95,
101,
118,
101,
110,
116,
95,
97,
117,
116,
104,
111,
114,
105,
116,
121
]
}
]
}
},
{
"name": "program"
}
],
"args": []
},
{
"name": "get_minimum_distributable_fee",
"docs": [
"Permissionless instruction to check the minimum required fees for distribution",
"Returns the minimum required balance from the creator_vault and whether distribution can proceed"
],
"discriminator": [
117,
225,
127,
202,
134,
95,
68,
35
],
"accounts": [
{
"name": "mint",
"relations": [
"sharing_config"
]
},
{
"name": "bonding_curve",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
98,
111,
110,
100,
105,
110,
103,
45,
99,
117,
114,
118,
101
]
},
{
"kind": "account",
"path": "mint"
}
]
}
},
{
"name": "sharing_config",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
115,
104,
97,
114,
105,
110,
103,
45,
99,
111,
110,
102,
105,
103
]
},
{
"kind": "account",
"path": "mint"
}
],
"program": {
"kind": "const",
"value": [
12,
53,
255,
169,
5,
90,
142,
86,
141,
168,
247,
188,
7,
86,
21,
39,
76,
241,
201,
44,
164,
31,
64,
0,
156,
81,
106,
164,
20,
194,
124,
112
]
}
}
},
{
"name": "creator_vault",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
99,
114,
101,
97,
116,
111,
114,
45,
118,
97,
117,
108,
116
]
},
{
"kind": "account",
"path": "bonding_curve.creator",
"account": "BondingCurve"
}
]
}
}
],
"args": [],
"returns": {
"defined": {
"name": "MinimumDistributableFeeEvent"
}
}
},
{
"name": "init_user_volume_accumulator",
"discriminator": [
94,
6,
202,
115,
255,
96,
232,
183
],
"accounts": [
{
"name": "payer",
"writable": true,
"signer": true
},
{
"name": "user"
},
{
"name": "user_volume_accumulator",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
117,
115,
101,
114,
95,
118,
111,
108,
117,
109,
101,
95,
97,
99,
99,
117,
109,
117,
108,
97,
116,
111,
114
]
},
{
"kind": "account",
"path": "user"
}
]
}
},
{
"name": "system_program",
"address": "11111111111111111111111111111111"
},
{
"name": "event_authority",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
95,
95,
101,
118,
101,
110,
116,
95,
97,
117,
116,
104,
111,
114,
105,
116,
121
]
}
]
}
},
{
"name": "program"
}
],
"args": []
},
{
"name": "initialize",
"docs": [
"Creates the global state."
],
"discriminator": [
175,
175,
109,
31,
13,
152,
155,
237
],
"accounts": [
{
"name": "global",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
103,
108,
111,
98,
97,
108
]
}
]
}
},
{
"name": "user",
"writable": true,
"signer": true
},
{
"name": "system_program",
"address": "11111111111111111111111111111111"
}
],
"args": []
},
{
"name": "migrate",
"docs": [
"Migrates liquidity to pump_amm if the bonding curve is complete"
],
"discriminator": [
155,
234,
231,
146,
236,
158,
162,
30
],
"accounts": [
{
"name": "global",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
103,
108,
111,
98,
97,
108
]
}
]
}
},
{
"name": "withdraw_authority",
"writable": true,
"relations": [
"global"
]
},
{
"name": "mint"
},
{
"name": "bonding_curve",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
98,
111,
110,
100,
105,
110,
103,
45,
99,
117,
114,
118,
101
]
},
{
"kind": "account",
"path": "mint"
}
]
}
},
{
"name": "associated_bonding_curve",
"writable": true,
"pda": {
"seeds": [
{
"kind": "account",
"path": "bonding_curve"
},
{
"kind": "account",
"path": "mint"
},
{
"kind": "account",
"path": "mint"
}
],
"program": {
"kind": "const",
"value": [
140,
151,
37,
143,
78,
36,
137,
241,
187,
61,
16,
41,
20,
142,
13,
131,
11,
90,
19,
153,
218,
255,
16,
132,
4,
142,
123,
216,
219,
233,
248,
89
]
}
}
},
{
"name": "user",
"signer": true
},
{
"name": "system_program",
"address": "11111111111111111111111111111111"
},
{
"name": "token_program",
"address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
},
{
"name": "pump_amm",
"address": "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"
},
{
"name": "pool",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
112,
111,
111,
108
]
},
{
"kind": "const",
"value": [
0,
0
]
},
{
"kind": "account",
"path": "pool_authority"
},
{
"kind": "account",
"path": "mint"
},
{
"kind": "account",
"path": "wsol_mint"
}
],
"program": {
"kind": "account",
"path": "pump_amm"
}
}
},
{
"name": "pool_authority",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
112,
111,
111,
108,
45,
97,
117,
116,
104,
111,
114,
105,
116,
121
]
},
{
"kind": "account",
"path": "mint"
}
]
}
},
{
"name": "pool_authority_mint_account",
"writable": true,
"pda": {
"seeds": [
{
"kind": "account",
"path": "pool_authority"
},
{
"kind": "account",
"path": "mint"
},
{
"kind": "account",
"path": "mint"
}
],
"program": {
"kind": "account",
"path": "associated_token_program"
}
}
},
{
"name": "pool_authority_wsol_account",
"writable": true,
"pda": {
"seeds": [
{
"kind": "account",
"path": "pool_authority"
},
{
"kind": "account",
"path": "token_program"
},
{
"kind": "account",
"path": "wsol_mint"
}
],
"program": {
"kind": "account",
"path": "associated_token_program"
}
}
},
{
"name": "amm_global_config",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
103,
108,
111,
98,
97,
108,
95,
99,
111,
110,
102,
105,
103
]
}
],
"program": {
"kind": "account",
"path": "pump_amm"
}
}
},
{
"name": "wsol_mint",
"address": "So11111111111111111111111111111111111111112"
},
{
"name": "lp_mint",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
112,
111,
111,
108,
95,
108,
112,
95,
109,
105,
110,
116
]
},
{
"kind": "account",
"path": "pool"
}
],
"program": {
"kind": "account",
"path": "pump_amm"
}
}
},
{
"name": "user_pool_token_account",
"writable": true,
"pda": {
"seeds": [
{
"kind": "account",
"path": "pool_authority"
},
{
"kind": "account",
"path": "token_2022_program"
},
{
"kind": "account",
"path": "lp_mint"
}
],
"program": {
"kind": "account",
"path": "associated_token_program"
}
}
},
{
"name": "pool_base_token_account",
"writable": true,
"pda": {
"seeds": [
{
"kind": "account",
"path": "pool"
},
{
"kind": "account",
"path": "mint"
},
{
"kind": "account",
"path": "mint"
}
],
"program": {
"kind": "account",
"path": "associated_token_program"
}
}
},
{
"name": "pool_quote_token_account",
"writable": true,
"pda": {
"seeds": [
{
"kind": "account",
"path": "pool"
},
{
"kind": "account",
"path": "token_program"
},
{
"kind": "account",
"path": "wsol_mint"
}
],
"program": {
"kind": "account",
"path": "associated_token_program"
}
}
},
{
"name": "token_2022_program",
"address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
},
{
"name": "associated_token_program",
"address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
},
{
"name": "pump_amm_event_authority",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
95,
95,
101,
118,
101,
110,
116,
95,
97,
117,
116,
104,
111,
114,
105,
116,
121
]
}
],
"program": {
"kind": "account",
"path": "pump_amm"
}
}
},
{
"name": "event_authority",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
95,
95,
101,
118,
101,
110,
116,
95,
97,
117,
116,
104,
111,
114,
105,
116,
121
]
}
]
}
},
{
"name": "program"
}
],
"args": []
},
{
"name": "migrate_bonding_curve_creator",
"discriminator": [
87,
124,
52,
191,
52,
38,
214,
232
],
"accounts": [
{
"name": "mint",
"relations": [
"sharing_config"
]
},
{
"name": "bonding_curve",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
98,
111,
110,
100,
105,
110,
103,
45,
99,
117,
114,
118,
101
]
},
{
"kind": "account",
"path": "mint"
}
]
}
},
{
"name": "sharing_config",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
115,
104,
97,
114,
105,
110,
103,
45,
99,
111,
110,
102,
105,
103
]
},
{
"kind": "account",
"path": "mint"
}
],
"program": {
"kind": "const",
"value": [
12,
53,
255,
169,
5,
90,
142,
86,
141,
168,
247,
188,
7,
86,
21,
39,
76,
241,
201,
44,
164,
31,
64,
0,
156,
81,
106,
164,
20,
194,
124,
112
]
}
}
},
{
"name": "event_authority",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
95,
95,
101,
118,
101,
110,
116,
95,
97,
117,
116,
104,
111,
114,
105,
116,
121
]
}
]
}
},
{
"name": "program"
}
],
"args": []
},
{
"name": "sell",
"docs": [
"Sells tokens into a bonding curve.",
"For cashback coins, optionally pass user_volume_accumulator as remaining_accounts[0].",
"If provided and valid, creator_fee goes to user_volume_accumulator.",
"Otherwise, falls back to transferring creator_fee to creator_vault."
],
"discriminator": [
51,
230,
133,
164,
1,
127,
131,
173
],
"accounts": [
{
"name": "global",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
103,
108,
111,
98,
97,
108
]
}
]
}
},
{
"name": "fee_recipient",
"writable": true
},
{
"name": "mint"
},
{
"name": "bonding_curve",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
98,
111,
110,
100,
105,
110,
103,
45,
99,
117,
114,
118,
101
]
},
{
"kind": "account",
"path": "mint"
}
]
}
},
{
"name": "associated_bonding_curve",
"writable": true,
"pda": {
"seeds": [
{
"kind": "account",
"path": "bonding_curve"
},
{
"kind": "account",
"path": "token_program"
},
{
"kind": "account",
"path": "mint"
}
],
"program": {
"kind": "const",
"value": [
140,
151,
37,
143,
78,
36,
137,
241,
187,
61,
16,
41,
20,
142,
13,
131,
11,
90,
19,
153,
218,
255,
16,
132,
4,
142,
123,
216,
219,
233,
248,
89
]
}
}
},
{
"name": "associated_user",
"writable": true
},
{
"name": "user",
"writable": true,
"signer": true
},
{
"name": "system_program",
"address": "11111111111111111111111111111111"
},
{
"name": "creator_vault",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
99,
114,
101,
97,
116,
111,
114,
45,
118,
97,
117,
108,
116
]
},
{
"kind": "account",
"path": "bonding_curve.creator",
"account": "BondingCurve"
}
]
}
},
{
"name": "token_program"
},
{
"name": "event_authority",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
95,
95,
101,
118,
101,
110,
116,
95,
97,
117,
116,
104,
111,
114,
105,
116,
121
]
}
]
}
},
{
"name": "program",
"address": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"
},
{
"name": "fee_config",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
102,
101,
101,
95,
99,
111,
110,
102,
105,
103
]
},
{
"kind": "const",
"value": [
1,
86,
224,
246,
147,
102,
90,
207,
68,
219,
21,
104,
191,
23,
91,
170,
81,
137,
203,
151,
245,
210,
255,
59,
101,
93,
43,
182,
253,
109,
24,
176
]
}
],
"program": {
"kind": "account",
"path": "fee_program"
}
}
},
{
"name": "fee_program",
"address": "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ"
}
],
"args": [
{
"name": "amount",
"type": "u64"
},
{
"name": "min_sol_output",
"type": "u64"
}
]
},
{
"name": "set_creator",
"docs": [
"Allows Global::set_creator_authority to set the bonding curve creator from Metaplex metadata or input argument"
],
"discriminator": [
254,
148,
255,
112,
207,
142,
170,
165
],
"accounts": [
{
"name": "set_creator_authority",
"signer": true,
"relations": [
"global"
]
},
{
"name": "global",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
103,
108,
111,
98,
97,
108
]
}
]
}
},
{
"name": "mint"
},
{
"name": "metadata",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
109,
101,
116,
97,
100,
97,
116,
97
]
},
{
"kind": "const",
"value": [
11,
112,
101,
177,
227,
209,
124,
69,
56,
157,
82,
127,
107,
4,
195,
205,
88,
184,
108,
115,
26,
160,
253,
181,
73,
182,
209,
188,
3,
248,
41,
70
]
},
{
"kind": "account",
"path": "mint"
}
],
"program": {
"kind": "const",
"value": [
11,
112,
101,
177,
227,
209,
124,
69,
56,
157,
82,
127,
107,
4,
195,
205,
88,
184,
108,
115,
26,
160,
253,
181,
73,
182,
209,
188,
3,
248,
41,
70
]
}
}
},
{
"name": "bonding_curve",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
98,
111,
110,
100,
105,
110,
103,
45,
99,
117,
114,
118,
101
]
},
{
"kind": "account",
"path": "mint"
}
]
}
},
{
"name": "event_authority",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
95,
95,
101,
118,
101,
110,
116,
95,
97,
117,
116,
104,
111,
114,
105,
116,
121
]
}
]
}
},
{
"name": "program"
}
],
"args": [
{
"name": "creator",
"type": "pubkey"
}
]
},
{
"name": "set_mayhem_virtual_params",
"discriminator": [
61,
169,
188,
191,
153,
149,
42,
97
],
"accounts": [
{
"name": "sol_vault_authority",
"writable": true,
"signer": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
115,
111,
108,
45,
118,
97,
117,
108,
116
]
}
],
"program": {
"kind": "const",
"value": [
5,
42,
229,
215,
167,
218,
167,
36,
166,
234,
176,
167,
41,
84,
145,
133,
90,
212,
160,
103,
22,
96,
103,
76,
78,
3,
69,
89,
128,
61,
101,
163
]
}
}
},
{
"name": "mayhem_token_vault",
"writable": true,
"pda": {
"seeds": [
{
"kind": "account",
"path": "sol_vault_authority"
},
{
"kind": "account",
"path": "token_program"
},
{
"kind": "account",
"path": "mint"
}
],
"program": {
"kind": "const",
"value": [
140,
151,
37,
143,
78,
36,
137,
241,
187,
61,
16,
41,
20,
142,
13,
131,
11,
90,
19,
153,
218,
255,
16,
132,
4,
142,
123,
216,
219,
233,
248,
89
]
}
}
},
{
"name": "mint"
},
{
"name": "global",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
103,
108,
111,
98,
97,
108
]
}
]
}
},
{
"name": "bonding_curve",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
98,
111,
110,
100,
105,
110,
103,
45,
99,
117,
114,
118,
101
]
},
{
"kind": "account",
"path": "mint"
}
]
}
},
{
"name": "token_program",
"address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
},
{
"name": "event_authority",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
95,
95,
101,
118,
101,
110,
116,
95,
97,
117,
116,
104,
111,
114,
105,
116,
121
]
}
]
}
},
{
"name": "program"
}
],
"args": []
},
{
"name": "set_metaplex_creator",
"docs": [
"Syncs the bonding curve creator with the Metaplex metadata creator if it exists"
],
"discriminator": [
138,
96,
174,
217,
48,
85,
197,
246
],
"accounts": [
{
"name": "mint"
},
{
"name": "metadata",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
109,
101,
116,
97,
100,
97,
116,
97
]
},
{
"kind": "const",
"value": [
11,
112,
101,
177,
227,
209,
124,
69,
56,
157,
82,
127,
107,
4,
195,
205,
88,
184,
108,
115,
26,
160,
253,
181,
73,
182,
209,
188,
3,
248,
41,
70
]
},
{
"kind": "account",
"path": "mint"
}
],
"program": {
"kind": "const",
"value": [
11,
112,
101,
177,
227,
209,
124,
69,
56,
157,
82,
127,
107,
4,
195,
205,
88,
184,
108,
115,
26,
160,
253,
181,
73,
182,
209,
188,
3,
248,
41,
70
]
}
}
},
{
"name": "bonding_curve",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
98,
111,
110,
100,
105,
110,
103,
45,
99,
117,
114,
118,
101
]
},
{
"kind": "account",
"path": "mint"
}
]
}
},
{
"name": "event_authority",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
95,
95,
101,
118,
101,
110,
116,
95,
97,
117,
116,
104,
111,
114,
105,
116,
121
]
}
]
}
},
{
"name": "program"
}
],
"args": []
},
{
"name": "set_params",
"docs": [
"Sets the global state parameters."
],
"discriminator": [
27,
234,
178,
52,
147,
2,
187,
141
],
"accounts": [
{
"name": "global",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
103,
108,
111,
98,
97,
108
]
}
]
}
},
{
"name": "authority",
"writable": true,
"signer": true,
"relations": [
"global"
]
},
{
"name": "event_authority",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
95,
95,
101,
118,
101,
110,
116,
95,
97,
117,
116,
104,
111,
114,
105,
116,
121
]
}
]
}
},
{
"name": "program"
}
],
"args": [
{
"name": "initial_virtual_token_reserves",
"type": "u64"
},
{
"name": "initial_virtual_sol_reserves",
"type": "u64"
},
{
"name": "initial_real_token_reserves",
"type": "u64"
},
{
"name": "token_total_supply",
"type": "u64"
},
{
"name": "fee_basis_points",
"type": "u64"
},
{
"name": "withdraw_authority",
"type": "pubkey"
},
{
"name": "enable_migrate",
"type": "bool"
},
{
"name": "pool_migration_fee",
"type": "u64"
},
{
"name": "creator_fee_basis_points",
"type": "u64"
},
{
"name": "set_creator_authority",
"type": "pubkey"
},
{
"name": "admin_set_creator_authority",
"type": "pubkey"
}
]
},
{
"name": "set_reserved_fee_recipients",
"discriminator": [
111,
172,
162,
232,
114,
89,
213,
142
],
"accounts": [
{
"name": "global",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
103,
108,
111,
98,
97,
108
]
}
]
}
},
{
"name": "authority",
"signer": true,
"relations": [
"global"
]
},
{
"name": "event_authority",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
95,
95,
101,
118,
101,
110,
116,
95,
97,
117,
116,
104,
111,
114,
105,
116,
121
]
}
]
}
},
{
"name": "program"
}
],
"args": [
{
"name": "whitelist_pda",
"type": "pubkey"
}
]
},
{
"name": "sync_user_volume_accumulator",
"discriminator": [
86,
31,
192,
87,
163,
87,
79,
238
],
"accounts": [
{
"name": "user"
},
{
"name": "global_volume_accumulator",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
103,
108,
111,
98,
97,
108,
95,
118,
111,
108,
117,
109,
101,
95,
97,
99,
99,
117,
109,
117,
108,
97,
116,
111,
114
]
}
]
}
},
{
"name": "user_volume_accumulator",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
117,
115,
101,
114,
95,
118,
111,
108,
117,
109,
101,
95,
97,
99,
99,
117,
109,
117,
108,
97,
116,
111,
114
]
},
{
"kind": "account",
"path": "user"
}
]
}
},
{
"name": "event_authority",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
95,
95,
101,
118,
101,
110,
116,
95,
97,
117,
116,
104,
111,
114,
105,
116,
121
]
}
]
}
},
{
"name": "program"
}
],
"args": []
},
{
"name": "toggle_cashback_enabled",
"discriminator": [
115,
103,
224,
255,
189,
89,
86,
195
],
"accounts": [
{
"name": "global",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
103,
108,
111,
98,
97,
108
]
}
]
}
},
{
"name": "authority",
"writable": true,
"signer": true,
"relations": [
"global"
]
},
{
"name": "event_authority",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
95,
95,
101,
118,
101,
110,
116,
95,
97,
117,
116,
104,
111,
114,
105,
116,
121
]
}
]
}
},
{
"name": "program"
}
],
"args": [
{
"name": "enabled",
"type": "bool"
}
]
},
{
"name": "toggle_create_v2",
"discriminator": [
28,
255,
230,
240,
172,
107,
203,
171
],
"accounts": [
{
"name": "global",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
103,
108,
111,
98,
97,
108
]
}
]
}
},
{
"name": "authority",
"writable": true,
"signer": true,
"relations": [
"global"
]
},
{
"name": "event_authority",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
95,
95,
101,
118,
101,
110,
116,
95,
97,
117,
116,
104,
111,
114,
105,
116,
121
]
}
]
}
},
{
"name": "program"
}
],
"args": [
{
"name": "enabled",
"type": "bool"
}
]
},
{
"name": "toggle_mayhem_mode",
"discriminator": [
1,
9,
111,
208,
100,
31,
255,
163
],
"accounts": [
{
"name": "global",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
103,
108,
111,
98,
97,
108
]
}
]
}
},
{
"name": "authority",
"writable": true,
"signer": true,
"relations": [
"global"
]
},
{
"name": "event_authority",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
95,
95,
101,
118,
101,
110,
116,
95,
97,
117,
116,
104,
111,
114,
105,
116,
121
]
}
]
}
},
{
"name": "program"
}
],
"args": [
{
"name": "enabled",
"type": "bool"
}
]
},
{
"name": "update_global_authority",
"discriminator": [
227,
181,
74,
196,
208,
21,
97,
213
],
"accounts": [
{
"name": "global",
"writable": true,
"pda": {
"seeds": [
{
"kind": "const",
"value": [
103,
108,
111,
98,
97,
108
]
}
]
}
},
{
"name": "authority",
"signer": true,
"relations": [
"global"
]
},
{
"name": "new_authority"
},
{
"name": "event_authority",
"pda": {
"seeds": [
{
"kind": "const",
"value": [
95,
95,
101,
118,
101,
110,
116,
95,
97,
117,
116,
104,
111,
114,
105,
116,
121
]
}
]
}
},
{
"name": "program"
}
],
"args": []
}
],
"accounts": [
{
"name": "BondingCurve",
"discriminator": [
23,
183,
248,
55,
96,
216,
172,
96
]
},
{
"name": "FeeConfig",
"discriminator": [
143,
52,
146,
187,
219,
123,
76,
155
]
},
{
"name": "Global",
"discriminator": [
167,
232,
232,
177,
200,
108,
114,
127
]
},
{
"name": "GlobalVolumeAccumulator",
"discriminator": [
202,
42,
246,
43,
142,
190,
30,
255
]
},
{
"name": "SharingConfig",
"discriminator": [
216,
74,
9,
0,
56,
140,
93,
75
]
},
{
"name": "UserVolumeAccumulator",
"discriminator": [
86,
255,
112,
14,
102,
53,
154,
250
]
}
],
"events": [
{
"name": "AdminSetCreatorEvent",
"discriminator": [
64,
69,
192,
104,
29,
30,
25,
107
]
},
{
"name": "AdminSetIdlAuthorityEvent",
"discriminator": [
245,
59,
70,
34,
75,
185,
109,
92
]
},
{
"name": "AdminUpdateTokenIncentivesEvent",
"discriminator": [
147,
250,
108,
120,
247,
29,
67,
222
]
},
{
"name": "ClaimCashbackEvent",
"discriminator": [
226,
214,
246,
33,
7,
242,
147,
229
]
},
{
"name": "ClaimTokenIncentivesEvent",
"discriminator": [
79,
172,
246,
49,
205,
91,
206,
232
]
},
{
"name": "CloseUserVolumeAccumulatorEvent",
"discriminator": [
146,
159,
189,
172,
146,
88,
56,
244
]
},
{
"name": "CollectCreatorFeeEvent",
"discriminator": [
122,
2,
127,
1,
14,
191,
12,
175
]
},
{
"name": "CompleteEvent",
"discriminator": [
95,
114,
97,
156,
212,
46,
152,
8
]
},
{
"name": "CompletePumpAmmMigrationEvent",
"discriminator": [
189,
233,
93,
185,
92,
148,
234,
148
]
},
{
"name": "CreateEvent",
"discriminator": [
27,
114,
169,
77,
222,
235,
99,
118
]
},
{
"name": "DistributeCreatorFeesEvent",
"discriminator": [
165,
55,
129,
112,
4,
179,
202,
40
]
},
{
"name": "ExtendAccountEvent",
"discriminator": [
97,
97,
215,
144,
93,
146,
22,
124
]
},
{
"name": "InitUserVolumeAccumulatorEvent",
"discriminator": [
134,
36,
13,
72,
232,
101,
130,
216
]
},
{
"name": "MigrateBondingCurveCreatorEvent",
"discriminator": [
155,
167,
104,
220,
213,
108,
243,
3
]
},
{
"name": "MinimumDistributableFeeEvent",
"discriminator": [
168,
216,
132,
239,
235,
182,
49,
52
]
},
{
"name": "ReservedFeeRecipientsEvent",
"discriminator": [
43,
188,
250,
18,
221,
75,
187,
95
]
},
{
"name": "SetCreatorEvent",
"discriminator": [
237,
52,
123,
37,
245,
251,
72,
210
]
},
{
"name": "SetMetaplexCreatorEvent",
"discriminator": [
142,
203,
6,
32,
127,
105,
191,
162
]
},
{
"name": "SetParamsEvent",
"discriminator": [
223,
195,
159,
246,
62,
48,
143,
131
]
},
{
"name": "SyncUserVolumeAccumulatorEvent",
"discriminator": [
197,
122,
167,
124,
116,
81,
91,
255
]
},
{
"name": "TradeEvent",
"discriminator": [
189,
219,
127,
211,
78,
230,
97,
238
]
},
{
"name": "UpdateGlobalAuthorityEvent",
"discriminator": [
182,
195,
137,
42,
35,
206,
207,
247
]
},
{
"name": "UpdateMayhemVirtualParamsEvent",
"discriminator": [
117,
123,
228,
182,
161,
168,
220,
214
]
}
],
"errors": [
{
"code": 6000,
"name": "NotAuthorized",
"msg": "The given account is not authorized to execute this instruction."
},
{
"code": 6001,
"name": "AlreadyInitialized",
"msg": "The program is already initialized."
},
{
"code": 6002,
"name": "TooMuchSolRequired",
"msg": "slippage: Too much SOL required to buy the given amount of tokens."
},
{
"code": 6003,
"name": "TooLittleSolReceived",
"msg": "slippage: Too little SOL received to sell the given amount of tokens."
},
{
"code": 6004,
"name": "MintDoesNotMatchBondingCurve",
"msg": "The mint does not match the bonding curve."
},
{
"code": 6005,
"name": "BondingCurveComplete",
"msg": "The bonding curve has completed and liquidity migrated to raydium."
},
{
"code": 6006,
"name": "BondingCurveNotComplete",
"msg": "The bonding curve has not completed."
},
{
"code": 6007,
"name": "NotInitialized",
"msg": "The program is not initialized."
},
{
"code": 6008,
"name": "WithdrawTooFrequent",
"msg": "Withdraw too frequent"
},
{
"code": 6009,
"name": "NewSizeShouldBeGreaterThanCurrentSize",
"msg": "new_size should be > current_size"
},
{
"code": 6010,
"name": "AccountTypeNotSupported",
"msg": "Account type not supported"
},
{
"code": 6011,
"name": "InitialRealTokenReservesShouldBeLessThanTokenTotalSupply",
"msg": "initial_real_token_reserves should be less than token_total_supply"
},
{
"code": 6012,
"name": "InitialVirtualTokenReservesShouldBeGreaterThanInitialRealTokenReserves",
"msg": "initial_virtual_token_reserves should be greater than initial_real_token_reserves"
},
{
"code": 6013,
"name": "FeeBasisPointsGreaterThanMaximum",
"msg": "fee_basis_points greater than maximum"
},
{
"code": 6014,
"name": "AllZerosWithdrawAuthority",
"msg": "Withdraw authority cannot be set to System Program ID"
},
{
"code": 6015,
"name": "PoolMigrationFeeShouldBeLessThanFinalRealSolReserves",
"msg": "pool_migration_fee should be less than final_real_sol_reserves"
},
{
"code": 6016,
"name": "PoolMigrationFeeShouldBeGreaterThanCreatorFeePlusMaxMigrateFees",
"msg": "pool_migration_fee should be greater than creator_fee + MAX_MIGRATE_FEES"
},
{
"code": 6017,
"name": "DisabledWithdraw",
"msg": "Migrate instruction is disabled"
},
{
"code": 6018,
"name": "DisabledMigrate",
"msg": "Migrate instruction is disabled"
},
{
"code": 6019,
"name": "InvalidCreator",
"msg": "Invalid creator pubkey"
},
{
"code": 6020,
"name": "BuyZeroAmount",
"msg": "Buy zero amount"
},
{
"code": 6021,
"name": "NotEnoughTokensToBuy",
"msg": "Not enough tokens to buy"
},
{
"code": 6022,
"name": "SellZeroAmount",
"msg": "Sell zero amount"
},
{
"code": 6023,
"name": "NotEnoughTokensToSell",
"msg": "Not enough tokens to sell"
},
{
"code": 6024,
"name": "Overflow",
"msg": "Overflow"
},
{
"code": 6025,
"name": "Truncation",
"msg": "Truncation"
},
{
"code": 6026,
"name": "DivisionByZero",
"msg": "Division by zero"
},
{
"code": 6027,
"name": "NotEnoughRemainingAccounts",
"msg": "Not enough remaining accounts"
},
{
"code": 6028,
"name": "AllFeeRecipientsShouldBeNonZero",
"msg": "All fee recipients should be non-zero"
},
{
"code": 6029,
"name": "UnsortedNotUniqueFeeRecipients",
"msg": "Unsorted or not unique fee recipients"
},
{
"code": 6030,
"name": "CreatorShouldNotBeZero",
"msg": "Creator should not be zero"
},
{
"code": 6031,
"name": "StartTimeInThePast"
},
{
"code": 6032,
"name": "EndTimeInThePast"
},
{
"code": 6033,
"name": "EndTimeBeforeStartTime"
},
{
"code": 6034,
"name": "TimeRangeTooLarge"
},
{
"code": 6035,
"name": "EndTimeBeforeCurrentDay"
},
{
"code": 6036,
"name": "SupplyUpdateForFinishedRange"
},
{
"code": 6037,
"name": "DayIndexAfterEndIndex"
},
{
"code": 6038,
"name": "DayInActiveRange"
},
{
"code": 6039,
"name": "InvalidIncentiveMint"
},
{
"code": 6040,
"name": "BuyNotEnoughSolToCoverRent",
"msg": "Buy: Not enough SOL to cover for rent exemption."
},
{
"code": 6041,
"name": "BuyNotEnoughSolToCoverFees",
"msg": "Buy: Not enough SOL to cover for fees."
},
{
"code": 6042,
"name": "BuySlippageBelowMinTokensOut",
"msg": "Slippage: Would buy less tokens than expected min_tokens_out"
},
{
"code": 6043,
"name": "NameTooLong"
},
{
"code": 6044,
"name": "SymbolTooLong"
},
{
"code": 6045,
"name": "UriTooLong"
},
{
"code": 6046,
"name": "CreateV2Disabled"
},
{
"code": 6047,
"name": "CpitializeMayhemFailed"
},
{
"code": 6048,
"name": "MayhemModeDisabled"
},
{
"code": 6049,
"name": "CreatorMigratedToSharingConfig",
"msg": "creator has been migrated to sharing config, use pump_fees::reset_fee_sharing_config instead"
},
{
"code": 6050,
"name": "UnableToDistributeCreatorVaultMigratedToSharingConfig",
"msg": "creator_vault has been migrated to sharing config, use pump:distribute_creator_fees instead"
},
{
"code": 6051,
"name": "SharingConfigNotActive",
"msg": "Sharing config is not active"
},
{
"code": 6052,
"name": "UnableToDistributeCreatorFeesToExecutableRecipient",
"msg": "The recipient account is executable, so it cannot receive lamports, remove it from the team first"
},
{
"code": 6053,
"name": "BondingCurveAndSharingConfigCreatorMismatch",
"msg": "Bonding curve creator does not match sharing config"
},
{
"code": 6054,
"name": "ShareholdersAndRemainingAccountsMismatch",
"msg": "Remaining accounts do not match shareholders, make sure to pass exactly the same pubkeys in the same order"
},
{
"code": 6055,
"name": "InvalidShareBps",
"msg": "Share bps must be greater than 0"
},
{
"code": 6056,
"name": "CashbackNotEnabled",
"msg": "Cashback is not enabled"
}
],
"types": [
{
"name": "AdminSetCreatorEvent",
"type": {
"kind": "struct",
"fields": [
{
"name": "timestamp",
"type": "i64"
},
{
"name": "admin_set_creator_authority",
"type": "pubkey"
},
{
"name": "mint",
"type": "pubkey"
},
{
"name": "bonding_curve",
"type": "pubkey"
},
{
"name": "old_creator",
"type": "pubkey"
},
{
"name": "new_creator",
"type": "pubkey"
}
]
}
},
{
"name": "AdminSetIdlAuthorityEvent",
"type": {
"kind": "struct",
"fields": [
{
"name": "idl_authority",
"type": "pubkey"
}
]
}
},
{
"name": "AdminUpdateTokenIncentivesEvent",
"type": {
"kind": "struct",
"fields": [
{
"name": "start_time",
"type": "i64"
},
{
"name": "end_time",
"type": "i64"
},
{
"name": "day_number",
"type": "u64"
},
{
"name": "token_supply_per_day",
"type": "u64"
},
{
"name": "mint",
"type": "pubkey"
},
{
"name": "seconds_in_a_day",
"type": "i64"
},
{
"name": "timestamp",
"type": "i64"
}
]
}
},
{
"name": "BondingCurve",
"type": {
"kind": "struct",
"fields": [
{
"name": "virtual_token_reserves",
"type": "u64"
},
{
"name": "virtual_sol_reserves",
"type": "u64"
},
{
"name": "real_token_reserves",
"type": "u64"
},
{
"name": "real_sol_reserves",
"type": "u64"
},
{
"name": "token_total_supply",
"type": "u64"
},
{
"name": "complete",
"type": "bool"
},
{
"name": "creator",
"type": "pubkey"
},
{
"name": "is_mayhem_mode",
"type": "bool"
},
{
"name": "is_cashback_coin",
"type": "bool"
}
]
}
},
{
"name": "ClaimCashbackEvent",
"type": {
"kind": "struct",
"fields": [
{
"name": "user",
"type": "pubkey"
},
{
"name": "amount",
"type": "u64"
},
{
"name": "timestamp",
"type": "i64"
},
{
"name": "total_claimed",
"type": "u64"
},
{
"name": "total_cashback_earned",
"type": "u64"
}
]
}
},
{
"name": "ClaimTokenIncentivesEvent",
"type": {
"kind": "struct",
"fields": [
{
"name": "user",
"type": "pubkey"
},
{
"name": "mint",
"type": "pubkey"
},
{
"name": "amount",
"type": "u64"
},
{
"name": "timestamp",
"type": "i64"
},
{
"name": "total_claimed_tokens",
"type": "u64"
},
{
"name": "current_sol_volume",
"type": "u64"
}
]
}
},
{
"name": "CloseUserVolumeAccumulatorEvent",
"type": {
"kind": "struct",
"fields": [
{
"name": "user",
"type": "pubkey"
},
{
"name": "timestamp",
"type": "i64"
},
{
"name": "total_unclaimed_tokens",
"type": "u64"
},
{
"name": "total_claimed_tokens",
"type": "u64"
},
{
"name": "current_sol_volume",
"type": "u64"
},
{
"name": "last_update_timestamp",
"type": "i64"
}
]
}
},
{
"name": "CollectCreatorFeeEvent",
"type": {
"kind": "struct",
"fields": [
{
"name": "timestamp",
"type": "i64"
},
{
"name": "creator",
"type": "pubkey"
},
{
"name": "creator_fee",
"type": "u64"
}
]
}
},
{
"name": "CompleteEvent",
"type": {
"kind": "struct",
"fields": [
{
"name": "user",
"type": "pubkey"
},
{
"name": "mint",
"type": "pubkey"
},
{
"name": "bonding_curve",
"type": "pubkey"
},
{
"name": "timestamp",
"type": "i64"
}
]
}
},
{
"name": "CompletePumpAmmMigrationEvent",
"type": {
"kind": "struct",
"fields": [
{
"name": "user",
"type": "pubkey"
},
{
"name": "mint",
"type": "pubkey"
},
{
"name": "mint_amount",
"type": "u64"
},
{
"name": "sol_amount",
"type": "u64"
},
{
"name": "pool_migration_fee",
"type": "u64"
},
{
"name": "bonding_curve",
"type": "pubkey"
},
{
"name": "timestamp",
"type": "i64"
},
{
"name": "pool",
"type": "pubkey"
}
]
}
},
{
"name": "ConfigStatus",
"type": {
"kind": "enum",
"variants": [
{
"name": "Paused"
},
{
"name": "Active"
}
]
}
},
{
"name": "CreateEvent",
"type": {
"kind": "struct",
"fields": [
{
"name": "name",
"type": "string"
},
{
"name": "symbol",
"type": "string"
},
{
"name": "uri",
"type": "string"
},
{
"name": "mint",
"type": "pubkey"
},
{
"name": "bonding_curve",
"type": "pubkey"
},
{
"name": "user",
"type": "pubkey"
},
{
"name": "creator",
"type": "pubkey"
},
{
"name": "timestamp",
"type": "i64"
},
{
"name": "virtual_token_reserves",
"type": "u64"
},
{
"name": "virtual_sol_reserves",
"type": "u64"
},
{
"name": "real_token_reserves",
"type": "u64"
},
{
"name": "token_total_supply",
"type": "u64"
},
{
"name": "token_program",
"type": "pubkey"
},
{
"name": "is_mayhem_mode",
"type": "bool"
},
{
"name": "is_cashback_enabled",
"type": "bool"
}
]
}
},
{
"name": "DistributeCreatorFeesEvent",
"type": {
"kind": "struct",
"fields": [
{
"name": "timestamp",
"type": "i64"
},
{
"name": "mint",
"type": "pubkey"
},
{
"name": "bonding_curve",
"type": "pubkey"
},
{
"name": "sharing_config",
"type": "pubkey"
},
{
"name": "admin",
"type": "pubkey"
},
{
"name": "shareholders",
"type": {
"vec": {
"defined": {
"name": "Shareholder"
}
}
}
},
{
"name": "distributed",
"type": "u64"
}
]
}
},
{
"name": "ExtendAccountEvent",
"type": {
"kind": "struct",
"fields": [
{
"name": "account",
"type": "pubkey"
},
{
"name": "user",
"type": "pubkey"
},
{
"name": "current_size",
"type": "u64"
},
{
"name": "new_size",
"type": "u64"
},
{
"name": "timestamp",
"type": "i64"
}
]
}
},
{
"name": "FeeConfig",
"type": {
"kind": "struct",
"fields": [
{
"name": "bump",
"type": "u8"
},
{
"name": "admin",
"type": "pubkey"
},
{
"name": "flat_fees",
"type": {
"defined": {
"name": "Fees"
}
}
},
{
"name": "fee_tiers",
"type": {
"vec": {
"defined": {
"name": "FeeTier"
}
}
}
}
]
}
},
{
"name": "FeeTier",
"type": {
"kind": "struct",
"fields": [
{
"name": "market_cap_lamports_threshold",
"type": "u128"
},
{
"name": "fees",
"type": {
"defined": {
"name": "Fees"
}
}
}
]
}
},
{
"name": "Fees",
"type": {
"kind": "struct",
"fields": [
{
"name": "lp_fee_bps",
"type": "u64"
},
{
"name": "protocol_fee_bps",
"type": "u64"
},
{
"name": "creator_fee_bps",
"type": "u64"
}
]
}
},
{
"name": "Global",
"type": {
"kind": "struct",
"fields": [
{
"name": "initialized",
"docs": [
"Unused"
],
"type": "bool"
},
{
"name": "authority",
"type": "pubkey"
},
{
"name": "fee_recipient",
"type": "pubkey"
},
{
"name": "initial_virtual_token_reserves",
"type": "u64"
},
{
"name": "initial_virtual_sol_reserves",
"type": "u64"
},
{
"name": "initial_real_token_reserves",
"type": "u64"
},
{
"name": "token_total_supply",
"type": "u64"
},
{
"name": "fee_basis_points",
"type": "u64"
},
{
"name": "withdraw_authority",
"type": "pubkey"
},
{
"name": "enable_migrate",
"docs": [
"Unused"
],
"type": "bool"
},
{
"name": "pool_migration_fee",
"type": "u64"
},
{
"name": "creator_fee_basis_points",
"type": "u64"
},
{
"name": "fee_recipients",
"type": {
"array": [
"pubkey",
7
]
}
},
{
"name": "set_creator_authority",
"type": "pubkey"
},
{
"name": "admin_set_creator_authority",
"type": "pubkey"
},
{
"name": "create_v2_enabled",
"type": "bool"
},
{
"name": "whitelist_pda",
"type": "pubkey"
},
{
"name": "reserved_fee_recipient",
"type": "pubkey"
},
{
"name": "mayhem_mode_enabled",
"type": "bool"
},
{
"name": "reserved_fee_recipients",
"type": {
"array": [
"pubkey",
7
]
}
},
{
"name": "is_cashback_enabled",
"type": "bool"
}
]
}
},
{
"name": "GlobalVolumeAccumulator",
"type": {
"kind": "struct",
"fields": [
{
"name": "start_time",
"type": "i64"
},
{
"name": "end_time",
"type": "i64"
},
{
"name": "seconds_in_a_day",
"type": "i64"
},
{
"name": "mint",
"type": "pubkey"
},
{
"name": "total_token_supply",
"type": {
"array": [
"u64",
30
]
}
},
{
"name": "sol_volumes",
"type": {
"array": [
"u64",
30
]
}
}
]
}
},
{
"name": "InitUserVolumeAccumulatorEvent",
"type": {
"kind": "struct",
"fields": [
{
"name": "payer",
"type": "pubkey"
},
{
"name": "user",
"type": "pubkey"
},
{
"name": "timestamp",
"type": "i64"
}
]
}
},
{
"name": "MigrateBondingCurveCreatorEvent",
"type": {
"kind": "struct",
"fields": [
{
"name": "timestamp",
"type": "i64"
},
{
"name": "mint",
"type": "pubkey"
},
{
gitextract_dpl0nx5y/
├── .gitignore
├── README.md
├── docs/
│ ├── BREAKING_FEE_RECIPIENT.md
│ ├── FAQ.md
│ ├── FEE_PROGRAM_README.md
│ ├── PUMP_CASHBACK_README.md
│ ├── PUMP_CREATOR_FEE_README.md
│ ├── PUMP_PROGRAM_README.md
│ ├── PUMP_SWAP_CREATOR_FEE_README.md
│ ├── PUMP_SWAP_README.md
│ └── PUMP_SWAP_SDK_README.md
└── idl/
├── pump.json
├── pump.ts
├── pump_amm.json
├── pump_amm.ts
├── pump_fees.json
└── pump_fees.ts
SYMBOL INDEX (3 symbols across 3 files)
FILE: idl/pump.ts
type Pump (line 7) | interface Pump {
FILE: idl/pump_amm.ts
type PumpAmm (line 7) | interface PumpAmm {
FILE: idl/pump_fees.ts
type PumpFees (line 7) | type PumpFees = {
Condensed preview — 17 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (823K chars).
[
{
"path": ".gitignore",
"chars": 6,
"preview": ".idea\n"
},
{
"path": "README.md",
"chars": 9322,
"preview": "# pump-public-docs\n\n[Pump fee program docs](docs/FEE_PROGRAM_README.md)\n\n## Other documentation\n\n- [Pump Program](docs/P"
},
{
"path": "docs/BREAKING_FEE_RECIPIENT.md",
"chars": 3370,
"preview": "# Program Upgrade\n\nHi. We will be doing a breaking program upgrade on April 28th, 16:00 UTC, to both the pump bonding cu"
},
{
"path": "docs/FAQ.md",
"chars": 1933,
"preview": "# Frequently Asked Questions\n\n## How to optimize buy / sell CU limit?\n\nEach buy / sell instruction used CUs depend on al"
},
{
"path": "docs/FEE_PROGRAM_README.md",
"chars": 5043,
"preview": "Hello. We pushed again the update to both Pump and PumpSwap programs which adds the 2 new additional accounts on buy / s"
},
{
"path": "docs/PUMP_CASHBACK_README.md",
"chars": 5061,
"preview": "## Overview\n\nCashback Rewards allows token creators to create coins with \"cashback\" enabled which redirects the creator "
},
{
"path": "docs/PUMP_CREATOR_FEE_README.md",
"chars": 6350,
"preview": "Pump program will have a breaking upgrade to add support for coin creator fees. Each swap on a not-yet-completed\nbonding"
},
{
"path": "docs/PUMP_PROGRAM_README.md",
"chars": 8339,
"preview": "# Pump program\n\nPump program allows creating SPL coins that are instantly tradeable on a bonding curve without having to"
},
{
"path": "docs/PUMP_SWAP_CREATOR_FEE_README.md",
"chars": 4725,
"preview": "PumpSwap (Pump AMM) program will have a breaking upgrade to add support for coin creator fees. Each swap on canonical\nPu"
},
{
"path": "docs/PUMP_SWAP_README.md",
"chars": 12363,
"preview": "# PumpSwap (Pump AMM) program\n\nPumpSwap program is a constant-product AMM deployed at address `pAMMBay6oceH9fJKBRHGP5D4b"
},
{
"path": "docs/PUMP_SWAP_SDK_README.md",
"chars": 3110,
"preview": "# Pump SDK\n\nThe SDK is structured as follows:\n- `PumpAmmSdk` is the high level SDK, useful for UI integrations.\n- `PumpA"
},
{
"path": "idl/pump.json",
"chars": 149355,
"preview": "{\n \"address\": \"6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P\",\n \"metadata\": {\n \"name\": \"pump\",\n \"version\": \"0.1.0\""
},
{
"path": "idl/pump.ts",
"chars": 137180,
"preview": "/**\n * Program IDL in camelCase format in order to be used in JS/TS.\n *\n * Note that this is only a type helper and is n"
},
{
"path": "idl/pump_amm.json",
"chars": 130535,
"preview": "{\n \"address\": \"pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA\",\n \"metadata\": {\n \"name\": \"pump_amm\",\n \"version\": \"0."
},
{
"path": "idl/pump_amm.ts",
"chars": 120907,
"preview": "/**\n * Program IDL in camelCase format in order to be used in JS/TS.\n *\n * Note that this is only a type helper and is n"
},
{
"path": "idl/pump_fees.json",
"chars": 81227,
"preview": "{\n \"address\": \"pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ\",\n \"metadata\": {\n \"name\": \"pump_fees\",\n \"version\": \"0"
},
{
"path": "idl/pump_fees.ts",
"chars": 81105,
"preview": "/**\n * Program IDL in camelCase format in order to be used in JS/TS.\n *\n * Note that this is only a type helper and is n"
}
]
About this extraction
This page contains the full source code of the pump-fun/pump-public-docs GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 17 files (742.1 KB), approximately 169.4k tokens, and a symbol index with 3 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.