{"id":20476855,"url":"https://github.com/askmike/bitmex-simple-rest","last_synced_at":"2025-09-10T00:15:16.918Z","repository":{"id":57163181,"uuid":"72930406","full_name":"askmike/bitmex-simple-rest","owner":"askmike","description":"simple rest API wrapper for bitmex","archived":false,"fork":false,"pushed_at":"2019-11-02T08:08:16.000Z","size":15,"stargazers_count":11,"open_issues_count":1,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-24T15:35:08.237Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/askmike.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}},"created_at":"2016-11-05T14:14:28.000Z","updated_at":"2023-11-29T11:35:13.000Z","dependencies_parsed_at":"2022-09-01T03:02:35.714Z","dependency_job_id":null,"html_url":"https://github.com/askmike/bitmex-simple-rest","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/askmike/bitmex-simple-rest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/askmike%2Fbitmex-simple-rest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/askmike%2Fbitmex-simple-rest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/askmike%2Fbitmex-simple-rest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/askmike%2Fbitmex-simple-rest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/askmike","download_url":"https://codeload.github.com/askmike/bitmex-simple-rest/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/askmike%2Fbitmex-simple-rest/sbom","scorecard":{"id":212342,"data":{"date":"2025-08-11","repo":{"name":"github.com/askmike/bitmex-simple-rest","commit":"f220552d14435bafe1c5f28957e655ac46641532"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/26 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 1 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T00:58:28.211Z","repository_id":57163181,"created_at":"2025-08-17T00:58:28.211Z","updated_at":"2025-08-17T00:58:28.211Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273484233,"owners_count":25114119,"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","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-15T15:24:07.835Z","updated_at":"2025-09-10T00:15:16.747Z","avatar_url":"https://github.com/askmike.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bitmex-simple-rest\n\n    npm install bitmex-simple-rest\n\nAPI wrapper for the [Bitmex REST API](https://www.bitmex.com/api/explorer/). Please refer to [their documentation](https://www.bitmex.com/api/explorer/) for all calls explained. Check out `sample.js` for some example calls.\n\nThis is a low level wrapper with zero dependencies focussed on:\n\n- Speed\n  - Uses keep-alive\n  - Disables Nagle's algorithm\n  - No complex code\n  - No third party libraries\n  - allows you to pre compile your message (see below under low latency usage)\n- Userland control\n  - Passes on response headers such as information on your [rate limit quota](https://www.bitmex.com/app/restAPI#Request-Rate-Limits)\n  - Allows you to specity timeout \u0026 expiration date per call\n\nUsed by my low latency market maker that's running in production. I don't think you can go much faster in nodejs without rewriting [Node.js' core http library](https://nodejs.org/api/http.html#http_http_request_options_callback) (if you think you can, feel free to open an issue or propose a PR).\n\n## Usage\n\n    // your api key \u0026 secret\n    const key = 'x';\n    const secret = 'y';\n\n    const BitmexRest = require('bitmex-simple-rest');\n    const bm = new BitmexRest({\n      key,\n      secret,\n\n      // these are optional\n      timeout: 90 * 1000, // ms - when this lib should timeout the call\n      expiration: 60 * 1000, // ms - after how many ms bitmex should refuse this call\n      userAgent: 'bearwhale' // string - custom ua\n    });\n\n    const { data, headers } = await bm.request({\n      path: '/user/margin',\n      method: 'GET',\n      data: { currency: 'XBt' }\n    });\n\n### Low latency usage\n\nSending an API request to Bitmex requires hashing the payload with your API key. **In nodejs, this process can easily take 0.15 millisecond** (on the non compute optimized AWS boxes I tested this on - because yes, you should run on AWS-EU-1 if you want to trade fast on Bitmex). You can test the speed of creating API requests yourself on your system by running `benchmark.js`, preferably with real keys and and a request similar to what your system might send.\n\nThis library allows you to prepare an API request draft before hand (doing all the heavy work). The microsecond you realize you actually want to send it you simply send the draft you created previously:\n\n    // create the draft before hand\n    const draft = bm.createDraft({\n      path: '/user/margin',\n      method: 'GET',\n      data: { currency: 'XBt' }\n    });\n\n    // later when you actually want to send\n    const { data, headers } = await bm.requestDraft(draft);\n\nNote that this only works in scenarios where you can estimate what will happen or which scenarios might happen: You can create drafts for all of them and only end up sending one later.\n\n## TODO\n\n- Figure out if we can reliably skip the `end` event of the packetstream (see requestDraft comment).\n- String compare for common errors (overload), skipping `JSON.parse`.\n\n## Final\n\nIf this library is helping you trade better on Bitmex feel free to use [my ref link](https://www.bitmex.com/register/VDPANj). You'll get a 10% fee discount for the first 6 months, lowering your market fees (on the perpetual swap) from 0.075% to a mere 0.0675%!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faskmike%2Fbitmex-simple-rest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faskmike%2Fbitmex-simple-rest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faskmike%2Fbitmex-simple-rest/lists"}