-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmain.ts
52 lines (42 loc) · 1.32 KB
/
main.ts
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { PublicKey } from "@solana/web3.js";
require("dotenv").config();
const moment = require("moment");
const SolanaBot = require("./modules/bot");
const main = async () => {
try {
const privateKey = process.env.KEY;
const config = {
live: true, // turn live trading on and off
snipeAmount: 0.001, // %
percentAddedRequirement: 0.9,
maxTrades: 2,
profitGoal: 0.85, // %
moonBag: 0.1, // %
stopLoss: 0.5, // %
tradeTimeLimit: 2000, // minutes
lowerLiquidityBound: 1000, // USD
upperLiquidityBound: 60000, // USD
slippage: 10, // %
};
const solanaBot = new SolanaBot(privateKey, config);
await solanaBot.init();
solanaBot.startMonitoringBasePair(10);
await solanaBot.enableMonitoringNewPairs();
await solanaBot.sendMessageToDiscord("bot start up");
} catch (error) {
console.error("An error occurred:", error);
}
};
const start = async () => {
let shouldRestart = true;
while (shouldRestart) {
try {
await main();
shouldRestart = false;
} catch (error) {
console.error("An error occurred:", error);
shouldRestart = true;
}
}
};
start();