From 3596e29e38076d5dea70ea40936bf0f25f20a387 Mon Sep 17 00:00:00 2001 From: 0xfnzero <0xfnzero@users.noreply.github.com> Date: Fri, 8 May 2026 16:11:55 +0800 Subject: [PATCH] feat(pumpfun): bonding curve buy_v2/sell_v2/buy_exact_quote_in_v2 + quote_mint decode - Switch swap ix assembly to unified v2 account layout (sharing_config, quote ATAs, buyback recipient). - Decode bonding curve account with optional trailing quote_mint; sync idl/pump.json from pump-public-docs. - Legacy buy/buy_exact_sol_in/sell encoders retained for reference. Co-authored-by: Cursor --- idl/pump.json | 5219 +++++++++++++--------------- src/common/bonding_curve.rs | 77 +- src/instruction/pumpfun.rs | 277 +- src/instruction/pumpfun_ix_data.rs | 46 +- src/instruction/utils/pumpfun.rs | 27 +- src/trading/core/params/pumpfun.rs | 16 +- 6 files changed, 2663 insertions(+), 2999 deletions(-) diff --git a/idl/pump.json b/idl/pump.json index 9977ae3..1b4d4b5 100644 --- a/idl/pump.json +++ b/idl/pump.json @@ -7,28 +7,64 @@ "description": "Created with Anchor" }, "instructions": [ + { + "name": "add_quote_mint", + "discriminator": [111, 121, 21, 56, 40, 24, 94, 209], + "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": "quote_mint", + "type": "pubkey" + } + ] + }, { "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 - ], + "discriminator": [69, 25, 171, 142, 57, 239, 13, 4], "accounts": [ { "name": "admin_set_creator_authority", "signer": true, - "relations": [ - "global" - ] + "relations": ["global"] }, { "name": "global", @@ -36,14 +72,7 @@ "seeds": [ { "kind": "const", - "value": [ - 103, - 108, - 111, - 98, - 97, - 108 - ] + "value": [103, 108, 111, 98, 97, 108] } ] } @@ -59,19 +88,7 @@ { "kind": "const", "value": [ - 98, - 111, - 110, - 100, - 105, - 110, - 103, - 45, - 99, - 117, - 114, - 118, - 101 + 98, 111, 110, 100, 105, 110, 103, 45, 99, 117, 114, 118, 101 ] }, { @@ -88,23 +105,8 @@ { "kind": "const", "value": [ - 95, - 95, - 101, - 118, - 101, - 110, - 116, - 95, - 97, - 117, - 116, - 104, - 111, - 114, - 105, - 116, - 121 + 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, + 114, 105, 116, 121 ] } ] @@ -123,23 +125,12 @@ }, { "name": "admin_set_idl_authority", - "discriminator": [ - 8, - 217, - 96, - 231, - 144, - 104, - 192, - 5 - ], + "discriminator": [8, 217, 96, 231, 144, 104, 192, 5], "accounts": [ { "name": "authority", "signer": true, - "relations": [ - "global" - ] + "relations": ["global"] }, { "name": "global", @@ -147,14 +138,7 @@ "seeds": [ { "kind": "const", - "value": [ - 103, - 108, - 111, - 98, - 97, - 108 - ] + "value": [103, 108, 111, 98, 97, 108] } ] } @@ -180,23 +164,8 @@ { "kind": "const", "value": [ - 95, - 95, - 101, - 118, - 101, - 110, - 116, - 95, - 97, - 117, - 116, - 104, - 111, - 114, - 105, - 116, - 121 + 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, + 114, 105, 116, 121 ] } ] @@ -215,24 +184,13 @@ }, { "name": "admin_update_token_incentives", - "discriminator": [ - 209, - 11, - 115, - 87, - 213, - 23, - 124, - 204 - ], + "discriminator": [209, 11, 115, 87, 213, 23, 124, 204], "accounts": [ { "name": "authority", "writable": true, "signer": true, - "relations": [ - "global" - ] + "relations": ["global"] }, { "name": "global", @@ -240,14 +198,7 @@ "seeds": [ { "kind": "const", - "value": [ - 103, - 108, - 111, - 98, - 97, - 108 - ] + "value": [103, 108, 111, 98, 97, 108] } ] } @@ -260,31 +211,8 @@ { "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 + 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 ] } ] @@ -314,38 +242,9 @@ "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 + 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 ] } } @@ -368,23 +267,8 @@ { "kind": "const", "value": [ - 95, - 95, - 101, - 118, - 101, - 110, - 116, - 95, - 97, - 117, - 116, - 104, - 111, - 114, - 105, - 116, - 121 + 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, + 114, 105, 116, 121 ] } ] @@ -419,19 +303,8 @@ }, { "name": "buy", - "docs": [ - "Buys tokens from a bonding curve." - ], - "discriminator": [ - 102, - 6, - 61, - 18, - 1, - 218, - 235, - 234 - ], + "docs": ["Buys tokens from a bonding curve."], + "discriminator": [102, 6, 61, 18, 1, 218, 235, 234], "accounts": [ { "name": "global", @@ -439,14 +312,7 @@ "seeds": [ { "kind": "const", - "value": [ - 103, - 108, - 111, - 98, - 97, - 108 - ] + "value": [103, 108, 111, 98, 97, 108] } ] } @@ -466,19 +332,7 @@ { "kind": "const", "value": [ - 98, - 111, - 110, - 100, - 105, - 110, - 103, - 45, - 99, - 117, - 114, - 118, - 101 + 98, 111, 110, 100, 105, 110, 103, 45, 99, 117, 114, 118, 101 ] }, { @@ -509,38 +363,9 @@ "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 + 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 ] } } @@ -569,19 +394,7 @@ { "kind": "const", "value": [ - 99, - 114, - 101, - 97, - 116, - 111, - 114, - 45, - 118, - 97, - 117, - 108, - 116 + 99, 114, 101, 97, 116, 111, 114, 45, 118, 97, 117, 108, 116 ] }, { @@ -599,23 +412,8 @@ { "kind": "const", "value": [ - 95, - 95, - 101, - 118, - 101, - 110, - 116, - 95, - 97, - 117, - 116, - 104, - 111, - 114, - 105, - 116, - 121 + 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, + 114, 105, 116, 121 ] } ] @@ -632,31 +430,8 @@ { "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 + 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 ] } ] @@ -670,29 +445,8 @@ { "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 + 117, 115, 101, 114, 95, 118, 111, 108, 117, 109, 101, 95, 97, + 99, 99, 117, 109, 117, 108, 97, 116, 111, 114 ] }, { @@ -708,54 +462,14 @@ "seeds": [ { "kind": "const", - "value": [ - 102, - 101, - 101, - 95, - 99, - 111, - 110, - 102, - 105, - 103 - ] + "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 + 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 ] } ], @@ -789,6 +503,412 @@ } ] }, + { + "name": "buy_exact_quote_in_v2", + "discriminator": [194, 171, 28, 70, 104, 77, 91, 47], + "accounts": [ + { + "name": "global", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [103, 108, 111, 98, 97, 108] + } + ] + } + }, + { + "name": "base_mint" + }, + { + "name": "quote_mint" + }, + { + "name": "base_token_program" + }, + { + "name": "quote_token_program" + }, + { + "name": "associated_token_program", + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "fee_recipient", + "writable": true + }, + { + "name": "associated_quote_fee_recipient", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "fee_recipient" + }, + { + "kind": "account", + "path": "quote_token_program" + }, + { + "kind": "account", + "path": "quote_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": "buyback_fee_recipient", + "writable": true + }, + { + "name": "associated_quote_buyback_fee_recipient", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "buyback_fee_recipient" + }, + { + "kind": "account", + "path": "quote_token_program" + }, + { + "kind": "account", + "path": "quote_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": "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": "base_mint" + } + ] + } + }, + { + "name": "associated_base_bonding_curve", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "bonding_curve" + }, + { + "kind": "account", + "path": "base_token_program" + }, + { + "kind": "account", + "path": "base_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_quote_bonding_curve", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "bonding_curve" + }, + { + "kind": "account", + "path": "quote_token_program" + }, + { + "kind": "account", + "path": "quote_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", + "writable": true, + "signer": true + }, + { + "name": "associated_base_user", + "writable": true + }, + { + "name": "associated_quote_user", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "user" + }, + { + "kind": "account", + "path": "quote_token_program" + }, + { + "kind": "account", + "path": "quote_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": "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": "associated_creator_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "creator_vault" + }, + { + "kind": "account", + "path": "quote_token_program" + }, + { + "kind": "account", + "path": "quote_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": "sharing_config", + "docs": [ + "seeds; the account is intentionally not deserialized here because it may be uninitialized", + "for mints that have not created a fee sharing config. Handlers must check", + "`data_is_empty()` / owner before reading." + ], + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 115, 104, 97, 114, 105, 110, 103, 45, 99, 111, 110, 102, 105, + 103 + ] + }, + { + "kind": "account", + "path": "base_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": "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": "associated_user_volume_accumulator", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "user_volume_accumulator" + }, + { + "kind": "account", + "path": "quote_token_program" + }, + { + "kind": "account", + "path": "quote_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": "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" + }, + { + "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": "spendable_quote_in", + "type": "u64" + }, + { + "name": "min_tokens_out", + "type": "u64" + } + ] + }, { "name": "buy_exact_sol_in", "docs": [ @@ -818,16 +938,7 @@ "- creator_vault: rent.minimum_balance(0)", "- user_volume_accumulator: rent.minimum_balance(UserVolumeAccumulator::LEN)" ], - "discriminator": [ - 56, - 252, - 116, - 8, - 158, - 223, - 205, - 95 - ], + "discriminator": [56, 252, 116, 8, 158, 223, 205, 95], "accounts": [ { "name": "global", @@ -835,14 +946,7 @@ "seeds": [ { "kind": "const", - "value": [ - 103, - 108, - 111, - 98, - 97, - 108 - ] + "value": [103, 108, 111, 98, 97, 108] } ] } @@ -862,19 +966,7 @@ { "kind": "const", "value": [ - 98, - 111, - 110, - 100, - 105, - 110, - 103, - 45, - 99, - 117, - 114, - 118, - 101 + 98, 111, 110, 100, 105, 110, 103, 45, 99, 117, 114, 118, 101 ] }, { @@ -905,38 +997,9 @@ "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 + 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 ] } } @@ -965,19 +1028,7 @@ { "kind": "const", "value": [ - 99, - 114, - 101, - 97, - 116, - 111, - 114, - 45, - 118, - 97, - 117, - 108, - 116 + 99, 114, 101, 97, 116, 111, 114, 45, 118, 97, 117, 108, 116 ] }, { @@ -995,23 +1046,8 @@ { "kind": "const", "value": [ - 95, - 95, - 101, - 118, - 101, - 110, - 116, - 95, - 97, - 117, - 116, - 104, - 111, - 114, - 105, - 116, - 121 + 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, + 114, 105, 116, 121 ] } ] @@ -1028,31 +1064,8 @@ { "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 + 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 ] } ] @@ -1066,29 +1079,8 @@ { "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 + 117, 115, 101, 114, 95, 118, 111, 108, 117, 109, 101, 95, 97, + 99, 99, 117, 109, 117, 108, 97, 116, 111, 114 ] }, { @@ -1104,54 +1096,14 @@ "seeds": [ { "kind": "const", - "value": [ - 102, - 101, - 101, - 95, - 99, - 111, - 110, - 102, - 105, - 103 - ] + "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 + 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 ] } ], @@ -1186,17 +1138,414 @@ ] }, { - "name": "claim_cashback", - "discriminator": [ - 37, - 58, - 35, - 126, - 190, - 53, - 228, - 197 + "name": "buy_v2", + "discriminator": [184, 23, 238, 97, 103, 197, 211, 61], + "accounts": [ + { + "name": "global", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [103, 108, 111, 98, 97, 108] + } + ] + } + }, + { + "name": "base_mint" + }, + { + "name": "quote_mint" + }, + { + "name": "base_token_program" + }, + { + "name": "quote_token_program" + }, + { + "name": "associated_token_program", + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "fee_recipient", + "writable": true + }, + { + "name": "associated_quote_fee_recipient", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "fee_recipient" + }, + { + "kind": "account", + "path": "quote_token_program" + }, + { + "kind": "account", + "path": "quote_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": "buyback_fee_recipient", + "writable": true + }, + { + "name": "associated_quote_buyback_fee_recipient", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "buyback_fee_recipient" + }, + { + "kind": "account", + "path": "quote_token_program" + }, + { + "kind": "account", + "path": "quote_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": "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": "base_mint" + } + ] + } + }, + { + "name": "associated_base_bonding_curve", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "bonding_curve" + }, + { + "kind": "account", + "path": "base_token_program" + }, + { + "kind": "account", + "path": "base_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_quote_bonding_curve", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "bonding_curve" + }, + { + "kind": "account", + "path": "quote_token_program" + }, + { + "kind": "account", + "path": "quote_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", + "writable": true, + "signer": true + }, + { + "name": "associated_base_user", + "writable": true + }, + { + "name": "associated_quote_user", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "user" + }, + { + "kind": "account", + "path": "quote_token_program" + }, + { + "kind": "account", + "path": "quote_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": "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": "associated_creator_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "creator_vault" + }, + { + "kind": "account", + "path": "quote_token_program" + }, + { + "kind": "account", + "path": "quote_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": "sharing_config", + "docs": [ + "seeds; the account is intentionally not deserialized here because it may be uninitialized", + "for mints that have not created a fee sharing config. Handlers must check", + "`data_is_empty()` / owner before reading." + ], + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 115, 104, 97, 114, 105, 110, 103, 45, 99, 111, 110, 102, 105, + 103 + ] + }, + { + "kind": "account", + "path": "base_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": "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": "associated_user_volume_accumulator", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "user_volume_accumulator" + }, + { + "kind": "account", + "path": "quote_token_program" + }, + { + "kind": "account", + "path": "quote_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": "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" + }, + { + "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": "amount", + "type": "u64" + }, + { + "name": "max_sol_cost", + "type": "u64" + } + ] + }, + { + "name": "claim_cashback", + "discriminator": [37, 58, 35, 126, 190, 53, 228, 197], "accounts": [ { "name": "user", @@ -1210,29 +1559,8 @@ { "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 + 117, 115, 101, 114, 95, 118, 111, 108, 117, 109, 101, 95, 97, + 99, 99, 117, 109, 117, 108, 97, 116, 111, 114 ] }, { @@ -1253,23 +1581,118 @@ { "kind": "const", "value": [ - 95, - 95, - 101, - 118, - 101, - 110, - 116, - 95, - 97, - 117, - 116, - 104, - 111, - 114, - 105, - 116, - 121 + 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, + 114, 105, 116, 121 + ] + } + ] + } + }, + { + "name": "program", + "address": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P" + } + ], + "args": [] + }, + { + "name": "claim_cashback_v2", + "discriminator": [122, 243, 204, 65, 94, 116, 29, 55], + "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": "quote_mint" + }, + { + "name": "quote_token_program" + }, + { + "name": "associated_token_program", + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "associated_user_volume_accumulator", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "user_volume_accumulator" + }, + { + "kind": "account", + "path": "quote_token_program" + }, + { + "kind": "account", + "path": "quote_mint" + } + ], + "program": { + "kind": "account", + "path": "associated_token_program" + } + } + }, + { + "name": "associated_quote_user", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "user" + }, + { + "kind": "account", + "path": "quote_token_program" + }, + { + "kind": "account", + "path": "quote_mint" + } + ], + "program": { + "kind": "account", + "path": "associated_token_program" + } + } + }, + { + "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 ] } ] @@ -1284,16 +1707,7 @@ }, { "name": "claim_token_incentives", - "discriminator": [ - 16, - 4, - 71, - 28, - 204, - 1, - 40, - 27 - ], + "discriminator": [16, 4, 71, 28, 204, 1, 40, 27], "accounts": [ { "name": "user" @@ -1319,38 +1733,9 @@ "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 + 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 ] } } @@ -1362,31 +1747,8 @@ { "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 + 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 ] } ] @@ -1413,38 +1775,9 @@ "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 + 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 ] } } @@ -1457,29 +1790,8 @@ { "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 + 117, 115, 101, 114, 95, 118, 111, 108, 117, 109, 101, 95, 97, + 99, 99, 117, 109, 117, 108, 97, 116, 111, 114 ] }, { @@ -1491,9 +1803,7 @@ }, { "name": "mint", - "relations": [ - "global_volume_accumulator" - ] + "relations": ["global_volume_accumulator"] }, { "name": "token_program" @@ -1513,23 +1823,8 @@ { "kind": "const", "value": [ - 95, - 95, - 101, - 118, - 101, - 110, - 116, - 95, - 97, - 117, - 116, - 104, - 111, - 114, - 105, - 116, - 121 + 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, + 114, 105, 116, 121 ] } ] @@ -1549,16 +1844,7 @@ }, { "name": "close_user_volume_accumulator", - "discriminator": [ - 249, - 69, - 164, - 218, - 150, - 103, - 84, - 138 - ], + "discriminator": [249, 69, 164, 218, 150, 103, 84, 138], "accounts": [ { "name": "user", @@ -1573,29 +1859,8 @@ { "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 + 117, 115, 101, 114, 95, 118, 111, 108, 117, 109, 101, 95, 97, + 99, 99, 117, 109, 117, 108, 97, 116, 111, 114 ] }, { @@ -1612,23 +1877,8 @@ { "kind": "const", "value": [ - 95, - 95, - 101, - 118, - 101, - 110, - 116, - 95, - 97, - 117, - 116, - 104, - 111, - 114, - 105, - 116, - 121 + 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, + 114, 105, 116, 121 ] } ] @@ -1645,16 +1895,7 @@ "docs": [ "Collects creator_fee from creator_vault to the coin creator account" ], - "discriminator": [ - 20, - 22, - 86, - 123, - 198, - 28, - 219, - 132 - ], + "discriminator": [20, 22, 86, 123, 198, 28, 219, 132], "accounts": [ { "name": "creator", @@ -1668,19 +1909,7 @@ { "kind": "const", "value": [ - 99, - 114, - 101, - 97, - 116, - 111, - 114, - 45, - 118, - 97, - 117, - 108, - 116 + 99, 114, 101, 97, 116, 111, 114, 45, 118, 97, 117, 108, 116 ] }, { @@ -1701,23 +1930,8 @@ { "kind": "const", "value": [ - 95, - 95, - 101, - 118, - 101, - 110, - 116, - 95, - 97, - 117, - 116, - 104, - 111, - 114, - 105, - 116, - 121 + 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, + 114, 105, 116, 121 ] } ] @@ -1731,19 +1945,8 @@ }, { "name": "create", - "docs": [ - "Creates a new coin and bonding curve." - ], - "discriminator": [ - 24, - 30, - 200, - 40, - 5, - 28, - 7, - 119 - ], + "docs": ["Creates a new coin and bonding curve."], + "discriminator": [24, 30, 200, 40, 5, 28, 7, 119], "accounts": [ { "name": "mint", @@ -1757,19 +1960,7 @@ { "kind": "const", "value": [ - 109, - 105, - 110, - 116, - 45, - 97, - 117, - 116, - 104, - 111, - 114, - 105, - 116, + 109, 105, 110, 116, 45, 97, 117, 116, 104, 111, 114, 105, 116, 121 ] } @@ -1784,19 +1975,7 @@ { "kind": "const", "value": [ - 98, - 111, - 110, - 100, - 105, - 110, - 103, - 45, - 99, - 117, - 114, - 118, - 101 + 98, 111, 110, 100, 105, 110, 103, 45, 99, 117, 114, 118, 101 ] }, { @@ -1818,38 +1997,9 @@ { "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 + 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 ] }, { @@ -1860,38 +2010,9 @@ "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 + 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 ] } } @@ -1902,14 +2023,7 @@ "seeds": [ { "kind": "const", - "value": [ - 103, - 108, - 111, - 98, - 97, - 108 - ] + "value": [103, 108, 111, 98, 97, 108] } ] } @@ -1925,52 +2039,14 @@ "seeds": [ { "kind": "const", - "value": [ - 109, - 101, - 116, - 97, - 100, - 97, - 116, - 97 - ] + "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 + 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 ] }, { @@ -2012,23 +2088,8 @@ { "kind": "const", "value": [ - 95, - 95, - 101, - 118, - 101, - 110, - 116, - 95, - 97, - 117, - 116, - 104, - 111, - 114, - 105, - 116, - 121 + 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, + 114, 105, 116, 121 ] } ] @@ -2059,19 +2120,8 @@ }, { "name": "create_v2", - "docs": [ - "Creates a new spl-22 coin and bonding curve." - ], - "discriminator": [ - 214, - 144, - 76, - 236, - 95, - 139, - 49, - 180 - ], + "docs": ["Creates a new spl-22 coin and bonding curve."], + "discriminator": [214, 144, 76, 236, 95, 139, 49, 180], "accounts": [ { "name": "mint", @@ -2085,19 +2135,7 @@ { "kind": "const", "value": [ - 109, - 105, - 110, - 116, - 45, - 97, - 117, - 116, - 104, - 111, - 114, - 105, - 116, + 109, 105, 110, 116, 45, 97, 117, 116, 104, 111, 114, 105, 116, 121 ] } @@ -2112,19 +2150,7 @@ { "kind": "const", "value": [ - 98, - 111, - 110, - 100, - 105, - 110, - 103, - 45, - 99, - 117, - 114, - 118, - 101 + 98, 111, 110, 100, 105, 110, 103, 45, 99, 117, 114, 118, 101 ] }, { @@ -2155,38 +2181,9 @@ "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 + 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 ] } } @@ -2197,14 +2194,7 @@ "seeds": [ { "kind": "const", - "value": [ - 103, - 108, - 111, - 98, - 97, - 108 - ] + "value": [103, 108, 111, 98, 97, 108] } ] } @@ -2238,57 +2228,16 @@ { "kind": "const", "value": [ - 103, - 108, - 111, - 98, - 97, - 108, - 45, - 112, - 97, - 114, - 97, - 109, - 115 + 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 + 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 ] } } @@ -2300,54 +2249,15 @@ "seeds": [ { "kind": "const", - "value": [ - 115, - 111, - 108, - 45, - 118, - 97, - 117, - 108, - 116 - ] + "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 + 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 ] } } @@ -2360,18 +2270,7 @@ { "kind": "const", "value": [ - 109, - 97, - 121, - 104, - 101, - 109, - 45, - 115, - 116, - 97, - 116, - 101 + 109, 97, 121, 104, 101, 109, 45, 115, 116, 97, 116, 101 ] }, { @@ -2382,38 +2281,9 @@ "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 + 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 ] } } @@ -2429,23 +2299,8 @@ { "kind": "const", "value": [ - 95, - 95, - 101, - 118, - 101, - 110, - 116, - 95, - 97, - 117, - 116, - 104, - 111, - 114, - 105, - 116, - 121 + 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, + 114, 105, 116, 121 ] } ] @@ -2493,22 +2348,11 @@ "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 - ], + "discriminator": [165, 114, 103, 0, 121, 206, 247, 81], "accounts": [ { "name": "mint", - "relations": [ - "sharing_config" - ] + "relations": ["sharing_config"] }, { "name": "bonding_curve", @@ -2517,19 +2361,7 @@ { "kind": "const", "value": [ - 98, - 111, - 110, - 100, - 105, - 110, - 103, - 45, - 99, - 117, - 114, - 118, - 101 + 98, 111, 110, 100, 105, 110, 103, 45, 99, 117, 114, 118, 101 ] }, { @@ -2546,19 +2378,7 @@ { "kind": "const", "value": [ - 115, - 104, - 97, - 114, - 105, - 110, - 103, - 45, - 99, - 111, - 110, - 102, - 105, + 115, 104, 97, 114, 105, 110, 103, 45, 99, 111, 110, 102, 105, 103 ] }, @@ -2570,38 +2390,9 @@ "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 + 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 ] } } @@ -2614,19 +2405,7 @@ { "kind": "const", "value": [ - 99, - 114, - 101, - 97, - 116, - 111, - 114, - 45, - 118, - 97, - 117, - 108, - 116 + 99, 114, 101, 97, 116, 111, 114, 45, 118, 97, 117, 108, 116 ] }, { @@ -2648,23 +2427,8 @@ { "kind": "const", "value": [ - 95, - 95, - 101, - 118, - 101, - 110, - 116, - 95, - 97, - 117, - 116, - 104, - 111, - 114, - 105, - 116, - 121 + 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, + 114, 105, 116, 121 ] } ] @@ -2684,19 +2448,8 @@ }, { "name": "extend_account", - "docs": [ - "Extends the size of program-owned accounts" - ], - "discriminator": [ - 234, - 102, - 194, - 203, - 150, - 72, - 62, - 229 - ], + "docs": ["Extends the size of program-owned accounts"], + "discriminator": [234, 102, 194, 203, 150, 72, 62, 229], "accounts": [ { "name": "account", @@ -2717,23 +2470,8 @@ { "kind": "const", "value": [ - 95, - 95, - 101, - 118, - 101, - 110, - 116, - 95, - 97, - 117, - 116, - 104, - 111, - 114, - 105, - 116, - 121 + 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, + 114, 105, 116, 121 ] } ] @@ -2751,22 +2489,11 @@ "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 - ], + "discriminator": [117, 225, 127, 202, 134, 95, 68, 35], "accounts": [ { "name": "mint", - "relations": [ - "sharing_config" - ] + "relations": ["sharing_config"] }, { "name": "bonding_curve", @@ -2775,19 +2502,7 @@ { "kind": "const", "value": [ - 98, - 111, - 110, - 100, - 105, - 110, - 103, - 45, - 99, - 117, - 114, - 118, - 101 + 98, 111, 110, 100, 105, 110, 103, 45, 99, 117, 114, 118, 101 ] }, { @@ -2804,19 +2519,7 @@ { "kind": "const", "value": [ - 115, - 104, - 97, - 114, - 105, - 110, - 103, - 45, - 99, - 111, - 110, - 102, - 105, + 115, 104, 97, 114, 105, 110, 103, 45, 99, 111, 110, 102, 105, 103 ] }, @@ -2828,38 +2531,9 @@ "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 + 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 ] } } @@ -2871,19 +2545,7 @@ { "kind": "const", "value": [ - 99, - 114, - 101, - 97, - 116, - 111, - 114, - 45, - 118, - 97, - 117, - 108, - 116 + 99, 114, 101, 97, 116, 111, 114, 45, 118, 97, 117, 108, 116 ] }, { @@ -2904,16 +2566,7 @@ }, { "name": "init_user_volume_accumulator", - "discriminator": [ - 94, - 6, - 202, - 115, - 255, - 96, - 232, - 183 - ], + "discriminator": [94, 6, 202, 115, 255, 96, 232, 183], "accounts": [ { "name": "payer", @@ -2931,29 +2584,8 @@ { "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 + 117, 115, 101, 114, 95, 118, 111, 108, 117, 109, 101, 95, 97, + 99, 99, 117, 109, 117, 108, 97, 116, 111, 114 ] }, { @@ -2974,23 +2606,8 @@ { "kind": "const", "value": [ - 95, - 95, - 101, - 118, - 101, - 110, - 116, - 95, - 97, - 117, - 116, - 104, - 111, - 114, - 105, - 116, - 121 + 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, + 114, 105, 116, 121 ] } ] @@ -3004,19 +2621,8 @@ }, { "name": "initialize", - "docs": [ - "Creates the global state." - ], - "discriminator": [ - 175, - 175, - 109, - 31, - 13, - 152, - 155, - 237 - ], + "docs": ["Creates the global state."], + "discriminator": [175, 175, 109, 31, 13, 152, 155, 237], "accounts": [ { "name": "global", @@ -3025,14 +2631,7 @@ "seeds": [ { "kind": "const", - "value": [ - 103, - 108, - 111, - 98, - 97, - 108 - ] + "value": [103, 108, 111, 98, 97, 108] } ] } @@ -3054,16 +2653,7 @@ "docs": [ "Migrates liquidity to pump_amm if the bonding curve is complete" ], - "discriminator": [ - 155, - 234, - 231, - 146, - 236, - 158, - 162, - 30 - ], + "discriminator": [155, 234, 231, 146, 236, 158, 162, 30], "accounts": [ { "name": "global", @@ -3071,14 +2661,7 @@ "seeds": [ { "kind": "const", - "value": [ - 103, - 108, - 111, - 98, - 97, - 108 - ] + "value": [103, 108, 111, 98, 97, 108] } ] } @@ -3086,9 +2669,7 @@ { "name": "withdraw_authority", "writable": true, - "relations": [ - "global" - ] + "relations": ["global"] }, { "name": "mint" @@ -3101,19 +2682,7 @@ { "kind": "const", "value": [ - 98, - 111, - 110, - 100, - 105, - 110, - 103, - 45, - 99, - 117, - 114, - 118, - 101 + 98, 111, 110, 100, 105, 110, 103, 45, 99, 117, 114, 118, 101 ] }, { @@ -3144,38 +2713,9 @@ "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 + 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 ] } } @@ -3203,19 +2743,11 @@ "seeds": [ { "kind": "const", - "value": [ - 112, - 111, - 111, - 108 - ] + "value": [112, 111, 111, 108] }, { "kind": "const", - "value": [ - 0, - 0 - ] + "value": [0, 0] }, { "kind": "account", @@ -3244,19 +2776,7 @@ { "kind": "const", "value": [ - 112, - 111, - 111, - 108, - 45, - 97, - 117, - 116, - 104, - 111, - 114, - 105, - 116, + 112, 111, 111, 108, 45, 97, 117, 116, 104, 111, 114, 105, 116, 121 ] }, @@ -3322,19 +2842,7 @@ { "kind": "const", "value": [ - 103, - 108, - 111, - 98, - 97, - 108, - 95, - 99, - 111, - 110, - 102, - 105, - 103 + 103, 108, 111, 98, 97, 108, 95, 99, 111, 110, 102, 105, 103 ] } ], @@ -3356,18 +2864,7 @@ { "kind": "const", "value": [ - 112, - 111, - 111, - 108, - 95, - 108, - 112, - 95, - 109, - 105, - 110, - 116 + 112, 111, 111, 108, 95, 108, 112, 95, 109, 105, 110, 116 ] }, { @@ -3468,23 +2965,8 @@ { "kind": "const", "value": [ - 95, - 95, - 101, - 118, - 101, - 110, - 116, - 95, - 97, - 117, - 116, - 104, - 111, - 114, - 105, - 116, - 121 + 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, + 114, 105, 116, 121 ] } ], @@ -3501,52 +2983,31 @@ { "kind": "const", "value": [ - 95, - 95, - 101, - 118, - 101, - 110, - 116, - 95, - 97, - 117, - 116, - 104, - 111, - 114, - 105, - 116, - 121 + 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, + 114, 105, 116, 121 ] } ] } }, { - "name": "program" + "name": "program", + "address": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P" + }, + { + "name": "rent", + "address": "SysvarRent111111111111111111111111111111111" } ], "args": [] }, { "name": "migrate_bonding_curve_creator", - "discriminator": [ - 87, - 124, - 52, - 191, - 52, - 38, - 214, - 232 - ], + "discriminator": [87, 124, 52, 191, 52, 38, 214, 232], "accounts": [ { "name": "mint", - "relations": [ - "sharing_config" - ] + "relations": ["sharing_config"] }, { "name": "bonding_curve", @@ -3556,19 +3017,7 @@ { "kind": "const", "value": [ - 98, - 111, - 110, - 100, - 105, - 110, - 103, - 45, - 99, - 117, - 114, - 118, - 101 + 98, 111, 110, 100, 105, 110, 103, 45, 99, 117, 114, 118, 101 ] }, { @@ -3585,19 +3034,7 @@ { "kind": "const", "value": [ - 115, - 104, - 97, - 114, - 105, - 110, - 103, - 45, - 99, - 111, - 110, - 102, - 105, + 115, 104, 97, 114, 105, 110, 103, 45, 99, 111, 110, 102, 105, 103 ] }, @@ -3609,38 +3046,9 @@ "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 + 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 ] } } @@ -3652,23 +3060,8 @@ { "kind": "const", "value": [ - 95, - 95, - 101, - 118, - 101, - 110, - 116, - 95, - 97, - 117, - 116, - 104, - 111, - 114, - 105, - 116, - 121 + 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, + 114, 105, 116, 121 ] } ] @@ -3681,38 +3074,431 @@ "args": [] }, { - "name": "sell", + "name": "migrate_v2", "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 + "Migrates liquidity to pump_amm if the bonding curve is complete" ], + "discriminator": [187, 203, 18, 31, 206, 237, 254, 41], "accounts": [ { "name": "global", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [103, 108, 111, 98, 97, 108] + } + ] + } + }, + { + "name": "withdraw_authority", + "writable": true, + "relations": ["global"] + }, + { + "name": "base_mint" + }, + { + "name": "quote_mint" + }, + { + "name": "bonding_curve", + "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ - 103, - 108, - 111, - 98, - 97, - 108 + 98, 111, 110, 100, 105, 110, 103, 45, 99, 117, 114, 118, 101 ] + }, + { + "kind": "account", + "path": "base_mint" + } + ] + } + }, + { + "name": "associated_base_bonding_curve", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "bonding_curve" + }, + { + "kind": "account", + "path": "base_token_program" + }, + { + "kind": "account", + "path": "base_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_quote_bonding_curve", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "bonding_curve" + }, + { + "kind": "account", + "path": "quote_token_program" + }, + { + "kind": "account", + "path": "quote_mint" + } + ], + "program": { + "kind": "account", + "path": "associated_token_program" + } + } + }, + { + "name": "user", + "signer": true + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + }, + { + "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": "base_mint" + }, + { + "kind": "account", + "path": "quote_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": "base_mint" + } + ] + } + }, + { + "name": "pool_authority_mint_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "pool_authority" + }, + { + "kind": "account", + "path": "base_token_program" + }, + { + "kind": "account", + "path": "base_mint" + } + ], + "program": { + "kind": "account", + "path": "associated_token_program" + } + } + }, + { + "name": "pool_authority_quote_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "pool_authority" + }, + { + "kind": "account", + "path": "quote_token_program" + }, + { + "kind": "account", + "path": "quote_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": "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": "base_token_program" + }, + { + "kind": "account", + "path": "base_mint" + } + ], + "program": { + "kind": "account", + "path": "associated_token_program" + } + } + }, + { + "name": "pool_quote_token_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "pool" + }, + { + "kind": "account", + "path": "quote_token_program" + }, + { + "kind": "account", + "path": "quote_mint" + } + ], + "program": { + "kind": "account", + "path": "associated_token_program" + } + } + }, + { + "name": "base_token_program" + }, + { + "name": "quote_token_program" + }, + { + "name": "token_2022_program", + "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" + }, + { + "name": "associated_token_program", + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "pump_amm_event_authority" + }, + { + "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": "remove_quote_mint", + "discriminator": [177, 65, 223, 38, 88, 209, 158, 155], + "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": "quote_mint", + "type": "pubkey" + } + ] + }, + { + "name": "sell", + "docs": [ + "Sells tokens into a bonding curve.", + "For cashback coins, pass as remaining_accounts: [0] user_volume_accumulator,", + "[1] bonding_curve_v2. 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] } ] } @@ -3732,19 +3518,7 @@ { "kind": "const", "value": [ - 98, - 111, - 110, - 100, - 105, - 110, - 103, - 45, - 99, - 117, - 114, - 118, - 101 + 98, 111, 110, 100, 105, 110, 103, 45, 99, 117, 114, 118, 101 ] }, { @@ -3775,38 +3549,9 @@ "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 + 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 ] } } @@ -3832,19 +3577,7 @@ { "kind": "const", "value": [ - 99, - 114, - 101, - 97, - 116, - 111, - 114, - 45, - 118, - 97, - 117, - 108, - 116 + 99, 114, 101, 97, 116, 111, 114, 45, 118, 97, 117, 108, 116 ] }, { @@ -3865,23 +3598,8 @@ { "kind": "const", "value": [ - 95, - 95, - 101, - 118, - 101, - 110, - 116, - 95, - 97, - 117, - 116, - 104, - 111, - 114, - 105, - 116, - 121 + 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, + 114, 105, 116, 121 ] } ] @@ -3897,54 +3615,14 @@ "seeds": [ { "kind": "const", - "value": [ - 102, - 101, - 101, - 95, - 99, - 111, - 110, - 102, - 105, - 103 - ] + "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 + 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 ] } ], @@ -3970,28 +3648,409 @@ } ] }, + { + "name": "sell_v2", + "discriminator": [93, 246, 130, 60, 231, 233, 64, 178], + "accounts": [ + { + "name": "global", + "pda": { + "seeds": [ + { + "kind": "const", + "value": [103, 108, 111, 98, 97, 108] + } + ] + } + }, + { + "name": "base_mint" + }, + { + "name": "quote_mint" + }, + { + "name": "base_token_program" + }, + { + "name": "quote_token_program" + }, + { + "name": "associated_token_program", + "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" + }, + { + "name": "fee_recipient", + "writable": true + }, + { + "name": "associated_quote_fee_recipient", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "fee_recipient" + }, + { + "kind": "account", + "path": "quote_token_program" + }, + { + "kind": "account", + "path": "quote_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": "buyback_fee_recipient", + "writable": true + }, + { + "name": "associated_quote_buyback_fee_recipient", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "buyback_fee_recipient" + }, + { + "kind": "account", + "path": "quote_token_program" + }, + { + "kind": "account", + "path": "quote_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": "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": "base_mint" + } + ] + } + }, + { + "name": "associated_base_bonding_curve", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "bonding_curve" + }, + { + "kind": "account", + "path": "base_token_program" + }, + { + "kind": "account", + "path": "base_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_quote_bonding_curve", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "bonding_curve" + }, + { + "kind": "account", + "path": "quote_token_program" + }, + { + "kind": "account", + "path": "quote_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", + "writable": true, + "signer": true + }, + { + "name": "associated_base_user", + "writable": true + }, + { + "name": "associated_quote_user", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "user" + }, + { + "kind": "account", + "path": "quote_token_program" + }, + { + "kind": "account", + "path": "quote_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": "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": "associated_creator_vault", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "creator_vault" + }, + { + "kind": "account", + "path": "quote_token_program" + }, + { + "kind": "account", + "path": "quote_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": "sharing_config", + "docs": [ + "seeds; the account is intentionally not deserialized here because it may be uninitialized", + "for mints that have not created a fee sharing config. Handlers must check", + "`data_is_empty()` / owner before reading." + ], + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 115, 104, 97, 114, 105, 110, 103, 45, 99, 111, 110, 102, 105, + 103 + ] + }, + { + "kind": "account", + "path": "base_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": "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": "associated_user_volume_accumulator", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "account", + "path": "user_volume_accumulator" + }, + { + "kind": "account", + "path": "quote_token_program" + }, + { + "kind": "account", + "path": "quote_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": "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" + }, + { + "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": "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 - ], + "discriminator": [254, 148, 255, 112, 207, 142, 170, 165], "accounts": [ { "name": "set_creator_authority", "signer": true, - "relations": [ - "global" - ] + "relations": ["global"] }, { "name": "global", @@ -3999,14 +4058,7 @@ "seeds": [ { "kind": "const", - "value": [ - 103, - 108, - 111, - 98, - 97, - 108 - ] + "value": [103, 108, 111, 98, 97, 108] } ] } @@ -4020,52 +4072,14 @@ "seeds": [ { "kind": "const", - "value": [ - 109, - 101, - 116, - 97, - 100, - 97, - 116, - 97 - ] + "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 + 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 ] }, { @@ -4076,38 +4090,9 @@ "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 + 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 ] } } @@ -4120,19 +4105,7 @@ { "kind": "const", "value": [ - 98, - 111, - 110, - 100, - 105, - 110, - 103, - 45, - 99, - 117, - 114, - 118, - 101 + 98, 111, 110, 100, 105, 110, 103, 45, 99, 117, 114, 118, 101 ] }, { @@ -4149,23 +4122,8 @@ { "kind": "const", "value": [ - 95, - 95, - 101, - 118, - 101, - 110, - 116, - 95, - 97, - 117, - 116, - 104, - 111, - 114, - 105, - 116, - 121 + 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, + 114, 105, 116, 121 ] } ] @@ -4184,16 +4142,7 @@ }, { "name": "set_mayhem_virtual_params", - "discriminator": [ - 61, - 169, - 188, - 191, - 153, - 149, - 42, - 97 - ], + "discriminator": [61, 169, 188, 191, 153, 149, 42, 97], "accounts": [ { "name": "sol_vault_authority", @@ -4203,54 +4152,15 @@ "seeds": [ { "kind": "const", - "value": [ - 115, - 111, - 108, - 45, - 118, - 97, - 117, - 108, - 116 - ] + "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 + 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 ] } } @@ -4276,38 +4186,9 @@ "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 + 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 ] } } @@ -4321,14 +4202,7 @@ "seeds": [ { "kind": "const", - "value": [ - 103, - 108, - 111, - 98, - 97, - 108 - ] + "value": [103, 108, 111, 98, 97, 108] } ] } @@ -4341,19 +4215,7 @@ { "kind": "const", "value": [ - 98, - 111, - 110, - 100, - 105, - 110, - 103, - 45, - 99, - 117, - 114, - 118, - 101 + 98, 111, 110, 100, 105, 110, 103, 45, 99, 117, 114, 118, 101 ] }, { @@ -4374,23 +4236,8 @@ { "kind": "const", "value": [ - 95, - 95, - 101, - 118, - 101, - 110, - 116, - 95, - 97, - 117, - 116, - 104, - 111, - 114, - 105, - 116, - 121 + 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, + 114, 105, 116, 121 ] } ] @@ -4407,16 +4254,7 @@ "docs": [ "Syncs the bonding curve creator with the Metaplex metadata creator if it exists" ], - "discriminator": [ - 138, - 96, - 174, - 217, - 48, - 85, - 197, - 246 - ], + "discriminator": [138, 96, 174, 217, 48, 85, 197, 246], "accounts": [ { "name": "mint" @@ -4427,52 +4265,14 @@ "seeds": [ { "kind": "const", - "value": [ - 109, - 101, - 116, - 97, - 100, - 97, - 116, - 97 - ] + "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 + 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 ] }, { @@ -4483,38 +4283,9 @@ "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 + 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 ] } } @@ -4527,19 +4298,7 @@ { "kind": "const", "value": [ - 98, - 111, - 110, - 100, - 105, - 110, - 103, - 45, - 99, - 117, - 114, - 118, - 101 + 98, 111, 110, 100, 105, 110, 103, 45, 99, 117, 114, 118, 101 ] }, { @@ -4556,23 +4315,8 @@ { "kind": "const", "value": [ - 95, - 95, - 101, - 118, - 101, - 110, - 116, - 95, - 97, - 117, - 116, - 104, - 111, - 114, - 105, - 116, - 121 + 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, + 114, 105, 116, 121 ] } ] @@ -4586,19 +4330,8 @@ }, { "name": "set_params", - "docs": [ - "Sets the global state parameters." - ], - "discriminator": [ - 27, - 234, - 178, - 52, - 147, - 2, - 187, - 141 - ], + "docs": ["Sets the global state parameters."], + "discriminator": [27, 234, 178, 52, 147, 2, 187, 141], "accounts": [ { "name": "global", @@ -4607,14 +4340,7 @@ "seeds": [ { "kind": "const", - "value": [ - 103, - 108, - 111, - 98, - 97, - 108 - ] + "value": [103, 108, 111, 98, 97, 108] } ] } @@ -4623,9 +4349,7 @@ "name": "authority", "writable": true, "signer": true, - "relations": [ - "global" - ] + "relations": ["global"] }, { "name": "event_authority", @@ -4634,23 +4358,8 @@ { "kind": "const", "value": [ - 95, - 95, - 101, - 118, - 101, - 110, - 116, - 95, - 97, - 117, - 116, - 104, - 111, - 114, - 105, - 116, - 121 + 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, + 114, 105, 116, 121 ] } ] @@ -4709,16 +4418,7 @@ }, { "name": "set_reserved_fee_recipients", - "discriminator": [ - 111, - 172, - 162, - 232, - 114, - 89, - 213, - 142 - ], + "discriminator": [111, 172, 162, 232, 114, 89, 213, 142], "accounts": [ { "name": "global", @@ -4727,14 +4427,7 @@ "seeds": [ { "kind": "const", - "value": [ - 103, - 108, - 111, - 98, - 97, - 108 - ] + "value": [103, 108, 111, 98, 97, 108] } ] } @@ -4742,9 +4435,7 @@ { "name": "authority", "signer": true, - "relations": [ - "global" - ] + "relations": ["global"] }, { "name": "event_authority", @@ -4753,23 +4444,8 @@ { "kind": "const", "value": [ - 95, - 95, - 101, - 118, - 101, - 110, - 116, - 95, - 97, - 117, - 116, - 104, - 111, - 114, - 105, - 116, - 121 + 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, + 114, 105, 116, 121 ] } ] @@ -4787,17 +4463,55 @@ ] }, { - "name": "sync_user_volume_accumulator", - "discriminator": [ - 86, - 31, - 192, - 87, - 163, - 87, - 79, - 238 + "name": "set_virtual_quote_reserves", + "discriminator": [101, 135, 191, 104, 9, 88, 20, 96], + "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_quote_reserves", + "type": "u64" + } + ] + }, + { + "name": "sync_user_volume_accumulator", + "discriminator": [86, 31, 192, 87, 163, 87, 79, 238], "accounts": [ { "name": "user" @@ -4809,31 +4523,8 @@ { "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 + 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 ] } ] @@ -4847,29 +4538,8 @@ { "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 + 117, 115, 101, 114, 95, 118, 111, 108, 117, 109, 101, 95, 97, + 99, 99, 117, 109, 117, 108, 97, 116, 111, 114 ] }, { @@ -4886,23 +4556,8 @@ { "kind": "const", "value": [ - 95, - 95, - 101, - 118, - 101, - 110, - 116, - 95, - 97, - 117, - 116, - 104, - 111, - 114, - 105, - 116, - 121 + 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, + 114, 105, 116, 121 ] } ] @@ -4916,16 +4571,7 @@ }, { "name": "toggle_cashback_enabled", - "discriminator": [ - 115, - 103, - 224, - 255, - 189, - 89, - 86, - 195 - ], + "discriminator": [115, 103, 224, 255, 189, 89, 86, 195], "accounts": [ { "name": "global", @@ -4934,14 +4580,7 @@ "seeds": [ { "kind": "const", - "value": [ - 103, - 108, - 111, - 98, - 97, - 108 - ] + "value": [103, 108, 111, 98, 97, 108] } ] } @@ -4950,9 +4589,7 @@ "name": "authority", "writable": true, "signer": true, - "relations": [ - "global" - ] + "relations": ["global"] }, { "name": "event_authority", @@ -4961,23 +4598,8 @@ { "kind": "const", "value": [ - 95, - 95, - 101, - 118, - 101, - 110, - 116, - 95, - 97, - 117, - 116, - 104, - 111, - 114, - 105, - 116, - 121 + 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, + 114, 105, 116, 121 ] } ] @@ -4996,16 +4618,7 @@ }, { "name": "toggle_create_v2", - "discriminator": [ - 28, - 255, - 230, - 240, - 172, - 107, - 203, - 171 - ], + "discriminator": [28, 255, 230, 240, 172, 107, 203, 171], "accounts": [ { "name": "global", @@ -5014,14 +4627,7 @@ "seeds": [ { "kind": "const", - "value": [ - 103, - 108, - 111, - 98, - 97, - 108 - ] + "value": [103, 108, 111, 98, 97, 108] } ] } @@ -5030,9 +4636,7 @@ "name": "authority", "writable": true, "signer": true, - "relations": [ - "global" - ] + "relations": ["global"] }, { "name": "event_authority", @@ -5041,23 +4645,8 @@ { "kind": "const", "value": [ - 95, - 95, - 101, - 118, - 101, - 110, - 116, - 95, - 97, - 117, - 116, - 104, - 111, - 114, - 105, - 116, - 121 + 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, + 114, 105, 116, 121 ] } ] @@ -5076,16 +4665,7 @@ }, { "name": "toggle_mayhem_mode", - "discriminator": [ - 1, - 9, - 111, - 208, - 100, - 31, - 255, - 163 - ], + "discriminator": [1, 9, 111, 208, 100, 31, 255, 163], "accounts": [ { "name": "global", @@ -5094,14 +4674,7 @@ "seeds": [ { "kind": "const", - "value": [ - 103, - 108, - 111, - 98, - 97, - 108 - ] + "value": [103, 108, 111, 98, 97, 108] } ] } @@ -5110,9 +4683,7 @@ "name": "authority", "writable": true, "signer": true, - "relations": [ - "global" - ] + "relations": ["global"] }, { "name": "event_authority", @@ -5121,23 +4692,8 @@ { "kind": "const", "value": [ - 95, - 95, - 101, - 118, - 101, - 110, - 116, - 95, - 97, - 117, - 116, - 104, - 111, - 114, - 105, - 116, - 121 + 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, + 114, 105, 116, 121 ] } ] @@ -5155,43 +4711,74 @@ ] }, { - "name": "update_global_authority", - "discriminator": [ - 227, - 181, - 74, - 196, - 208, - 21, - 97, - 213 - ], + "name": "update_buyback_config", + "discriminator": [251, 224, 171, 146, 160, 26, 113, 233], "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": [ - 103, - 108, - 111, - 98, - 97, - 108 + 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, + 114, 105, 116, 121 ] } ] } }, + { + "name": "program" + } + ], + "args": [ + { + "name": "buyback_basis_points", + "type": { + "option": "u64" + } + } + ] + }, + { + "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" - ] + "relations": ["global"] }, { "name": "new_authority" @@ -5203,23 +4790,8 @@ { "kind": "const", "value": [ - 95, - 95, - 101, - 118, - 101, - 110, - 116, - 95, - 97, - 117, - 116, - 104, - 111, - 114, - 105, - 116, - 121 + 95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, + 114, 105, 116, 121 ] } ] @@ -5235,382 +4807,121 @@ "accounts": [ { "name": "BondingCurve", - "discriminator": [ - 23, - 183, - 248, - 55, - 96, - 216, - 172, - 96 - ] + "discriminator": [23, 183, 248, 55, 96, 216, 172, 96] }, { "name": "FeeConfig", - "discriminator": [ - 143, - 52, - 146, - 187, - 219, - 123, - 76, - 155 - ] + "discriminator": [143, 52, 146, 187, 219, 123, 76, 155] }, { "name": "Global", - "discriminator": [ - 167, - 232, - 232, - 177, - 200, - 108, - 114, - 127 - ] + "discriminator": [167, 232, 232, 177, 200, 108, 114, 127] }, { "name": "GlobalVolumeAccumulator", - "discriminator": [ - 202, - 42, - 246, - 43, - 142, - 190, - 30, - 255 - ] + "discriminator": [202, 42, 246, 43, 142, 190, 30, 255] }, { "name": "SharingConfig", - "discriminator": [ - 216, - 74, - 9, - 0, - 56, - 140, - 93, - 75 - ] + "discriminator": [216, 74, 9, 0, 56, 140, 93, 75] }, { "name": "UserVolumeAccumulator", - "discriminator": [ - 86, - 255, - 112, - 14, - 102, - 53, - 154, - 250 - ] + "discriminator": [86, 255, 112, 14, 102, 53, 154, 250] } ], "events": [ { "name": "AdminSetCreatorEvent", - "discriminator": [ - 64, - 69, - 192, - 104, - 29, - 30, - 25, - 107 - ] + "discriminator": [64, 69, 192, 104, 29, 30, 25, 107] }, { "name": "AdminSetIdlAuthorityEvent", - "discriminator": [ - 245, - 59, - 70, - 34, - 75, - 185, - 109, - 92 - ] + "discriminator": [245, 59, 70, 34, 75, 185, 109, 92] }, { "name": "AdminUpdateTokenIncentivesEvent", - "discriminator": [ - 147, - 250, - 108, - 120, - 247, - 29, - 67, - 222 - ] + "discriminator": [147, 250, 108, 120, 247, 29, 67, 222] }, { "name": "ClaimCashbackEvent", - "discriminator": [ - 226, - 214, - 246, - 33, - 7, - 242, - 147, - 229 - ] + "discriminator": [226, 214, 246, 33, 7, 242, 147, 229] }, { "name": "ClaimTokenIncentivesEvent", - "discriminator": [ - 79, - 172, - 246, - 49, - 205, - 91, - 206, - 232 - ] + "discriminator": [79, 172, 246, 49, 205, 91, 206, 232] }, { "name": "CloseUserVolumeAccumulatorEvent", - "discriminator": [ - 146, - 159, - 189, - 172, - 146, - 88, - 56, - 244 - ] + "discriminator": [146, 159, 189, 172, 146, 88, 56, 244] }, { "name": "CollectCreatorFeeEvent", - "discriminator": [ - 122, - 2, - 127, - 1, - 14, - 191, - 12, - 175 - ] + "discriminator": [122, 2, 127, 1, 14, 191, 12, 175] }, { "name": "CompleteEvent", - "discriminator": [ - 95, - 114, - 97, - 156, - 212, - 46, - 152, - 8 - ] + "discriminator": [95, 114, 97, 156, 212, 46, 152, 8] }, { "name": "CompletePumpAmmMigrationEvent", - "discriminator": [ - 189, - 233, - 93, - 185, - 92, - 148, - 234, - 148 - ] + "discriminator": [189, 233, 93, 185, 92, 148, 234, 148] }, { "name": "CreateEvent", - "discriminator": [ - 27, - 114, - 169, - 77, - 222, - 235, - 99, - 118 - ] + "discriminator": [27, 114, 169, 77, 222, 235, 99, 118] }, { "name": "DistributeCreatorFeesEvent", - "discriminator": [ - 165, - 55, - 129, - 112, - 4, - 179, - 202, - 40 - ] + "discriminator": [165, 55, 129, 112, 4, 179, 202, 40] }, { "name": "ExtendAccountEvent", - "discriminator": [ - 97, - 97, - 215, - 144, - 93, - 146, - 22, - 124 - ] + "discriminator": [97, 97, 215, 144, 93, 146, 22, 124] }, { "name": "InitUserVolumeAccumulatorEvent", - "discriminator": [ - 134, - 36, - 13, - 72, - 232, - 101, - 130, - 216 - ] + "discriminator": [134, 36, 13, 72, 232, 101, 130, 216] }, { "name": "MigrateBondingCurveCreatorEvent", - "discriminator": [ - 155, - 167, - 104, - 220, - 213, - 108, - 243, - 3 - ] + "discriminator": [155, 167, 104, 220, 213, 108, 243, 3] }, { "name": "MinimumDistributableFeeEvent", - "discriminator": [ - 168, - 216, - 132, - 239, - 235, - 182, - 49, - 52 - ] + "discriminator": [168, 216, 132, 239, 235, 182, 49, 52] }, { "name": "ReservedFeeRecipientsEvent", - "discriminator": [ - 43, - 188, - 250, - 18, - 221, - 75, - 187, - 95 - ] + "discriminator": [43, 188, 250, 18, 221, 75, 187, 95] }, { "name": "SetCreatorEvent", - "discriminator": [ - 237, - 52, - 123, - 37, - 245, - 251, - 72, - 210 - ] + "discriminator": [237, 52, 123, 37, 245, 251, 72, 210] }, { "name": "SetMetaplexCreatorEvent", - "discriminator": [ - 142, - 203, - 6, - 32, - 127, - 105, - 191, - 162 - ] + "discriminator": [142, 203, 6, 32, 127, 105, 191, 162] }, { "name": "SetParamsEvent", - "discriminator": [ - 223, - 195, - 159, - 246, - 62, - 48, - 143, - 131 - ] + "discriminator": [223, 195, 159, 246, 62, 48, 143, 131] }, { "name": "SyncUserVolumeAccumulatorEvent", - "discriminator": [ - 197, - 122, - 167, - 124, - 116, - 81, - 91, - 255 - ] + "discriminator": [197, 122, 167, 124, 116, 81, 91, 255] }, { "name": "TradeEvent", - "discriminator": [ - 189, - 219, - 127, - 211, - 78, - 230, - 97, - 238 - ] + "discriminator": [189, 219, 127, 211, 78, 230, 97, 238] }, { "name": "UpdateGlobalAuthorityEvent", - "discriminator": [ - 182, - 195, - 137, - 42, - 35, - 206, - 207, - 247 - ] + "discriminator": [182, 195, 137, 42, 35, 206, 207, 247] }, { "name": "UpdateMayhemVirtualParamsEvent", - "discriminator": [ - 117, - 123, - 228, - 182, - 161, - 168, - 220, - 214 - ] + "discriminator": [117, 123, 228, 182, 161, 168, 220, 214] } ], "errors": [ @@ -5883,6 +5194,68 @@ "code": 6056, "name": "CashbackNotEnabled", "msg": "Cashback is not enabled" + }, + { + "code": 6057, + "name": "BuybackFeeRecipientNotAuthorized", + "msg": "Buyback fee recipient not authorized" + }, + { + "code": 6058, + "name": "AllBuybackFeeRecipientsShouldBeNonZero" + }, + { + "code": 6059, + "name": "NotUniqueBuybackFeeRecipients" + }, + { + "code": 6060, + "name": "BuybackBasisPointsOutOfRange", + "msg": "buyback_basis_points must be <= 10_000" + }, + { + "code": 6061, + "name": "WrongBuybackFeeRecipientsCount", + "msg": "buyback fee recipients require exactly 8 remaining accounts (or none)" + }, + { + "code": 6062, + "name": "BuybackFeeRecipientMissing" + }, + { + "code": 6063, + "name": "UnsupportedQuoteMint", + "msg": "Unsupported quote mint" + }, + { + "code": 6064, + "name": "InvalidQuoteTokenProgram", + "msg": "Create v2: quote token program must be legacy SPL Token" + }, + { + "code": 6065, + "name": "InvalidAssociatedQuoteBondingCurve", + "msg": "Create v2: associated quote bonding curve address does not match derivation" + }, + { + "code": 6066, + "name": "QuoteMintWhitelistFull", + "msg": "Quote mint whitelist is full" + }, + { + "code": 6067, + "name": "QuoteMintAlreadyWhitelisted", + "msg": "Quote mint is already whitelisted" + }, + { + "code": 6068, + "name": "QuoteMintNotWhitelisted", + "msg": "Quote mint is not in the whitelist" + }, + { + "code": 6069, + "name": "QuoteMintNotEligibleForWhitelist", + "msg": "Quote mint cannot be added or removed via whitelist (default or native SOL mint)" } ], "types": [ @@ -5976,7 +5349,7 @@ "type": "u64" }, { - "name": "virtual_sol_reserves", + "name": "virtual_quote_reserves", "type": "u64" }, { @@ -5984,7 +5357,7 @@ "type": "u64" }, { - "name": "real_sol_reserves", + "name": "real_quote_reserves", "type": "u64" }, { @@ -6006,6 +5379,10 @@ { "name": "is_cashback_coin", "type": "bool" + }, + { + "name": "quote_mint", + "type": "pubkey" } ] } @@ -6142,6 +5519,10 @@ { "name": "timestamp", "type": "i64" + }, + { + "name": "quote_mint", + "type": "pubkey" } ] } @@ -6264,6 +5645,14 @@ { "name": "is_cashback_enabled", "type": "bool" + }, + { + "name": "quote_mint", + "type": "pubkey" + }, + { + "name": "virtual_quote_reserves", + "type": "u64" } ] } @@ -6368,6 +5757,16 @@ } } } + }, + { + "name": "stable_fee_tiers", + "type": { + "vec": { + "defined": { + "name": "FeeTier" + } + } + } } ] } @@ -6419,9 +5818,7 @@ "fields": [ { "name": "initialized", - "docs": [ - "Unused" - ], + "docs": ["Unused"], "type": "bool" }, { @@ -6458,9 +5855,7 @@ }, { "name": "enable_migrate", - "docs": [ - "Unused" - ], + "docs": ["Unused"], "type": "bool" }, { @@ -6474,10 +5869,7 @@ { "name": "fee_recipients", "type": { - "array": [ - "pubkey", - 7 - ] + "array": ["pubkey", 7] } }, { @@ -6507,15 +5899,32 @@ { "name": "reserved_fee_recipients", "type": { - "array": [ - "pubkey", - 7 - ] + "array": ["pubkey", 7] } }, { "name": "is_cashback_enabled", "type": "bool" + }, + { + "name": "buyback_fee_recipients", + "type": { + "array": ["pubkey", 8] + } + }, + { + "name": "buyback_basis_points", + "type": "u64" + }, + { + "name": "initial_virtual_quote_reserves", + "type": "u64" + }, + { + "name": "whitelisted_quote_mints", + "type": { + "array": ["pubkey", 1] + } } ] } @@ -6544,19 +5953,13 @@ { "name": "total_token_supply", "type": { - "array": [ - "u64", - 30 - ] + "array": ["u64", 30] } }, { "name": "sol_volumes", "type": { - "array": [ - "u64", - 30 - ] + "array": ["u64", 30] } } ] @@ -6638,9 +6041,7 @@ "name": "OptionBool", "type": { "kind": "struct", - "fields": [ - "bool" - ] + "fields": ["bool"] } }, { @@ -6659,10 +6060,7 @@ { "name": "reserved_fee_recipients", "type": { - "array": [ - "pubkey", - 7 - ] + "array": ["pubkey", 7] } } ] @@ -6768,10 +6166,7 @@ { "name": "fee_recipients", "type": { - "array": [ - "pubkey", - 8 - ] + "array": ["pubkey", 8] } }, { @@ -6877,9 +6272,7 @@ }, { "name": "TradeEvent", - "docs": [ - "ix_name: \"buy\" | \"sell\" | \"buy_exact_sol_in\"" - ], + "docs": ["ix_name: \"buy\" | \"sell\" | \"buy_exact_sol_in\""], "type": { "kind": "struct", "fields": [ @@ -6982,6 +6375,40 @@ { "name": "cashback", "type": "u64" + }, + { + "name": "buyback_fee_basis_points", + "type": "u64" + }, + { + "name": "buyback_fee", + "type": "u64" + }, + { + "name": "shareholders", + "type": { + "vec": { + "defined": { + "name": "Shareholder" + } + } + } + }, + { + "name": "quote_mint", + "type": "pubkey" + }, + { + "name": "quote_amount", + "type": "u64" + }, + { + "name": "virtual_quote_reserves", + "type": "u64" + }, + { + "name": "real_quote_reserves", + "type": "u64" } ] } @@ -7095,4 +6522,4 @@ } } ] -} \ No newline at end of file +} diff --git a/src/common/bonding_curve.rs b/src/common/bonding_curve.rs index b6785d2..ec1736e 100755 --- a/src/common/bonding_curve.rs +++ b/src/common/bonding_curve.rs @@ -10,9 +10,10 @@ //! //! - `discriminator`: Unique identifier for the bonding curve //! - `virtual_token_reserves`: Virtual token reserves used for price calculations -//! - `virtual_sol_reserves`: Virtual SOL reserves used for price calculations +//! - `virtual_sol_reserves`: Virtual **quote** reserves (historical name; lamports for SOL-paired coins) //! - `real_token_reserves`: Actual token reserves available for trading -//! - `real_sol_reserves`: Actual SOL reserves available for trading +//! - `real_sol_reserves`: Actual **quote** reserves on the curve (historical name) +//! - `quote_mint`: Quote mint from on-chain layout (`Pubkey::default` = legacy SOL-paired; pass WSOL mint in `buy_v2` / `sell_v2`) //! - `token_total_supply`: Total supply of tokens //! - `complete`: Whether the bonding curve is complete/finalized //! @@ -25,7 +26,7 @@ //! - `get_final_market_cap_sol`: Calculates the final market cap in SOL after all tokens are sold //! - `get_buy_out_price`: Calculates the price to buy out all remaining tokens -use borsh::BorshDeserialize; +use anyhow::{anyhow, Context}; use serde::{Deserialize, Serialize}; use solana_sdk::pubkey::Pubkey; @@ -36,13 +37,11 @@ use crate::instruction::utils::pumpfun::global_constants::{ use crate::instruction::utils::pumpfun::{get_bonding_curve_pda, get_creator_vault_pda}; /// Represents the global configuration account for token pricing and fees -#[derive(Debug, Clone, Serialize, Deserialize, Default, BorshDeserialize)] +#[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct BondingCurveAccount { - /// Unique identifier for the bonding curve - #[borsh(skip)] + /// Unique identifier for the bonding curve (unused on-chain decode path) pub discriminator: u64, - /// Account address - #[borsh(skip)] + /// Bonding curve PDA address (filled by RPC helpers) pub account: Pubkey, /// Virtual token reserves used for price calculations pub virtual_token_reserves: u64, @@ -62,9 +61,69 @@ pub struct BondingCurveAccount { pub is_mayhem_mode: bool, /// Whether this coin has cashback enabled (creator fee redirected to users) pub is_cashback_coin: bool, + /// On-chain `quote_mint` (post bonding-curve upgrade). `Pubkey::default()` means legacy SOL quote (use wrapped SOL in `*_v2` instructions). + pub quote_mint: Pubkey, } +/// Payload after the 8-byte Anchor account discriminator (`account.data[8..]`). +const BC_PAYLOAD_MIN_LEGACY: usize = 5 * 8 + 1 + 32 + 1 + 1; + impl BondingCurveAccount { + /// Decode bonding curve account data (`full_account.data`, including 8-byte disc prefix). + pub fn decode_from_chain_account_data(data: &[u8]) -> anyhow::Result { + if data.len() < 8 + BC_PAYLOAD_MIN_LEGACY { + return Err(anyhow!( + "bonding curve account too short: {} bytes", + data.len() + )); + } + let payload = &data[8..]; + Self::decode_payload(payload) + } + + fn decode_payload(payload: &[u8]) -> anyhow::Result { + if payload.len() < BC_PAYLOAD_MIN_LEGACY { + return Err(anyhow!( + "bonding curve payload too short: {}", + payload.len() + )); + } + let virtual_token_reserves = + u64::from_le_bytes(payload[0..8].try_into().map_err(|_| anyhow!("vt"))?); + let virtual_sol_reserves = + u64::from_le_bytes(payload[8..16].try_into().map_err(|_| anyhow!("vs"))?); + let real_token_reserves = + u64::from_le_bytes(payload[16..24].try_into().map_err(|_| anyhow!("rt"))?); + let real_sol_reserves = + u64::from_le_bytes(payload[24..32].try_into().map_err(|_| anyhow!("rs"))?); + let token_total_supply = + u64::from_le_bytes(payload[32..40].try_into().map_err(|_| anyhow!("tts"))?); + let complete = payload[40] != 0; + let creator = + Pubkey::try_from(&payload[41..73]).context("creator pubkey")?; + let is_mayhem_mode = payload[73] != 0; + let is_cashback_coin = payload[74] != 0; + let quote_mint = if payload.len() >= BC_PAYLOAD_MIN_LEGACY + 32 { + Pubkey::try_from(&payload[75..107]).context("quote_mint")? + } else { + Pubkey::default() + }; + Ok(Self { + discriminator: 0, + account: Pubkey::default(), + virtual_token_reserves, + virtual_sol_reserves, + real_token_reserves, + real_sol_reserves, + token_total_supply, + complete, + creator, + is_mayhem_mode, + is_cashback_coin, + quote_mint, + }) + } + /// When building from event/parser data (e.g. sol-parser-sdk), pass the token's cashback flag /// so that sell instructions include the correct remaining accounts. From RPC use `from_mint_by_rpc` instead. pub fn from_dev_trade( @@ -93,6 +152,7 @@ impl BondingCurveAccount { creator: creator, is_mayhem_mode: is_mayhem_mode, is_cashback_coin, + quote_mint: Pubkey::default(), } } @@ -126,6 +186,7 @@ impl BondingCurveAccount { creator: creator, is_mayhem_mode: is_mayhem_mode, is_cashback_coin, + quote_mint: Pubkey::default(), } } diff --git a/src/instruction/pumpfun.rs b/src/instruction/pumpfun.rs index 83b5a5f..99c3ed5 100644 --- a/src/instruction/pumpfun.rs +++ b/src/instruction/pumpfun.rs @@ -1,7 +1,10 @@ //! Pump.fun bonding-curve swap ix assembly ([`SwapParams`](crate::trading::core::params::SwapParams)). +//! +//! 组装 **`buy_v2` / `sell_v2` / `buy_exact_quote_in_v2`**([pump-public-docs](https://github.com/pump-fun/pump-public-docs)): +//! 链上 `BondingCurve.quote_mint == default` 的 SOL 币对须在指令里传 **wrapped SOL**;报价侧程序 id 与官方 Rust 示例一致用 legacy SPL Token。 use crate::{ - common::spl_token::close_account, + common::{bonding_curve::BondingCurveAccount, spl_token::close_account}, constants::{trade::trade::DEFAULT_SLIPPAGE, TOKEN_PROGRAM_2022}, trading::core::{ params::{PumpFunParams, SwapParams}, @@ -10,14 +13,13 @@ use crate::{ }; use crate::{ instruction::pumpfun_ix_data::{ - encode_pumpfun_buy_exact_sol_in_ix_data, encode_pumpfun_buy_ix_data, - encode_pumpfun_sell_ix_data, TRACK_VOLUME_TRUE, + encode_pumpfun_buy_exact_quote_in_v2_ix_data, encode_pumpfun_buy_v2_ix_data, + encode_pumpfun_sell_v2_ix_data, }, instruction::utils::pumpfun::{ - accounts, get_bonding_curve_pda, get_bonding_curve_v2_pda, - get_protocol_extra_fee_recipient_random, get_user_volume_accumulator_pda, - pump_fun_fee_recipient_meta, resolve_creator_vault_for_ix_with_fee_sharing, - global_constants::{self}, + accounts, get_bonding_curve_pda, get_fee_sharing_config_pda, get_user_volume_accumulator_pda, + pump_fun_buyback_fee_recipient_meta_random, pump_fun_fee_recipient_meta, + resolve_creator_vault_for_ix_with_fee_sharing, global_constants::{self}, }, utils::calc::{ common::{calculate_with_slippage_buy, calculate_with_slippage_sell}, @@ -38,6 +40,16 @@ fn effective_pump_mint_token_program(protocol_params: &PumpFunParams) -> Pubkey } } +#[inline] +fn effective_quote_mint_and_token_program(bc: &BondingCurveAccount) -> (Pubkey, Pubkey) { + let quote_mint = if bc.quote_mint == Pubkey::default() { + crate::constants::WSOL_TOKEN_ACCOUNT + } else { + bc.quote_mint + }; + (quote_mint, crate::constants::TOKEN_PROGRAM) +} + pub struct PumpFunInstructionBuilder; #[async_trait::async_trait] @@ -89,32 +101,84 @@ impl InstructionBuilder for PumpFunInstructionBuilder { })?; let is_mayhem_mode = bonding_curve.is_mayhem_mode; - let token_program = effective_pump_mint_token_program(protocol_params); - let token_program_meta = if token_program == TOKEN_PROGRAM_2022 { + let base_token_program = effective_pump_mint_token_program(protocol_params); + let base_token_program_meta = if base_token_program == TOKEN_PROGRAM_2022 { crate::constants::TOKEN_PROGRAM_2022_META } else { crate::constants::TOKEN_PROGRAM_META }; - let associated_bonding_curve = + let (quote_mint, quote_token_program) = effective_quote_mint_and_token_program(bonding_curve); + let quote_token_program_meta = crate::constants::TOKEN_PROGRAM_META; + + let associated_base_bonding_curve = crate::common::fast_fn::get_associated_token_address_with_program_id_fast( &bonding_curve_addr, ¶ms.output_mint, - &token_program, + &base_token_program, ); - let user_token_account = + let associated_base_user = crate::common::fast_fn::get_associated_token_address_with_program_id_fast_use_seed( ¶ms.payer.pubkey(), ¶ms.output_mint, - &token_program, + &base_token_program, params.open_seed_optimize, ); + let fee_recipient_meta = + pump_fun_fee_recipient_meta(protocol_params.fee_recipient, is_mayhem_mode); + let fee_recipient_pk = fee_recipient_meta.pubkey; + let buyback_fee_recipient_meta = pump_fun_buyback_fee_recipient_meta_random(); + let buyback_pk = buyback_fee_recipient_meta.pubkey; + + let associated_quote_fee_recipient = + crate::common::fast_fn::get_associated_token_address_with_program_id_fast( + &fee_recipient_pk, + "e_mint, + "e_token_program, + ); + let associated_quote_buyback_fee_recipient = + crate::common::fast_fn::get_associated_token_address_with_program_id_fast( + &buyback_pk, + "e_mint, + "e_token_program, + ); + let associated_quote_bonding_curve = + crate::common::fast_fn::get_associated_token_address_with_program_id_fast( + &bonding_curve_addr, + "e_mint, + "e_token_program, + ); + let associated_quote_user = + crate::common::fast_fn::get_associated_token_address_with_program_id_fast_use_seed( + ¶ms.payer.pubkey(), + "e_mint, + "e_token_program, + params.open_seed_optimize, + ); + let associated_creator_vault = + crate::common::fast_fn::get_associated_token_address_with_program_id_fast( + &creator_vault_account, + "e_mint, + "e_token_program, + ); + + let sharing_config = + get_fee_sharing_config_pda(¶ms.output_mint).ok_or_else(|| { + anyhow!("sharing_config PDA derivation failed for mint {}", params.output_mint) + })?; + let user_volume_accumulator = get_user_volume_accumulator_pda(¶ms.payer.pubkey()) .ok_or_else(|| anyhow!("user_volume_accumulator PDA derivation failed"))?; + let associated_user_volume_accumulator = + crate::common::fast_fn::get_associated_token_address_with_program_id_fast( + &user_volume_accumulator, + "e_mint, + "e_token_program, + ); - let mut instructions = Vec::with_capacity(2); + let mut instructions = Vec::with_capacity(4); if params.create_output_mint_ata { instructions.extend( @@ -122,52 +186,58 @@ impl InstructionBuilder for PumpFunInstructionBuilder { ¶ms.payer.pubkey(), ¶ms.payer.pubkey(), ¶ms.output_mint, - &token_program, + &base_token_program, params.open_seed_optimize, ), ); } + instructions.extend( + crate::common::fast_fn::create_associated_token_account_idempotent_fast_use_seed( + ¶ms.payer.pubkey(), + ¶ms.payer.pubkey(), + "e_mint, + "e_token_program, + params.open_seed_optimize, + ), + ); + let buy_data = if params.use_exact_sol_amount.unwrap_or(true) { let min_tokens_out = calculate_with_slippage_sell(buy_token_amount, slippage_bp); - encode_pumpfun_buy_exact_sol_in_ix_data( - lamports_in, - min_tokens_out, - TRACK_VOLUME_TRUE, - ) + encode_pumpfun_buy_exact_quote_in_v2_ix_data(lamports_in, min_tokens_out) } else { - encode_pumpfun_buy_ix_data(buy_token_amount, max_sol_cost, TRACK_VOLUME_TRUE) + encode_pumpfun_buy_v2_ix_data(buy_token_amount, max_sol_cost) }; - let fee_recipient_meta = - pump_fun_fee_recipient_meta(protocol_params.fee_recipient, is_mayhem_mode); - - let bonding_curve_v2 = get_bonding_curve_v2_pda(¶ms.output_mint).ok_or_else(|| { - anyhow!("bonding_curve_v2 PDA derivation failed for mint {}", params.output_mint) - })?; - let mut metas: Vec = vec![ + let metas: Vec = vec![ global_constants::GLOBAL_ACCOUNT_META, - fee_recipient_meta, AccountMeta::new_readonly(params.output_mint, false), + AccountMeta::new_readonly(quote_mint, false), + base_token_program_meta, + quote_token_program_meta, + AccountMeta::new_readonly(accounts::ASSOCIATED_TOKEN_PROGRAM, false), + fee_recipient_meta, + AccountMeta::new(associated_quote_fee_recipient, false), + buyback_fee_recipient_meta, + AccountMeta::new(associated_quote_buyback_fee_recipient, false), AccountMeta::new(bonding_curve_addr, false), - AccountMeta::new(associated_bonding_curve, false), - AccountMeta::new(user_token_account, false), + AccountMeta::new(associated_base_bonding_curve, false), + AccountMeta::new(associated_quote_bonding_curve, false), AccountMeta::new(params.payer.pubkey(), true), - crate::constants::SYSTEM_PROGRAM_META, - token_program_meta, + AccountMeta::new(associated_base_user, false), + AccountMeta::new(associated_quote_user, false), AccountMeta::new(creator_vault_account, false), - accounts::EVENT_AUTHORITY_META, - accounts::PUMPFUN_META, + AccountMeta::new(associated_creator_vault, false), + AccountMeta::new_readonly(sharing_config, false), accounts::GLOBAL_VOLUME_ACCUMULATOR_META, AccountMeta::new(user_volume_accumulator, false), + AccountMeta::new(associated_user_volume_accumulator, false), accounts::FEE_CONFIG_META, accounts::FEE_PROGRAM_META, + crate::constants::SYSTEM_PROGRAM_META, + accounts::EVENT_AUTHORITY_META, + accounts::PUMPFUN_META, ]; - metas.push(AccountMeta::new_readonly(bonding_curve_v2, false)); - metas.push(AccountMeta::new( - get_protocol_extra_fee_recipient_random(), - false, - )); instructions.push(Instruction::new_with_bytes( accounts::PUMPFUN, @@ -228,66 +298,125 @@ impl InstructionBuilder for PumpFunInstructionBuilder { })?; let is_mayhem_mode = bonding_curve.is_mayhem_mode; - let token_program = effective_pump_mint_token_program(protocol_params); - let token_program_meta = if token_program == TOKEN_PROGRAM_2022 { + let base_token_program = effective_pump_mint_token_program(protocol_params); + let base_token_program_meta = if base_token_program == TOKEN_PROGRAM_2022 { crate::constants::TOKEN_PROGRAM_2022_META } else { crate::constants::TOKEN_PROGRAM_META }; - let associated_bonding_curve = + let (quote_mint, quote_token_program) = effective_quote_mint_and_token_program(bonding_curve); + let quote_token_program_meta = crate::constants::TOKEN_PROGRAM_META; + + let associated_base_bonding_curve = crate::common::fast_fn::get_associated_token_address_with_program_id_fast( &bonding_curve_addr, ¶ms.input_mint, - &token_program, + &base_token_program, ); - let user_token_account = + let associated_base_user = crate::common::fast_fn::get_associated_token_address_with_program_id_fast_use_seed( ¶ms.payer.pubkey(), ¶ms.input_mint, - &token_program, + &base_token_program, params.open_seed_optimize, ); - let mut instructions = Vec::with_capacity(2); - let sell_data = encode_pumpfun_sell_ix_data(token_amount, min_sol_output); let fee_recipient_meta = pump_fun_fee_recipient_meta(protocol_params.fee_recipient, is_mayhem_mode); + let fee_recipient_pk = fee_recipient_meta.pubkey; + let buyback_fee_recipient_meta = pump_fun_buyback_fee_recipient_meta_random(); + let buyback_pk = buyback_fee_recipient_meta.pubkey; - let mut metas: Vec = vec![ + let associated_quote_fee_recipient = + crate::common::fast_fn::get_associated_token_address_with_program_id_fast( + &fee_recipient_pk, + "e_mint, + "e_token_program, + ); + let associated_quote_buyback_fee_recipient = + crate::common::fast_fn::get_associated_token_address_with_program_id_fast( + &buyback_pk, + "e_mint, + "e_token_program, + ); + let associated_quote_bonding_curve = + crate::common::fast_fn::get_associated_token_address_with_program_id_fast( + &bonding_curve_addr, + "e_mint, + "e_token_program, + ); + let associated_quote_user = + crate::common::fast_fn::get_associated_token_address_with_program_id_fast_use_seed( + ¶ms.payer.pubkey(), + "e_mint, + "e_token_program, + params.open_seed_optimize, + ); + let associated_creator_vault = + crate::common::fast_fn::get_associated_token_address_with_program_id_fast( + &creator_vault_account, + "e_mint, + "e_token_program, + ); + + let sharing_config = get_fee_sharing_config_pda(¶ms.input_mint).ok_or_else(|| { + anyhow!("sharing_config PDA derivation failed for mint {}", params.input_mint) + })?; + + let user_volume_accumulator = get_user_volume_accumulator_pda(¶ms.payer.pubkey()) + .ok_or_else(|| anyhow!("user_volume_accumulator PDA derivation failed"))?; + let associated_user_volume_accumulator = + crate::common::fast_fn::get_associated_token_address_with_program_id_fast( + &user_volume_accumulator, + "e_mint, + "e_token_program, + ); + + let mut instructions = Vec::with_capacity(3); + + instructions.extend( + crate::common::fast_fn::create_associated_token_account_idempotent_fast_use_seed( + ¶ms.payer.pubkey(), + ¶ms.payer.pubkey(), + "e_mint, + "e_token_program, + params.open_seed_optimize, + ), + ); + + let sell_data = encode_pumpfun_sell_v2_ix_data(token_amount, min_sol_output); + + let metas: Vec = vec![ global_constants::GLOBAL_ACCOUNT_META, - fee_recipient_meta, AccountMeta::new_readonly(params.input_mint, false), + AccountMeta::new_readonly(quote_mint, false), + base_token_program_meta, + quote_token_program_meta, + AccountMeta::new_readonly(accounts::ASSOCIATED_TOKEN_PROGRAM, false), + fee_recipient_meta, + AccountMeta::new(associated_quote_fee_recipient, false), + buyback_fee_recipient_meta, + AccountMeta::new(associated_quote_buyback_fee_recipient, false), AccountMeta::new(bonding_curve_addr, false), - AccountMeta::new(associated_bonding_curve, false), - AccountMeta::new(user_token_account, false), + AccountMeta::new(associated_base_bonding_curve, false), + AccountMeta::new(associated_quote_bonding_curve, false), AccountMeta::new(params.payer.pubkey(), true), - crate::constants::SYSTEM_PROGRAM_META, + AccountMeta::new(associated_base_user, false), + AccountMeta::new(associated_quote_user, false), AccountMeta::new(creator_vault_account, false), - token_program_meta, - accounts::EVENT_AUTHORITY_META, - accounts::PUMPFUN_META, + AccountMeta::new(associated_creator_vault, false), + AccountMeta::new_readonly(sharing_config, false), + AccountMeta::new(user_volume_accumulator, false), + AccountMeta::new(associated_user_volume_accumulator, false), accounts::FEE_CONFIG_META, accounts::FEE_PROGRAM_META, + crate::constants::SYSTEM_PROGRAM_META, + accounts::EVENT_AUTHORITY_META, + accounts::PUMPFUN_META, ]; - if bonding_curve.is_cashback_coin { - let user_volume_accumulator = - get_user_volume_accumulator_pda(¶ms.payer.pubkey()) - .ok_or_else(|| anyhow!("user_volume_accumulator PDA derivation failed"))?; - metas.push(AccountMeta::new(user_volume_accumulator, false)); - } - - let bonding_curve_v2 = get_bonding_curve_v2_pda(¶ms.input_mint).ok_or_else(|| { - anyhow!("bonding_curve_v2 PDA derivation failed for mint {}", params.input_mint) - })?; - metas.push(AccountMeta::new_readonly(bonding_curve_v2, false)); - metas.push(AccountMeta::new( - get_protocol_extra_fee_recipient_random(), - false, - )); - instructions.push(Instruction::new_with_bytes( accounts::PUMPFUN, &sell_data, @@ -298,8 +427,8 @@ impl InstructionBuilder for PumpFunInstructionBuilder { || params.close_input_mint_ata { instructions.push(close_account( - &token_program, - &user_token_account, + &base_token_program, + &associated_base_user, ¶ms.payer.pubkey(), ¶ms.payer.pubkey(), &[¶ms.payer.pubkey()], diff --git a/src/instruction/pumpfun_ix_data.rs b/src/instruction/pumpfun_ix_data.rs index 0f064b0..82ce3a3 100644 --- a/src/instruction/pumpfun_ix_data.rs +++ b/src/instruction/pumpfun_ix_data.rs @@ -1,15 +1,21 @@ -//! Pump.fun 曲线 `buy` / `buy_exact_sol_in` / `sell` 的 **instruction data** 栈上编码(热路径零堆分配)。 +//! Pump.fun 曲线 **legacy** `buy` / `buy_exact_sol_in` / `sell` 与 **`buy_v2` / `sell_v2` / `buy_exact_quote_in_v2`** +//! 的 instruction data 栈上编码(热路径零堆分配)。 //! -//! 与 `@pump-fun/pump-sdk` Anchor `coder.instruction.encode` 对齐:`OptionBool` 在 ix 参数中为 **1 字节**。 +//! Legacy `buy` / `buy_exact_sol_in` 与 `@pump-fun/pump-sdk` 对齐:`OptionBool` 在 ix 参数中为 **1 字节**。 +//! `*_v2` 指令无 `track_volume` 字节(见 [pump-public-docs](https://github.com/pump-fun/pump-public-docs))。 use crate::instruction::utils::pumpfun::{ - BUY_DISCRIMINATOR, BUY_EXACT_SOL_IN_DISCRIMINATOR, SELL_DISCRIMINATOR, + BUY_DISCRIMINATOR, BUY_EXACT_QUOTE_IN_V2_DISCRIMINATOR, BUY_EXACT_SOL_IN_DISCRIMINATOR, + BUY_V2_DISCRIMINATOR, SELL_DISCRIMINATOR, SELL_V2_DISCRIMINATOR, }; -/// 与官方 `getBuyInstructionInternal` 一致:`track_volume = true`。 +/// Legacy `buy`:`track_volume = true`(仅 legacy 指令使用)。 +#[allow(dead_code)] pub const TRACK_VOLUME_TRUE: u8 = 1; +/// Legacy `buy` ix data(保留供兼容 / 对照 IDL;热路径已改用 [`encode_pumpfun_buy_v2_ix_data`])。 #[inline(always)] +#[allow(dead_code)] pub fn encode_pumpfun_buy_ix_data( token_amount: u64, max_sol_cost: u64, @@ -24,6 +30,7 @@ pub fn encode_pumpfun_buy_ix_data( } #[inline(always)] +#[allow(dead_code)] pub fn encode_pumpfun_buy_exact_sol_in_ix_data( spendable_sol_in: u64, min_tokens_out: u64, @@ -38,6 +45,7 @@ pub fn encode_pumpfun_buy_exact_sol_in_ix_data( } #[inline(always)] +#[allow(dead_code)] pub fn encode_pumpfun_sell_ix_data(token_amount: u64, min_sol_output: u64) -> [u8; 24] { let mut d = [0u8; 24]; d[..8].copy_from_slice(&SELL_DISCRIMINATOR); @@ -45,3 +53,33 @@ pub fn encode_pumpfun_sell_ix_data(token_amount: u64, min_sol_output: u64) -> [u d[16..24].copy_from_slice(&min_sol_output.to_le_bytes()); d } + +#[inline(always)] +pub fn encode_pumpfun_buy_v2_ix_data(amount: u64, max_sol_cost: u64) -> [u8; 24] { + let mut d = [0u8; 24]; + d[..8].copy_from_slice(&BUY_V2_DISCRIMINATOR); + d[8..16].copy_from_slice(&amount.to_le_bytes()); + d[16..24].copy_from_slice(&max_sol_cost.to_le_bytes()); + d +} + +#[inline(always)] +pub fn encode_pumpfun_buy_exact_quote_in_v2_ix_data( + spendable_quote_in: u64, + min_tokens_out: u64, +) -> [u8; 24] { + let mut d = [0u8; 24]; + d[..8].copy_from_slice(&BUY_EXACT_QUOTE_IN_V2_DISCRIMINATOR); + d[8..16].copy_from_slice(&spendable_quote_in.to_le_bytes()); + d[16..24].copy_from_slice(&min_tokens_out.to_le_bytes()); + d +} + +#[inline(always)] +pub fn encode_pumpfun_sell_v2_ix_data(token_amount: u64, min_sol_output: u64) -> [u8; 24] { + let mut d = [0u8; 24]; + d[..8].copy_from_slice(&SELL_V2_DISCRIMINATOR); + d[8..16].copy_from_slice(&token_amount.to_le_bytes()); + d[16..24].copy_from_slice(&min_sol_output.to_le_bytes()); + d +} diff --git a/src/instruction/utils/pumpfun.rs b/src/instruction/utils/pumpfun.rs index 7b2e24a..e2cae3b 100644 --- a/src/instruction/utils/pumpfun.rs +++ b/src/instruction/utils/pumpfun.rs @@ -172,6 +172,13 @@ pub const BUY_DISCRIMINATOR: [u8; 8] = [102, 6, 61, 18, 1, 218, 235, 234]; pub const BUY_EXACT_SOL_IN_DISCRIMINATOR: [u8; 8] = [56, 252, 116, 8, 158, 223, 205, 95]; pub const SELL_DISCRIMINATOR: [u8; 8] = [51, 230, 133, 164, 1, 127, 131, 173]; +/// `buy_v2` — unified SOL/USDC quote interface ([pump-public-docs](https://github.com/pump-fun/pump-public-docs)). +pub const BUY_V2_DISCRIMINATOR: [u8; 8] = [184, 23, 238, 97, 103, 197, 211, 61]; +/// `sell_v2` +pub const SELL_V2_DISCRIMINATOR: [u8; 8] = [93, 246, 130, 60, 231, 233, 64, 178]; +/// `buy_exact_quote_in_v2` (native SOL spend for SOL-paired coins when `quote_mint` is WSOL) +pub const BUY_EXACT_QUOTE_IN_V2_DISCRIMINATOR: [u8; 8] = [194, 171, 28, 70, 104, 77, 91, 47]; + pub const EXTEND_ACCOUNT_DISCRIMINATOR: [u8; 8] = [234, 102, 194, 203, 150, 72, 62, 229]; pub const SHARING_CONFIG_ACCOUNT_DISCRIMINATOR: [u8; 8] = [216, 74, 9, 0, 56, 140, 93, 75]; @@ -278,6 +285,17 @@ pub fn get_protocol_extra_fee_recipient_random() -> Pubkey { .unwrap_or(&global_constants::PROTOCOL_EXTRA_FEE_RECIPIENTS[0]) } +/// Buyback fee recipient (#8 / `buyback_fee_recipient`) — same static pool as protocol extra / pump-public-docs buyback list. +#[inline] +pub fn pump_fun_buyback_fee_recipient_meta_random() -> AccountMeta { + let pubkey = get_protocol_extra_fee_recipient_random(); + AccountMeta { + pubkey, + is_signer: false, + is_writable: true, + } +} + #[inline] pub fn pump_fun_fee_recipient_meta(observed_fee_recipient: Pubkey, is_mayhem_mode: bool) -> AccountMeta { let trust_observation = observed_fee_recipient != Pubkey::default() @@ -516,9 +534,9 @@ pub async fn fetch_bonding_curve_account( return Err(anyhow!("Bonding curve not found")); } - let bonding_curve = - solana_sdk::borsh1::try_from_slice_unchecked::(&account.data[8..]) - .map_err(|e| anyhow::anyhow!("Failed to deserialize bonding curve account: {}", e))?; + let mut bonding_curve = BondingCurveAccount::decode_from_chain_account_data(account.data.as_slice()) + .map_err(|e| anyhow::anyhow!("Failed to decode bonding curve account: {}", e))?; + bonding_curve.account = bonding_curve_pda; Ok((Arc::new(bonding_curve), bonding_curve_pda)) } @@ -540,6 +558,9 @@ mod tests { assert_eq!(BUY_DISCRIMINATOR.len(), 8); assert_eq!(BUY_EXACT_SOL_IN_DISCRIMINATOR.len(), 8); assert_eq!(SELL_DISCRIMINATOR.len(), 8); + assert_eq!(BUY_V2_DISCRIMINATOR.len(), 8); + assert_eq!(SELL_V2_DISCRIMINATOR.len(), 8); + assert_eq!(BUY_EXACT_QUOTE_IN_V2_DISCRIMINATOR.len(), 8); } #[test] diff --git a/src/trading/core/params/pumpfun.rs b/src/trading/core/params/pumpfun.rs index e8f6b9b..aba0c55 100644 --- a/src/trading/core/params/pumpfun.rs +++ b/src/trading/core/params/pumpfun.rs @@ -170,19 +170,7 @@ impl PumpFunParams { let account = crate::instruction::utils::pumpfun::fetch_bonding_curve_account(rpc, mint).await?; let mint_account = rpc.get_account(&mint).await?; - let bonding_curve = BondingCurveAccount { - discriminator: 0, - account: account.1, - virtual_token_reserves: account.0.virtual_token_reserves, - virtual_sol_reserves: account.0.virtual_sol_reserves, - real_token_reserves: account.0.real_token_reserves, - real_sol_reserves: account.0.real_sol_reserves, - token_total_supply: account.0.token_total_supply, - complete: account.0.complete, - creator: account.0.creator, - is_mayhem_mode: account.0.is_mayhem_mode, - is_cashback_coin: account.0.is_cashback_coin, - }; + let bonding_curve = account.0.clone(); let associated_bonding_curve = get_associated_token_address_with_program_id( &bonding_curve.account, mint, @@ -200,7 +188,7 @@ impl PumpFunParams { .or_else(|| crate::instruction::utils::pumpfun::get_creator_vault_pda(&bonding_curve.creator)) .unwrap_or_default(); Ok(Self { - bonding_curve: Arc::new(bonding_curve), + bonding_curve, associated_bonding_curve: associated_bonding_curve, observed_trade_creator: None, creator_vault,