A complete solution for a Solana market making bot that captures creator fees from Pump.fun and intelligently allocates them across market making, buyback/burn, and team operations.
GoemonAI is a sophisticated trading bot for Solana that:
- Monitors Pump.fun - Listens to creator fee events on Pump.fun
- Allocates Funds - Optimized fund distribution strategy
- 80% to market making (price support and trading)
- 15% to buyback and burn (reduce supply, increase scarcity)
- 5% to team (operational costs)
- Tracks Everything - Provides real-time dashboard for complete transparency
- Manages Growth - Sustainable token economics through continuous buyback and burn
goemonai/
βββ bot/ # Core trading bot
β βββ src/
β β βββ index.ts # Express API server
β β βββ bot.ts # Bot trading logic
β β βββ database.ts # SQLite persistence
β β βββ types.ts # TypeScript types
β βββ package.json
β βββ tsconfig.json
β βββ .env.example
βββ website/ # React/Next.js dashboard
β βββ pages/ # Dashboard, Transactions, Stats
β βββ components/ # UI components
β βββ lib/ # API client
β βββ styles/ # Tailwind CSS
β βββ package.json
βββ shared/ # Shared utilities
βββ docker-compose.yml # Docker orchestration
βββ Dockerfile.bot # Bot container
βββ Dockerfile.website # Website container
βββ setup.sh # Linux/Mac setup
βββ setup.bat # Windows setup
GoemonAI uses an optimized three-way allocation strategy:
Creator Fee
β
ββ 80% β Market Making Wallet (price support & trading)
ββ 15% β Buyback & Burn Wallet (reduce supply)
ββ 5% β Team Wallet (operational costs)
- Market Making Focus - 80% ensures strong price support
- Supply Reduction - 15% buyback & burn decreases token supply
- Lean Operations - 5% team allocation keeps overhead low
- Token Value - Continuous burning increases scarcity
- Sustainable - Scalable allocation strategy
- Professional - Proven tokenomics model
- Node.js 18+ and npm/yarn
- Solana CLI (optional)
- A Solana devnet/mainnet RPC endpoint
- Bot wallet with initial SOL balance
cd bot
# Install dependencies
npm install
# Create .env file
cp .env.example .env
# Edit .env with your configuration
nano .env
# Required:
# - SOLANA_RPC_URL: Your Solana RPC endpoint
# - BOT_PRIVATE_KEY: Your bot's wallet private key (base64 encoded)
# - TEAM_WALLET: Team's Solana address
# - MARKET_MAKING_WALLET: Market making wallet address
# - LOTTERY_WALLET: Buyback/burn wallet address
# Development
npm run dev
# Production
npm run build
npm startBot API available at: http://localhost:3001
cd website
# Install dependencies
npm install
# Create .env.local file
cp .env.example .env.local
# Development
npm run dev
# Production
npm run build
npm startDashboard available at: http://localhost:3000
# RPC Configuration
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
# Wallet Configuration (base64 encoded private key)
BOT_PRIVATE_KEY=your_base64_encoded_key_here
# Fund Destination Wallets
TEAM_WALLET=<team_solana_address>
MARKET_MAKING_WALLET=<market_making_solana_address>
LOTTERY_WALLET=<buyback_burn_solana_address>
# Pump.fun Program ID
PUMP_FUN_PROGRAM_ID=39azUhRZyodmcP2ZNaZjqwNcqRQB3hEd5e7g9qKB5qS1
# API Configuration
API_PORT=3001NEXT_PUBLIC_API_URL=http://localhost:3001The bot exposes REST API endpoints:
Health check - returns bot and database status
Current bot metrics and recent transactions
Transaction history with pagination
Query Parameters:
limit- Number of transactions (default: 50)offset- Pagination offset (default: 0)
Transactions filtered by type (fee_received, allocation, market_buy, etc.)
Aggregated statistics and fund allocation
Response includes:
totalFeesCollected- Total SOL fees collectedteamFunds- Total allocated to teammarketMakingFunds- Total allocated to market makingbuybackBurnFunds- Total allocated to buyback/burnallocation- Current allocation percentages
The bot uses SQLite for persistent data storage.
- transactions - All transactions (fees, allocations, trades)
- fund_allocation - Historical fund allocation records
- metrics - Time-series bot performance metrics
Data is stored in bot_data.db in the bot directory.
- Real-time fund allocation visualization
- Total fees collected
- Fund distribution breakdown
- Recent transactions
- Auto-refresh every 5 seconds
- Full transaction history
- Pagination support
- Filter by transaction type
- View allocation details
- Links to Solscan explorer
- Performance metrics
- Fund distribution summary
- Daily volume tracking
- Profit/loss analysis
- Current allocation percentages
Build and run with Docker:
# Build images
docker-compose build
# Start services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose downServices will be available at:
- Bot API:
http://localhost:3001 - Website:
http://localhost:3000
# Clone repository
git clone https://github.com/yourusername/goemonai.git
cd goemonai
# Run setup script
bash setup.sh # Linux/Mac
setup.bat # Windows
# Start services
cd bot && npm run build && npm start &
cd ../website && npm run build && npm start &- Update SOLANA_RPC_URL to mainnet
- Configure real wallet addresses
- Set up HTTPS/SSL certificate
- Enable authentication if needed
- Configure firewall rules
- Set up monitoring/logging
- Implement backup strategy
- Test with small amounts first
- Monitor bot activity closely
-
Private Keys
- Never commit
.envfiles to git - Use base64 encoding for keys
- Rotate keys periodically
- Restrict file permissions (chmod 600)
- Never commit
-
API Security
- Disable public API endpoints in production
- Implement authentication
- Use HTTPS only
- Add rate limiting
- Enable CORS properly
-
Wallet Security
- Use separate wallets for different functions
- Implement transaction limits
- Regular security audits
- Monitor for suspicious activity
# Test RPC endpoint
solana cluster-version --url <YOUR_RPC_URL>
# Check program ID
solana account <PUMP_FUN_PROGRAM_ID> --url <YOUR_RPC_URL>Solutions:
- Verify RPC URL is correct
- Check Pump.fun program ID
- Ensure bot wallet has SOL balance
# Check bot API health
curl http://localhost:3001/api/health
# Check database exists
ls -la bot/bot_data.dbSolutions:
- Verify bot is running
- Check NEXT_PUBLIC_API_URL is correct
- Clear browser cache
- Check browser console for errors
Check:
- Bot is receiving fees from Pump.fun
- Database is accessible and writable
- Bot logs for errors:
npm run dev
If bot receives 100 SOL from creator fees:
| Allocation | Amount | Wallet | Purpose |
|---|---|---|---|
| Market Making | 80 SOL | Market Making | Price support & trading |
| Buyback & Burn | 15 SOL | Buyback/Burn | Supply reduction |
| Team | 5 SOL | Team | Operations |
The bot implements:
- Order Placement - Places orders around market price
- Spread Management - Maintains profitable spreads
- Position Management - Balances inventory
- Risk Control - Implements safeguards
Note: Detailed algorithms should be customized based on your strategy
Backend:
- Node.js + TypeScript
- Express.js (REST API)
- SQLite (database)
- @solana/web3.js (blockchain)
Frontend:
- React 18
- Next.js 14
- Tailwind CSS
- Recharts (visualization)
Deployment:
- Docker
- Docker Compose
For issues and questions:
- Check the troubleshooting section above
- Review bot logs:
npm run dev - Check database:
sqlite3 bot_data.db - Verify configuration files
Provided for educational purposes.
This bot interacts with real blockchain assets. Use at your own risk. The developers are not responsible for financial losses. Always test on devnet first.
Built with β€οΈ for the Solana ecosystem