mirror of
https://github.com/chainstacklabs/pumpfun-bonkfun-bot.git
synced 2026-08-15 16:28:04 +00:00
feat(pumpswap): update pool account to writable for buy/sell instructions (#146)
This commit is contained in:
@@ -302,7 +302,8 @@
|
|||||||
],
|
],
|
||||||
"accounts": [
|
"accounts": [
|
||||||
{
|
{
|
||||||
"name": "pool"
|
"name": "pool",
|
||||||
|
"writable": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "user",
|
"name": "user",
|
||||||
@@ -730,7 +731,8 @@
|
|||||||
],
|
],
|
||||||
"accounts": [
|
"accounts": [
|
||||||
{
|
{
|
||||||
"name": "pool"
|
"name": "pool",
|
||||||
|
"writable": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "user",
|
"name": "user",
|
||||||
@@ -2465,7 +2467,8 @@
|
|||||||
],
|
],
|
||||||
"accounts": [
|
"accounts": [
|
||||||
{
|
{
|
||||||
"name": "pool"
|
"name": "pool",
|
||||||
|
"writable": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "user",
|
"name": "user",
|
||||||
|
|||||||
@@ -318,7 +318,7 @@ async def buy_pump_swap(
|
|||||||
|
|
||||||
# Define all accounts needed for the buy instruction
|
# Define all accounts needed for the buy instruction
|
||||||
accounts = [
|
accounts = [
|
||||||
AccountMeta(pubkey=pump_fun_amm_market, is_signer=False, is_writable=False),
|
AccountMeta(pubkey=pump_fun_amm_market, is_signer=False, is_writable=True),
|
||||||
AccountMeta(pubkey=payer.pubkey(), is_signer=True, is_writable=True),
|
AccountMeta(pubkey=payer.pubkey(), is_signer=True, is_writable=True),
|
||||||
AccountMeta(pubkey=PUMP_SWAP_GLOBAL_CONFIG, is_signer=False, is_writable=False),
|
AccountMeta(pubkey=PUMP_SWAP_GLOBAL_CONFIG, is_signer=False, is_writable=False),
|
||||||
AccountMeta(pubkey=base_mint, is_signer=False, is_writable=False),
|
AccountMeta(pubkey=base_mint, is_signer=False, is_writable=False),
|
||||||
@@ -365,6 +365,7 @@ async def buy_pump_swap(
|
|||||||
BUY_DISCRIMINATOR
|
BUY_DISCRIMINATOR
|
||||||
+ struct.pack("<Q", base_amount_out)
|
+ struct.pack("<Q", base_amount_out)
|
||||||
+ struct.pack("<Q", max_sol_input)
|
+ struct.pack("<Q", max_sol_input)
|
||||||
|
+ struct.pack("<B", 1) # track_volume: 1 = true (enable volume tracking)
|
||||||
)
|
)
|
||||||
|
|
||||||
compute_limit_ix = set_compute_unit_limit(COMPUTE_UNIT_BUDGET)
|
compute_limit_ix = set_compute_unit_limit(COMPUTE_UNIT_BUDGET)
|
||||||
|
|||||||
@@ -308,7 +308,7 @@ async def sell_pump_swap(
|
|||||||
|
|
||||||
# Define all accounts needed for the sell instruction
|
# Define all accounts needed for the sell instruction
|
||||||
accounts = [
|
accounts = [
|
||||||
AccountMeta(pubkey=pump_fun_amm_market, is_signer=False, is_writable=False),
|
AccountMeta(pubkey=pump_fun_amm_market, is_signer=False, is_writable=True),
|
||||||
AccountMeta(pubkey=payer.pubkey(), is_signer=True, is_writable=True),
|
AccountMeta(pubkey=payer.pubkey(), is_signer=True, is_writable=True),
|
||||||
AccountMeta(pubkey=PUMP_SWAP_GLOBAL_CONFIG, is_signer=False, is_writable=False),
|
AccountMeta(pubkey=PUMP_SWAP_GLOBAL_CONFIG, is_signer=False, is_writable=False),
|
||||||
AccountMeta(pubkey=base_mint, is_signer=False, is_writable=False),
|
AccountMeta(pubkey=base_mint, is_signer=False, is_writable=False),
|
||||||
|
|||||||
Reference in New Issue
Block a user