@pump-fun/pump-swap-sdk
Version:
Official SDK for interacting with Pump Swap AMM protocol on Solana
1,412 lines (1,411 loc) • 209 kB
TypeScript
/**
* Program IDL in camelCase format in order to be used in JS/TS.
*
* Note that this is only a type helper and is not the actual IDL. The original
* IDL can be found at `target/idl/pump_amm.json`.
*/
type PumpAmm = {
"address": "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA";
"metadata": {
"name": "pumpAmm";
"version": "0.1.0";
"spec": "0.1.0";
"description": "Created with Anchor";
};
"instructions": [
{
"name": "adminSetCoinCreator";
"docs": [
"Overrides the coin creator for a canonical pump pool"
];
"discriminator": [
242,
40,
117,
145,
73,
96,
105,
104
];
"accounts": [
{
"name": "adminSetCoinCreatorAuthority";
"signer": true;
"relations": [
"globalConfig"
];
},
{
"name": "globalConfig";
},
{
"name": "pool";
"writable": true;
},
{
"name": "eventAuthority";
"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": "coinCreator";
"type": "pubkey";
}
];
},
{
"name": "adminUpdateTokenIncentives";
"discriminator": [
209,
11,
115,
87,
213,
23,
124,
204
];
"accounts": [
{
"name": "admin";
"writable": true;
"signer": true;
"relations": [
"globalConfig"
];
},
{
"name": "globalConfig";
"pda": {
"seeds": [
{
"kind": "const";
"value": [
103,
108,
111,
98,
97,
108,
95,
99,
111,
110,
102,
105,
103
];
}
];
};
},
{
"name": "globalVolumeAccumulator";
"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": "globalIncentiveTokenAccount";
"writable": true;
"pda": {
"seeds": [
{
"kind": "account";
"path": "globalVolumeAccumulator";
},
{
"kind": "account";
"path": "tokenProgram";
},
{
"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": "associatedTokenProgram";
"address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
},
{
"name": "systemProgram";
"address": "11111111111111111111111111111111";
},
{
"name": "tokenProgram";
},
{
"name": "eventAuthority";
"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": "startTime";
"type": "i64";
},
{
"name": "endTime";
"type": "i64";
},
{
"name": "secondsInADay";
"type": "i64";
},
{
"name": "dayNumber";
"type": "u64";
},
{
"name": "tokenSupplyPerDay";
"type": "u64";
}
];
},
{
"name": "buy";
"docs": [
"For cashback coins, optionally pass user_volume_accumulator_wsol_ata as remaining_accounts[0].",
"If provided and valid, the ATA will be initialized if needed."
];
"discriminator": [
102,
6,
61,
18,
1,
218,
235,
234
];
"accounts": [
{
"name": "pool";
"writable": true;
},
{
"name": "user";
"writable": true;
"signer": true;
},
{
"name": "globalConfig";
},
{
"name": "baseMint";
"relations": [
"pool"
];
},
{
"name": "quoteMint";
"relations": [
"pool"
];
},
{
"name": "userBaseTokenAccount";
"writable": true;
},
{
"name": "userQuoteTokenAccount";
"writable": true;
},
{
"name": "poolBaseTokenAccount";
"writable": true;
"relations": [
"pool"
];
},
{
"name": "poolQuoteTokenAccount";
"writable": true;
"relations": [
"pool"
];
},
{
"name": "protocolFeeRecipient";
},
{
"name": "protocolFeeRecipientTokenAccount";
"writable": true;
"pda": {
"seeds": [
{
"kind": "account";
"path": "protocolFeeRecipient";
},
{
"kind": "account";
"path": "quoteTokenProgram";
},
{
"kind": "account";
"path": "quoteMint";
}
];
"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": "baseTokenProgram";
},
{
"name": "quoteTokenProgram";
},
{
"name": "systemProgram";
"address": "11111111111111111111111111111111";
},
{
"name": "associatedTokenProgram";
"address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
},
{
"name": "eventAuthority";
"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": "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA";
},
{
"name": "coinCreatorVaultAta";
"writable": true;
"pda": {
"seeds": [
{
"kind": "account";
"path": "coinCreatorVaultAuthority";
},
{
"kind": "account";
"path": "quoteTokenProgram";
},
{
"kind": "account";
"path": "quoteMint";
}
];
"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": "coinCreatorVaultAuthority";
"pda": {
"seeds": [
{
"kind": "const";
"value": [
99,
114,
101,
97,
116,
111,
114,
95,
118,
97,
117,
108,
116
];
},
{
"kind": "account";
"path": "pool.coin_creator";
"account": "pool";
}
];
};
},
{
"name": "globalVolumeAccumulator";
"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": "userVolumeAccumulator";
"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": "feeConfig";
"pda": {
"seeds": [
{
"kind": "const";
"value": [
102,
101,
101,
95,
99,
111,
110,
102,
105,
103
];
},
{
"kind": "const";
"value": [
12,
20,
222,
252,
130,
94,
198,
118,
148,
37,
8,
24,
187,
101,
64,
101,
244,
41,
141,
49,
86,
213,
113,
180,
212,
248,
9,
12,
24,
233,
168,
99
];
}
];
"program": {
"kind": "account";
"path": "feeProgram";
};
};
},
{
"name": "feeProgram";
"address": "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ";
}
];
"args": [
{
"name": "baseAmountOut";
"type": "u64";
},
{
"name": "maxQuoteAmountIn";
"type": "u64";
},
{
"name": "trackVolume";
"type": {
"defined": {
"name": "optionBool";
};
};
}
];
},
{
"name": "buyExactQuoteIn";
"docs": [
"Given a budget of spendable_quote_in, buy at least min_base_amount_out",
"Fees will be deducted from spendable_quote_in",
"",
"f(quote) = tokens, where tokens >= min_base_amount_out",
"",
"Make sure the payer has enough SOL to cover creation of the following accounts (unless already created):",
"- protocol_fee_recipient_token_account: rent.minimum_balance(TokenAccount::LEN)",
"- coin_creator_vault_ata: rent.minimum_balance(TokenAccount::LEN)",
"- user_volume_accumulator: rent.minimum_balance(UserVolumeAccumulator::LEN)",
"",
"For cashback coins, optionally pass user_volume_accumulator_wsol_ata as remaining_accounts[0].",
"If provided and valid, the ATA will be initialized if needed."
];
"discriminator": [
198,
46,
21,
82,
180,
217,
232,
112
];
"accounts": [
{
"name": "pool";
"writable": true;
},
{
"name": "user";
"writable": true;
"signer": true;
},
{
"name": "globalConfig";
},
{
"name": "baseMint";
"relations": [
"pool"
];
},
{
"name": "quoteMint";
"relations": [
"pool"
];
},
{
"name": "userBaseTokenAccount";
"writable": true;
},
{
"name": "userQuoteTokenAccount";
"writable": true;
},
{
"name": "poolBaseTokenAccount";
"writable": true;
"relations": [
"pool"
];
},
{
"name": "poolQuoteTokenAccount";
"writable": true;
"relations": [
"pool"
];
},
{
"name": "protocolFeeRecipient";
},
{
"name": "protocolFeeRecipientTokenAccount";
"writable": true;
"pda": {
"seeds": [
{
"kind": "account";
"path": "protocolFeeRecipient";
},
{
"kind": "account";
"path": "quoteTokenProgram";
},
{
"kind": "account";
"path": "quoteMint";
}
];
"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": "baseTokenProgram";
},
{
"name": "quoteTokenProgram";
},
{
"name": "systemProgram";
"address": "11111111111111111111111111111111";
},
{
"name": "associatedTokenProgram";
"address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
},
{
"name": "eventAuthority";
"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": "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA";
},
{
"name": "coinCreatorVaultAta";
"writable": true;
"pda": {
"seeds": [
{
"kind": "account";
"path": "coinCreatorVaultAuthority";
},
{
"kind": "account";
"path": "quoteTokenProgram";
},
{
"kind": "account";
"path": "quoteMint";
}
];
"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": "coinCreatorVaultAuthority";
"pda": {
"seeds": [
{
"kind": "const";
"value": [
99,
114,
101,
97,
116,
111,
114,
95,
118,
97,
117,
108,
116
];
},
{
"kind": "account";
"path": "pool.coin_creator";
"account": "pool";
}
];
};
},
{
"name": "globalVolumeAccumulator";
"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": "userVolumeAccumulator";
"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": "feeConfig";
"pda": {
"seeds": [
{
"kind": "const";
"value": [
102,
101,
101,
95,
99,
111,
110,
102,
105,
103
];
},
{
"kind": "const";
"value": [
12,
20,
222,
252,
130,
94,
198,
118,
148,
37,
8,
24,
187,
101,
64,
101,
244,
41,
141,
49,
86,
213,
113,
180,
212,
248,
9,
12,
24,
233,
168,
99
];
}
];
"program": {
"kind": "account";
"path": "feeProgram";
};
};
},
{
"name": "feeProgram";
"address": "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ";
}
];
"args": [
{
"name": "spendableQuoteIn";
"type": "u64";
},
{
"name": "minBaseAmountOut";
"type": "u64";
},
{
"name": "trackVolume";
"type": {
"defined": {
"name": "optionBool";
};
};
}
];
},
{
"name": "claimCashback";
"discriminator": [
37,
58,
35,
126,
190,
53,
228,
197
];
"accounts": [
{
"name": "user";
"writable": true;
},
{
"name": "userVolumeAccumulator";
"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": "quoteMint";
},
{
"name": "quoteTokenProgram";
},
{
"name": "userVolumeAccumulatorWsolTokenAccount";
"writable": true;
"pda": {
"seeds": [
{
"kind": "account";
"path": "userVolumeAccumulator";
},
{
"kind": "account";
"path": "quoteTokenProgram";
},
{
"kind": "account";
"path": "quoteMint";
}
];
"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": "userWsolTokenAccount";
"writable": true;
"pda": {
"seeds": [
{
"kind": "account";
"path": "user";
},
{
"kind": "account";
"path": "quoteTokenProgram";
},
{
"kind": "account";
"path": "quoteMint";
}
];
"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": "systemProgram";
"address": "11111111111111111111111111111111";
},
{
"name": "eventAuthority";
"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": "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA";
}
];
"args": [];
},
{
"name": "claimTokenIncentives";
"discriminator": [
16,
4,
71,
28,
204,
1,
40,
27
];
"accounts": [
{
"name": "user";
},
{
"name": "userAta";
"writable": true;
"pda": {
"seeds": [
{
"kind": "account";
"path": "user";
},
{
"kind": "account";
"path": "tokenProgram";
},
{
"kind": "account";
"path": "mint";
}
];
"program": {
"kind": "const";
"value": [
140,
151,
37,
143,
78,
36,
137,
241,
187,