Socket
Book a DemoInstallSign in
Socket

@adrienv1520/mmbot

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@adrienv1520/mmbot

A simple market making bot

0.0.2
unpublished
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

mmbot

A simple market making bot.

Table of Contents

  • Presentation
  • Installation
  • Technical information
  • Usage
  • Code of Conduct
  • Contributing
  • Support
  • Security
  • License

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

namecodedescriptionmodule
BotError
TOO_MUCH_CURRENCIESToo much currencies specified at bot creation.lib/index
UNSUPPORTED_CURRENCYThe specified currency at bot creation is not supported.lib/index
UNSUPPORTED_PAIRThe trading pair is not supported.lib/index
MARKET_API_ERRORRequesting market API data led to an error.lib/index
LibError
UNKNOWN_ERRORAn unknown error was caugth.lib/index

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.

Keywords

node.js

FAQs

Package last updated on 29 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.