{"id":22608973,"url":"https://github.com/bitfinexcom/bfx-hf-algo","last_synced_at":"2025-04-09T09:04:49.467Z","repository":{"id":33155982,"uuid":"143998096","full_name":"bitfinexcom/bfx-hf-algo","owner":"bitfinexcom","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-04T22:38:22.000Z","size":2704,"stargazers_count":90,"open_issues_count":8,"forks_count":39,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-02T07:51:15.519Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitfinexcom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-08T10:28:36.000Z","updated_at":"2024-02-01T14:32:39.000Z","dependencies_parsed_at":"2024-06-18T21:25:58.236Z","dependency_job_id":"c39b7f49-c89b-4f23-81e4-ffc6bf8a51e6","html_url":"https://github.com/bitfinexcom/bfx-hf-algo","commit_stats":{"total_commits":646,"total_committers":16,"mean_commits":40.375,"dds":0.6284829721362228,"last_synced_commit":"478ba536ea90eabaee890716ee018497f9a6efc3"},"previous_names":[],"tags_count":99,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbfx-hf-algo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbfx-hf-algo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbfx-hf-algo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbfx-hf-algo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitfinexcom","download_url":"https://codeload.github.com/bitfinexcom/bfx-hf-algo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248008631,"owners_count":21032556,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-08T15:10:24.288Z","updated_at":"2025-04-09T09:04:49.447Z","avatar_url":"https://github.com/bitfinexcom.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bitfinex Honey Framework Algorithmic Order Library for Node.JS\n\n[![Build Status](https://travis-ci.org/bitfinexcom/bfx-hf-algo.svg?branch=master)](https://travis-ci.org/bitfinexcom/bfx-hf-algo)\n\nFor a description of the included algo orders, see our [user docs](./user-docs.md)\n\n### Installation\n\n```bash\nnpm i --save bfx-hf-algo\nnpm i --save bfx-hf-models\nnpm i --save bfx-hf-ext-plugin-bitfinex\nnpm i --save bfx-hf-models-adapter-lowdb\n```\n\n### Quickstart \u0026 Example\n\nTo get started, create an object wsSettings required for `AOAdapter`,\nthen pass them to a new `AOHost` instance and call `startAO(id, args)`:\n\n```js\nconst {\n  AOHost, PingPong, Iceberg, TWAP, AccumulateDistribute, MACrossover\n} = require('bfx-hf-algo')\n\nconst HFDB = require('bfx-hf-models')\nconst HFDBLowDBAdapter = require('bfx-hf-models-adapter-lowdb')\nconst {\n  schema: HFDBBitfinexSchema\n} = require('bfx-hf-ext-plugin-bitfinex')\n\nconst algoDB = new HFDB({\n  schema: HFDBBitfinexSchema,\n  adapter: HFDBLowDBAdapter({\n    dbPath: path.join(__dirname, '..', 'db', 'example.json')\n  })\n})\n\nconst host = new AOHost({\n  aos: [PingPong, Iceberg, TWAP, AccumulateDistribute, MACrossover],\n  wsSettings: {\n    apiKey: '...',\n    apiSecret: '...',\n    // Authentication with auth tokens is available as an alternative for API credentials\n    // authToken,\n    dms: 4\n  }\n})\n\nhost.on('ao:state:update', async (updateOpts) =\u003e {\n  // send ui updates\n})\n\nhost.on('auth:error', (packet) =\u003e {\n  console.log('error authenticating: %j', packet)\n})\n\nhost.on('error', (err) =\u003e {\n  console.log('error: %s', err)\n})\n\nhost.once('ready', async () =\u003e {\n  // Start an Iceberg order instance\n  const [serialized] = await host.startAO('bfx-iceberg', {\n    symbol: 'tBTCUSD',\n    price: 21000,\n    amount: -0.5,\n    sliceAmount: -0.1,\n    excessAsHidden: true,\n    orderType: 'LIMIT',\n    _margin: false,\n  })\n\n  // later, host.stopAO(gid)\n})\n```\n\n### Docs\n\n[Refer to the `docs/`](/docs) folder for JSDoc-generated API documentation.\n\n### Benchmarking\n\nEnvironment variables API_KEY and API_SECRET must be defined (in paper mode)\nRun `npm run benchmark:mock` and keep it running in a separate terminal\nRun `TARGET=\u003cbenchmark name\u003e npm run benchmark:run` to generate the reports (destination folder is ./benchmarks_reports),\nwhere TARGET is name of JS file in the root of `test/benchmarks` folder\n\n### Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n### Note\n\nThis package will be maintained only via github, please use latest relases from github instead of npm.\n\nExample on how to install specific version from github:\n```\nnpm i --save-prod https://github.com/bitfinexcom/bfx-hf-algo.git#v4.3.4\n```\n\nExample on how to install it latest version from github:\n```\nnpm i --save-prod https://github.com/bitfinexcom/bfx-hf-algo.git\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitfinexcom%2Fbfx-hf-algo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitfinexcom%2Fbfx-hf-algo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitfinexcom%2Fbfx-hf-algo/lists"}