fix(pumpfun): resolve creator_vault with fee-sharing PDA (mint-aware)
- Add get_fee_sharing_config_pda per @pump-fun/pump-sdk (sharing-config + mint under pump-fees) - resolve_creator_vault_for_ix now takes mint: accept gRPC creator_vault when it matches either PDA(creator) or PDA(fee_sharing_config(mint)) for migrated / fee-sharing bonding curves - Mayhem uses the same Pump buy/sell account layout (IDL); Token-2022 + fee pool differ, not creator_vault seeds Made-with: Cursor
This commit is contained in:
+22
-14
@@ -46,13 +46,17 @@ impl InstructionBuilder for PumpFunInstructionBuilder {
|
||||
// creator_vault must be PDA(creator) per bonding curve. Event vault: use only if == derived;
|
||||
// if stream sends a mismatched vault (wrong token / stale), fall back to derived.
|
||||
let creator = bonding_curve.creator;
|
||||
let creator_vault_pda = resolve_creator_vault_for_ix(&creator, protocol_params.creator_vault)
|
||||
.ok_or_else(|| {
|
||||
anyhow!(
|
||||
"creator_vault PDA derivation failed (creator={})",
|
||||
creator
|
||||
)
|
||||
})?;
|
||||
let creator_vault_pda = resolve_creator_vault_for_ix(
|
||||
&creator,
|
||||
protocol_params.creator_vault,
|
||||
¶ms.output_mint,
|
||||
)
|
||||
.ok_or_else(|| {
|
||||
anyhow!(
|
||||
"creator_vault PDA derivation failed (creator={})",
|
||||
creator
|
||||
)
|
||||
})?;
|
||||
|
||||
// ========================================
|
||||
// Trade calculation and account address preparation
|
||||
@@ -206,13 +210,17 @@ impl InstructionBuilder for PumpFunInstructionBuilder {
|
||||
|
||||
let bonding_curve = &protocol_params.bonding_curve;
|
||||
let creator = bonding_curve.creator;
|
||||
let creator_vault_pda = resolve_creator_vault_for_ix(&creator, protocol_params.creator_vault)
|
||||
.ok_or_else(|| {
|
||||
anyhow!(
|
||||
"creator_vault PDA derivation failed (creator={})",
|
||||
creator
|
||||
)
|
||||
})?;
|
||||
let creator_vault_pda = resolve_creator_vault_for_ix(
|
||||
&creator,
|
||||
protocol_params.creator_vault,
|
||||
¶ms.input_mint,
|
||||
)
|
||||
.ok_or_else(|| {
|
||||
anyhow!(
|
||||
"creator_vault PDA derivation failed (creator={})",
|
||||
creator
|
||||
)
|
||||
})?;
|
||||
|
||||
// ========================================
|
||||
// Trade calculation and account address preparation
|
||||
|
||||
Reference in New Issue
Block a user