# Clone the repository
git clone https://github.com/CryptoGnome/aster_lick_hunter_node.git
cd aster_lick_hunter_node
# Run automatic setup (installs dependencies and builds)
npm run setup
# Start the bot
npm run dev# Install dependencies
npm install
# Build the project
npm run build
# Start development mode
npm run devWhen pulling updates from the repository, always follow these steps:
# 1. Stop the running bot (Ctrl+C)
# 2. Pull latest changes
git pull
# 3. Install new/updated dependencies
npm install
# 4. Rebuild the project
npm run build
# 5. Start the bot
npm run devgit pull: Fetches latest code changesnpm install: Updates dependencies that may have changednpm run build: Compiles TypeScript and prepares production bundlesnpm run dev: Starts both the web UI and bot service
If you know dependencies haven't changed:
git pull
npm run build
npm run dev# Development mode (with hot reload)
npm run dev
# Production mode
npm start
# Web UI only
npm run dev:web
# Bot only (with watch mode)
npm run dev:bot
# Bot only (single run)
npm run bot# Run all tests
npm run test:all
# Test limit orders
npm test
# Test bot simulation
npm run test:simulation
# Test order flow
npm run test:flow# Check for linting issues
npm run lint
# Check TypeScript types
npx tsc --noEmit# Setup initial configuration
npm run setup:config
# This will:
# - Migrate existing config.json to config.user.json
# - Create config.user.json from defaults if needed
# - Remove config.json from git trackingIf you see "Port 3000 is already in use":
# Windows
netstat -ano | findstr :3000
taskkill /PID <PID> /F
# Linux/Mac
lsof -i :3000
kill -9 <PID>- Check your API keys are correct
- Ensure you're not running multiple instances
- Check firewall settings
- Try restarting with
npm run dev
# Clean install
rm -rf node_modules package-lock.json
npm install
npm run build# Reset to default configuration
cp config.default.json config.user.json
# Then add your API keys via web UI at http://localhost:3000/configaster_lick_hunter_node/
├── src/
│ ├── app/ # Next.js pages and API routes
│ ├── bot/ # Bot service and WebSocket server
│ ├── lib/ # Shared business logic
│ │ ├── api/ # Exchange API interaction
│ │ ├── bot/ # Bot components
│ │ └── db/ # Database operations
│ └── components/ # React UI components
├── config.user.json # User configuration (gitignored)
├── config.default.json # Default configuration
└── package.json # Dependencies and scripts
-
Before making changes: Create a branch
git checkout -b feature/your-feature-name
-
Test your changes:
npm run lint npx tsc --noEmit npm test -
Build and verify:
npm run build npm run dev
To test API connections without running the full bot:
# Use the Node.js REPL
node
# Then in the REPL:
const { loadConfig } = require('./dist/lib/bot/config');
const { getBalance } = require('./dist/lib/api/market');
(async () => {
const config = await loadConfig();
const balance = await getBalance(config.api);
console.log(balance);
})();The bot uses SQLite for storing liquidation history:
# View database (requires sqlite3 CLI)
sqlite3 liquidations.db
# In SQLite:
.tables
SELECT * FROM liquidations ORDER BY timestamp DESC LIMIT 10;
.quit- Bot logs: Check terminal output when running
npm run dev - Web UI logs: Check browser console (F12)
- WebSocket status: Monitor at http://localhost:3000 dashboard
- Database: Check
liquidations.dbfor historical data
While not required, you can use environment variables:
# Create .env.local file
API_KEY=your_api_key_here
SECRET_KEY=your_secret_key_here
# These will override config.user.json values- Always test in paper mode first
- Start with small position sizes
- Monitor the first few trades closely
- Set conservative stop-loss levels
- Keep your API keys secure
# Weekly: Update dependencies
npm update
# Monthly: Check for major updates
npm outdated
# As needed: Clean database
# The bot auto-manages database size, but you can manually clean old entries# Backup your configuration
cp config.user.json config.user.backup.json
# Backup database
cp liquidations.db liquidations.backup.db- GitHub Issues: Report bugs or request features
- Discord: Join the community
- Video Tutorial: Setup guide on YouTube
- Never commit
config.user.json- It contains your API keys - Keep your API keys secret - Don't share them with anyone
- Use paper mode - Test all changes in paper mode first
- Monitor positions - Always keep an eye on open positions