Skip to content

Open source .Net API wrapper for the web API and websockets API @BitMEX cryptocurrency exchange

License

Notifications You must be signed in to change notification settings

alokym86/Bitmex.Net

 
 

Repository files navigation

Icon Bitmex.Net

publish to nuget

Bitmex.Net.Client is a .Net wrapper for the Bitmex API as described on Bitmex. It includes all features the API provides using clear and readable C# objects including

  • Reading market info
  • Placing and managing orders
  • Reading balances and funds
  • Live updates using the websocket
  • Loading historical data

Additionally it adds some convenience features like:

  • Configurable rate limiting
  • Autmatic logging

Installation

Nuget version Nuget downloads

Available on NuGet:

PM> Install-Package Bitmex.Net.Client

To get started with Bitmex.Net.Client first you will need to get the library itself. The easiest way to do this is to install the package into your project using NuGet.

Getting started

To get started we have to add the Bitmex.Net.Client namespace: using Bitmex.Net.Client;.

Bitmex.Net.Client provides three clients to interact with the Bitmex API:

The BitmexClient provides all rest API calls.

The BitmexSocketClient provides functions to interact with the websocket provided by the Bitmex API.

The BitmexHistoricalTradesLoader provides ability to bulk load historical trading data from Bitmex public data endpoint

See examples here. Note that you have to add your own appconfig.json and set up connection to testnet or production Bitmex API:

{
  "testnet": {
    "key": "yourTestentKey",
    "secret": "yourTestentSecret"
  },
  "prod": {
    "key": "yourProdKey",
    "secret": "yourProdSecret"
  }  
}

If you think something is broken, something is missing or have any questions, please open an Issue

CryptoExchange.Net

Implementation is build upon the CryptoExchange.Net library, make sure to also check out the documentation on that: docs

Other CryptoExchange.Net implementations:


Bitfinex

Bittrex

Binance

CoinEx

Huobi

Kucoin

Kraken

Switcheo

Liquid

OKEx

Exante

Changelog

  • 3.0.1
    • updated to CryptoExchange.Net v6.2.1
    • small fixess
  • 3.0.0
    • updated to CryptoExchange.Net v6.1.4
  • 2.0.3
    • updated to CryptoExchange.Net v5.4.3
  • 2.0.2
    • fixed setting up rate limiter
  • 2.0.1
    • updated documentation
  • 2.0.0
    • updated to CryptoExchange.Net v5.3.1. See examples here how to use BitmexClient.
    • removed some unused fields due to bitmex.com updates
    • nontrade socket subscriptions on different endpoint (due to bitmex.com updates)
    • ratelimiter by default:
      • 30/min for unsigned requests
      • 120/min for signed ones
      • 10/1s (in addition to 120/min) for orders requests
    • fixed resubscribing SymbolOrderBook
    • position: renamed RealisedPnl=> RealisedPnlAfterRebalancing. RealisedPnl is a result of calculation now
    • renamed models Order=>BitmexOrder and so on, to avoid conflict with base lib naming
    • revert=true by default! Be careful, by default, requests return the latest values first
    • added a few new requesting methods
    • removed sync version of requesting methods
  • v1.6.1
    • ws endpoint update, bulk orders changes
  • v1.6.0
    • fix user wallet history deserialization error
  • v1.5.2
    • base library major update, bulk orders cancelling fixes
  • v1.4.8
    • dependencies update
  • v1.4.7
    • added milliseconds accuracy to start/end time filters
  • v1.4.6
    • added auth in not auth methods for better rate limits
  • v1.4.6
    • fix boolean values serialization
  • v1.4.4
    • Wallet history fix
  • v1.4.3
    • Fix typo at Get all price indices endpoint
  • v1.4.2
    • base library update

Donations

Donations are greatly appreciated and a motivation to keep improving.

Btc: 14nuXrFEKTrvyhHWYW7RgRt4zVxBfwff5V
Eth: 0xa399Fff5Cd14fc589030C85C5671cdEdC4C413b1

About

Open source .Net API wrapper for the web API and websockets API @BitMEX cryptocurrency exchange

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%