This is a custom crypto trading bot built with Node.js, using Bitget API for spot trading and Supabase for logging trades. The bot buys coins when their price drops by 10%, sells when they rise by 20%, and implements a stop-loss at -30%.
- Trades multiple coins asynchronously.
- Executes market orders based on price movements.
- Logs all trades in Supabase for monitoring.
- Runs continuously on a server with automatic execution.
- Node.js (Backend)
- Bitget API (Trading)
- Supabase (Database for trade logs)
- Render (Hosting for the bot)
- Vercel (Web dashboard for trade monitoring)
git clone https://github.com/your-repo/trading-bot-nodejs.git
cd trading-bot-nodejsnpm installCreate a .env file with your API keys:
BITGET_API_KEY=your_api_key
BITGET_SECRET_KEY=your_secret_key
BITGET_PASSPHRASE=your_passphrase
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_key
PORT=8000
- Create a new Web Service in Render.
- Connect your GitHub repository.
- Set environment variables in Render's dashboard.
- Deploy and run the service.
- Create a new Supabase project.
- Go to SQL Editor and run:
CREATE TABLE trades (
id SERIAL PRIMARY KEY,
action TEXT,
symbol TEXT,
price FLOAT,
timestamp TIMESTAMP DEFAULT NOW()
);- Get your Supabase URL and API Key and add them to
.env.
node index.jsYou can build a Vercel-hosted dashboard to view live trades. Steps:
- Create a new Next.js app (
npx create-next-app@latest). - Fetch trade data from Supabase and display it.
- Deploy to Vercel.
MIT License. Feel free to contribute!
🚀 Happy Trading!