GithubHelp home page GithubHelp logo

thesoftwarejedi / tribeca Goto Github PK

View Code? Open in Web Editor NEW

This project forked from michaelgrosner/tribeca

2.0 2.0 1.0 742 KB

A very low latency cryptocurrency market making trading bot built using node.js

JavaScript 1.11% TypeScript 93.33% HTML 5.56%

tribeca's Introduction

tribeca

tribeca is a very low latency cryptocurrency market making trading bot with a full featured web client, backtester, and supports direct connectivity to several large cryptocoin exchanges. On modern hardware, it can react to market data by placing and canceling orders in under a millisecond. It runs on v0.12 nodejs or the latest io.js. Persistence is acheived using mongodb.

tribeca can be installed "by-hand" or via Docker

Manual Installation

Pre-reqs

  1. nodejs v0.12 or latest io.js

  2. MongoDB

  3. Typescript 1.5 with tsd

  4. Grunt

Steps

  1. Make sure your machine has all listed pre-reqs

  2. npm install and then tsd reinstall -s

  3. Change any relevant parameters into src/service/config.ts, like input your exchange API keys

  4. Compile typescript to javascript via grunt compile

  5. Run tribeca via EXCHANGE={exchange} TRIBECA_MODE={mode} node main.js -- see later for more explaination on valid exchanges and modes. It may also be prudent to run via a tool like forever.js or supervisor to keep tribeca running after any unexpected crashes.

  6. Set up parameters to your trading liking in the web admin (http://localhost:3000)

  7. Click the "BTC/USD" button in the web admin so it is green to start making markets

Docker Installation

  1. Change any relevant parameters into src/service/config.ts, like input your exchange API keys

  2. Setup a mongodb container/instance that our container can access

  3. Build and run the included Dockerfile

Environment variables

EXCHANGE

  1. coinbase - uses the WebSocket API

  2. hitbtc - WebSocket + socket.io API

  3. okcoin - WebSocket API (most likely broken, untested for months)

  4. null - Test in-memory exchange

  5. FIX - (not included), uses ZeroMQ to communicate to a FIX client which talks FIX to an exchange

TRIBECA_MODE

  1. prod

  2. dev (when the exchange has a test environment, like Coinbase or HitBtc)

  3. backtest - advanced mode, also check out included backtest.js for more details

Quoting Parameters

Note: only a few parameters are listed currently. Peek at src/common/models.ts:QuotingParameters for the full list of parameters

  1. width: sell orders will always be placed for this many dollars more than buy orders. Defaults to $0.30

  2. size: amount of coins to make each side of the quote. Defaults to 0.05 BTC

  3. mode: quoting style to use. Some modes will look at other orders in the market, the midpoint of the spread, etc.

  4. tradesPerMinute and tradeRateSeconds: only allow tradesPerMinute (disregard the minutes portion of the name...) trades in every tradeRateSeconds window.

Web UI

Web UI Preview

Once tribeca is up and running, visit port 3000 of the machine on which it is running to view the admin view. There are inputs for quoting parameters, grids to display market orders, market trades, your trades, your order history, your positions, and a big button with the currency pair you are trading. When you're ready, click that button green to begin sending out quotes. The UI uses a healthy mixture of socket.io and angularjs.

REST API

Tribeca also exposes a REST API of all it's data. It's all the same data you would get via the Web UI, just a bit easier to connect up to via other applications. Visit http://localhost:3000/data/md for the current market data, for instance.

tribeca's People

Contributors

michaelgrosner avatar

Stargazers

Etch avatar andnasnd avatar

Watchers

James Cloos avatar Dana avatar

Forkers

andnasnd

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.