All Projects → RickWong → bitmex-orderbook

RickWong / bitmex-orderbook

Licence: BSD-3-Clause License
The fastest order book implementation for the BitMEX WebSocket API.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to bitmex-orderbook

Crypto vba
An Excel/VBA project to communicate with various cryptocurrency exchanges APIs
Stars: ✭ 103 (+41.1%)
Mutual labels:  exchange, cryptocurrencies
Coinapi Sdk
SDKs for CoinAPI
Stars: ✭ 238 (+226.03%)
Mutual labels:  exchange, cryptocurrencies
Bitcoin Arbitrage
An AWS Lambda function that looks for Bitcoin Arbitrage opportunities
Stars: ✭ 115 (+57.53%)
Mutual labels:  exchange, cryptocurrencies
Bitcoinlib
Bitcoin Core RPC compatible, battle-tested .NET library and RPC wrapper for Bitcoin and Altcoins
Stars: ✭ 350 (+379.45%)
Mutual labels:  exchange, cryptocurrencies
ccapi
A header-only C++ library for interacting with crypto exchanges. Binding for Python is provided. A spot market making application is also provided as an end-to-end solution for liquidity providers.
Stars: ✭ 227 (+210.96%)
Mutual labels:  exchange, orderbook
Eazebot
Free python/telegram bot for easy execution and surveillance of crypto trading plans on multiple exchanges.
Stars: ✭ 51 (-30.14%)
Mutual labels:  exchange, cryptocurrencies
Krypto Trading Bot
Self-hosted crypto trading bot (automated high frequency market making) written in C++
Stars: ✭ 2,589 (+3446.58%)
Mutual labels:  exchange, bitmex
Atomicswap
On-chain atomic swaps for Decred and other cryptocurrencies.
Stars: ✭ 485 (+564.38%)
Mutual labels:  exchange, cryptocurrencies
tellerbot
Telegram Bot for over-the-counter trading
Stars: ✭ 17 (-76.71%)
Mutual labels:  exchange, orderbook
bitmex-client-websocket
🛠️ C# client for Bitmex websocket API
Stars: ✭ 60 (-17.81%)
Mutual labels:  exchange, bitmex
Wolfbot
Crypto currency trading bot written in TypeScript for NodeJS
Stars: ✭ 335 (+358.9%)
Mutual labels:  exchange, cryptocurrencies
crypto-websocket-extensions
🧰 Unified and optimized data structures across cryptocurrency exchanges
Stars: ✭ 31 (-57.53%)
Mutual labels:  exchange, orderbook
Socktrader
🚀 Websocket based trading bot for 💰cryptocurrencies 📈
Stars: ✭ 152 (+108.22%)
Mutual labels:  exchange, cryptocurrencies
bot-trader
Simple bot trader for Bitmex
Stars: ✭ 14 (-80.82%)
Mutual labels:  exchange, bitmex
coinaly
🚀 Fast and easy to use mobile trade interface for cryptocurrencies. Track your trades to the moon and beyond. Currently only for Bittrex.
Stars: ✭ 32 (-56.16%)
Mutual labels:  exchange, cryptocurrencies
uniswap-python
🦄 The unofficial Python client for the Uniswap exchange.
Stars: ✭ 533 (+630.14%)
Mutual labels:  exchange, orderbook
redis-memolock
Redis MemoLock - Distributed Caching with Promises
Stars: ✭ 63 (-13.7%)
Mutual labels:  promise
queue-promise
A simple, dependency-free library for concurrent promise-based queues. Comes with with concurrency and timeout control.
Stars: ✭ 56 (-23.29%)
Mutual labels:  promise
CVE-2021-33766
ProxyToken (CVE-2021-33766) : An Authentication Bypass in Microsoft Exchange Server POC exploit
Stars: ✭ 37 (-49.32%)
Mutual labels:  exchange
debounce-async
A debounce function that delays invoking asynchronous functions.
Stars: ✭ 21 (-71.23%)
Mutual labels:  promise

BitMEX Order Book

The fastest order book implementation for the BitMEX WebSocket API.

  • Fast & unthrottled price updates from L2 table.
  • Automatically calculates cumulative prices.
  • Reuse an existing WebSocket connection.
  • Built-in heartbeats functionality.
  • Easy to use.

Install

yarn add bitmex-orderbook

Or you can use npm install.

Example

const OrderBook = require("bitmex-orderbook");

await OrderBook.open("XBTH18", {
  onUpdate(orderBook) {
    // Top 10 ask prices.
    const bestAskPrices = orderBook.getAskPrices(10);
    
    // Top 5 bid prices, skipping the first 2.
    const [thirdBestBid] = orderBook.getBidprices(5, 2); 
    
    thirdBestBid.side; // "Buy"
    thirdBestBid.price; // 17341.5
    thirdBestBid.size; // 400
    thirdBestBid.cumulative; // 57 + 372 + 400
    thirdBestBid.timestamp; // Date()
  },
});

Documentation

OrderBook.open(symbol, options = {}): Promise<OrderBook>

  • symbol : String - The instrument symbol. Required.
  • options.table : String - The order book table to subscribe to. Default: orderBookL2, the fastest table on BitMEX.
  • options.depth : Integer - Number of entries to remember for each side bid and ask. The worst prices are evicted. Default: 20.
  • options.cumulative : Boolean - Calculate cumulative sizes automatically at tiny processing cost. Default: true, it's very useful.
  • options.onUpdate : Function(OrderBook) - A function that is invoked whenever the prices are updated.
  • options.socket : WebSocket - An existing BitMEX WebSocket connection. If left empty a new WebSocket connection will be opened, and stored in orderBook._client.socket.
  • options.testmode : Boolean - Connect to the BitMEX test environment. Only used if options.socket is empty. Default: false.
  • options.heartbeat : Integer - Milliseconds between WebSocket connection pings. Default: 15000.
  • options.endpoint : String - Specifies the wss:// address for a new WebSocket connection. Only used if options.socket is empty. Default: wss://www.bitmex.com/realtime.

Returns a Promise that resolves when the connection is opened.

orderBook.getAskPrices(count, skip = 0) : OrderBookEntry

  • count: Integer - Max number of prices to return. Sorted by best price first. Default: options.depth.

  • skip: Integer - Number of best prices to skip. This is useful with highly volatile markets. Default: 0.

orderBook.getBidPrices(count, skip = 0) : OrderBookEntry

Same as orderBook.getAskPrices(). Sorted by best price first.

License

BSD 3-Clause license. Copyright © 2018 Rick Wong.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].