Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DEBUG="3commas-control:*"
THREE_COMMAS_API_KEY=
THREE_COMMAS_SECRET_KEY=
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
/serverless.yml
/credentials.json
/node_modules/
/.env
30 changes: 29 additions & 1 deletion botHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ const subMinutes = require('date-fns/subMinutes');

const ACCOUNT_ID_TOM = process.env.THREE_COMMAS_ACCOUNT_ID;
const ACCOUNT_ID_CHRIS = process.env.THREE_COMMAS_ACCOUNT_ID_CHRIS;
const ACCOUNT_ID_KUCOIN_TOM = process.env.THREE_COMMAS_ACCOUNT_ID_KUCOIN_TOM;
const SHOULD_RUN_BOTS = true;
const SHOULD_RUN_SUPER_BOTS = false;

const paramsToEnableSuperBot = {
timePeriod: 45,
Expand Down Expand Up @@ -53,7 +55,7 @@ module.exports.handleBots = async () => {
module.exports.toggleSuperBots = async () => {
console.log("STARTING review of bots to enabled a superbot");

if (!SHOULD_RUN_BOTS) {
if (!SHOULD_RUN_SUPER_BOTS) {
return {
statusCode: 200,
body: JSON.stringify({ message: 'NOT UPDATING BOTS', success: true }),
Expand Down Expand Up @@ -105,8 +107,12 @@ module.exports.toggleSuperBots = async () => {
};

module.exports.handleChrisBots = async () => {
console.log("NOT RUNNING");
return false;

console.log("STARTING update of all Chris bots");


const filters = [];

filters.push((deal) => deal.completed_safety_orders_count >= 3);
Expand All @@ -126,6 +132,28 @@ module.exports.handleChrisBots = async () => {
};
};

module.exports.handleKucoinTomBots = async () => {
console.log("STARTING update of all ACCOUNT_ID_KUCOIN_TOM bots");

const filters = [];

filters.push((deal) => deal.completed_safety_orders_count >= 9);
filters.push({trailing_enabled: false});
filters.push((deal) => !deal.bot_name.includes("(SKIP)"));

const deals = await updateAllDeals(ACCOUNT_ID_KUCOIN_TOM, filters, {
trailing_enabled: true,
take_profit: 2.40,
trailing_deviation: 0.4
});

console.log("FINISHED update of all ACCOUNT_ID_KUCOIN_TOM bots");
return {
statusCode: 200,
body: JSON.stringify({ message: 'Updated all bots, see logs', success: true, deals }),
};
};

module.exports.updateAllDeals = async () => {

const filters = [];
Expand Down
Loading