Dcube Ai
Nabeel Javed
Published
0
Trading Agent
Description
The Trading Agent is an automated trading bot designed for autonomous trading on Solana-based tokens. It evaluates token data, filters opportunities based on predefined trading criteria, and uses AI for final trade decisions. The bot executes trades and posts real-time updates on Twitter, sharing details about purchases and sales, including profit margins.
This project is built on Eliza where it integrates with APIs like BirdEye and Helius to gather live token rates and utilizes OpenAI for AI-driven trade decision-making.
Trading Logic
For Purchasing:
- Fetch token data such as market cap, volume, and bonding progress.
- Finalize token purchase if:
- Market cap reaches $10K on PumpFun within 24 hours.
- Bonding market cap is 50% of the total market cap.
- Buying volume is twice the selling volume in the last 4 hours.
- Retrieve wallet balance using BirdEye API.
- Use AI via LLM to determine the appropriate purchase amount based on collected data.
- Store purchase data in the pumpfundata table.
- Check for buying opportunities every 3 hours.
- After purchasing a token, tweet on Twitter to announce the purchase.
For Selling:
- Retrieve stored purchase positions from the database.
- Fetch the current token price.
- Compare prices for each token and execute sales:
- Sell 50% of the amount at 2x profit.
- Sell 25% at 4x profit.
- Sell 12.5% at 8x profit.
- Update the token position in the pumpfundata table after partial or full sales.
- Store sale details in the pumpfunsales table.
- Check for selling opportunities every hour.
- After selling a token, tweet on Twitter to announce the sale and profit gained.