mirror of
https://github.com/chainstacklabs/pumpfun-bonkfun-bot.git
synced 2026-08-17 09:18:05 +00:00
fixed transaction import
This commit is contained in:
@@ -4,13 +4,8 @@ Configuration for the pump.fun trading bot.
|
|||||||
|
|
||||||
from typing import Final
|
from typing import Final
|
||||||
|
|
||||||
import os
|
|
||||||
|
|
||||||
from dotenv import load_dotenv
|
|
||||||
from solders.pubkey import Pubkey
|
from solders.pubkey import Pubkey
|
||||||
|
|
||||||
load_dotenv()
|
|
||||||
|
|
||||||
# System & pump.fun addresses
|
# System & pump.fun addresses
|
||||||
PUMP_PROGRAM: Final[Pubkey] = Pubkey.from_string(
|
PUMP_PROGRAM: Final[Pubkey] = Pubkey.from_string(
|
||||||
"6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"
|
"6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"
|
||||||
@@ -45,9 +40,9 @@ BUY_AMOUNT = 0.0001 # Amount of SOL to spend when buying
|
|||||||
BUY_SLIPPAGE = 0.2 # 20% slippage tolerance for buying
|
BUY_SLIPPAGE = 0.2 # 20% slippage tolerance for buying
|
||||||
SELL_SLIPPAGE = 0.2 # 20% slippage tolerance for selling
|
SELL_SLIPPAGE = 0.2 # 20% slippage tolerance for selling
|
||||||
ENABLE_DYNAMIC_PRIORITY_FEE = (
|
ENABLE_DYNAMIC_PRIORITY_FEE = (
|
||||||
True # getRecentPriorityFee is used to get current priority fee
|
True # TODO: getRecentPriorityFee is used to get current priority fee
|
||||||
)
|
)
|
||||||
EXTRA_PRIORITY_FEE = 0.1 # 10% increase in dynamic priority fee
|
EXTRA_PRIORITY_FEE = 0.1 # TODO: 10% increase in dynamic priority fee
|
||||||
|
|
||||||
TOKEN_DECIMALS: Final[int] = 6
|
TOKEN_DECIMALS: Final[int] = 6
|
||||||
MAX_RETRIES: int = 5
|
MAX_RETRIES: int = 5
|
||||||
@@ -55,6 +50,6 @@ WAIT_TIME_AFTER_BUY: int = 20
|
|||||||
WAIT_TIME_BEFORE_NEW_TOKEN: int = 5
|
WAIT_TIME_BEFORE_NEW_TOKEN: int = 5
|
||||||
WAIT_TIME_AFTER_CREATION: int = 15
|
WAIT_TIME_AFTER_CREATION: int = 15
|
||||||
|
|
||||||
# RPS of your node to avoid rate limit errors
|
# TODO: RPS of your node to avoid rate limit errors
|
||||||
# You can also get a trader node https://docs.chainstack.com/docs/solana-trader-nodes
|
# You can also get a trader node https://docs.chainstack.com/docs/solana-trader-nodes
|
||||||
MAX_RPS = 25
|
MAX_RPS = 25
|
||||||
|
|||||||
+1
-1
@@ -8,10 +8,10 @@ from typing import Any, Dict, List, Optional, Tuple, Union
|
|||||||
from solana.rpc.async_api import AsyncClient
|
from solana.rpc.async_api import AsyncClient
|
||||||
from solana.rpc.commitment import Confirmed
|
from solana.rpc.commitment import Confirmed
|
||||||
from solana.rpc.types import TxOpts
|
from solana.rpc.types import TxOpts
|
||||||
from solana.transaction import Transaction
|
|
||||||
from solders.instruction import Instruction
|
from solders.instruction import Instruction
|
||||||
from solders.keypair import Keypair
|
from solders.keypair import Keypair
|
||||||
from solders.pubkey import Pubkey
|
from solders.pubkey import Pubkey
|
||||||
|
from solders.transaction import Transaction
|
||||||
|
|
||||||
from src.utils.logger import get_logger
|
from src.utils.logger import get_logger
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -64,10 +64,10 @@ class TradeResult:
|
|||||||
"""Result of a trading operation."""
|
"""Result of a trading operation."""
|
||||||
|
|
||||||
success: bool
|
success: bool
|
||||||
tx_signature: Optional[str] = None
|
tx_signature: str | None = None
|
||||||
error_message: Optional[str] = None
|
error_message: str | None = None
|
||||||
amount: Optional[float] = None
|
amount: float | None = None
|
||||||
price: Optional[float] = None
|
price: float | None = None
|
||||||
|
|
||||||
|
|
||||||
class Trader(ABC):
|
class Trader(ABC):
|
||||||
|
|||||||
@@ -10,11 +10,11 @@ import spl.token.instructions as spl_token
|
|||||||
from solana.rpc.async_api import AsyncClient
|
from solana.rpc.async_api import AsyncClient
|
||||||
from solana.rpc.commitment import Confirmed
|
from solana.rpc.commitment import Confirmed
|
||||||
from solana.rpc.types import TxOpts
|
from solana.rpc.types import TxOpts
|
||||||
from solana.transaction import Transaction
|
|
||||||
from solders.instruction import AccountMeta, Instruction
|
from solders.instruction import AccountMeta, Instruction
|
||||||
from solders.keypair import Keypair
|
from solders.keypair import Keypair
|
||||||
from solders.pubkey import Pubkey
|
from solders.pubkey import Pubkey
|
||||||
from solders.system_program import TransferParams, transfer
|
from solders.system_program import TransferParams, transfer
|
||||||
|
from solders.transaction import Transaction
|
||||||
from spl.token.instructions import get_associated_token_address
|
from spl.token.instructions import get_associated_token_address
|
||||||
|
|
||||||
from src.core.client import SolanaClient
|
from src.core.client import SolanaClient
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import asyncio
|
|||||||
import struct
|
import struct
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from solana.transaction import Transaction
|
|
||||||
from solders.instruction import AccountMeta, Instruction
|
from solders.instruction import AccountMeta, Instruction
|
||||||
from solders.pubkey import Pubkey
|
from solders.pubkey import Pubkey
|
||||||
|
from solders.transaction import Transaction
|
||||||
|
|
||||||
from src.core.client import SolanaClient
|
from src.core.client import SolanaClient
|
||||||
from src.core.curve import BondingCurveManager
|
from src.core.curve import BondingCurveManager
|
||||||
|
|||||||
Reference in New Issue
Block a user