Bitfinex Honey Framework Algorithmic Order Server for Node.JS
This is a thin wrapper around the
AOHost class, which connects it to the Bitfinex notification system in order to start algo orders from the order form in the bfx UI. The AOHost automatically uploads all relevant order form layouts on startup.
The algo orders themselves are implemented in
Algo orders are automatically persisted via a DB backend provided by the user, and are resumed when the algo server starts up.
- Enables the execution of algorithmic orders via the official Bitfinex UI
- Exposes a WebSocket API for executing & managing the operation of algo orders
- Allows for the usage of custom DB backends via the
For standalone usage:
git clone https://github.com/bitfinexcom/bfx-hf-algo-servercd bfx-hf-algo-servernpm itouch .envecho 'DB_FILENAME=db/algo-server-db.json' >> .envecho 'API_KEY=...' >> .envecho 'API_SECRET=...' >> .envnpm start
For usage/extension within an existing project:
npm i --save bfx-hf-algo-server
By default, the
lowdb DB backend is used. To run the standard server, populate
.env with your API credentials and DB path:
API_KEY=... API_SECRET=... DB_FILENAME=...
Refresh your Bitfinex UI after all order form layouts have been uploaded. Once the server is listening, select an algorithmic order from the order form dropdown and fill in your desired arguments.
To start an algo order click the 'Submit' button in the Bitfinex UI to generate a broadcast notification which will be picked up by your running algo server instance, starting the desired order.
The server can be stopped/started at will, with running algo orders automatically resuming if the contents of
db/* have not been cleared.
examples/ folder for executable examples.
constIcebergOrder TWAPOrder AccumulateDistribute MACrossover} =const WebSocket =const AOServer =const HFDB =const HFDBLowDBAdapter =constAOAdapter: BFXAOAdapter schema: HFDBBitfinexSchema} =const DB_PATH = './some_path/db.json'// create database instance for persisting algo ordersconst db =schema: HFDBBitfinexSchemaadapter:// create exchange adapter for order executionconst adapter =apiKey: '...'apiSecret: '...'// spawn algo server instanceconst server =dbadapterport: 8877aos:PingPongIcebergTWAPAccumulateDistributeMACrossoverserverserver// ao server now ready to accept orders on port 8877// example order submitconst ws = 'ws://localhost:8877'ws
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create a new Pull Request