-
Notifications
You must be signed in to change notification settings - Fork 61
/
helper.js
169 lines (159 loc) · 10.6 KB
/
helper.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
const config = require('./config');
const ethers = require('ethers');
const input = require("input");
/**
** Don't Change this file, change settings in config.js
**/
async function getUserInput() {
const choices = ['Default', 'Buy Only Low Liquidity Tokens 1-150 BNB', 'Buy Only Medium Liquidity Tokens 150-300 BNB', 'Buy Only High Liquidity Tokens 300-700 BNB', 'Custom Liquidity Strategy']
const choices2 = ['COINMARKETCAP', 'COINGECKO', 'BOTH'];
const channelChoices = ['CoinGecko & CoinMarketCap Listing Alerts', 'Coinmarketcap Fastest Alerts'];
await input.select('Welcome, please choose a buying strategy', choices).then(async function (answers) {
if (answers == 'Default') {
console.log(config.strategy);
}
if (answers == "Buy Only Low Liquidity Tokens 1-150 BNB") {
config.numberOfTokensToBuy = parseInt(await input.text("Enter number of different tokens you want to buy"));
config.strategy.investmentAmount = await input.text("Enter Investment Amount in BNB");
config.strategy.gasPrice = ethers.utils.parseUnits(await input.text("Enter Gas Price"), 'gwei');
config.strategy.maxBuyTax = parseFloat(await input.text("Enter max buying tax"));
config.strategy.minBuyTax = parseFloat(await input.text("Enter min buying tax"));
config.strategy.maxSellTax = parseFloat(await input.text("Enter max sell tax"));
config.strategy.minSellTax = parseFloat(await input.text("Enter min sell tax"));
config.strategy.profitPercent = parseFloat(await input.text("Enter profit percent you want"));
config.strategy.stopLossPercent = parseFloat(await input.text("Enter max loss percent"));
config.strategy.trailingStopLossPercent = parseFloat(await input.text("Enter trailing stop loss percent"));
config.strategy.percentOfTokensToSellProfit = parseFloat(await input.text("Enter percent of tokens to sell when profit reached"));
config.strategy.percentOfTokensToSellLoss = parseFloat(await input.text("Enter percent of tokens to sell when stop loss reached"));
config.strategy.maxLiquidity = 150;
config.strategy.minLiquidity = 1;
await input.select('Choose a channel to buy from', channelChoices).then(async function (channelAnswer) {
if (channelAnswer == "CoinGecko & CoinMarketCap Listing Alerts") {
config.channel = 'CGCMC'
await input.select('Choose coinmarketcap, coingecko or both', choices2).then(async function (answers2) {
if (answers2 == "COINMARKETCAP") {
config.strategy.platform = "COINMARKETCAP";
}
else if (answers2 == "COINGECKO") {
config.strategy.platform = "COINGECKO";
} else {
config.strategy.platform = "BOTH";
}
});
}
else {
config.channel = 'CFA';
}
});
console.log(config.strategy);
}
if (answers == "Buy Only Medium Liquidity Tokens 150-300 BNB") {
config.numberOfTokensToBuy = parseInt(await input.text("Enter number of different tokens you want to buy"));
config.strategy.investmentAmount = await input.text("Enter Investment Amount in BNB");
config.strategy.gasPrice = ethers.utils.parseUnits(await input.text("Enter Gas Price"), 'gwei');
config.strategy.maxBuyTax = parseFloat(await input.text("Enter max buying tax"));
config.strategy.minBuyTax = parseFloat(await input.text("Enter min buying tax"));
config.strategy.maxSellTax = parseFloat(await input.text("Enter max sell tax"));
config.strategy.minSellTax = parseFloat(await input.text("Enter min sell tax"));
config.strategy.profitPercent = parseFloat(await input.text("Enter profit percent you want"));
config.strategy.stopLossPercent = parseFloat(await input.text("Enter max loss percent"));
config.strategy.trailingStopLossPercent = parseFloat(await input.text("Enter trailing stop loss percent"));
config.strategy.percentOfTokensToSellProfit = parseFloat(await input.text("Enter percent of tokens to sell when profit reached"));
config.strategy.percentOfTokensToSellLoss = parseFloat(await input.text("Enter percent of tokens to sell when stop loss reached"));
config.strategy.maxLiquidity = 300;
config.strategy.minLiquidity = 150;
await input.select('Choose a channel to buy from', channelChoices).then(async function (channelAnswer) {
if (channelAnswer == "CoinGecko & CoinMarketCap Listing Alerts") {
config.channel = 'CGCMC'
await input.select('Choose coinmarketcap, coingecko or both', choices2).then(async function (answers2) {
if (answers2 == "COINMARKETCAP") {
config.strategy.platform = "COINMARKETCAP";
}
else if (answers2 == "COINGECKO") {
config.strategy.platform = "COINGECKO";
} else {
config.strategy.platform = "BOTH";
}
});
}
else {
config.channel = 'CFA';
}
});
console.log(config.strategy);
}
if (answers == "Buy Only High Liquidity Tokens 300-700 BNB") {
config.numberOfTokensToBuy = parseInt(await input.text("Enter number of different tokens you want to buy"));
config.strategy.investmentAmount = await input.text("Enter Investment Amount in BNB");
config.strategy.gasPrice = ethers.utils.parseUnits(await input.text("Enter Gas Price"), 'gwei');
config.strategy.maxBuyTax = parseFloat(await input.text("Enter max buying tax"));
config.strategy.minBuyTax = parseFloat(await input.text("Enter min buying tax"));
config.strategy.maxSellTax = parseFloat(await input.text("Enter max sell tax"));
config.strategy.minSellTax = parseFloat(await input.text("Enter min sell tax"));
config.strategy.profitPercent = parseFloat(await input.text("Enter profit percent you want"));
config.strategy.stopLossPercent = parseFloat(await input.text("Enter max loss percent"));
config.strategy.trailingStopLossPercent = parseFloat(await input.text("Enter trailing stop loss percent"));
config.strategy.percentOfTokensToSellProfit = parseFloat(await input.text("Enter percent of tokens to sell when profit reached"));
config.strategy.percentOfTokensToSellLoss = parseFloat(await input.text("Enter percent of tokens to sell when stop loss reached"));
config.strategy.maxLiquidity = 700;
config.strategy.minLiquidity = 300;
await input.select('Choose a channel to buy from', channelChoices).then(async function (channelAnswer) {
if (channelAnswer == "CoinGecko & CoinMarketCap Listing Alerts") {
config.channel = 'CGCMC'
await input.select('Choose coinmarketcap, coingecko or both', choices2).then(async function (answers2) {
if (answers2 == "COINMARKETCAP") {
config.strategy.platform = "COINMARKETCAP";
}
else if (answers2 == "COINGECKO") {
config.strategy.platform = "COINGECKO";
} else {
config.strategy.platform = "BOTH";
}
});
}
else {
config.channel = 'CFA';
}
});
console.log(config.strategy);
}
if (answers == "Custom Liquidity Strategy") {
config.numberOfTokensToBuy = parseInt(await input.text("Enter number of different tokens you want to buy"));
config.strategy.investmentAmount = await input.text("Enter Investment Amount in BNB");
config.strategy.gasPrice = ethers.utils.parseUnits(await input.text("Enter Gas Price"), 'gwei');
config.strategy.minLiquidity = parseFloat(await input.text("Enter minimum liquidity"));
config.strategy.maxLiquidity = parseFloat(await input.text("Enter maximum liquidity"));
config.strategy.maxBuyTax = parseFloat(await input.text("Enter max buying tax"));
config.strategy.minBuyTax = parseFloat(await input.text("Enter min buying tax"));
config.strategy.maxSellTax = parseFloat(await input.text("Enter max sell tax"));
config.strategy.minSellTax = parseFloat(await input.text("Enter min sell tax"));
config.strategy.profitPercent = parseFloat(await input.text("Enter profit percent you want"));
config.strategy.stopLossPercent = parseFloat(await input.text("Enter max loss percent"));
config.strategy.trailingStopLossPercent = parseFloat(await input.text("Enter trailing stop loss percent"));
config.strategy.percentOfTokensToSellProfit = parseFloat(await input.text("Enter percent of tokens to sell when profit reached"));
config.strategy.percentOfTokensToSellLoss = parseFloat(await input.text("Enter percent of tokens to sell when stop loss reached"));
await input.select('Choose a channel to buy from', channelChoices).then(async function (channelAnswer) {
if (channelAnswer == "CoinGecko & CoinMarketCap Listing Alerts") {
config.channel = 'CGCMC'
await input.select('Choose coinmarketcap, coingecko or both', choices2).then(async function (answers2) {
if (answers2 == "COINMARKETCAP") {
config.strategy.platform = "COINMARKETCAP";
}
else if (answers2 == "COINGECKO") {
config.strategy.platform = "COINGECKO";
} else {
config.strategy.platform = "BOTH";
}
});
}
else {
config.channel = 'CFA';
}
});
console.log(config.strategy);
}
});
}
module.exports = {
getUserInput
}