jkorf/binance.net

Net wrapper for the Binance API as described on Binance, including all features the API...

Net wrapper for the Binance API as described on Issue

Net wrapper for the Binance API as described on Binance, including all features the API...

Binance.Net

A .Net wrapper for the Binance API as described on Binance, including all features the API provides (Spot, (Isolated) margin and futures) using clear and readable objects.

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:


Bittrex

Bitfinex

CoinEx

Huobi

Kucoin

Kraken
Implementations from third parties:

Switcheo

Liquid

Bitmex

HitBTC

LiveCoin

OKEx

Chiliz

BtcTurk

Thodex

Exante

Donations

I develop and maintain this package on my own for free in my spare time. Donations are greatly appreciated.

Btc: 12KwZk3r2Y3JZ2uMULcjqqBvXmpDwjhhQS
Eth: 0x069176ca1a4b1d6e0b7901a6bc0dbf3bb0bf5cc2
Nano: xrb_1ocs3hbp561ef76eoctjwg85w5ugr8wgimkj8mfhoyqbx4s1pbc74zggw7gs

Discord

A Discord server is available here. For discussion and/or questions around the CryptoExchange.Net and implementation libraries, feel free to join.

Installation

Available on Nuget.

pm> Install-Package Binance.Net

To get started with Binance.Net 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. Using Visual Studio this can be done in two ways.

Using the package manager

In Visual Studio right click on your solution and select 'Manage NuGet Packages for solution...'. A screen will appear which initially shows the currently installed packages. In the top bit select 'Browse'. This will let you download net package from the NuGet server. In the search box type 'Binance.Net' and hit enter. The Binance.Net package should come up in the results. After selecting the package you can then on the right hand side select in which projects in your solution the package should install. After you've selected all project you wish to install and use Binance.Net in hit 'Install' and the package will be downloaded and added to you projects.

Using the package manager console

In Visual Studio in the top menu select 'Tools' -> 'NuGet Package Manager' -> 'Package Manager Console'. This should open up a command line interface. On top of the interface there is a dropdown menu where you can select the Default Project. This is the project that Binance.Net will be installed in. After selecting the correct project type Install-Package Binance.Net in the command line interface. This should install the latest version of the package in your project.

After doing either of above steps you should now be ready to actually start using Binance.Net.

Getting started

After installing it's time to actually use it. To get started we have to add the Binance.Net namespace: using Binance.Net;.

Binance.Net provides two clients to interact with the Binance API. The BinanceClient provides all rest API calls. The BinanceSocketClient provides functions to interact with the websocket provided by the Binance API. Both clients are disposable and as such can be used in a usingstatement.

Examples

Examples can be found in the Examples folder.

Timestamping

Requests made to Binance are checked for a correct timestamp. When requests are send a timestamp is added to the message. When Binance processes the message the timestamp is checked to be > the current time and < the current time + 5000ms (default). If the timestamp is outside these limits the following errors will be returned: timestamps 1000ms ahead of server time or Timestamp for this request is outside of the recvWindow The recvWindow is default 5000ms and can be changed using the ReceiveWindow configuration option. All times are communicated in UTC so there won't be any timezone issues. However, because of clock drifting it can be that the client UTC time is not the same as the server UTC time. It is therefor recommended clients use the SP TimeSync program to resync the client UTC time more often than windows does by default (every 10 minutes or less is recommended).

Websockets

The Binance.Net socket client provides several socket endpoint to which can be subscribed.

var client = new BinanceSocketClient();
// subscribe to updates on the spot API
client.Spot.SubscribeToBookTickerUpdates("BTCUSDT", data => {
  // Handle data
});

// subscribe to updates on the futures API
client.Futures.SubscribeToBookTickerUpdates("BTCUSDT", data => {
  // Handle data
});

To subscribe to account update (balance updates, order updates, etc.) you need to create a listen key using the BinanceClient, then start the user stream for account updates on the BinanceSocketClient:

var client = new BinanceClient(new BinanceClientOptions{
	ApiCredentials = new ApiCredentials("APIKEY", "APISECRET")
});
var startResult = client.Spot.UserStream.StartUserStream();

if(!startResult.Success)
	throw new Exception($"Failed to start user stream: {startResult.Error}");

var socketClient = new BinanceSocketClient();

socketClient.Spot.SubscribeToUserDataUpdates(startResult.Data, 
	orderUpdate => { // Handle order update
	}, 
	ocoUpdate => { // Handle oco order update
	},
	positionUpdate => { // Handle account position update
	},
	balanceUpdate => { // Handle balance update
	});

null can be passed as a parameter to any of these handlers to ignore the events of that type.

When no longer listening to private endpoints the StopUserStream method in BinanceClient should be used to signal the Binance server the stream can be closed.

Release notes

  • Version 6.13.5 - 22 Jul 2021

    • Added support for multiple KlineIntervals in kline socket subscriptions
    • Updated from wapi to sapi endpoints
  • Version 6.13.4 - 24 Jun 2021

    • Fixed/updated multiple models
  • Version 6.13.3 - 28 apr 2021

    • Fixed some issues in the IExchangeClient interface
    • Updated ExchangeClient.Net
    • Fixed QueryOCO order id parameter
  • Version 6.13.2 - 19 apr 2021

    • Updated CryptoExchange.Net
  • Version 6.13.1 - 02 apr 2021

    • Fixed mining endpoints
    • Adjusted TransferSubAccountToSubAccount request
    • Removed invalid symbol check Usdt futures GetKlines
  • Version 6.13.0 - 30 mrt 2021

    • Added CancelOpenMarginOrders endpoint
    • Added universal Transfer endpoints
    • Added new mining endpoints
    • Updated futures/loan endpoints to V2
    • Added new subAccount endpoints
    • Added margin GetInterestRateHistory endpoint
    • Updated multiple models
    • Fixed trade rules not applied to Oco orders
    • Fixed mining endpoints not signed
    • Fixed quoteQuantity parameter serialization on GetQuote liquid swap endpoint
    • Fixed GetAssetDetails throwing exception
  • Version 6.12.0 - 10 mrt 2021

    • Fixed multiple models
  • Version 6.11.1 - 01 mrt 2021

    • Added Nuget SymbolPackage
  • Version 6.11.0 - 01 mrt 2021

    • Fixed position models
    • Fixed reduceOnly parameter on PlaceMultipleOrder method
    • Added transactionFeeFlag on Withdraw method
    • Added config for deterministic build
    • Updated CryptoExchange.Net
  • Version 6.10.0 - 22 feb 2021

    • IndexPrice added to BinanceFurustMarkPrice
    • Removed deprecated accountInfo update from userDataStream
    • Updated spot Order models
  • Version 6.9.1 - 18 feb 2021

    • Fixed inconsistent naming GetPrices
  • Version 6.9.0 - 18 feb 2021

    • Updated withdraw models
    • Brokerage API updates
    • Updated GetPrice for coin futures
    • Fixed Swap quantity parameter
    • Added limit parameter to GetDividendRecords
  • Version 6.8.2 - 11 feb 2021

    • Fixed more HttpMethods
  • Version 6.8.1 - 11 feb 2021

    • Fixed GetOpenOrder endpoint on futures
    • Fixed HttpMethods in subaccount calls
  • Version 6.8.0 - 09 feb 2021

    • Fixed stopPrice AutoComply trade rules behavior
    • Fixed position models
  • Version 6.7.0 - 05 feb 2021

    • Fixed Mark stream update model
    • Added onLeverageUpdate to futures user stream subscription
    • Updated futures position info models
  • Version 6.6.4 - 22 jan 2021

    • Fixed GetSubAccountsFuturesSummary http method
    • Moved FirstUpdateId in order book model
    • Updated for ICommonKline
  • Version 6.6.3 - 11 jan 2021

    • Added missing enum values
  • Version 6.6.2 - 11 jan 2021

    • Updated futures Symbol models for GetExchangeInfo
    • Updated CryptoExchange.Net
    • Added Pre-Settle symbol status to fix deserialization issue
  • Version 6.6.1 - 05 jan 2021

    • Fixed contractType deserialization
  • Version 6.6.0 - 05 jan 2021

    • Updated orderbook models
    • Fixed GetExchangeInfo deserialization for Futures
  • Version 6.5.0 - 21 dec 2020

    • Updated Brokerage API
    • Fix for SubAccountToSubAccount email parameter serialization
    • Fix for GetSubAccountTransferHistoryForSubAccount using wrong Http method
    • Fix in TradeRules check
    • Updated CryptoExchange.Net, updated IExchangeClient
  • Version 6.4.1 - 11 dec 2020

    • Updated CryptoExchange.Net
    • Added IExchangeClient implementation
    • Added missing properties Coin-M Symbol model
    • Added stopPrice checking in AutoComply trade rules behaviour
  • Version 6.4.0 - 25 nov 2020

    • Fixed futures book ticker stream data parsing
  • Version 6.3.7 - 24 nov 2020

    • Fix parsing of single bracket in GetBrackets
    • Added MaxPosition filter in GetExchangeInfo
  • Version 6.3.6 - 19 nov 2020

    • Fixed reference in package
  • Version 6.3.5 - 19 nov 2020

    • Added PendingTrade status to futures symbol status mapping
    • Added BNB burn toggle endpoints
    • Added Composite index endpoint to USDT futures
    • Added Composite index stream to USDT futures
    • Added archived parameter for margin loan/repay/interestHistory queries
  • Version 6.3.4 - 16 nov 2020

    • Added missig TimeInForce mapping
    • Added missing orderResponseType parameter to futures PlaceOrder
  • Version 6.3.3 - 09 nov 2020

    • Updated check for valid Binance symbol
    • Fixed ModifyPositionMode result symbol
  • Version 6.3.2 - 23 okt 2020

    • Re-added locking when signing messages to prevent issues when multithreading
  • Version 6.3.1 - 22 okt 2020

    • Added missing Interval property on stream kline updates
  • Version 6.3.0 - 20 Oct 2020

    • Added BSwap endpoints
    • Added BLVT endpoints
    • Fixed incomeType parameter on GetIncomeHistory
    • Added BorrowLimit property to GetMaxBorrowAmount
    • Added Coin-M futures support for sub-account transfer
    • Added ids to lending borrow/repay results
    • Added ChangeToDailyPosition endpoint
    • Updated Regular to Activity in savings endpoints
  • Version 6.2.0 - 08 Oct 2020

    • Added missing transaction timestamp on future user streams
    • Updated book price models
    • Update CryptoExchange.Net
  • Version 6.1.0 - 06 Oct 2020

    • Fixed future trade timestamps
    • Fixed some decimal serialization culture issues
    • Updated future user streams to include timestamps
    • Fixed used weight parsing
    • Brokerage API update
  • Version 6.0.2 - 17 Sep 2020

    • Fix for socket client receiving intermittent byte data
    • Updated market data interfaces to support inheritance
  • Version 6.0.1 - 09 Sep 2020

    • Fixed missing properties in stream kline models
  • Version 6.0.0 - 09 Sep 2020

    • Added future transfer endpoints
    • Added cross-collateral endpoints
    • Refactored volume properties to properly be named base/quote
    • Fixed isolated margin all symbols endpoint
  • Version 6.0.0-beta.6 - 31 Aug 2020

    • Combined futures userstream Balance and Position update handlers, UpdateReason property added
  • Version 6.0.0-beta.5 - 28 Aug 2020

    • Fixed futures order update wrong JsonConverter
  • Version 6.0.0-beta.4 - 28 Aug 2020

    • Added support for Coin-M futures
    • Some refactoring
  • Version 6.0.0-beta.3 - 17 Aug 2020

    • Fixed GetAccountInfo endpoint
  • Version 6.0.0-beta.2 - 13 Aug 2020

    • Fixed ModifyPositionMargin futures call
  • Version 6.0.0-beta.1 - 12 Aug 2020

    • Restructured BinanceClient and BinanceSocketClient to include the futures and brokerage API. Clients are now divided per topic
    • Added isolated margin endpoints
    • Fixed MinNotional checking in trade rules when also adjusting price
    • Added shared interfaces for Futures and Spot market data and market stream subscriptions
  • Version 5.1.14 - 03 Aug 2020

    • Added check for MinNotional filter when using AutoComply trade rules behaviour
    • Adjusted bool parameter serialization
  • Version 5.1.13 - 27 Jul 2020

    • Updated futures balance, account info, position endpoints to version 2
    • Added missing futures market data endpoints
  • Version 5.1.12 - 21 Jul 2020

    • Updated order book models
  • Version 5.1.11 - 20 Jul 2020

    • Fixes for future client
  • Version 5.1.10 - 07 Jul 2020

    • Fixed datetime conversion for some objects
  • Version 5.1.9 - 06 Jul 2020

    • Added CancelMultipleOrders
    • Added CancelAllOrders
    • Added EventTime to OrderBook stream
    • Fixed purchase record conversion
  • Version 5.1.8 - 21 Jun 2020

    • Updated CryptoExchange
  • Version 5.1.7 - 16 Jun 2020

    • Changed IncomeType to string, Update CryptoExchange.Net
  • Version 5.1.6 - 11 Jun 2020

    • Fixed subscribe error on symbols with an I caused by unset culture info
  • Version 5.1.5 - 07 Jun 2020

    • Fixed serialization/encryption bug
  • Version 5.1.4 - 02 Jun 2020

    • Fixed empty request bug
  • Version 5.1.3 - 02 Jun 2020

    • Added CancelAllOrders endpoint
    • Added PlaceMultipleOrders endpoint for futures
    • Added BinanceFuturesSymbolOrderBook
    • Added missing Expired order status mapping
    • Added GetBrackets to futures client
  • Version 5.1.2 - 26 May 2020

    • Added CancelAllOrdersAfterTimeout futures endpoint
    • Added timestamp to various models
    • Added closePosition paramter for future orders
  • Version 5.1.1 - 20 May 2020

    • Fixed ChangeInitialLeverage endpoint
    • Fixed ChangeMarginType endpoint
    • Fixed deserialization error on maxNotionalValue
    • Updated CryptoExchange.Net
  • Version 5.1.0 - 20 may 2020

    • Bumped to release version
    • Added missing wallet endpoints
    • Added sub-account endpoints
    • Added savings endpoints
  • Version 5.1.0-alpha10 - 08 May 2020

    • Added Brokerage client, various fixes, added some missing parameters
  • Version 5.1.0-alpha9 - 01 May 2020

    • Fixed GetExchangeInfo call, merged master
  • Version 5.1.0-alpha8 - 19 Mar 2020

    • Futures update
  • Version 5.1.0-alpha7 - 16 Mar 2020

    • fixed reference
  • Version 5.1.0-alpha6 - 16 Mar 2020

    • Fixed ticker stream
  • Version 5.1.0-alpha5 - 16 Mar 2020

    • Futures update
  • Version 5.1.0-alpha4 - 06 Mar 2020

    • Actual stream fixes
  • Version 5.1.0-alpha3 - 06 Mar 2020

    • Futures stream fixes
  • Version 5.1.0-alpha2 - 03 Mar 2020

    • Updated CryptoExchange version
  • Version 5.1.0-alpha - 03 Mar 2020

    • First version Futures Api implementation
  • Version 5.0.10 - 01 May 2020

    • Fixed filter parsing in GetExchangeInfo
  • Version 5.0.9 - 03 Mar 2020

    • Fixed serialization issue on DustTransfer assets parameter
  • Version 5.0.8 - 03 Mar 2020

    • Added SideEffectType and MarginBuyBorrow properties
    • Added trade rules check for margin orders
  • Version 5.0.7 - 05 Feb 2020

    • Fixed incorrect Invalid symbol error
  • Version 5.0.6 - 27 Jan 2020

    • Updated CryptoExchange.Net
  • Version 5.0.5 - 23 Jan 2020

    • Added option for custom url
  • Version 5.0.4 - 10 Dec 2019

    • Fix for BinanceSymbolOrderBook
  • Version 5.0.3 - 13 Nov 2019

    • Updated for new API version
    • Added QuoteOrderQuantity parameter/property
    • Add stream balance update
    • Added precisions to ExchangeInfo symbols
  • Version 5.0.1 - 23 Oct 2019

    • Fixed validation for 9 length symbols
  • Version 5.0.1 - 23 Oct 2019

    • Fixed validation for 5 length symbols
  • Version 5.0.0 - 23 Oct 2019

    • See CryptoExchange.Net 3.0 release notes
    • Added input validation
    • Added CancellationToken support to all requests
    • Now using IEnumerable<> for collections
    • Renamed various methods to be more in line with other exchanges
    • Renamed SubscribeToXXXStream to SubscribeToXXXUpdates
  • Version 4.3.3 - 06 Oct 2019

    • Added serialization method for BinanceSymbolFilter
  • Version 4.3.2 - 25 Sep 2019

    • Added missing AddressTag and TransactionFee properties in withdrawal object
  • Version 4.3.1 - 03 Sep 2019

    • Added book ticker stream to socket client
  • Version 4.3.0 - 02 Sep 2019

    • Added new Margin endpoints
    • Renamed Query- methods to Get- methods for consistency
  • Version 4.2.3 - 29 Aug 2019

    • Added DustTransfer and GetDividendRecords endpoints
    • Added updateInterval parameter to depth streams
  • Version 4.2.2 - 20 Aug 2019

    • Added missing margin endpoints
    • IndicatorType to enum
  • Version 4.2.1 - 19 Aug 2019

    • Added current average price endpoint
  • Version 4.2.0 - 15 Aug 2019

    • Implemented OCO orders
    • Adjustments for API update
  • Version 4.1.3 - 12 Aug 2019

    • Fix margin order cancel
  • Version 4.1.2 - 07 Aug 2019

    • Updated CryptoExchange.Net
  • Version 4.1.1 - 05 Aug 2019

    • Added xml file for code docs
  • Version 4.1.0 - 30 Jul 2019

    • Added margin API
  • Version 4.0.17 - 09 jun 2019

    • Added TimestampOffset options
    • Update BinanceSymbolOrderBook
  • Version 4.0.16 - 20 may 2019

    • Fixed AutoComply trade rules behavior
  • Version 4.0.15 - 16 may 2019

    • Fixed order book limit implementation
  • Version 4.0.14 - 14 may 2019

    • Added an order book implementation for easily keeping an updated order book
    • Added additional constructor to ApiCredentials to be able to read from file
  • Version 4.0.13 - 01 may 2019

    • Updated to latest CryptoExchange.Net
      • Adds response header to REST call result
      • Added rate limiter per API key
      • Unified socket client workings
  • Version 4.0.12 - 09 apr 2019

    • Fixed type in FifteenMinutes kline interval enum
    • Added update time to BinanceStreamAccountInfo
    • Added IsSpotTradingAllowed and IsMarginTradingAllowed fields to BinanceSymbol
    • Added IDisposable to client interfaces
  • Version 4.0.11 - 02 apr 2019

    • Added Symbol field in BinanceTrade
    • Added deposit status Completed to deposits filter
    • Fixed Exception handler null reference if not set
  • Version 4.0.10 - 18 mar 2019

    • Added AutoReconnect option
    • Fix for error parsing without code/message
    • Added QuoteQuantity to MyTrades result
  • Version 4.0.9 - 07 mar 2019

    • Added start/end time parameters to GetAllOrders
    • Updated CryptoExchange.Net
  • Version 4.0.8 - 27 feb 2019

    • Added sub account support
    • Added trading status call
    • Changed CallResult to WebCallResult for REST requests to expose the response status
  • Version 4.0.7 - 01 feb 2019

    • Added exception event to subscriptions
    • General fixes
  • Version 4.0.6 - 10 jan 2019

    • Fix for timestamp calculation
  • Version 4.0.5 - 09 jan 2019

    • Adjusted AutoTimestamp calculation
  • Version 4.0.4 - 28 dec 2018

    • Another fix for reconnecting
  • Version 4.0.3 - 17 dec 2018

    • Fixed reconnecting sometimes throwing error
  • Version 4.0.2 - 10 dec 2018

    • TradeRuleBehavior.AutoComply rounding fix
  • Version 4.0.1 - 06 dec 2018

    • Fix for freezes if called from UI thread
    • Fixed AutoComply trade rules behavior
    • Fixed IDisposable interface
  • Version 4.0.0 - 05 dec 2018

    • Updated to CryptoExchange.Net version 2
      • Libraries now use the same standard functionalities
      • Objects returned by socket subscriptions standardized across libraries
    • Added start/endtime parameters to GetMyTrades
  • Version 3.3.0 - 15 nov 2018

    • Updated to support latest Binance API update, including:
      • Added RawRequest rate limit
      • Canceling an order now returns full order report
      • Added multiple symbol filters
      • Added LastQuoteTransactedQuantity to socket order update
  • Version 3.2.12 - 15 nov 2018

    • Added event time to BinanceStreamTick
  • Version 3.2.11 - 01 nov 2018

    • Exception handling in error response parsing
  • Version 3.2.10 - 24 oct 2018

    • AutoTimestamp now enabled by default
    • BaseAssetPrecision and QuoteAssetPrecision type from string to int
  • Version 3.2.9 - 18 oct 2018

    • Added default receiveWindow parameter to client options
    • Updated time calculation between server/client, should help people with unstable ping who got intermittent errors saying the local time was ahead of server time
  • Version 3.2.8 - 04 oct 2018

    • Fixed subscriptions trying to reconnect if initial subscribe fails
    • Added accessors for symbol filters
    • Fix subscription reconnections
  • Version 3.2.7 - 21 sep 2018

    • Updated CryptoExchange.Net
  • Version 3.2.6 - 17 sep 2018

    • Combined PartialBookDepthStream data object with DepthStream data object
    • Fix reconnection bug
  • Version 3.2.5 - 10 sep 2018

    • Added check for failed auto timestamp syncing
    • Added auto recalculation interval for auto timestamp
  • Version 3.2.4 - 07 sep 2018

    • Fixed proxy setting on socket client
  • Version 3.2.3 - 21 aug 2018

    • Fix for previous fix..
  • Version 3.2.2 - 21 aug 2018

    • Fix for default api credentials getting disposed
  • Version 3.2.1 - 20 aug 2018

    • Update CryptoExchange.Net for bugfix
  • Version 3.2.0 - 16 aug 2018

    • Added socket client interface
    • Moved interface to interface namespace
    • Fixed some minor Resharper findings
  • Version 3.1.18 - 13 aug 2018

    • Fix for userstream not connecting
  • Version 3.1.17 - 13 aug 2018

    • Updated CryptoExchange.Net to fix bug
  • Version 3.1.16 - 13 aug 2018

    • Updated CryptoExchange.Net
    • Fixed error response parsing
  • Version 3.1.15 - 24 jul 2018

    • Fixed missing Symbol filter type
  • Version 3.1.14 - 20 jul 2018

    • Added error parsing to code/message
  • Version 3.1.13 - 19 jul 2018

    • Update to latest api update adding various properties/filters
  • Version 3.1.12 - 17 jul 2018

    • Added GetAccountStatus endpoint
    • Added GetSystemStatus endpoint
    • Added GetDustLog endpoint
  • Version 3.1.11 - 16 jul 2018

    • Fix for UI thread freezing when unsubscribing a stream
  • Version 3.1.10 - 03 jul 2018

    • Small fix for socket event binding
  • Version 3.1.9 - 25 jun 2018

    • Fix for Unsubscribe freezing if called from UI thread
  • Version 3.1.8 - 08 jun 2018

    • Fix for DateTime parsing
  • Version 3.1.7 - 08 jun 2018

    • Added missing TradeId field in PlaceOrder response
  • Version 3.1.6 - 04 jun 2018

    • Fix for OrderUpdate mapping
    • Fix for BinanceSymbol mapping
  • Version 3.1.5 - 07 may 2018

    • Added resetAutoTimestamp parameter to server time
  • Version 3.1.4 - 03 may 2018

    • Additional debug logging
  • Version 3.1.3 - 30 apr 2018

    • Refactored combined streams to be easier to use and reduce duplicate code
    • Fixed threadsafety issue in authenticator
  • Version 3.1.2 - 19 apr 2018

    • Added combined streams
  • Version 3.1.1 - 16 apr 2018

    • Added receiveWindow parameter to PlaceOrder
  • Version 3.1.0 - 27 mar 2018

    • Added GetWithdrawalFee call
    • Refactored Klines some to have the stream and the rest data be more similair
    • Added code docs where missing
  • Version 3.0.11 - 23 mar 2018

    • Updated closed/reconnect handling for sockets
    • Updated base
  • Version 3.0.10 - 21 mar 2018

    • Now possible to add multiple log writers
    • Added automatic reconnecting after loss of internet
    • Fixed error when subsribing to a stream while passing Null as handler
  • Version 3.0.9 - 13 mar 2018

    • Added trade stream next to aggregated trade stream
    • Fix for BuyerIsMaker field always being true
  • Version 3.0.8 - 12 mar 2018

    • Fix for inconsistent int/long types
    • Fix for freezing when making calls from UI thread
    • Added auto reconnect functionality
  • Version 3.0.7 - 08 mar 2018

    • Updated base
  • Version 3.0.6 - 08 mar 2018

    • Fix for socket connecting in non dotnet core clients
  • Version 3.0.5 - 07 mar 2018

    • Fix for deserialization error handling
    • Socket opening async, subscribe methods async
  • Version 3.0.4 - 05 mar 2018

    • Added SetApiCredentials methods
  • Version 3.0.2/3.0.3 - 05 mar 2018

    • SetDefaultOptions made static
  • Version 3.0.1 - 05 mar 2018

    • Additional logging
    • Updated base verions
  • Version 3.0.0 - 01 mar 2018

    • Updated to use a base package, which introduces some changes in syntax, but keeps functionality unchanged
  • Version 2.3.4 - 12 feb 2018

    • Fix for AutoComply trading rules sending too much trailing zero's
  • Version 2.3.3 - 10 feb 2018

    • Fix for stream order parsing
  • Version 2.3.2 - 09 feb 2018

    • Changed base address from https://www.binance.com to https://api.binance.com to fix connection errors
  • Version 2.3.1 - 08 feb 2018

    • Updated models to latest version
    • Cleaned code and code docs
  • Version 2.3.0 - 07 feb 2018

    • Added missing fields to 24h prices
    • Changed subscription results from an id to an object with closed/error events
    • Changed how to subscribe to the user stream
    • Updated/fixed unit test project
    • Updated readme
  • Version 2.2.5 - 24 jan 2018

    • Added optional automated checking of trading rules when placing an order
    • Added BinanceHelpers static class containing some basic helper functions
    • Fix for default logger not writing on a new line
    • Simplified internal defaults
  • Version 2.2.4 - 23 jan 2018

    • Fix for RateLimit type in GetExchangeInfo
    • Split the BinanceSymbolFilter in 3 classes
  • Version 2.2.3 - 15 jan 2018

    • Fix for calls freezing when made from UI thread
  • Version 2.2.2 - 15 jan 2018

    • Fix in PlaceOrder using InvariantCulture
    • Fix for FirstId property in 24h price
    • Added symbol property to 24h price
  • Version 2.2.1 - 12 jan 2018

    • Fix for parse error in StreamOrderUpdate
  • Version 2.2.0 - 08 jan 2018

    • Updated according to latest documentation, adding various endpoints
  • Version 2.1.3 - 9 nov 2017

    • Added automatic configurable retry on server errors
    • Refactor on error returns
    • Renamed ApiResult to BinanceApiResult
  • Version 2.1.2 - 31 okt 2017

    • Added alot of code documentation
    • Small cleanups and fix
  • Version 2.1.1 - 30 okt 2017

    • Fix for socket closing
  • Version 2.1.0 - 30 okt 2017

    • Small rename/refactor, BinanceSocketClient also use ApiResult now
  • Version 2.0.1 - 30 okt 2017

    • Improved error messages/handling in BinanceClient
    • Extra unit tests for failing requests
  • Version 2.0.0 - 25 okt 2017

    • Changed from static class to object orriented, added IDisposable interface to be able to use using statements
    • Split websocket and restapi functionality in BinanceClient and BinanceSocketClient
    • Added method to set log output writer
    • Added abitlity to set defaults for new clients
    • Fixed unit tests for new setup
    • Updated documentation
  • Version 1.1.2 - 25 okt 2017

    • Added UnsubscribeAllStreams method
  • Version 1.1.1 - 20 okt 2017

    • Fix for withdrawal/deposit filter
  • Version 1.1.0 - 20 okt 2017

    • Updated withdrawal/deposit functionality according to API changes
    • Cleaned up BinanceClient a bit
  • Version 1.0.9 - 19 okt 2017

    • Added withdrawal/deposit functionality
Issues

Quick list of the latest Issues we found

prozerran

prozerran

Icon For Comments1

I am able to create a LIMIT order, but now i try to REPLACE the order, I keep getting object ref not set to an instance. Something is wrong in the library internally. This is my code, its very short and doesnt work, or cannot replace my order,,,,,, anybody know why is that?

dumblearn

dumblearn

Icon For Comments0

Hi JKorf, I am trying to get history data (UsdFuture) for one minute interval and I am getting no data when I call GetKlinesAsync() with Interval of OneMinute.

var result = await binanceClient.UsdFuturesApi.ExchangeData.GetKlinesAsync(symbol, interval, startTime, endTime); result shows "Success" but Data.Count is zero

vaniakurd

vaniakurd

Icon For Comments0

SubscribeToAllBookTickerUpdatesAsync() drop connection every 5 minute with this error:

2022.09.09 00:22:00:909 | Trace | Binance | Socket 1 received data: {"stream":"!bookTicker","data":{"u":340768750,"s":"IMXUSDT","b":"0.81900000","B":"23549.87000000","a":"0.82000000","A":"243.82000000"}} 2022.09.09 00:22:00:911 | Trace | Binance | Socket 1 subscription 3 message processed in 2ms, (0ms user code) 2022.09.09 00:22:00:916 | Warning | Binance | Socket 1 error: Websocket error code ConnectionClosedPrematurely, details: WebSocketException - The remote party closed the WebSocket connection without completing the close handshake. at System.Net.WebSockets.ManagedWebSocket.ReceiveAsyncPrivate[TResult](Memory1 payloadBuffer, CancellationToken cancellationToken) at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder1.StateMachineBox1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token) at System.Threading.Tasks.ValueTask1.GetTaskForValueTaskSource(IValueTaskSource1 t) --- End of stack trace from previous location --- at CryptoExchange.Net.Sockets.CryptoExchangeWebSocketClient.ReceiveLoopAsync() IOException - Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host​.. at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](TIOAdapter adapter) at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](TIOAdapter adapter, Memory1 buffer) at System.Net.Http.HttpConnection.ReadBufferedAsyncCore(Memory1 destination) at System.Net.Http.HttpConnection.RawConnectionStream.ReadAsync(Memory1 buffer, CancellationToken cancellationToken) at System.Net.WebSockets.ManagedWebSocket.EnsureBufferContainsAsync(Int32 minimumRequiredBytes, CancellationToken cancellationToken, Boolean throwOnPrematureClosure) at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder1.StateMachineBox1.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) at System.Net.WebSockets.ManagedWebSocket.ReceiveAsyncPrivate[TResult](Memory1 payloadBuffer, CancellationToken cancellationToken) SocketException - An existing connection was forcibly closed by the remote host​. at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.CreateException(SocketError error, Boolean forAsyncThrow) at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ReceiveAsync(Socket socket, CancellationToken cancellationToken) at System.Net.Sockets.NetworkStream.ReadAsync(Memory1 buffer, CancellationToken cancellationToken) at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](TIOAdapter adapter) at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](TIOAdapter adapter, Memory1 buffer) at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) at System.Net.Security.SslStream.ReadAsync(Memory1 buffer, CancellationToken cancellationToken) at System.Net.Http.HttpConnection.ReadBufferedAsyncCore(Memory1 destination) at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) at System.Net.Http.HttpConnection.ReadBufferedAsyncCore(Memory1 destination) at System.Net.Http.HttpConnection.RawConnectionStream.ReadAsync(Memory1 buffer, CancellationToken cancellationToken) at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) at System.Net.Http.HttpConnection.RawConnectionStream.ReadAsync(Memory1 buffer, CancellationToken cancellationToken) at System.Net.WebSockets.ManagedWebSocket.EnsureBufferContainsAsync(Int32 minimumRequiredBytes, CancellationToken cancellationToken, Boolean throwOnPrematureClosure) at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) at System.Net.WebSockets.ManagedWebSocket.ReceiveAsyncPrivate[TResult](Memory1 payloadBuffer, CancellationToken cancellationToken) at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) at System.Net.WebSockets.ManagedWebSocket.ReceiveAsync(ArraySegment1 buffer, CancellationToken cancellationToken) at CryptoExchange.Net.Sockets.CryptoExchangeWebSocketClient.ReceiveLoopAsync() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.AsyncStateMachineBox1.MoveNext(Thread threadPoolThread) at System.Runtime.CompilerServices.TaskAwaiter.<>c.b__12_0(Action innerContinuation, Task innerTask) at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(Action action, Boolean allowInlining) at System.Threading.Tasks.Task.RunContinuations(Object continuationObject) at System.Threading.Tasks.Task1.TrySetResult(TResult result) at System.Threading.Tasks.ValueTask1.ValueTaskSourceAsTask.<>c.<.cctor>b__4_0(Object state) at System.Net.WebSockets.ManagedWebSocket.ReceiveAsyncPrivate[TResult](Memory1 payloadBuffer, CancellationToken cancellationToken) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Net.WebSockets.ManagedWebSocket.EnsureBufferContainsAsync(Int32 minimumRequiredBytes, CancellationToken cancellationToken, Boolean throwOnPrematureClosure) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Runtime.CompilerServices.TaskAwaiter.<>c.<OutputWaitEtwEvents>b__12_0(Action innerContinuation, Task innerTask) at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(Action action, Boolean allowInlining) at System.Threading.Tasks.Task.RunContinuations(Object continuationObject) at System.Threading.Tasks.Task1.TrySetResult(TResult result) at System.Net.Http.HttpConnection.RawConnectionStream.ReadAsync(Memory1 buffer, CancellationToken cancellationToken) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.AsyncStateMachineBox1.MoveNext(Thread threadPoolThread) at System.Runtime.CompilerServices.TaskAwaiter.<>c.<OutputWaitEtwEvents>b__12_0(Action innerContinuation, Task innerTask) at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(Action action, Boolean allowInlining) at System.Threading.Tasks.Task.RunContinuations(Object continuationObject) at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.SetExistingTaskResult(Task1 task, TResult result) at System.Net.Http.HttpConnection.ReadBufferedAsyncCore(Memory1 destination) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.AsyncStateMachineBox1.MoveNext(Thread threadPoolThread) at System.Runtime.CompilerServices.TaskAwaiter.<>c.b__12_0(Action innerContinuation, Task innerTask) at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(Action action, Boolean allowInlining) at System.Threading.Tasks.Task.RunContinuations(Object continuationObject) at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.SetExistingTaskResult(Task1 task, TResult result) at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](TIOAdapter adapter, Memory1 buffer) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.AsyncStateMachineBox1.MoveNext(Thread threadPoolThread) at System.Runtime.CompilerServices.TaskAwaiter.<>c.<OutputWaitEtwEvents>b__12_0(Action innerContinuation, Task innerTask) at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(Action action, Boolean allowInlining) at System.Threading.Tasks.Task.RunContinuations(Object continuationObject) at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](TIOAdapter adapter) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.AsyncStateMachineBox1.MoveNext(Thread threadPoolThread) at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.InvokeContinuation(Action1 continuation, Object state, Boolean forceAsync, Boolean requiresExecutionContextFlow) at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.OnCompleted(SocketAsyncEventArgs _) at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pNativeOverlapped) --- End of stack trace from previous location ---

2022.09.09 00:22:00:922 | Debug | Binance | Socket 1 Receive loop finished 2022.09.09 00:22:00:924 | Debug | Binance | Socket 1 Send loop finished 2022.09.09 00:22:00:925 | Debug | Binance | Socket 1 processing tasks finished 2022.09.09 00:22:00:926 | Debug | Binance | Socket 1 status changed from Connected to Reconnecting 2022.09.09 00:22:00:929 | Debug | Binance | Socket 1 attempting to reconnect 2022.09.09 00:22:00:930 | Debug | Binance | Socket 1 connecting 2022.09.09 00:22:02:095 | Debug | Binance | Socket 1 connected to #404 2022.09.09 00:22:02:096 | Debug | Binance | Socket 1 status changed from Reconnecting to Resubscribing 2022.09.09 00:22:02:098 | Trace | Binance | Socket 1 sending data: {"method":"SUBSCRIBE","params":["!bookTicker"],"id":2} 2022.09.09 00:22:02:099 | Trace | Binance | Socket 1 Adding 54 to sent buffer 2022.09.09 00:22:02:101 | Debug | Binance | Socket 1 starting processing tasks 2022.09.09 00:22:02:103 | Trace | Binance | Socket 1 sent 54 bytes 2022.09.09 00:22:02:105 | Debug | Binance | Socket 1 Starting task checking for no data received for 00:01:00 2022.09.09 00:22:02:396 | Trace | Binance | Socket 1 received 22 bytes in single message 2022.09.09 00:22:02:398 | Trace | Binance | Socket 1 received data: {"result":null,"id":2} 2022.09.09 00:22:02:399 | Trace | Binance | Socket 1 Subscription completed 2022.09.09 00:22:02:401 | Debug | Binance | Socket 1 all subscription successfully resubscribed on reconnected socket. 2022.09.09 00:22:02:403 | Debug | Binance | Socket 1 status changed from Resubscribing to Connected

UtkuX

UtkuX

Icon For Comments0

Hello, I'm trying to get data from sockets. While receiving data from the aggTrade channel without any problems, data from other channels is very rare. I'm not very good at C#, is there a problem with my code or the socket itself? I would really appreciate if you can help.

isorokuYam

isorokuYam

Icon For Comments0

Hello, just for clarification: I'm reporting warning, not order rejection itself. Version: 8.1.10

Describe the bug Received warning: `2022.09.04 23:27:17:199 | Warning | Cannot map enum value. EnumType: Binance.Net.Enums.OrderRejectReason, Value: STOP_PRICE_WOULD_TRIGGER_IMMEDIATELY, Known values: NONE, UNKNOWN_INSTRUMENT, MARKET_CLOSED, PRICE_QTY_EXCEED_HARD_LIMITS, UNKNOWN_ORDER, DUPLICATE_ORDER, UNKNOWN_ACCOUNT, INSUFFICIENT_BALANCE, ACCOUNT_INACTIVE, ACCOUNT_CANNOT_SETTLE. If you think STOP_PRICE_WOULD_TRIGGER_IMMEDIATELY should added please open an issue on the Github repo

2022.09.04 23:27:17:370 | Warning | Binance | [58] Error received in 586ms: {"code":-2021,"msg":"Order cancel-replace partially failed.","data":{"cancelResult":"SUCCESS","newOrderResult":"FAILURE","cancelResponse":{"symbol":"BTCBUSD","origClientOrderId":"Qirik6eOJMB0zAdKiXTHe5","orderId":5923863981,"orderListId":-1,"clientOrderId":"QIjQOWYuSiJLTm3aJUYNiZ","price":"19882.60000000","origQty":"0.00100000","executedQty":"0.00000000","cummulativeQuoteQty":"0.00000000","status":"CANCELED","timeInForce":"GTC","type":"STOP_LOSS_LIMIT","side":"SELL","stopPrice":"19888.57000000"},"newOrderResponse":{"code":-2010,"msg":"Stop price would trigger immediately."}}} `

To Reproduce Order placed with SpotApi.Trading.ReplaceOrderAsync()

Expected behavior No warning

dungtrandk

dungtrandk

Icon For Comments1

Hi

I was wondering if anybody else would like to share how fast IT takes for you guys from placing a spot limit ordre in tour code, until the callback? In milliseconds/seconds.

My calls usually take between 500ms up to almost 1 second.

Can it somehow be done faster than this?

trapdoor26

trapdoor26

Icon For Comments1

Hello,

I think there is a problem at GetExchangeInfoAsync task. As below screenshot, you may see that i try to get TickSize info under Filters.

But under Filters, only FilterType seems to appear. But when investigating parent, you can see TickSize is there.

Can this problem be solved different way ?

image

image

prozerran

prozerran

Icon For Comments1

Not really a bug, or missing feature, but how to.... I have several questions.....

  1. Whats the API to call to close a futures position, either on USDM or COINM (Futures or Inverse Futures) [for both Limit and Market Close position]
  2. How get to all trades (trade history) but the API seem to ONLY allow get all trades by Symbol, I just want to get all trades regardless of symbol.
  3. If and only when get all trades do return, I do not see the corresponding ClientOrderId return as well. I need to get ClOrdId.

These issues are for Futures and InvserseFutures (USDM and COINM) Theres seem to work ok for Spot, but the above 3 issues exist for the 2 futures, how can i resolve it.

GraniLuk

GraniLuk

Icon For Comments0

Describe the bug PurchaseStakingProductAsync and RedeemStakingProductAsync returns Bad Signature error, because quanity parameter is passed with wrong culture, it should always be passed formatted with InvariantCulture as other decimal parameters.

To Reproduce PurchaseStakingProductAsync and RedeemStakingProductAsync with any parameters.

Expected behavior It should returns Success response.

Debug logging Add debug logging related to the issue. Enable Debug logging in the client options by settings LogLevel to Debug.

It just needs to be changed to: { "amount", quantity.ToString(CultureInfo.InvariantCulture) },

dungtrandk

dungtrandk

Icon For Comments3

Sometimes I detect high fluctuations in the orderbook. In my case I am subscribed to SOL/USDT. What happens is that sometimes asks/bids gets returned from the API with values that are "not in line" with the other values.

Here is an example of the binance sol/usdt ask prices:

Timestamp Ask 10:12:36:710 - 57,84000000 10:12:36:907 - 57,61000000 10:12:37:108 - 47,81000000 10:12:37:209 - 57,38000000 10:12:37:409 - 57,15000000 10:12:37:607 - 47,37000000 10:12:37:708 - 56,91000000 10:12:37:907 - 56,68000000 10:12:38:273 - 47,37000000 10:12:38:365 - 47,37000000 10:12:38:481 - 47,37000000 10:12:38:714 - 56,00000000 10:12:38:810 - 47,37000000 10:12:38:911 - 47,49000000 10:12:39:109 - 47,38000000 10:12:39:209 - 55,55000000 10:12:39:412 - 55,32000000 10:12:39:708 - 55,10000000

As you can see, there is a huge fluctuation between 47'isch and 55'isch. The correct price range is 47'isch.

I am using your API for FTX as well and here I see the same problem.

How come this is?

salsburg

salsburg

Icon For Comments0

Binance API was modified recently to provide for market data and trading of vanilla options (on futures BTC, ETH, XRP, and others).

documentation for api is here: https://developers.binance.com/docs/binance-trading-api/voption GET /vapi/v1/optionInfo

symbol looks like: BTC-210129-40000-C as an example

example curl command:

$ curl -H "X-MBX-APIKEY: 22BjeOROKiXJ3NxbR3zjh3uoGcaflPu3VMyBXAg8Jj2J1xVSnY0eB4dzacdE9IWn" -X POST 'https://vapi.binance.com/vapi/v1/order' -d 'symbol=BTC-210129-40000-C&side=BUY&type=LIMIT&timeInForce=GTC&quantity=0.01&price=2000&recvWindow=5000&timestamp=1611825601400&signature=7c12045972f6140e765e0f2b67d28099718df805732676494238f50be830a7d7'

vaniakurd

vaniakurd

Icon For Comments0

Sokcet options: LogLevel = Microsoft.Extensions.Logging.LogLevel.Trace

i just wanna ask about message processed. I not sure but it seems to me that 3 ms for parse response is a lot. This logs from VS outpoot window. logs.txt

thomasd3

thomasd3

Icon For Comments4

Binance has a limit about the number of streams will it support on a socket. Right now, it stands at 128.

I'm grabbing the candles of the 139 futures with 8 timeframes per future, which means 139 * 8 = 1112 streams.

If you max out the number of streams / socket, Binance will just close the socket without telling you anything. And being at the max is not a good idea because a reply to a ping will open a new stream for the socket, and it will be dropped just like that.

I'm putting 120 streams per sockets, so I have: 139 futures * 8 time frames / 120 streams = 9 socket connections.

This means 15 futures / socket, and it works, I can stream all the data without problem.

But then I notice some streams are dropping sometimes. It's not regular, but rather random. And when they're dropped, there is no connection / disconnection event sent.

I do not know if the library doesn't reconnect the socket, or if it reconnects but doesn't resend the subscription message. But, from my perspective, I can only know something is amiss when some futures don't have messages for a while.

I am wondering if Binance dropping the connection is detected. They don't send a notification saying it's being closed when you exceed the number of streams.

NoamStudio

NoamStudio

Icon For Comments3

Hi, i'm trying to use this library to integrate with a trading software, which accept only Net Framework 4.8 libraries. when trying to use any client Task (lets say GetKlinesAsync method) with the 'await' keyword, the library failed to load with a 'TypeLoadException' when using the same method without 'await' the library will load and the method will get the first 500 klines, and not the full request.

is there any reason why i can't use 'await' with any of the methods? is it even possible to use this library in a Net Framework 4.8 environment?

hope anyone can help.

andresdrb

andresdrb

Icon For Comments3

Is anyone aware of the spot streams not working? I stopped receiving updates sometime earlier today...

cknia

cknia

Icon For Comments2

#region var orderData = await binanceClient.SpotApi.Trading.PlaceOrderAsync( "FTMUSDT", OrderSide.Sell, SpotOrderType.Market, quantity: 141); #endregion

The spot order is a success! But the futures order below keeps failing! I don't know what is the reason, please help me

#region var orderData = await binanceClient.UsdFuturesApi.Trading.PlaceOrderAsync( "FTMUSDT", OrderSide.Buy, FuturesOrderType.Market, 50m, timeInForce: TimeInForce.GoodTillCanceled); #endregion

NektoDron

NektoDron

Icon For Comments4

Describe the bug Not handled exception after disposing BinanceClient after upgrade to 8.0.13 from 8.0.11

To Reproduce Dispose client in reconnecting state

Expected behavior not handled exception will be handled FATAL:UnhandledException: System.ObjectDisposedException: The CancellationTokenSource has been disposed. at CryptoExchange.Net.Sockets.CryptoExchangeWebSocketClient.CloseInternalAsync() at CryptoExchange.Net.Sockets.CryptoExchangeWebSocketClient.CloseAsync() at CryptoExchange.Net.Sockets.SocketConnection.CloseAsync() at CryptoExchange.Net.Sockets.SocketConnection.CloseAsync(SocketSubscription subscription) at CryptoExchange.Net.BaseSocketClient.<>c_DisplayClass37_01.<<SubscribeAsync>b_0>d.MoveNext() — End of stack trace from previous location — at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__127_1(Object state) at System.Threading.QueueUserWorkItemCallback.Execute() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() at CryptoExchange.Net.Sockets.CryptoExchangeWebSocketClient.CloseInternalAsync() at CryptoExchange.Net.Sockets.CryptoExchangeWebSocketClient.CloseAsync() at CryptoExchange.Net.Sockets.SocketConnection.CloseAsync() at CryptoExchange.Net.Sockets.SocketConnection.CloseAsync(SocketSubscription subscription) at CryptoExchange.Net.BaseSocketClient.<>c_DisplayClass37_01.<b_0>d.MoveNext() — End of stack trace from previous location — at System.Threading.Tasks.Task.<>c.b__127_1(Object state) at System.Threading.QueueUserWorkItemCallback.Execute() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()

Kirill2Kirill

Kirill2Kirill

Icon For Comments1

Currently, I am tracking the ping to the exchange by using _client.SpotApi.ExchangeData.PingAsync() method every second. And my logic works fine, but it clogs up the LOGS with trash info messages about this requests. Maybe there is some way to track the ping to the server via sockets?

M22arius494

M22arius494

Icon For Comments3

Describe the bug After updating to v8 I get this error. It wasn't in previous V7 so I assume its the library (but not sure if that is really correct)

To Reproduce socketClient.SpotStreams.SubscribeToKlineUpdatesAsync(symbols .... ) Where symbols is the FULL set of BTC, BUSD, USDT coins. This full set can be over 300 symbols (seperated by BTC/USDT etc)

Expected behavior I expect this to work like the V7 enige, but instead I get an error "No response on subscription request received"

[Quick Fix] For now i have a quick fix by reducing the amount of symbols. But that is not an technical answer why this problems occurs

andresdrb

andresdrb

Icon For Comments49

Describe the bug Since upgraded to 8.x version the timestamp sync ssems to intermitently (every few hours) fail and spend 1-2 hours out of sync (givin "Timestamp for this request was 1000ms ahead..." messages).

To Reproduce Happens on all endpoints called (I call accountInfo, exchangeInfo, trading, etc). AutoTimestamp setting is set to true

Papercut110

Papercut110

Icon For Comments1

Hi! Periodically I get an error - -4184: Limit price can't be lower than.... For this error, I found the following information

Set the limit orders slipping in the trading settings. With the parameter "0", the range is determined automatically. Sometimes Binance forbids setting the long orders slipping. In this case, you need to set the parameter manually or select the Stop-Loss/Take-Profit placement to "On the server" parameter.

please help me find where to set the specified parameter

Library Stats (Sep 21, 2022)

Subscribers: 48
Stars: 817
Forks: 369
Issues: 38

dotnet-sshdeploy

here, otherwise you are in the right place

dotnet-sshdeploy

SharpeningCobaltStrike

In realtime compiling of dotnet v35/v40 exe/dll binaries + obfuscation with ConfuserEx on your linux cobalt strike server

SharpeningCobaltStrike

Dotnet client for Tarantool NoSql database

Some methods are not implemented yet because there are no direct analogs in IProto

Dotnet client for Tarantool NoSql database

dotnet-coverageconverter

coverage (binary format) files to

dotnet-coverageconverter

dotnet-stellar-sdk Stellar API SDK for

Report Bug · Report Security Vulnerability

dotnet-stellar-sdk Stellar API SDK for

dotnet-jwk is a JSON Web Key manager for dotnet

It allow to generate, encrypt, decrypt, convert and check JWK

dotnet-jwk is a JSON Web Key manager for dotnet

dotnet add package Brighid

Protecting the Client Secret

dotnet add package Brighid

dotnet-real-time-chat

A real time chat using C# dotnet and RabbitMQ

dotnet-real-time-chat

Run command line tools inside CSharp

Example running some dotnet CLI commands:

Run command line tools inside CSharp

Run command line tools inside CSharp

Example running some dotnet CLI commands:

Run command line tools inside CSharp
dotnet tool install --global dotnet-extract