Spaces:
No application file
No application file
| # 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}") | |