Skip to content

Examples and SDKs for using the Routefire REST API for algorithmic execution of cryptocurrency trades

License

Notifications You must be signed in to change notification settings

djchou/rf-core-api-examples

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Routefire API: example code and SDKs

This repository contains examples of using the Routefire REST API for algorithmic execution of cryptocurrency trades, which we're developing into a set of full SDKs supporting all major functionality in both Node.js/TypeScript and Go.

Usage

Node

Enter the js/ subdirectory of this repository and run npm install to install dependencies.

Reporting

To run a full trading activity report, you would execute a command such as:

node report.js "[email protected]" "myPa$$w0rd" "2018-11-01T00:00:00.000Z" > november-snapshot.jsonp 

Order entry and status

To submit an order and watch it until completion using the API, one could buy 0.01 BTC using the TWAP execution algorithm via:

node placeorder.js "[email protected]" "myPa$$w0rd" "0.01"

This particular example watches the order until its completion, printing the latest status to the screen every 5 seconds.

Market inquiries and order book data

The placeorder.js example will obtain full depth-of-book data as well as a top-of-book inquiry for 0.5 BTC if you omit the quantity:

node placeorder.js "[email protected]" "myPa$$w0rd"

This is primarily an example of how to use the functions getOrderBook and inquire contained in the file placeorder.js, which demonstrate how to pull market data from Routefire.

Dependencies

Node

To run the Node examples, you'll need to download and install the latest version of Node.js/NPM. Then, follow the usage instructions above (the only dependency will be automatically pulled down by running npm install in the js directory).

About

Examples and SDKs for using the Routefire REST API for algorithmic execution of cryptocurrency trades

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%