From 96dcb45d6022fad9e90da6bfa8398a3bedcbaa46 Mon Sep 17 00:00:00 2001 From: Victor Lee Date: Mon, 2 May 2022 16:12:22 -0700 Subject: [PATCH] new NuGet 1.0.2 (#773) - changed link from jjxtra/ES to DigitalRuby/ES - added BtcTurk to readme --- README.md | 5 +- .../API/Exchanges/BitMEX/ExchangeBitMEXAPI.cs | 229 ++++++++++-------- src/ExchangeSharp/ExchangeSharp.csproj | 8 +- src/ExchangeSharp/Properties/AssemblyInfo.cs | 4 +- .../ExchangeSharpConsole.csproj | 4 +- .../ExchangeSharpTests.csproj | 4 +- 6 files changed, 136 insertions(+), 118 deletions(-) diff --git a/README.md b/README.md index a795d628..b1978c12 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ The following cryptocurrency exchanges are supported: | Bittrex | x | x | T R | | BL3P | x | x | R B | Trades stream does not send trade's ids. | | Bleutrade | x | x | | +| BtcTurk | | | R | | BTSE | x | x | | | Bybit | x | x | R | Has public method for Websocket Positions | Coinbase | x | x | T R O U | @@ -112,11 +113,11 @@ See [`WebSocket4NetClientWebSocket.cs`][websocket4net] for implementation detail #### dotnet CLI -[`dotnet add package DigitalRuby.ExchangeSharp --version 1.0.1`][nuget] +[`dotnet add package DigitalRuby.ExchangeSharp --version 1.0.2`][nuget] #### Package Manager on VS -[`PM> Install-Package DigitalRuby.ExchangeSharp -Version 1.0.1`][nuget] +[`PM> Install-Package DigitalRuby.ExchangeSharp -Version 1.0.2`][nuget] ### Examples diff --git a/src/ExchangeSharp/API/Exchanges/BitMEX/ExchangeBitMEXAPI.cs b/src/ExchangeSharp/API/Exchanges/BitMEX/ExchangeBitMEXAPI.cs index 02671740..398ffb59 100644 --- a/src/ExchangeSharp/API/Exchanges/BitMEX/ExchangeBitMEXAPI.cs +++ b/src/ExchangeSharp/API/Exchanges/BitMEX/ExchangeBitMEXAPI.cs @@ -88,109 +88,114 @@ protected override async Task> OnGetMarketSymbolsAsync() protected internal override async Task> OnGetMarketSymbolsMetadataAsync() { /* - {{ - "symbol": ".XRPXBT", - "rootSymbol": "XRP", - "state": "Unlisted", - "typ": "MRCXXX", - "listing": null, - "front": null, - "expiry": null, - "settle": null, - "relistInterval": null, - "inverseLeg": "", - "sellLeg": "", - "buyLeg": "", - "optionStrikePcnt": null, - "optionStrikeRound": null, - "optionStrikePrice": null, - "optionMultiplier": null, - "positionCurrency": "", - "underlying": "XRP", - "quoteCurrency": "XBT", - "underlyingSymbol": "XRPXBT=", - "reference": "PLNX", - "referenceSymbol": "BTC_XRP", - "calcInterval": null, - "publishInterval": "2000-01-01T00:01:00Z", - "publishTime": null, - "maxOrderQty": null, - "maxPrice": null, - "lotSize": null, - "tickSize": 1E-08, - "multiplier": null, - "settlCurrency": "", - "underlyingToPositionMultiplier": null, - "underlyingToSettleMultiplier": null, - "quoteToSettleMultiplier": null, - "isQuanto": false, - "isInverse": false, - "initMargin": null, - "maintMargin": null, - "riskLimit": null, - "riskStep": null, - "limit": null, - "capped": false, - "taxed": false, - "deleverage": false, - "makerFee": null, - "takerFee": null, - "settlementFee": null, - "insuranceFee": null, - "fundingBaseSymbol": "", - "fundingQuoteSymbol": "", - "fundingPremiumSymbol": "", - "fundingTimestamp": null, - "fundingInterval": null, - "fundingRate": null, - "indicativeFundingRate": null, - "rebalanceTimestamp": null, - "rebalanceInterval": null, - "openingTimestamp": null, - "closingTimestamp": null, - "sessionInterval": null, - "prevClosePrice": null, - "limitDownPrice": null, - "limitUpPrice": null, - "bankruptLimitDownPrice": null, - "bankruptLimitUpPrice": null, - "prevTotalVolume": null, - "totalVolume": null, - "volume": null, - "volume24h": null, - "prevTotalTurnover": null, - "totalTurnover": null, - "turnover": null, - "turnover24h": null, - "prevPrice24h": 7.425E-05, - "vwap": null, - "highPrice": null, - "lowPrice": null, - "lastPrice": 7.364E-05, - "lastPriceProtected": null, - "lastTickDirection": "MinusTick", - "lastChangePcnt": -0.0082, - "bidPrice": null, - "midPrice": null, - "askPrice": null, - "impactBidPrice": null, - "impactMidPrice": null, - "impactAskPrice": null, - "hasLiquidity": false, - "openInterest": 0, - "openValue": 0, - "fairMethod": "", - "fairBasisRate": null, - "fairBasis": null, - "fairPrice": null, - "markMethod": "LastPrice", - "markPrice": 7.364E-05, - "indicativeTaxRate": null, - "indicativeSettlePrice": null, - "optionUnderlyingPrice": null, - "settledPrice": null, - "timestamp": "2018-07-05T13:27:15Z" -}} +[ + { + "symbol": "XBTZ14", + "rootSymbol": "XBT", + "state": "Settled", + "typ": "FXXXS", + "listing": "2014-11-21T20:00:00.000Z", + "front": "2014-11-28T12:00:00.000Z", + "expiry": "2014-12-26T12:00:00.000Z", + "settle": "2014-12-26T12:00:00.000Z", + "listedSettle": "2014-12-26T12:00:00.000Z", + "relistInterval": null, + "inverseLeg": "", + "sellLeg": "", + "buyLeg": "", + "optionStrikePcnt": null, + "optionStrikeRound": null, + "optionStrikePrice": null, + "optionMultiplier": null, + "positionCurrency": "", + "underlying": "XBT", + "quoteCurrency": "USD", + "underlyingSymbol": "XBT=", + "reference": "BMEX", + "referenceSymbol": ".XBT2H", + "calcInterval": null, + "publishInterval": null, + "publishTime": null, + "maxOrderQty": 10000000, + "maxPrice": 1000000, + "lotSize": 1, + "tickSize": 0.01, + "multiplier": 1000, + "settlCurrency": "XBt", + "underlyingToPositionMultiplier": null, + "underlyingToSettleMultiplier": 100000000, + "quoteToSettleMultiplier": null, + "isQuanto": true, + "isInverse": false, + "initMargin": 0.3, + "maintMargin": 0.2, + "riskLimit": 25000000000, + "riskStep": 5000000000, + "limit": 0.2, + "capped": false, + "taxed": false, + "deleverage": false, + "makerFee": 0.00005, + "takerFee": 0.00005, + "settlementFee": 0.00005, + "insuranceFee": 0.00015, + "fundingBaseSymbol": "", + "fundingQuoteSymbol": "", + "fundingPremiumSymbol": "", + "fundingTimestamp": null, + "fundingInterval": null, + "fundingRate": null, + "indicativeFundingRate": null, + "rebalanceTimestamp": null, + "rebalanceInterval": null, + "openingTimestamp": "2014-12-26T12:00:00.000Z", + "closingTimestamp": "2014-12-26T12:00:00.000Z", + "sessionInterval": "2000-01-01T08:00:00.000Z", + "prevClosePrice": 319, + "limitDownPrice": 255.2, + "limitUpPrice": 382.8, + "bankruptLimitDownPrice": null, + "bankruptLimitUpPrice": null, + "prevTotalVolume": 323564, + "totalVolume": 348271, + "volume": 0, + "volume24h": 0, + "prevTotalTurnover": 0, + "totalTurnover": 0, + "turnover": 0, + "turnover24h": 0, + "homeNotional24h": 0, + "foreignNotional24h": 0, + "prevPrice24h": 323.33, + "vwap": null, + "highPrice": null, + "lowPrice": null, + "lastPrice": 323.33, + "lastPriceProtected": 323.33, + "lastTickDirection": "PlusTick", + "lastChangePcnt": 0, + "bidPrice": null, + "midPrice": null, + "askPrice": null, + "impactBidPrice": null, + "impactMidPrice": null, + "impactAskPrice": null, + "hasLiquidity": false, + "openInterest": 0, + "openValue": 0, + "fairMethod": "", + "fairBasisRate": null, + "fairBasis": 0, + "fairPrice": 323.33, + "markMethod": "LastPrice", + "markPrice": 323.33, + "indicativeTaxRate": null, + "indicativeSettlePrice": 323.33, + "optionUnderlyingPrice": null, + "settledPriceAdjustmentRate": null, + "settledPrice": 323.33, + "timestamp": "2014-11-21T21:00:02.409Z" + }, */ List markets = new List(); @@ -209,11 +214,23 @@ protected internal override async Task> OnGetMarketS { market.PriceStepSize = marketSymbolToken["tickSize"].ConvertInvariant(); market.MaxPrice = marketSymbolToken["maxPrice"].ConvertInvariant(); - //market.MinPrice = symbol["minPrice"].ConvertInvariant(); + //market.MinPrice = symbol["minPrice"].ConvertInvariant(); - BitMex does not provide min price market.MaxTradeSize = marketSymbolToken["maxOrderQty"].ConvertInvariant(); - //market.MinTradeSize = symbol["minQty"].ConvertInvariant(); - //market.QuantityStepSize = symbol["stepSize"].ConvertInvariant(); + var underlyingToPositionMultiplier = marketSymbolToken["underlyingToPositionMultiplier"].Type == JTokenType.Null ? 1 : marketSymbolToken["underlyingToPositionMultiplier"].ConvertInvariant(); + var contractSize = 1 / underlyingToPositionMultiplier; + var lotSize = marketSymbolToken["lotSize"].ConvertInvariant(); + var minTradeAmt = contractSize * lotSize; + var positionCurrency = marketSymbolToken["positionCurrency"]?.ToStringUpperInvariant(); + if (positionCurrency == market.BaseCurrency) + { + market.MinTradeSize = market.QuantityStepSize = minTradeAmt; + } + else if (positionCurrency == market.QuoteCurrency) + { + market.MinTradeSizeInQuoteCurrency = minTradeAmt; + } + // else positionCurrency is probably null and the intrument is not active } catch { diff --git a/src/ExchangeSharp/ExchangeSharp.csproj b/src/ExchangeSharp/ExchangeSharp.csproj index 2557c9bc..1084f27b 100644 --- a/src/ExchangeSharp/ExchangeSharp.csproj +++ b/src/ExchangeSharp/ExchangeSharp.csproj @@ -8,18 +8,18 @@ 8 DigitalRuby.ExchangeSharp ExchangeSharp - C# API for cryptocurrency exchanges - 1.0.1 + 1.0.2 jjxtra ExchangeSharp is a C# API for working with various cryptocurrency exchanges. Web sockets are also supported for some exchanges. Supported exchanges: Binance BitMEX Bitfinex Bithumb Bitstamp Bittrex BL3P Bleutrade BTSE Cryptopia Coinbase(GDAX) Digifinex Gemini Gitbtc Huobi Kraken Kucoin Livecoin NDAX OKCoin OKEx Poloniex TuxExchange Yobit ZBcom. Pull requests welcome. icon.png LICENSE.txt - https://github.com/jjxtra/ExchangeSharp + https://github.com/DigitalRuby/ExchangeSharp true - https://github.com/jjxtra/ExchangeSharp/releases + https://github.com/DigitalRuby/ExchangeSharp/releases README.md C# crypto cryptocurrency trade trader exchange sharp socket web socket websocket signalr secure API Binance BitMEX Bitfinex Bithumb Bitstamp Bittrex BL3P Bleutrade BTSE Cryptopia Coinbase GDAX Digifinex Gemini Gitbtc Huobi Kraken Kucoin Livecoin NDAX OKCoin OKEx Poloniex TuxExchange Yobit ZBcom - https://github.com/jjxtra/ExchangeSharp + https://github.com/DigitalRuby/ExchangeSharp git true diff --git a/src/ExchangeSharp/Properties/AssemblyInfo.cs b/src/ExchangeSharp/Properties/AssemblyInfo.cs index ca2eb58a..1508da8c 100644 --- a/src/ExchangeSharp/Properties/AssemblyInfo.cs +++ b/src/ExchangeSharp/Properties/AssemblyInfo.cs @@ -31,6 +31,6 @@ // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.1")] -[assembly: AssemblyFileVersion("1.0.1")] +[assembly: AssemblyVersion("1.0.2")] +[assembly: AssemblyFileVersion("1.0.2")] [assembly: InternalsVisibleTo("ExchangeSharpTests")] diff --git a/src/ExchangeSharpConsole/ExchangeSharpConsole.csproj b/src/ExchangeSharpConsole/ExchangeSharpConsole.csproj index 66010c7d..e3613c85 100644 --- a/src/ExchangeSharpConsole/ExchangeSharpConsole.csproj +++ b/src/ExchangeSharpConsole/ExchangeSharpConsole.csproj @@ -5,8 +5,8 @@ exchange-sharp net6.0 en - 1.0.1 - 1.0.1 + 1.0.2 + 1.0.2 diff --git a/tests/ExchangeSharpTests/ExchangeSharpTests.csproj b/tests/ExchangeSharpTests/ExchangeSharpTests.csproj index 632c9238..2cace1c1 100644 --- a/tests/ExchangeSharpTests/ExchangeSharpTests.csproj +++ b/tests/ExchangeSharpTests/ExchangeSharpTests.csproj @@ -4,8 +4,8 @@ net6.0 false en - 1.0.1 - 1.0.1 + 1.0.2 + 1.0.2 true