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
-
nodejs v0.12 or latest io.js
-
MongoDB
-
Typescript 1.5 with tsd
-
Grunt
-
Make sure your machine has all listed pre-reqs
-
npm install
and thentsd reinstall -s
-
Change any relevant parameters into
src/service/config.ts
, like input your exchange API keys -
Compile typescript to javascript via
grunt compile
-
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. -
Set up parameters to your trading liking in the web admin (http://localhost:3000)
-
Click the "BTC/USD" button in the web admin so it is green to start making markets
-
Change any relevant parameters into
src/service/config.ts
, like input your exchange API keys -
Setup a mongodb container/instance that our container can access
-
Build and run the included
Dockerfile
-
coinbase
- uses the WebSocket API -
hitbtc
- WebSocket + socket.io API -
okcoin
- WebSocket API (most likely broken, untested for months) -
null
- Test in-memory exchange -
FIX - (not included), uses ZeroMQ to communicate to a FIX client which talks FIX to an exchange
-
prod
-
dev
(when the exchange has a test environment, like Coinbase or HitBtc) -
backtest
- advanced mode, also check out included backtest.js for more details
Note: only a few parameters are listed currently. Peek at src/common/models.ts:QuotingParameters for the full list of parameters
-
width
: sell orders will always be placed for this many dollars more than buy orders. Defaults to $0.30 -
size
: amount of coins to make each side of the quote. Defaults to 0.05 BTC -
mode
: quoting style to use. Some modes will look at other orders in the market, the midpoint of the spread, etc. -
tradesPerMinute
andtradeRateSeconds
: only allowtradesPerMinute
(disregard the minutes portion of the name...) trades in everytradeRateSeconds
window.
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.
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.