fix(examples): add bonding_curve_v2 to learning examples (#160)

* fix(examples): add bonding_curve_v2 remaining account to learning examples

Add the required bonding_curve_v2 PDA as a remaining account to buy/sell
instructions in manual_buy, manual_sell, mint_and_buy, and mint_and_buy_v2
learning examples, matching the pump.fun program upgrade.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(examples): add bonding_curve_v2 to manual_buy_geyser and manual_buy_cu_optimized

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Anton Sauchyk
2026-02-27 23:54:18 +01:00
committed by GitHub
co-authored by Claude Opus 4.6
parent 4a48f545c1
commit 546b94af6f
6 changed files with 136 additions and 22 deletions
+14
View File
@@ -147,6 +147,14 @@ def _find_fee_config() -> Pubkey:
return derived_address
def _find_bonding_curve_v2(mint: Pubkey) -> Pubkey:
derived_address, _ = Pubkey.find_program_address(
[b"bonding-curve-v2", bytes(mint)],
PUMP_PROGRAM,
)
return derived_address
async def get_fee_recipient(
client: AsyncClient, curve_state: BondingCurveState
) -> Pubkey:
@@ -312,6 +320,12 @@ async def sell_token(
is_signer=False,
is_writable=False,
),
# Remaining account: bonding_curve_v2 (readonly, required for all coins)
AccountMeta(
pubkey=_find_bonding_curve_v2(mint),
is_signer=False,
is_writable=False,
),
]
discriminator = struct.pack("<Q", 12502976635542562355)