Skip to content

Commit

Permalink
Merge pull request #5 from Adamant-im/dev
Browse files Browse the repository at this point in the history
Liquidity & spread maintenance, price setting
  • Loading branch information
adamant-al committed Nov 22, 2020
2 parents 6f2e328 + 72c848a commit 85fc6df
Show file tree
Hide file tree
Showing 30 changed files with 2,779 additions and 773 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ logs/
package-lock.json
tests.js
config.test
.DS_Store
41 changes: 28 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,56 @@
ADAMANT Trading & Market making bot is a software that allows to run trades on crypto exchanges, make fake volume (wash trading) and build live-like dynamic order book.
ADAMANT Trading & Market making bot is a software that allows to run trades on crypto exchanges, make trade volume, maintain spread and liquidity, set price range, and build live-like dynamic order book.

* In Market making mode, the bot places orders and execute them by himself, making a trade volume; and builds live-like dynamic order book.
* Trading is a mode when bot run orders according to some strategy. It can be profitable or not. Unavailable now—use [Zenbot](https://github.com/DeviaVir/zenbot).
# Market making

Trade bots work in ADAMANT Messenger chats directly.
In Market making mode, the bot places orders and execute them by himself, making a trade volume, maintaining spread and liquidity; and builds live-like dynamic order book. Market making helps:

* Cryptocurrency projects (token issuers)
* Cryptocurrency exchanges

See [marketmaking.app](https://marketmaking.app) to have a look at the bot possibilities.

![Trading chart](./assets/Making-chart.png)

![Market Making & OrderBook Building](./assets/OrderBook-Builder.gif)

Features:
# Profit trading

Trading is a mode when bot run orders according to some strategy. It can be profitable or not. This feature is unavailable now—we recommend to use [Zenbot](https://github.com/DeviaVir/zenbot) instead.

# Features

* Managed with your commands using ADAMANT Messenger
* Easy to install and configure
* Free and open source
* Fill order books
* Place buy and sell limit or market orders
* Market making
* Dynamic order book
* Dynamic order book building
* Spread & liquidity maintenance
* Price range setting
* Stores and displays statistics
* Managed with your commands using ADAMANT Messenger

Supported exchanges (more in progress):
# Supported exchanges

If the bot don't support the exchange you need, code it by yourself, or [hire developers](https://marketmaking.app/services/).

* [IDCM](https://idcm.io/invitation/receive?code=LM5510&lang=en)
* [Bit-Z](https://u.bit-z.com/register?invite_code=2423317)
* [CoinDeal](https://coindeal.com/ref/9WZN)
* [Resfinex](https://trade.resfinex.com?ref=7ccb34d867&pair=ADM_USDT)
* [Atomars](https://atomars.com/refcode/kaba)

# Usage
# Usage and Installation

After installation, you control the bot in secure ADAMANT Messenger chat directly.

Available commands: ask a bot with `/help` command. Read more how to install and use the bot: [Crypto trading & Market making bot in ADAMANT](https://medium.com/adamant-im/crypto-trading-market-making-bot-in-adamant-82fa48b78f51).

# Installation
We can run market making for you, see [marketmaking.app/services](https://marketmaking.app/services/).

## Requirements

* Ubuntu 16 / Ubuntu 18 (other OS had not been tested)
* NodeJS v 8+
* Ubuntu 16 / Ubuntu 18 (we didn't test others)
* NodeJS v 10+
* MongoDB ([installation instructions](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/))

## Setup
Expand Down
3 changes: 3 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ function init() {
checker();
require('./trade/mm_trader').run();
require('./trade/mm_orderbook_builder').run();
require('./trade/mm_liquidity_provider').run();
require('./trade/mm_price_watcher').run();
// require('./trade/mm_orderbook_builder').test();
notify(`*${config.notifyName} started* for address _${Store.user.ADM.address}_ (ver. ${Store.version}).`, 'info');
});
}
Expand Down
Binary file added assets/Making-chart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
/** Notify non-admins that they are not admins. If false, bot will be silent. **/
"notify_non_admins": true,

/** Exchange to work with. Available values: "IDCM", "Bit-Z", "CoinDeal", "Resfinex", "Atomars". Case insensitive. **/
/** Exchange to work with. Available values: "Bit-Z", "CoinDeal", "Resfinex", "Atomars". Case insensitive. **/
"exchange": "Resfinex",

/** Pair to trade **/
Expand Down
24 changes: 12 additions & 12 deletions helpers/log.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,26 @@ _________________${fullTime()}_________________
module.exports = {
error(str) {
infoStr.write(`
` + 'Bot error|' + time() + '|' + str);
console.log('\x1b[31m', 'error|' + time(), '\x1b[0m', str);
` + 'Bot error|' + fullTime() + '|' + str);
console.log('\x1b[31m', 'error|' + fullTime(), '\x1b[0m', str);
},
info(str) {
console.log('\x1b[32m', 'info|' + time(), '\x1b[0m', str);
console.log('\x1b[32m', 'info|' + fullTime(), '\x1b[0m', str);

infoStr.write(`
` + 'Bot info|' + time() + '|' + str);
` + 'Bot info|' + fullTime() + '|' + str);
},
warn(str) {
console.log('\x1b[33m', 'warn|' + time(), '\x1b[0m', str);
console.log('\x1b[33m', 'warn|' + fullTime(), '\x1b[0m', str);

infoStr.write(`
` + 'Bot warn|' + time() + '|' + str);
` + 'Bot warn|' + fullTime() + '|' + str);
},
log(str) {
console.log('\x1b[34m', 'log|' + time(), '\x1b[0m', str);
console.log('\x1b[34m', 'log|' + fullTime(), '\x1b[0m', str);

infoStr.write(`
` + 'Bot log|[' + time() + '|' + str);
` + 'Bot log|[' + fullTime() + '|' + str);
}
};

Expand All @@ -44,16 +44,16 @@ function time() {
second: 'numeric'
};

return new Date().toLocaleString('en', options);
return new Date().toLocaleString('en-GB', options);
}

function date() {
var options = {
day: 'numeric',
year: 'numeric',
month: 'numeric',
year: 'numeric'
day: 'numeric'
};
return (new Date().toLocaleString('en', options)).replace(/\//g, '-');
return (new Date().toLocaleString('fr-CA', options)).replace(/\//g, '-');
}

function fullTime() {
Expand Down
6 changes: 5 additions & 1 deletion helpers/notify.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ module.exports = (message, type, silent_mode = false) => {
uri: slack,
method: 'POST',
json: true,
timeout: 10000,
body: {
'attachments': [{
'fallback': message,
Expand All @@ -47,7 +48,10 @@ module.exports = (message, type, silent_mode = false) => {
}
};
if (slack && slack.length > 34) {
request(opts);
request(opts)
.on('error', function(err) {
log.log(`Request to Slack with message ${message} failed. ${err}.`);
});
}
if (adamant_notify && adamant_notify.length > 5 && adamant_notify.startsWith('U') && config.passPhrase && config.passPhrase.length > 30) {
api.send(config.passPhrase, adamant_notify, `${type}| ${message.replace(/\*/g, '**')}`, 'message');
Expand Down
Loading

0 comments on commit 85fc6df

Please sign in to comment.