UNPKG

@pump-fun/pump-swap-sdk

Version:

Official SDK for interacting with Pump Swap AMM protocol on Solana

2,380 lines 90.6 kB
/** * 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`. */ export 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", "discriminator": [ 102, 6, 61, 18, 1, 218, 235, 234 ], "accounts": [ { "name": "pool" }, { "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" }, { "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", "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": "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" } ] } } ], "args": [ { "name": "baseAmountOut", "type": "u64" }, { "name": "maxQuoteAmountIn", "type": "u64" }, { "name": "trackVolume", "type": { "defined": { "name": "optionBool" } } } ] }, { "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, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216, 219, 233, 248, 89 ] } } }, { "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": "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": "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": "mint", "relations": [ "globalVolumeAccumulator" ] }, { "name": "tokenProgram" }, { "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" }, { "name": "payer", "writable": true, "signer": true } ], "args": [] }, { "name": "closeUserVolumeAccumulator", "discriminator": [ 249, 69, 164, 218, 150, 103, 84, 138 ], "accounts": [ { "name": "user", "writable": true, "signer": 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": "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": "collectCoinCreatorFee", "discriminator": [ 160, 57, 89, 42, 181, 139, 43, 66 ], "accounts": [ { "name": "quoteMint" }, { "name": "quoteTokenProgram" }, { "name": "coinCreator" }, { "name": "coinCreatorVaultAuthority", "pda": { "seeds": [ { "kind": "const", "value": [ 99, 114, 101, 97, 116, 111, 114, 95, 118, 97, 117, 108, 116 ] }, { "kind": "account", "path": "coinCreator" } ] } }, { "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": "coinCreatorTokenAccount", "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": "createConfig", "discriminator": [ 201, 207, 243, 114, 75, 111, 47, 189 ], "accounts": [ { "name": "admin", "writable": true, "signer": true, "address": "8LWu7QM2dGR1G8nKDHthckea57bkCzXyBTAKPJUBDHo8" }, { "name": "globalConfig", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 103, 108, 111, 98, 97, 108, 95, 99, 111, 110, 102, 105, 103 ] } ] } }, { "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" } ], "args": [ { "name": "lpFeeBasisPoints", "type": "u64" }, { "name": "protocolFeeBasisPoints", "type": "u64" }, { "name": "protocolFeeRecipients", "type": { "array": [ "pubkey", 8 ] } }, { "name": "coinCreatorFeeBasisPoints", "type": "u64" }, { "name": "adminSetCoinCreatorAuthority", "type": "pubkey" } ] }, { "name": "createPool", "discriminator": [ 233, 146, 209, 142, 207, 104, 64, 188 ], "accounts": [ { "name": "pool", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 112, 111, 111, 108 ] }, { "kind": "arg", "path": "index" }, { "kind": "account", "path": "creator" }, { "kind": "account", "path": "baseMint" }, { "kind": "account", "path": "quoteMint" } ] } }, { "name": "globalConfig" }, { "name": "creator", "writable": true, "signer": true }, { "name": "baseMint" }, { "name": "quoteMint" }, { "name": "lpMint", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 112, 111, 111, 108, 95, 108, 112, 95, 109, 105, 110, 116 ] }, { "kind": "account", "path": "pool" } ] } }, { "name": "userBaseTokenAccount", "writable": true }, { "name": "userQuoteTokenAccount", "writable": true }, { "name": "userPoolTokenAccount", "writable": true, "pda": { "seeds": [ { "kind": "account", "path": "creator" }, { "kind": "account", "path": "token2022Program" }, { "kind": "account", "path": "lpMint" } ], "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": "poolBaseTokenAccount", "writable": true, "pda": { "seeds": [ { "kind": "account", "path": "pool" }, { "kind": "account", "path": "baseTokenProgram" }, { "kind": "account", "path": "baseMint" } ], "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": "poolQuoteTokenAccount", "writable": true, "pda": { "seeds": [ { "kind": "account", "path": "pool" }, { "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": "token2022Program", "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" }, { "name": "baseTokenProgram" }, { "name": "quoteTokenProgram" }, { "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" } ], "args": [ { "name": "index", "type": "u16" }, { "name": "baseAmountIn", "type": "u64" }, { "name": "quoteAmountIn", "type": "u64" }, { "name": "coinCreator", "type": "pubkey" } ] }, { "name": "deposit", "discriminator": [ 242, 35, 198, 137, 82, 225, 242, 182 ], "accounts": [ { "name": "pool", "writable": true }, { "name": "globalConfig" }, { "name": "user", "signer": true }, { "name": "baseMint", "relations": [ "pool" ] }, { "name": "quoteMint", "relations": [ "pool" ] }, { "name": "lpMint", "writable": true, "relations": [ "pool" ] }, { "name": "userBaseTokenAccount", "writable": true }, { "name": "userQuoteTokenAccount", "writable": true }, { "name": "userPoolTokenAccount", "writable": true }, { "name": "poolBaseTokenAccount", "writable": true, "relations": [ "pool" ] }, { "name": "poolQuoteTokenAccount", "writable": true, "relations": [ "pool" ] }, { "name": "tokenProgram", "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" }, { "name": "token2022Program", "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" }, { "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": "lpTokenAmountOut", "type": "u64" }, { "name": "maxBaseAmountIn", "type": "u64" }, { "name": "maxQuoteAmountIn", "type": "u64" } ] }, { "name": "disable", "discriminator": [ 185, 173, 187, 90, 216, 15, 238, 233 ], "accounts": [ { "name": "admin", "signer": true, "relations": [ "globalConfig" ] }, { "name": "globalConfig", "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": "disableCreatePool", "type": "bool" }, { "name": "disableDeposit", "type": "bool" }, { "name": "disableWithdraw", "type": "bool" }, { "name": "disableBuy", "type": "bool" }, { "name": "disableSell", "type": "bool" } ] }, { "name": "extendAccount", "discriminator": [ 234, 102, 194, 203, 150, 72, 62, 229 ], "accounts": [ { "name": "account", "writable": true }, { "name": "user", "signer": true }, { "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" } ], "args": [] }, { "name": "initUserVolumeAccumulator", "discriminator": [ 94, 6, 202, 115, 255, 96, 232, 183 ], "accounts": [ { "name": "payer", "writable": true, "signer": true }, { "name": "user" }, { "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": "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" } ], "args": [] }, { "name": "sell", "discriminator": [ 51, 230, 133, 164, 1, 127, 131, 173 ], "accounts": [ { "name": "pool" }, { "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" }, { "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" } ] } } ], "args": [ { "name": "baseAmountIn", "type": "u64" }, { "name": "minQuoteAmountOut", "type": "u64" } ] }, { "name": "setCoinCreator", "docs": [ "Sets Pool::coin_creator from Metaplex metadata creator or BondingCurve::creator" ], "discriminator": [ 210, 149, 128, 45, 188, 58, 78, 175 ], "accounts": [ { "name": "pool", "writable": true }, { "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": "pool.base_mint", "account": "pool" } ], "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": "bondingCurve", "pda": { "seeds": [ { "kind": "const", "value": [ 98, 111, 110, 100, 105, 110, 103, 45, 99, 117, 114, 118, 101 ] }, { "kind": "account", "path": "pool.base_mint", "account": "pool" } ], "program": { "kind": "const", "value": [ 1, 86, 224, 246, 147,