mirror of
https://github.com/chainstacklabs/pumpfun-bonkfun-bot.git
synced 2026-07-27 23:37:45 +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
|
||||
|
||||
import os
|
||||
|
||||
from dotenv import load_dotenv
|
||||
from solders.pubkey import Pubkey
|
||||
|
||||
load_dotenv()
|
||||
|
||||
# System & pump.fun addresses
|
||||
PUMP_PROGRAM: Final[Pubkey] = Pubkey.from_string(
|
||||
"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
|
||||
SELL_SLIPPAGE = 0.2 # 20% slippage tolerance for selling
|
||||
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
|
||||
MAX_RETRIES: int = 5
|
||||
@@ -55,6 +50,6 @@ WAIT_TIME_AFTER_BUY: int = 20
|
||||
WAIT_TIME_BEFORE_NEW_TOKEN: int = 5
|
||||
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
|
||||
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.commitment import Confirmed
|
||||
from solana.rpc.types import TxOpts
|
||||
from solana.transaction import Transaction
|
||||
from solders.instruction import Instruction
|
||||
from solders.keypair import Keypair
|
||||
from solders.pubkey import Pubkey
|
||||
from solders.transaction import Transaction
|
||||
|
||||
from src.utils.logger import get_logger
|
||||
|
||||
|
||||
+4
-4
@@ -64,10 +64,10 @@ class TradeResult:
|
||||
"""Result of a trading operation."""
|
||||
|
||||
success: bool
|
||||
tx_signature: Optional[str] = None
|
||||
error_message: Optional[str] = None
|
||||
amount: Optional[float] = None
|
||||
price: Optional[float] = None
|
||||
tx_signature: str | None = None
|
||||
error_message: str | None = None
|
||||
amount: float | None = None
|
||||
price: float | None = None
|
||||
|
||||
|
||||
class Trader(ABC):
|
||||
|
||||
@@ -10,11 +10,11 @@ import spl.token.instructions as spl_token
|
||||
from solana.rpc.async_api import AsyncClient
|
||||
from solana.rpc.commitment import Confirmed
|
||||
from solana.rpc.types import TxOpts
|
||||
from solana.transaction import Transaction
|
||||
from solders.instruction import AccountMeta, Instruction
|
||||
from solders.keypair import Keypair
|
||||
from solders.pubkey import Pubkey
|
||||
from solders.system_program import TransferParams, transfer
|
||||
from solders.transaction import Transaction
|
||||
from spl.token.instructions import get_associated_token_address
|
||||
|
||||
from src.core.client import SolanaClient
|
||||
|
||||
@@ -6,9 +6,9 @@ import asyncio
|
||||
import struct
|
||||
from typing import Optional
|
||||
|
||||
from solana.transaction import Transaction
|
||||
from solders.instruction import AccountMeta, Instruction
|
||||
from solders.pubkey import Pubkey
|
||||
from solders.transaction import Transaction
|
||||
|
||||
from src.core.client import SolanaClient
|
||||
from src.core.curve import BondingCurveManager
|
||||
|
||||
Reference in New Issue
Block a user