-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
32 lines (22 loc) · 939 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
'use strict'
require('dotenv').config();
const Binance = require('./modules/binance');
const twilio = require('./modules/twilio');
const coin = require('./modules/coin');
const CONFIG = {
baseCurrency: process.env.BINANCE_BASE_CURRENCY || 'BTC',
fee: process.env.BINANCE_FEE || 0.0005,
placementPercentage: process.env.BINANCE_PLACEMENT_PERCENTAGE || 1,
takeProfitPercentage: process.env.TAKE_PROFIT_PERCENTAGE || 50
};
(async (config) => {
let bin = new Binance(config);
await twilio.sendSms(`[SurgeBot] Initialized.`);
coin.announced(async (announcement) => {
let message = `[SurgeBot] Announced [$${announcement.coin}] on Binance. SurgeBot activated.`;
// If Twillio account enabled, send a message to a designated mobile number
await twilio.sendSms(message);
// Kickoff the Binance SurgeBot
await bin.coinDetected(announcement.coin);
});
})(CONFIG);