mirror of
https://github.com/chainstacklabs/pumpfun-bonkfun-bot.git
synced 2026-08-17 17:28:05 +00:00
Add requirements.txt
This commit is contained in:
@@ -35,7 +35,7 @@ SOL = Pubkey.from_string("So11111111111111111111111111111111111111112")
|
|||||||
LAMPORTS_PER_SOL = 1_000_000_000
|
LAMPORTS_PER_SOL = 1_000_000_000
|
||||||
|
|
||||||
# RPC endpoint
|
# RPC endpoint
|
||||||
RPC_ENDPOINT = "SOLANA_NODE_RPC_ENDPOINT"
|
RPC_ENDPOINT = "https://nd-789-855-895.p2pify.com/a24eec46e256346bd48e6a7ae9aab4c5"
|
||||||
|
|
||||||
class BondingCurveState:
|
class BondingCurveState:
|
||||||
_STRUCT = Struct(
|
_STRUCT = Struct(
|
||||||
@@ -69,7 +69,7 @@ def calculate_pump_curve_price(curve_state: BondingCurveState) -> float:
|
|||||||
return (curve_state.virtual_sol_reserves / LAMPORTS_PER_SOL) / (curve_state.virtual_token_reserves / 10 ** TOKEN_DECIMALS)
|
return (curve_state.virtual_sol_reserves / LAMPORTS_PER_SOL) / (curve_state.virtual_token_reserves / 10 ** TOKEN_DECIMALS)
|
||||||
|
|
||||||
async def buy_token(mint: Pubkey, bonding_curve: Pubkey, associated_bonding_curve: Pubkey, amount: float, slippage: float = 0.01, max_retries=5):
|
async def buy_token(mint: Pubkey, bonding_curve: Pubkey, associated_bonding_curve: Pubkey, amount: float, slippage: float = 0.01, max_retries=5):
|
||||||
private_key = base58.b58decode("SOLANA_PRIVATE_KEY")
|
private_key = base58.b58decode("5dhFD6KgGThDa2c8ytNquSVgpD1o1WuG4qGrSaT4yy3AbW812dYctgUEj8wV4XoWYfmdqFy6UaWLK8QZ7XzgnLZE")
|
||||||
payer = Keypair.from_bytes(private_key)
|
payer = Keypair.from_bytes(private_key)
|
||||||
|
|
||||||
async with AsyncClient(RPC_ENDPOINT) as client:
|
async with AsyncClient(RPC_ENDPOINT) as client:
|
||||||
@@ -165,7 +165,7 @@ async def buy_token(mint: Pubkey, bonding_curve: Pubkey, associated_bonding_curv
|
|||||||
else:
|
else:
|
||||||
print("Max retries reached. Unable to complete the transaction.")
|
print("Max retries reached. Unable to complete the transaction.")
|
||||||
|
|
||||||
RPC_NODE_URL = "SOLANA_NODE_WS_ENDPOINT"
|
RPC_NODE_URL = "wss://ws-nd-789-855-895.p2pify.com/a24eec46e256346bd48e6a7ae9aab4c5"
|
||||||
|
|
||||||
def load_idl(file_path):
|
def load_idl(file_path):
|
||||||
with open(file_path, 'r') as f:
|
with open(file_path, 'r') as f:
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
base58>=2.1.1
|
||||||
|
borsh-construct>=0.1.0
|
||||||
|
construct>=2.10.68
|
||||||
|
construct-typing>=0.5.6
|
||||||
|
solana>=0.34.3
|
||||||
|
solders>=0.21.0
|
||||||
|
websockets>=10.4
|
||||||
Reference in New Issue
Block a user