kid / trade_executor.py
nastaseshot's picture
trade_executor.py
8e12c57 verified
# trade_executor.py
from utils.solana_sdk_helper import send_transaction
def execute_trade(wallet, token_address, amount_in_sol):
"""
Executes a buy trade for a new token.
"""
try:
txn = send_transaction(wallet, token_address, amount_in_sol)
print(f"[TradeExecutor] Successfully bought token {token_address}")
return txn
except Exception as e:
print(f"[TradeExecutor] Trade execution failed: {e}")