Genesis Replicator replicates a GDAX order book as a Parity order book.
Genesis Replicator subscribes to a product on GDAX WebSocket Feed and connects to the market data and order entry interfaces of a Parity instance. Then it starts translating market data messages from GDAX to order entry messages on Parity.
Genesis Replicator listens to Parity market data and maintains a reconstructed Parity order book. When a market data message indicating a trade is received from GDAX, it consults its reconstruction and adjusts the quantity of the translation to account not only for the replicated order but all non-replicated orders with better price or time priority as well.
Genesis Replicator requires Node 6 or newer.
Genesis Replicator is configured using environment variables. The following environment variables are mandatory:
-
PARITY_MARKET_DATA_ADDRESS
: The IP address of the market data gateway. -
PARITY_MARKET_DATA_PORT
: The TCP port of the market data gateway. -
PARITY_MARKET_DATA_USERNAME
: The username on the market data gateway. -
PARITY_MARKET_DATA_PASSWORD
: The password on the market data gateway. -
PARITY_ORDER_ENTRY_ADDRESS
: The IP address of the Parity instance. -
PARITY_ORDER_ENTRY_PORT
: The TCP port of the order entry interface on the Parity instance. -
PARITY_ORDER_ENTRY_USERNAME
: The username on the Parity instance. -
PARITY_ORDER_ENTRY_PASSWORD
: The password on the Parity instance.
The following environment variables are optional:
-
GDAX_API_URL
: The GDAX REST API URL. Defaults tohttps://api.gdax.com
. -
GDAX_WEBSOCKET_FEED_URL
: The GDAX WebSocket Feed URL. Defaults towss://ws-feed.gdax.com
. -
GDAX_PRODUCT_ID
: The product identifier on GDAX. Defaults toBTC-USD
. -
PARITY_INSTRUMENT
: The instrument on Parity. Defaults to$GDAX_PRODUCT_ID
. -
PARITY_PRICE_FACTOR
: The scaling factor for prices on Parity. Defaults to100
. -
PARITY_SIZE_FACTOR
: The scaling factor for sizes on Parity. Defaults to100000000
.
Install the dependencies:
npm install
Launch Nassau and Parity applications with the configuration files in etc
.
Run the application:
(. etc/example.sh; ./bin/genesis-replicator)
Released under the Apache License, Version 2.0.