0.0.2 • Published 4 years ago

@adrienv1520/mmbot v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Table of Contents

Presentation

A simple market making bot using DeversiFi to get orderbook data and place n bid/ask orders every x seconds regarding best bid/ask within a certain price range and balance size percentages. It will automatically cancel orders out of a maximum price range percentage.

This code is dynamic enough to add trading pairs right now. At the moment only ETH:USD is supported.

Work to do:

  • place real orders;
  • make each bot configurable to the user (delay between orders, number of bid/as orders per loop, maximum price ranges, etc.);
  • add more trading pairs;
  • add more tests;
  • test performance.

Installation

npm i -S @adrienv1520/mmbot

Technical information

Node.js

  • Language: JavaScript ES6/ES7
  • VM: Node.js >= Dubnium (10.22.1)

Tests

Command to run all tests:

npm test

Linting

ESLint with Airbnb base rules. See Airbnb JavaScript Style Guide.

npm run test:lint

Unit

Mocha and Chai.

npm run test:unit

Usage

Environment variables

nametypedescriptiondefaultexample
DEBUGDebugDebug mode. See bugbug.nonemmbot:*

*required

Import module

const MMBot = require('@adrienv1520/mmbot');

Run the bot

No errors are thrown when running the bot. If any error occurred it will be caught and logged by the bot and then the script will be stopped.

//your-script.js
const MMBot = require('@adrienv1520/mmbot');
const bot = new MMBot({ balances: { eth: 10, usd: 2000 } });

bot.run();

Run your script

DEBUG=mmbot:* node your-script.js

# you can also test the bot locally once the repository being cloned
# at the mmbot project root run:
DEBUG=mmbot:* node test/run-the-bot-locally.js

Errors

Object structure

Errors emitted by mmbot inherit the native Error prototype with an additional code property and toString method.

{
  name,
  code,
  message,
  stack,
  toString(),
}

Codes

Code of Conduct

This project has a Code of Conduct. By interacting with this repository, organization, or community you agree to abide by its terms.

Contributing

Please take also a moment to read our Contributing Guidelines if you haven't yet done so.

Support

Please see our Support page if you have any questions or for any help needed.

Security

For any security concerns or issues, please visit our Security Policy page.

License

MIT.