diff --git a/src/IDL/pump-fun.json b/src/IDL/pump-fun.json index 12fe959..9977ae3 100644 --- a/src/IDL/pump-fun.json +++ b/src/IDL/pump-fun.json @@ -3,17 +3,35 @@ "metadata": { "name": "pump", "version": "0.1.0", - "spec": "0.1.0" + "spec": "0.1.0", + "description": "Created with Anchor" }, "instructions": [ { - "name": "initialize", - "discriminator": [175, 175, 109, 31, 13, 152, 155, 237], - "docs": ["Creates the global state."], + "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", - "writable": true, "pda": { "seeds": [ { @@ -31,25 +49,100 @@ } }, { - "name": "user", + "name": "mint" + }, + { + "name": "bonding_curve", "writable": true, - "signer": true + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 98, + 111, + 110, + 100, + 105, + 110, + 103, + 45, + 99, + 117, + 114, + 118, + 101 + ] + }, + { + "kind": "account", + "path": "mint" + } + ] + } }, { - "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": [] + "args": [ + { + "name": "creator", + "type": "pubkey" + } + ] }, { - "name": "setParams", - "discriminator": [165, 31, 134, 53, 189, 180, 130, 255], - "docs": ["Sets the global state parameters."], + "name": "admin_set_idl_authority", + "discriminator": [ + 8, + 217, + 96, + 231, + 144, + 104, + 192, + 5 + ], "accounts": [ + { + "name": "authority", + "signer": true, + "relations": [ + "global" + ] + }, { "name": "global", - "writable": true, "pda": { "seeds": [ { @@ -67,72 +160,34 @@ } }, { - "name": "user", - "writable": true, - "signer": true + "name": "idl_account", + "writable": true }, { "name": "system_program", "address": "11111111111111111111111111111111" }, { - "name": "event_authority", - "address": "Ce6TQqeHC9p8KetsN6JsjHK7UTZk7nasjjnr7XxXp9F1" - }, - { - "name": "program", - "address": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P" - } - ], - "args": [ - { - "name": "feeRecipient", - "type": "pubkey" - }, - { - "name": "initialVirtualTokenReserves", - "type": "u64" - }, - { - "name": "initialVirtualSolReserves", - "type": "u64" - }, - { - "name": "initialRealTokenReserves", - "type": "u64" - }, - { - "name": "tokenTotalSupply", - "type": "u64" - }, - { - "name": "feeBasisPoints", - "type": "u64" - } - ] - }, - { - "name": "create", - "discriminator": [24, 30, 200, 40, 5, 28, 7, 119], - "docs": ["Creates a new coin and bonding curve."], - "accounts": [ - { - "name": "mint", - "writable": true, - "signer": true + "name": "program_signer", + "pda": { + "seeds": [] + } }, { - "name": "mint_authority", + "name": "event_authority", "pda": { "seeds": [ { "kind": "const", "value": [ - 109, - 105, + 95, + 95, + 101, + 118, + 101, 110, 116, - 45, + 95, 97, 117, 116, @@ -148,43 +203,58 @@ } }, { - "name": "bonding_curve", + "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": [ - 98, - 111, - 110, - 100, - 105, - 110, 103, - 45, - 99, - 117, - 114, - 118, - 101 + 108, + 111, + 98, + 97, + 108 ] - }, - { - "kind": "account", - "path": "mint" } ] } }, { - "name": "associated_bonding_curve", + "name": "global_volume_accumulator", "writable": true, - "signer": false - }, - { - "name": "global", - "writable": false, "pda": { "seeds": [ { @@ -195,74 +265,173 @@ 111, 98, 97, - 108 + 108, + 95, + 118, + 111, + 108, + 117, + 109, + 101, + 95, + 97, + 99, + 99, + 117, + 109, + 117, + 108, + 97, + 116, + 111, + 114 ] } ] } }, { - "name": "mpl_token_metadata", - "address": "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s" + "name": "mint" }, { - "name": "metadata", + "name": "global_incentive_token_account", "writable": true, - "signer": false + "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", - "isMut": true, - "isSigner": true + "name": "associated_token_program", + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" }, { "name": "system_program", "address": "11111111111111111111111111111111" }, { - "name": "token_program", - "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" - }, - { - "name": "associated_token_program", - "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" - }, - { - "name": "rent", - "address": "SysvarRent111111111111111111111111111111111" + "name": "token_program" }, { "name": "event_authority", - "address": "Ce6TQqeHC9p8KetsN6JsjHK7UTZk7nasjjnr7XxXp9F1" + "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": "program" } ], "args": [ { - "name": "name", - "type": "string" + "name": "start_time", + "type": "i64" }, { - "name": "symbol", - "type": "string" + "name": "end_time", + "type": "i64" }, { - "name": "uri", - "type": "string" + "name": "seconds_in_a_day", + "type": "i64" }, { - "name": "creator", - "type": "pubkey" + "name": "day_number", + "type": "u64" + }, + { + "name": "pump_token_supply_per_day", + "type": "u64" } ] }, { "name": "buy", - "discriminator": [102, 6, 61, 18, 1, 218, 235, 234], - "docs": ["Buys tokens from a bonding curve."], + "docs": [ + "Buys tokens from a bonding curve." + ], + "discriminator": [ + 102, + 6, + 61, + 18, + 1, + 218, + 235, + 234 + ], "accounts": [ { "name": "global", @@ -284,13 +453,10 @@ }, { "name": "fee_recipient", - "writable": true, - "signer": false + "writable": true }, { - "name": "mint", - "writable": false, - "signer": false + "name": "mint" }, { "name": "bonding_curve", @@ -325,12 +491,63 @@ { "name": "associated_bonding_curve", "writable": true, - "signer": false - }, - { + "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, - "signer": false + "writable": true }, { "name": "user", @@ -342,41 +559,74 @@ "address": "11111111111111111111111111111111" }, { - "name": "token_program", - "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + "name": "token_program" }, { - "name": "rent", - "address": "SysvarRent111111111111111111111111111111111" + "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", - "address": "Ce6TQqeHC9p8KetsN6JsjHK7UTZk7nasjjnr7XxXp9F1" + "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": "amount", - "type": "u64" }, { - "name": "maxSolCost", - "type": "u64" - } - ] - }, - { - "name": "sell", - "discriminator": [51, 230, 133, 164, 1, 127, 131, 173], - "docs": ["Sells tokens into a bonding curve."], - "accounts": [ - { - "name": "global", - "writable": false, + "name": "global_volume_accumulator", "pda": { "seeds": [ { @@ -387,86 +637,137 @@ 111, 98, 97, - 108 + 108, + 95, + 118, + 111, + 108, + 117, + 109, + 101, + 95, + 97, + 99, + 99, + 117, + 109, + 117, + 108, + 97, + 116, + 111, + 114 ] } ] } }, { - "name": "feeRecipient", - "writable": true, - "signer": false - }, - { - "name": "mint", - "writable": false, - "signer": false - }, - { - "name": "bonding_curve", + "name": "user_volume_accumulator", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ - 98, - 111, - 110, - 100, - 105, - 110, - 103, - 45, - 99, 117, + 115, + 101, 114, + 95, 118, - 101 + 111, + 108, + 117, + 109, + 101, + 95, + 97, + 99, + 99, + 117, + 109, + 117, + 108, + 97, + 116, + 111, + 114 ] }, { "kind": "account", - "path": "mint" + "path": "user" } ] } }, { - "name": "associatedBondingCurve", - "writable": true, - "signer": false - }, - { - "name": "associatedUser", - "writable": true, - "signer": false - }, - { - "name": "user", - "writable": true, - "signer": true - }, - { - "name": "system_program", - "address": "11111111111111111111111111111111" - }, - { - "name": "associated_token_program", - "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" - }, - { - "name": "token_program", - "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" - }, - { - "name": "event_authority", - "address": "Ce6TQqeHC9p8KetsN6JsjHK7UTZk7nasjjnr7XxXp9F1" + "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": "program", - "address": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P" + "name": "fee_program", + "address": "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ" } ], "args": [ @@ -475,21 +776,61 @@ "type": "u64" }, { - "name": "minSolOutput", + "name": "max_sol_cost", "type": "u64" + }, + { + "name": "track_volume", + "type": { + "defined": { + "name": "OptionBool" + } + } } ] }, { - "name": "withdraw", - "discriminator": [183, 18, 70, 156, 148, 109, 161, 34], + "name": "buy_exact_sol_in", "docs": [ - "Allows the admin to withdraw liquidity for a migration once the bonding curve completes" + "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", - "writable": false, "pda": { "seeds": [ { @@ -507,14 +848,11 @@ } }, { - "name": "lastWithdraw", - "writable": true, - "signer": false + "name": "fee_recipient", + "writable": true }, { - "name": "mint", - "writable": false, - "signer": false + "name": "mint" }, { "name": "bonding_curve", @@ -547,14 +885,65 @@ } }, { - "name": "associatedBondingCurve", + "name": "associated_bonding_curve", "writable": true, - "signer": false + "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": "associatedUser", - "writable": true, - "signer": false + "name": "associated_user", + "writable": true }, { "name": "user", @@ -566,364 +955,6144 @@ "address": "11111111111111111111111111111111" }, { - "name": "token_program", - "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + "name": "token_program" }, { - "name": "rent", - "address": "SysvarRent111111111111111111111111111111111" + "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", - "address": "Ce6TQqeHC9p8KetsN6JsjHK7UTZk7nasjjnr7XxXp9F1" + "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": [] - } - ], - "accounts": [ - { - "name": "BondingCurve", - "discriminator": [ - 23, - 183, - 248, - 55, - 96, - 216, - 172, - 96 + }, + { + "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", - "discriminator": [ - 167, - 232, - 232, - 177, - 200, - 108, - 114, - 127 - ] - } - ], - "events": [ + "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": "CreateEvent", - "discriminator": [27, 114, 169, 77, 222, 235, 99, 118] + "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": "TradeEvent", - "discriminator": [189, 219, 127, 211, 78, 230, 97, 238] + "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" + }, + { + "name": "bonding_curve", + "type": "pubkey" + }, + { + "name": "sharing_config", + "type": "pubkey" + }, + { + "name": "old_creator", + "type": "pubkey" + }, + { + "name": "new_creator", + "type": "pubkey" + } + ] + } + }, + { + "name": "MinimumDistributableFeeEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "minimum_required", + "type": "u64" + }, + { + "name": "distributable_fees", + "type": "u64" + }, + { + "name": "can_distribute", + "type": "bool" + } + ] + } + }, + { + "name": "OptionBool", + "type": { + "kind": "struct", + "fields": [ + "bool" + ] + } + }, + { + "name": "ReservedFeeRecipientsEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "reserved_fee_recipient", + "type": "pubkey" + }, + { + "name": "reserved_fee_recipients", + "type": { + "array": [ + "pubkey", + 7 + ] + } + } + ] + } + }, + { + "name": "SetCreatorEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "mint", + "type": "pubkey" + }, + { + "name": "bonding_curve", + "type": "pubkey" + }, + { + "name": "creator", + "type": "pubkey" + } + ] + } }, { - "name": "CompleteEvent", - "discriminator": [95, 114, 97, 156, 212, 46, 152, 8] + "name": "SetMetaplexCreatorEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "mint", + "type": "pubkey" + }, + { + "name": "bonding_curve", + "type": "pubkey" + }, + { + "name": "metadata", + "type": "pubkey" + }, + { + "name": "creator", + "type": "pubkey" + } + ] + } }, { "name": "SetParamsEvent", - "discriminator": [223, 195, 159, 246, 62, 48, 143, 131] - } - ], - "types": [ - { - "name": "Global", "type": { "kind": "struct", "fields": [ { - "name": "initialized", - "type": "bool" + "name": "initial_virtual_token_reserves", + "type": "u64" }, { - "name": "authority", - "type": "pubkey" + "name": "initial_virtual_sol_reserves", + "type": "u64" }, { - "name": "feeRecipient", - "type": "pubkey" + "name": "initial_real_token_reserves", + "type": "u64" }, { - "name": "initialVirtualTokenReserves", + "name": "final_real_sol_reserves", "type": "u64" }, { - "name": "initialVirtualSolReserves", + "name": "token_total_supply", "type": "u64" }, { - "name": "initialRealTokenReserves", + "name": "fee_basis_points", "type": "u64" }, { - "name": "tokenTotalSupply", + "name": "withdraw_authority", + "type": "pubkey" + }, + { + "name": "enable_migrate", + "type": "bool" + }, + { + "name": "pool_migration_fee", "type": "u64" }, { - "name": "feeBasisPoints", + "name": "creator_fee_basis_points", "type": "u64" + }, + { + "name": "fee_recipients", + "type": { + "array": [ + "pubkey", + 8 + ] + } + }, + { + "name": "timestamp", + "type": "i64" + }, + { + "name": "set_creator_authority", + "type": "pubkey" + }, + { + "name": "admin_set_creator_authority", + "type": "pubkey" } ] } }, { - "name": "LastWithdraw", + "name": "Shareholder", "type": { "kind": "struct", "fields": [ { - "name": "lastWithdrawTimestamp", - "type": "i64" + "name": "address", + "type": "pubkey" + }, + { + "name": "share_bps", + "type": "u16" } ] } }, { - "name": "BondingCurve", + "name": "SharingConfig", "type": { "kind": "struct", "fields": [ { - "name": "virtualTokenReserves", - "type": "u64" + "name": "bump", + "type": "u8" }, { - "name": "virtualSolReserves", - "type": "u64" + "name": "version", + "type": "u8" }, { - "name": "realTokenReserves", - "type": "u64" + "name": "status", + "type": { + "defined": { + "name": "ConfigStatus" + } + } }, { - "name": "realSolReserves", - "type": "u64" + "name": "mint", + "type": "pubkey" }, { - "name": "tokenTotalSupply", - "type": "u64" + "name": "admin", + "type": "pubkey" }, { - "name": "complete", + "name": "admin_revoked", "type": "bool" + }, + { + "name": "shareholders", + "type": { + "vec": { + "defined": { + "name": "Shareholder" + } + } + } } ] } }, { - "name": "CreateEvent", + "name": "SyncUserVolumeAccumulatorEvent", "type": { "kind": "struct", "fields": [ { - "name": "name", - "type": "string", - "index": false - }, - { - "name": "symbol", - "type": "string", - "index": false - }, - { - "name": "uri", - "type": "string", - "index": false + "name": "user", + "type": "pubkey" }, { - "name": "mint", - "type": "pubkey", - "index": false + "name": "total_claimed_tokens_before", + "type": "u64" }, { - "name": "bondingCurve", - "type": "pubkey", - "index": false + "name": "total_claimed_tokens_after", + "type": "u64" }, { - "name": "user", - "type": "pubkey", - "index": false + "name": "timestamp", + "type": "i64" } ] } }, { "name": "TradeEvent", + "docs": [ + "ix_name: \"buy\" | \"sell\" | \"buy_exact_sol_in\"" + ], "type": { "kind": "struct", "fields": [ { "name": "mint", - "type": "pubkey", - "index": false + "type": "pubkey" }, { - "name": "solAmount", - "type": "u64", - "index": false + "name": "sol_amount", + "type": "u64" }, { - "name": "tokenAmount", - "type": "u64", - "index": false + "name": "token_amount", + "type": "u64" }, { - "name": "isBuy", - "type": "bool", - "index": false + "name": "is_buy", + "type": "bool" }, { "name": "user", - "type": "pubkey", - "index": false + "type": "pubkey" }, { "name": "timestamp", - "type": "i64", - "index": false + "type": "i64" + }, + { + "name": "virtual_sol_reserves", + "type": "u64" + }, + { + "name": "virtual_token_reserves", + "type": "u64" + }, + { + "name": "real_sol_reserves", + "type": "u64" + }, + { + "name": "real_token_reserves", + "type": "u64" + }, + { + "name": "fee_recipient", + "type": "pubkey" + }, + { + "name": "fee_basis_points", + "type": "u64" + }, + { + "name": "fee", + "type": "u64" }, { - "name": "virtualSolReserves", - "type": "u64", - "index": false + "name": "creator", + "type": "pubkey" + }, + { + "name": "creator_fee_basis_points", + "type": "u64" + }, + { + "name": "creator_fee", + "type": "u64" + }, + { + "name": "track_volume", + "type": "bool" + }, + { + "name": "total_unclaimed_tokens", + "type": "u64" + }, + { + "name": "total_claimed_tokens", + "type": "u64" }, { - "name": "virtualTokenReserves", - "type": "u64", - "index": false + "name": "current_sol_volume", + "type": "u64" + }, + { + "name": "last_update_timestamp", + "type": "i64" + }, + { + "name": "ix_name", + "type": "string" + }, + { + "name": "mayhem_mode", + "type": "bool" }, { - "name": "realSolReserves", - "type": "u64", - "index": false + "name": "cashback_fee_basis_points", + "type": "u64" }, { - "name": "realTokenReserves", - "type": "u64", - "index": false + "name": "cashback", + "type": "u64" } ] } }, { - "name": "CompleteEvent", + "name": "UpdateGlobalAuthorityEvent", "type": { "kind": "struct", "fields": [ { - "name": "user", - "type": "pubkey", - "index": false + "name": "global", + "type": "pubkey" }, { - "name": "mint", - "type": "pubkey", - "index": false + "name": "authority", + "type": "pubkey" }, { - "name": "bondingCurve", - "type": "pubkey", - "index": false + "name": "new_authority", + "type": "pubkey" }, { "name": "timestamp", - "type": "i64", - "index": false + "type": "i64" } ] } }, { - "name": "SetParamsEvent", + "name": "UpdateMayhemVirtualParamsEvent", "type": { "kind": "struct", "fields": [ { - "name": "feeRecipient", - "type": "pubkey", - "index": false + "name": "timestamp", + "type": "i64" + }, + { + "name": "mint", + "type": "pubkey" + }, + { + "name": "virtual_token_reserves", + "type": "u64" }, { - "name": "initialVirtualTokenReserves", - "type": "u64", - "index": false + "name": "virtual_sol_reserves", + "type": "u64" }, { - "name": "initialVirtualSolReserves", - "type": "u64", - "index": false + "name": "new_virtual_token_reserves", + "type": "u64" }, { - "name": "initialRealTokenReserves", - "type": "u64", - "index": false + "name": "new_virtual_sol_reserves", + "type": "u64" }, { - "name": "tokenTotalSupply", - "type": "u64", - "index": false + "name": "real_token_reserves", + "type": "u64" }, { - "name": "feeBasisPoints", - "type": "u64", - "index": false + "name": "real_sol_reserves", + "type": "u64" } ] } - } - ], - "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" + "name": "UserVolumeAccumulator", + "type": { + "kind": "struct", + "fields": [ + { + "name": "user", + "type": "pubkey" + }, + { + "name": "needs_claim", + "type": "bool" + }, + { + "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": "has_total_claimed_tokens", + "type": "bool" + }, + { + "name": "cashback_earned", + "type": "u64" + }, + { + "name": "total_cashback_claimed", + "type": "u64" + } + ] + } } ] -} +} \ No newline at end of file diff --git a/src/IDL/pump-fun.ts b/src/IDL/pump-fun.ts index f673ae7..73a8805 100644 --- a/src/IDL/pump-fun.ts +++ b/src/IDL/pump-fun.ts @@ -1,869 +1,4 @@ -export type PumpFun = { - address: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"; - metadata: { - name: "pump"; - version: "0.1.0"; - spec: "0.1.0"; - }; - instructions: [ - { - name: "initialize"; - discriminator: [175, 175, 109, 31, 13, 152, 155, 237]; - docs: ["Creates the global state."]; - accounts: [ - { - name: "global"; - writable: true; - pda: { - seeds: [ - { - kind: "const"; - value: [103, 108, 111, 98, 97, 108]; - } - ]; - }; - }, - { - name: "user"; - writable: true; - signer: true; - }, - { - name: "systemProgram"; - address: "11111111111111111111111111111111"; - } - ]; - args: []; - }, - { - name: "setParams"; - discriminator: [165, 31, 134, 53, 189, 180, 130, 255]; - docs: ["Sets the global state parameters."]; - accounts: [ - { - name: "global"; - writable: true; - pda: { - seeds: [ - { - kind: "const"; - value: [103, 108, 111, 98, 97, 108]; - } - ]; - }; - }, - { - name: "user"; - writable: true; - signer: true; - }, - { - name: "systemProgram"; - address: "11111111111111111111111111111111"; - }, - { - name: "eventAuthority"; - address: "Ce6TQqeHC9p8KetsN6JsjHK7UTZk7nasjjnr7XxXp9F1"; - }, - { - name: "program"; - address: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"; - } - ]; - args: [ - { - name: "feeRecipient"; - type: "pubkey"; - }, - { - name: "initialVirtualTokenReserves"; - type: "u64"; - }, - { - name: "initialVirtualSolReserves"; - type: "u64"; - }, - { - name: "initialRealTokenReserves"; - type: "u64"; - }, - { - name: "tokenTotalSupply"; - type: "u64"; - }, - { - name: "feeBasisPoints"; - type: "u64"; - } - ]; - }, - { - name: "create"; - discriminator: [24, 30, 200, 40, 5, 28, 7, 119]; - docs: ["Creates a new coin and bonding curve."]; - 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: "bondingCurve"; - 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: "associatedBondingCurve"; - writable: true; - signer: false; - }, - { - name: "global"; - writable: false; - pda: { - seeds: [ - { - kind: "const"; - value: [103, 108, 111, 98, 97, 108]; - } - ]; - }; - }, - { - name: "mplTokenMetadata"; - address: "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"; - }, - { - name: "metadata"; - writable: true; - signer: false; - }, - { - name: "user"; - isMut: true; - isSigner: true; - }, - { - name: "systemProgram"; - address: "11111111111111111111111111111111"; - }, - { - name: "tokenProgram"; - address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"; - }, - { - name: "associatedTokenProgram"; - address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"; - }, - { - name: "rent"; - address: "SysvarRent111111111111111111111111111111111"; - }, - { - name: "eventAuthority"; - address: "Ce6TQqeHC9p8KetsN6JsjHK7UTZk7nasjjnr7XxXp9F1"; - }, - { - name: "program"; - address: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"; - } - ]; - args: [ - { - name: "name"; - type: "string"; - }, - { - name: "symbol"; - type: "string"; - }, - { - name: "uri"; - type: "string"; - }, - { - name: "creator"; - type: "pubkey"; - } - ]; - }, - { - name: "buy"; - discriminator: [102, 6, 61, 18, 1, 218, 235, 234]; - docs: ["Buys tokens from a bonding curve."]; - accounts: [ - { - name: "global"; - pda: { - seeds: [ - { - kind: "const"; - value: [103, 108, 111, 98, 97, 108]; - } - ]; - }; - }, - { - name: "feeRecipient"; - writable: true; - signer: false; - }, - { - name: "mint"; - writable: false; - signer: false; - }, - { - name: "bondingCurve"; - 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: "associatedBondingCurve"; - writable: true; - signer: false; - }, - { - name: "associatedUser"; - writable: true; - signer: false; - }, - { - name: "user"; - writable: true; - signer: true; - }, - { - name: "systemProgram"; - address: "11111111111111111111111111111111"; - }, - { - name: "tokenProgram"; - address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"; - }, - { - name: "rent"; - address: "SysvarRent111111111111111111111111111111111"; - }, - { - name: "eventAuthority"; - address: "Ce6TQqeHC9p8KetsN6JsjHK7UTZk7nasjjnr7XxXp9F1"; - }, - { - name: "program"; - address: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"; - } - ]; - args: [ - { - name: "amount"; - type: "u64"; - }, - { - name: "maxSolCost"; - type: "u64"; - } - ]; - }, - { - name: "sell"; - discriminator: [51, 230, 133, 164, 1, 127, 131, 173]; - docs: ["Sells tokens into a bonding curve."]; - accounts: [ - { - name: "global"; - writable: false; - pda: { - seeds: [ - { - kind: "const"; - value: [103, 108, 111, 98, 97, 108]; - } - ]; - }; - }, - { - name: "feeRecipient"; - writable: true; - signer: false; - }, - { - name: "mint"; - writable: false; - signer: false; - }, - { - name: "bondingCurve"; - 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: "associatedBondingCurve"; - writable: true; - signer: false; - }, - { - name: "associatedUser"; - writable: true; - signer: false; - }, - { - name: "user"; - writable: true; - signer: true; - }, - { - name: "systemProgram"; - address: "11111111111111111111111111111111"; - }, - { - name: "associatedTokenProgram"; - address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"; - }, - { - name: "tokenProgram"; - address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"; - }, - { - name: "eventAuthority"; - address: "Ce6TQqeHC9p8KetsN6JsjHK7UTZk7nasjjnr7XxXp9F1"; - }, - { - name: "program"; - address: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"; - } - ]; - args: [ - { - name: "amount"; - type: "u64"; - }, - { - name: "minSolOutput"; - type: "u64"; - } - ]; - }, - { - name: "withdraw"; - discriminator: [183, 18, 70, 156, 148, 109, 161, 34]; - docs: [ - "Allows the admin to withdraw liquidity for a migration once the bonding curve completes" - ]; - accounts: [ - { - name: "global"; - writable: false; - pda: { - seeds: [ - { - kind: "const"; - value: [103, 108, 111, 98, 97, 108]; - } - ]; - }; - }, - { - name: "lastWithdraw"; - writable: true; - signer: false; - }, - { - name: "mint"; - writable: false; - signer: false; - }, - { - name: "bondingCurve"; - 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: "associatedBondingCurve"; - writable: true; - signer: false; - }, - { - name: "associatedUser"; - writable: true; - signer: false; - }, - { - name: "user"; - writable: true; - signer: true; - }, - { - name: "system_program"; - address: "11111111111111111111111111111111"; - }, - { - name: "tokenProgram"; - address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"; - }, - { - name: "rent"; - address: "SysvarRent111111111111111111111111111111111"; - }, - { - name: "eventAuthority"; - address: "Ce6TQqeHC9p8KetsN6JsjHK7UTZk7nasjjnr7XxXp9F1"; - }, - { - name: "program"; - address: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"; - } - ]; - args: []; - } - ]; - accounts: [ - { - name: "bondingCurve"; - discriminator: [23, 183, 248, 55, 96, 216, 172, 96]; - }, - { - name: "global"; - discriminator: [167, 232, 232, 177, 200, 108, 114, 127]; - } - ]; - events: [ - { - name: "createEvent"; - discriminator: [27, 114, 169, 77, 222, 235, 99, 118]; - }, - { - name: "tradeEvent"; - discriminator: [189, 219, 127, 211, 78, 230, 97, 238]; - }, - { - name: "completeEvent"; - discriminator: [95, 114, 97, 156, 212, 46, 152, 8]; - }, - { - name: "setParamsEvent"; - discriminator: [223, 195, 159, 246, 62, 48, 143, 131]; - } - ]; - types: [ - { - name: "global"; - type: { - kind: "struct"; - fields: [ - { - name: "initialized"; - type: "bool"; - }, - { - name: "authority"; - type: "pubkey"; - }, - { - name: "feeRecipient"; - type: "pubkey"; - }, - { - name: "initialVirtualTokenReserves"; - type: "u64"; - }, - { - name: "initialVirtualSolReserves"; - type: "u64"; - }, - { - name: "initialRealTokenReserves"; - type: "u64"; - }, - { - name: "tokenTotalSupply"; - type: "u64"; - }, - { - name: "feeBasisPoints"; - type: "u64"; - } - ]; - }; - }, - { - name: "lastWithdraw"; - type: { - kind: "struct"; - fields: [ - { - name: "lastWithdrawTimestamp"; - type: "i64"; - } - ]; - }; - }, - { - name: "bondingCurve"; - type: { - kind: "struct"; - fields: [ - { - name: "virtualTokenReserves"; - type: "u64"; - }, - { - name: "virtualSolReserves"; - type: "u64"; - }, - { - name: "realTokenReserves"; - type: "u64"; - }, - { - name: "realSolReserves"; - type: "u64"; - }, - { - name: "tokenTotalSupply"; - type: "u64"; - }, - { - name: "complete"; - type: "bool"; - } - ]; - }; - }, - { - name: "createEvent"; - type: { - kind: "struct"; - fields: [ - { - name: "name"; - type: "string"; - index: false; - }, - { - name: "symbol"; - type: "string"; - index: false; - }, - { - name: "uri"; - type: "string"; - index: false; - }, - { - name: "mint"; - type: "pubkey"; - index: false; - }, - { - name: "bondingCurve"; - type: "pubkey"; - index: false; - }, - { - name: "user"; - type: "pubkey"; - index: false; - } - ]; - }; - }, - { - name: "tradeEvent"; - type: { - kind: "struct"; - fields: [ - { - name: "mint"; - type: "pubkey"; - index: false; - }, - { - name: "solAmount"; - type: "u64"; - index: false; - }, - { - name: "tokenAmount"; - type: "u64"; - index: false; - }, - { - name: "isBuy"; - type: "bool"; - index: false; - }, - { - name: "user"; - type: "pubkey"; - index: false; - }, - { - name: "timestamp"; - type: "i64"; - index: false; - }, - { - name: "virtualSolReserves"; - type: "u64"; - index: false; - }, - { - name: "virtualTokenReserves"; - type: "u64"; - index: false; - }, - { - name: "realSolReserves"; - type: "u64"; - index: false; - }, - { - name: "realTokenReserves"; - type: "u64"; - index: false; - } - ]; - }; - }, - { - name: "completeEvent"; - type: { - kind: "struct"; - fields: [ - { - name: "user"; - type: "pubkey"; - index: false; - }, - { - name: "mint"; - type: "pubkey"; - index: false; - }, - { - name: "bondingCurve"; - type: "pubkey"; - index: false; - }, - { - name: "timestamp"; - type: "i64"; - index: false; - } - ]; - }; - }, - { - name: "setParamsEvent"; - type: { - kind: "struct"; - fields: [ - { - name: "feeRecipient"; - type: "pubkey"; - index: false; - }, - { - name: "initialVirtualTokenReserves"; - type: "u64"; - index: false; - }, - { - name: "initialVirtualSolReserves"; - type: "u64"; - index: false; - }, - { - name: "initialRealTokenReserves"; - type: "u64"; - index: false; - }, - { - name: "tokenTotalSupply"; - type: "u64"; - index: false; - }, - { - name: "feeBasisPoints"; - type: "u64"; - index: false; - } - ]; - }; - } - ]; - 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"; - } - ]; -}; +import { Idl } from "@coral-xyz/anchor"; +import IDL_JSON from "./pump-fun.json"; + +export type PumpFun = typeof IDL_JSON & Idl; diff --git a/src/bondingCurveAccount.ts b/src/bondingCurveAccount.ts index fc91d9d..d76640f 100644 --- a/src/bondingCurveAccount.ts +++ b/src/bondingCurveAccount.ts @@ -1,4 +1,5 @@ -import { struct, bool, u64, Layout } from "@coral-xyz/borsh"; +import { PublicKey } from "@solana/web3.js"; +import { struct, bool, u64, publicKey, Layout } from "@coral-xyz/borsh"; export class BondingCurveAccount { public discriminator: bigint; @@ -8,6 +9,9 @@ export class BondingCurveAccount { public realSolReserves: bigint; public tokenTotalSupply: bigint; public complete: boolean; + public creator: PublicKey; + public isMayhemMode: boolean; + public isCashbackCoin: boolean; constructor( discriminator: bigint, @@ -16,7 +20,10 @@ export class BondingCurveAccount { realTokenReserves: bigint, realSolReserves: bigint, tokenTotalSupply: bigint, - complete: boolean + complete: boolean, + creator: PublicKey, + isMayhemMode: boolean, + isCashbackCoin: boolean ) { this.discriminator = discriminator; this.virtualTokenReserves = virtualTokenReserves; @@ -25,6 +32,9 @@ export class BondingCurveAccount { this.realSolReserves = realSolReserves; this.tokenTotalSupply = tokenTotalSupply; this.complete = complete; + this.creator = creator; + this.isMayhemMode = isMayhemMode; + this.isCashbackCoin = isCashbackCoin; } getBuyPrice(amount: bigint): bigint { @@ -118,6 +128,9 @@ export class BondingCurveAccount { u64("realSolReserves"), u64("tokenTotalSupply"), bool("complete"), + publicKey("creator"), + bool("isMayhemMode"), + bool("isCashbackCoin"), ]); let value = structure.decode(buffer); @@ -128,7 +141,10 @@ export class BondingCurveAccount { BigInt(value.realTokenReserves), BigInt(value.realSolReserves), BigInt(value.tokenTotalSupply), - value.complete + value.complete, + value.creator, + value.isMayhemMode, + value.isCashbackCoin ); } } diff --git a/src/globalAccount.ts b/src/globalAccount.ts index b422c50..18cffee 100644 --- a/src/globalAccount.ts +++ b/src/globalAccount.ts @@ -1,5 +1,5 @@ import { PublicKey } from "@solana/web3.js"; -import { struct, bool, u64, publicKey, Layout } from "@coral-xyz/borsh"; +import { struct, bool, u64, publicKey, Layout, array } from "@coral-xyz/borsh"; export class GlobalAccount { public discriminator: bigint; @@ -11,6 +11,12 @@ export class GlobalAccount { public initialRealTokenReserves: bigint; public tokenTotalSupply: bigint; public feeBasisPoints: bigint; + public withdrawAuthority: PublicKey; + public enableMigrate: boolean; + public poolMigrationFee: bigint; + public creatorFeeBasisPoints: bigint; + public feeRecipients: PublicKey[]; + public setCreatorAuthority: PublicKey; constructor( discriminator: bigint, @@ -21,7 +27,13 @@ export class GlobalAccount { initialVirtualSolReserves: bigint, initialRealTokenReserves: bigint, tokenTotalSupply: bigint, - feeBasisPoints: bigint + feeBasisPoints: bigint, + withdrawAuthority: PublicKey, + enableMigrate: boolean, + poolMigrationFee: bigint, + creatorFeeBasisPoints: bigint, + feeRecipients: PublicKey[], + setCreatorAuthority: PublicKey ) { this.discriminator = discriminator; this.initialized = initialized; @@ -32,6 +44,17 @@ export class GlobalAccount { this.initialRealTokenReserves = initialRealTokenReserves; this.tokenTotalSupply = tokenTotalSupply; this.feeBasisPoints = feeBasisPoints; + this.withdrawAuthority = withdrawAuthority; + this.enableMigrate = enableMigrate; + this.poolMigrationFee = poolMigrationFee; + this.creatorFeeBasisPoints = creatorFeeBasisPoints; + this.feeRecipients = feeRecipients; + this.setCreatorAuthority = setCreatorAuthority; + } + + /** Total fee basis points (protocol + creator) */ + getTotalFeeBasisPoints(): bigint { + return this.feeBasisPoints + this.creatorFeeBasisPoints; } getInitialBuyPrice(amount: bigint): bigint { @@ -59,6 +82,12 @@ export class GlobalAccount { u64("initialRealTokenReserves"), u64("tokenTotalSupply"), u64("feeBasisPoints"), + publicKey("withdrawAuthority"), + bool("enableMigrate"), + u64("poolMigrationFee"), + u64("creatorFeeBasisPoints"), + array(publicKey(), 7, "feeRecipients"), + publicKey("setCreatorAuthority"), ]); let value = structure.decode(buffer); @@ -71,7 +100,13 @@ export class GlobalAccount { BigInt(value.initialVirtualSolReserves), BigInt(value.initialRealTokenReserves), BigInt(value.tokenTotalSupply), - BigInt(value.feeBasisPoints) + BigInt(value.feeBasisPoints), + value.withdrawAuthority, + value.enableMigrate, + BigInt(value.poolMigrationFee), + BigInt(value.creatorFeeBasisPoints), + value.feeRecipients, + value.setCreatorAuthority ); } } diff --git a/src/pumpfun.ts b/src/pumpfun.ts index cd8aaf9..38e42e0 100644 --- a/src/pumpfun.ts +++ b/src/pumpfun.ts @@ -4,6 +4,7 @@ import { Finality, Keypair, PublicKey, + SystemProgram, Transaction, } from "@solana/web3.js"; import { Program, Provider } from "@coral-xyz/anchor"; @@ -29,6 +30,7 @@ import { createAssociatedTokenAccountInstruction, getAccount, getAssociatedTokenAddress, + TOKEN_PROGRAM_ID, } from "@solana/spl-token"; import { BondingCurveAccount } from "./bondingCurveAccount.js"; import { BN } from "bn.js"; @@ -40,17 +42,29 @@ import { sendTx, } from "./util.js"; import { PumpFun, IDL } from "./IDL/index.js"; + const PROGRAM_ID = "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"; const MPL_TOKEN_METADATA_PROGRAM_ID = "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"; +const FEE_PROGRAM_ID = "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ"; export const GLOBAL_ACCOUNT_SEED = "global"; export const MINT_AUTHORITY_SEED = "mint-authority"; export const BONDING_CURVE_SEED = "bonding-curve"; export const METADATA_SEED = "metadata"; +export const CREATOR_VAULT_SEED = "creator-vault"; +export const GLOBAL_VOLUME_ACCUMULATOR_SEED = "global_volume_accumulator"; +export const USER_VOLUME_ACCUMULATOR_SEED = "user_volume_accumulator"; +export const FEE_CONFIG_SEED = "fee_config"; export const DEFAULT_DECIMALS = 6; +// The admin pubkey used in fee_config PDA derivation (from official IDL) +const FEE_CONFIG_ADMIN_BYTES = new Uint8Array([ + 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, +]); + export class PumpFunSDK { public program: Program; public connection: Connection; @@ -59,7 +73,7 @@ export class PumpFunSDK { this.connection = this.program.provider.connection; } - async createAndBuy ( + async createAndBuy( creator: Keypair, mint: Keypair, createTokenMetadata: CreateTokenMetadata, @@ -94,7 +108,8 @@ export class PumpFunSDK { mint.publicKey, globalAccount.feeRecipient, buyAmount, - buyAmountWithSlippage + buyAmountWithSlippage, + commitment ); newTx.add(buyTx); @@ -235,7 +250,8 @@ export class PumpFunSDK { mint, globalAccount.feeRecipient, buyAmount, - buyAmountWithSlippage + buyAmountWithSlippage, + commitment ); } @@ -271,15 +287,41 @@ export class PumpFunSDK { ); } + // Read bonding curve to get creator for creator_vault PDA + const bondingCurveAccount = await this.getBondingCurveAccount( + mint, + commitment + ); + if (!bondingCurveAccount) { + throw new Error(`Bonding curve account not found: ${mint.toBase58()}`); + } + + const creatorVault = this.getCreatorVaultPDA(bondingCurveAccount.creator); + const globalVolumeAccumulator = this.getGlobalVolumeAccumulatorPDA(); + const userVolumeAccumulator = this.getUserVolumeAccumulatorPDA(buyer); + const feeConfig = this.getFeeConfigPDA(); + const feeProgramId = new PublicKey(FEE_PROGRAM_ID); + transaction.add( await this.program.methods - .buy(new BN(amount.toString()), new BN(solAmount.toString())) + .buy(new BN(amount.toString()), new BN(solAmount.toString()), null) .accounts({ + global: this.getGlobalPDA(), feeRecipient: feeRecipient, mint: mint, + bondingCurve: this.getBondingCurvePDA(mint), associatedBondingCurve: associatedBondingCurve, associatedUser: associatedUser, user: buyer, + systemProgram: SystemProgram.programId, + tokenProgram: TOKEN_PROGRAM_ID, + creatorVault: creatorVault, + eventAuthority: this.getEventAuthorityPDA(), + program: new PublicKey(PROGRAM_ID), + globalVolumeAccumulator: globalVolumeAccumulator, + userVolumeAccumulator: userVolumeAccumulator, + feeConfig: feeConfig, + feeProgram: feeProgramId, }) .transaction() ); @@ -305,9 +347,12 @@ export class PumpFunSDK { let globalAccount = await this.getGlobalAccount(commitment); + // Use combined protocol + creator fee for sell price calculation + let totalFeeBps = globalAccount.getTotalFeeBasisPoints(); + let minSolOutput = bondingCurveAccount.getSellPrice( sellTokenAmount, - globalAccount.feeBasisPoints + totalFeeBps ); let sellAmountWithSlippage = calculateWithSlippageSell( @@ -320,7 +365,8 @@ export class PumpFunSDK { mint, globalAccount.feeRecipient, sellTokenAmount, - sellAmountWithSlippage + sellAmountWithSlippage, + commitment ); } @@ -329,7 +375,8 @@ export class PumpFunSDK { mint: PublicKey, feeRecipient: PublicKey, amount: bigint, - minSolOutput: bigint + minSolOutput: bigint, + commitment: Commitment = DEFAULT_COMMITMENT ) { const associatedBondingCurve = await getAssociatedTokenAddress( mint, @@ -339,17 +386,39 @@ export class PumpFunSDK { const associatedUser = await getAssociatedTokenAddress(mint, seller, false); + // Read bonding curve to get creator for creator_vault PDA + const bondingCurveAccount = await this.getBondingCurveAccount( + mint, + commitment + ); + if (!bondingCurveAccount) { + throw new Error(`Bonding curve account not found: ${mint.toBase58()}`); + } + + const creatorVault = this.getCreatorVaultPDA(bondingCurveAccount.creator); + const feeConfig = this.getFeeConfigPDA(); + const feeProgramId = new PublicKey(FEE_PROGRAM_ID); + let transaction = new Transaction(); transaction.add( await this.program.methods .sell(new BN(amount.toString()), new BN(minSolOutput.toString())) .accounts({ + global: this.getGlobalPDA(), feeRecipient: feeRecipient, mint: mint, + bondingCurve: this.getBondingCurvePDA(mint), associatedBondingCurve: associatedBondingCurve, associatedUser: associatedUser, user: seller, + systemProgram: SystemProgram.programId, + creatorVault: creatorVault, + tokenProgram: TOKEN_PROGRAM_ID, + eventAuthority: this.getEventAuthorityPDA(), + program: new PublicKey(PROGRAM_ID), + feeConfig: feeConfig, + feeProgram: feeProgramId, }) .transaction() ); @@ -372,34 +441,73 @@ export class PumpFunSDK { } async getGlobalAccount(commitment: Commitment = DEFAULT_COMMITMENT) { - const [globalAccountPDA] = PublicKey.findProgramAddressSync( - [Buffer.from(GLOBAL_ACCOUNT_SEED)], - new PublicKey(PROGRAM_ID) - ); - const tokenAccount = await this.connection.getAccountInfo( - globalAccountPDA, + this.getGlobalPDA(), commitment ); return GlobalAccount.fromBuffer(tokenAccount!.data); } - getBondingCurvePDA(mint: PublicKey) { + // --- PDA derivation helpers --- + + getGlobalPDA(): PublicKey { + return PublicKey.findProgramAddressSync( + [Buffer.from(GLOBAL_ACCOUNT_SEED)], + new PublicKey(PROGRAM_ID) + )[0]; + } + + getBondingCurvePDA(mint: PublicKey): PublicKey { return PublicKey.findProgramAddressSync( [Buffer.from(BONDING_CURVE_SEED), mint.toBuffer()], this.program.programId )[0]; } + getCreatorVaultPDA(creator: PublicKey): PublicKey { + return PublicKey.findProgramAddressSync( + [Buffer.from(CREATOR_VAULT_SEED), creator.toBuffer()], + new PublicKey(PROGRAM_ID) + )[0]; + } + + getEventAuthorityPDA(): PublicKey { + return PublicKey.findProgramAddressSync( + [Buffer.from("__event_authority")], + new PublicKey(PROGRAM_ID) + )[0]; + } + + getGlobalVolumeAccumulatorPDA(): PublicKey { + return PublicKey.findProgramAddressSync( + [Buffer.from(GLOBAL_VOLUME_ACCUMULATOR_SEED)], + new PublicKey(PROGRAM_ID) + )[0]; + } + + getUserVolumeAccumulatorPDA(user: PublicKey): PublicKey { + return PublicKey.findProgramAddressSync( + [Buffer.from(USER_VOLUME_ACCUMULATOR_SEED), user.toBuffer()], + new PublicKey(PROGRAM_ID) + )[0]; + } + + getFeeConfigPDA(): PublicKey { + return PublicKey.findProgramAddressSync( + [Buffer.from(FEE_CONFIG_SEED), FEE_CONFIG_ADMIN_BYTES], + new PublicKey(FEE_PROGRAM_ID) + )[0]; + } + async createTokenMetadata(create: CreateTokenMetadata) { // Validate file if (!(create.file instanceof Blob)) { - throw new Error('File must be a Blob or File object'); + throw new Error("File must be a Blob or File object"); } let formData = new FormData(); - formData.append("file", create.file, 'image.png'); // Add filename + formData.append("file", create.file, "image.png"); formData.append("name", create.name); formData.append("symbol", create.symbol); formData.append("description", create.description); @@ -409,40 +517,42 @@ export class PumpFunSDK { formData.append("showName", "true"); try { - const request = await fetch("https://pump.fun/api/ipfs", { - method: "POST", - headers: { - 'Accept': 'application/json', - }, - body: formData, - credentials: 'same-origin' - }); - - if (request.status === 500) { - // Try to get more error details - const errorText = await request.text(); - throw new Error(`Server error (500): ${errorText || 'No error details available'}`); - } + const request = await fetch("https://pump.fun/api/ipfs", { + method: "POST", + headers: { + Accept: "application/json", + }, + body: formData, + credentials: "same-origin", + }); + + if (request.status === 500) { + const errorText = await request.text(); + throw new Error( + `Server error (500): ${errorText || "No error details available"}` + ); + } - if (!request.ok) { - throw new Error(`HTTP error! status: ${request.status}`); - } + if (!request.ok) { + throw new Error(`HTTP error! status: ${request.status}`); + } - const responseText = await request.text(); - if (!responseText) { - throw new Error('Empty response received from server'); - } + const responseText = await request.text(); + if (!responseText) { + throw new Error("Empty response received from server"); + } - try { - return JSON.parse(responseText); - } catch (e) { - throw new Error(`Invalid JSON response: ${responseText}`); - } + try { + return JSON.parse(responseText); + } catch (e) { + throw new Error(`Invalid JSON response: ${responseText}`); + } } catch (error) { - console.error('Error in createTokenMetadata:', error); - throw error; + console.error("Error in createTokenMetadata:", error); + throw error; } -} + } + //EVENTS addEventListener( eventType: T,