mirror of
https://github.com/chainstacklabs/pumpfun-bonkfun-bot.git
synced 2026-08-17 09:18:05 +00:00
feat(pumpfun): add fee_config and fee_program, close #132
This commit is contained in:
@@ -43,6 +43,9 @@ PUMP_EVENT_AUTHORITY: Final[Pubkey] = Pubkey.from_string(
|
||||
PUMP_FEE: Final[Pubkey] = Pubkey.from_string(
|
||||
"CebN5WGQ4jvEPvsVU4EoHEpgzq1VV7AbicfhtW4xC9iM"
|
||||
)
|
||||
PUMP_FEE_PROGRAM: Final[Pubkey] = Pubkey.from_string(
|
||||
"pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ"
|
||||
)
|
||||
PUMP_MINT_AUTHORITY: Final[Pubkey] = Pubkey.from_string(
|
||||
"TSLvdd1pWpHVjahSpsvCXUbgwsL3JAcvokwaKt1eokM"
|
||||
)
|
||||
@@ -129,6 +132,14 @@ def _find_user_volume_accumulator(user: Pubkey) -> Pubkey:
|
||||
return derived_address
|
||||
|
||||
|
||||
def _find_fee_config() -> Pubkey:
|
||||
derived_address, _ = Pubkey.find_program_address(
|
||||
[b"fee_config", bytes(PUMP_PROGRAM)],
|
||||
PUMP_FEE_PROGRAM,
|
||||
)
|
||||
return derived_address
|
||||
|
||||
|
||||
def create_pump_create_instruction(
|
||||
mint: Pubkey,
|
||||
mint_authority: Pubkey,
|
||||
@@ -217,6 +228,18 @@ def create_buy_instruction(
|
||||
is_signer=False,
|
||||
is_writable=True,
|
||||
),
|
||||
# Index 14: fee_config (readonly)
|
||||
AccountMeta(
|
||||
pubkey=_find_fee_config(),
|
||||
is_signer=False,
|
||||
is_writable=False,
|
||||
),
|
||||
# Index 15: fee_program (readonly)
|
||||
AccountMeta(
|
||||
pubkey=PUMP_FEE_PROGRAM,
|
||||
is_signer=False,
|
||||
is_writable=False,
|
||||
),
|
||||
]
|
||||
|
||||
data = (
|
||||
|
||||
Reference in New Issue
Block a user