Skip to content

Commit 96dcb45

Browse files
authored
new NuGet 1.0.2 (#773)
- changed link from jjxtra/ES to DigitalRuby/ES - added BtcTurk to readme
1 parent 0af5d5b commit 96dcb45

File tree

6 files changed

+136
-118
lines changed

6 files changed

+136
-118
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ The following cryptocurrency exchanges are supported:
4141
| Bittrex | x | x | T R |
4242
| BL3P | x | x | R B | Trades stream does not send trade's ids. |
4343
| Bleutrade | x | x | |
44+
| BtcTurk | | | R |
4445
| BTSE | x | x | |
4546
| Bybit | x | x | R | Has public method for Websocket Positions
4647
| Coinbase | x | x | T R O U |
@@ -112,11 +113,11 @@ See [`WebSocket4NetClientWebSocket.cs`][websocket4net] for implementation detail
112113

113114
#### dotnet CLI
114115

115-
[`dotnet add package DigitalRuby.ExchangeSharp --version 1.0.1`][nuget]
116+
[`dotnet add package DigitalRuby.ExchangeSharp --version 1.0.2`][nuget]
116117

117118
#### Package Manager on VS
118119

119-
[`PM> Install-Package DigitalRuby.ExchangeSharp -Version 1.0.1`][nuget]
120+
[`PM> Install-Package DigitalRuby.ExchangeSharp -Version 1.0.2`][nuget]
120121

121122
### Examples
122123

src/ExchangeSharp/API/Exchanges/BitMEX/ExchangeBitMEXAPI.cs

Lines changed: 123 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -88,109 +88,114 @@ protected override async Task<IEnumerable<string>> OnGetMarketSymbolsAsync()
8888
protected internal override async Task<IEnumerable<ExchangeMarket>> OnGetMarketSymbolsMetadataAsync()
8989
{
9090
/*
91-
{{
92-
"symbol": ".XRPXBT",
93-
"rootSymbol": "XRP",
94-
"state": "Unlisted",
95-
"typ": "MRCXXX",
96-
"listing": null,
97-
"front": null,
98-
"expiry": null,
99-
"settle": null,
100-
"relistInterval": null,
101-
"inverseLeg": "",
102-
"sellLeg": "",
103-
"buyLeg": "",
104-
"optionStrikePcnt": null,
105-
"optionStrikeRound": null,
106-
"optionStrikePrice": null,
107-
"optionMultiplier": null,
108-
"positionCurrency": "",
109-
"underlying": "XRP",
110-
"quoteCurrency": "XBT",
111-
"underlyingSymbol": "XRPXBT=",
112-
"reference": "PLNX",
113-
"referenceSymbol": "BTC_XRP",
114-
"calcInterval": null,
115-
"publishInterval": "2000-01-01T00:01:00Z",
116-
"publishTime": null,
117-
"maxOrderQty": null,
118-
"maxPrice": null,
119-
"lotSize": null,
120-
"tickSize": 1E-08,
121-
"multiplier": null,
122-
"settlCurrency": "",
123-
"underlyingToPositionMultiplier": null,
124-
"underlyingToSettleMultiplier": null,
125-
"quoteToSettleMultiplier": null,
126-
"isQuanto": false,
127-
"isInverse": false,
128-
"initMargin": null,
129-
"maintMargin": null,
130-
"riskLimit": null,
131-
"riskStep": null,
132-
"limit": null,
133-
"capped": false,
134-
"taxed": false,
135-
"deleverage": false,
136-
"makerFee": null,
137-
"takerFee": null,
138-
"settlementFee": null,
139-
"insuranceFee": null,
140-
"fundingBaseSymbol": "",
141-
"fundingQuoteSymbol": "",
142-
"fundingPremiumSymbol": "",
143-
"fundingTimestamp": null,
144-
"fundingInterval": null,
145-
"fundingRate": null,
146-
"indicativeFundingRate": null,
147-
"rebalanceTimestamp": null,
148-
"rebalanceInterval": null,
149-
"openingTimestamp": null,
150-
"closingTimestamp": null,
151-
"sessionInterval": null,
152-
"prevClosePrice": null,
153-
"limitDownPrice": null,
154-
"limitUpPrice": null,
155-
"bankruptLimitDownPrice": null,
156-
"bankruptLimitUpPrice": null,
157-
"prevTotalVolume": null,
158-
"totalVolume": null,
159-
"volume": null,
160-
"volume24h": null,
161-
"prevTotalTurnover": null,
162-
"totalTurnover": null,
163-
"turnover": null,
164-
"turnover24h": null,
165-
"prevPrice24h": 7.425E-05,
166-
"vwap": null,
167-
"highPrice": null,
168-
"lowPrice": null,
169-
"lastPrice": 7.364E-05,
170-
"lastPriceProtected": null,
171-
"lastTickDirection": "MinusTick",
172-
"lastChangePcnt": -0.0082,
173-
"bidPrice": null,
174-
"midPrice": null,
175-
"askPrice": null,
176-
"impactBidPrice": null,
177-
"impactMidPrice": null,
178-
"impactAskPrice": null,
179-
"hasLiquidity": false,
180-
"openInterest": 0,
181-
"openValue": 0,
182-
"fairMethod": "",
183-
"fairBasisRate": null,
184-
"fairBasis": null,
185-
"fairPrice": null,
186-
"markMethod": "LastPrice",
187-
"markPrice": 7.364E-05,
188-
"indicativeTaxRate": null,
189-
"indicativeSettlePrice": null,
190-
"optionUnderlyingPrice": null,
191-
"settledPrice": null,
192-
"timestamp": "2018-07-05T13:27:15Z"
193-
}}
91+
[
92+
{
93+
"symbol": "XBTZ14",
94+
"rootSymbol": "XBT",
95+
"state": "Settled",
96+
"typ": "FXXXS",
97+
"listing": "2014-11-21T20:00:00.000Z",
98+
"front": "2014-11-28T12:00:00.000Z",
99+
"expiry": "2014-12-26T12:00:00.000Z",
100+
"settle": "2014-12-26T12:00:00.000Z",
101+
"listedSettle": "2014-12-26T12:00:00.000Z",
102+
"relistInterval": null,
103+
"inverseLeg": "",
104+
"sellLeg": "",
105+
"buyLeg": "",
106+
"optionStrikePcnt": null,
107+
"optionStrikeRound": null,
108+
"optionStrikePrice": null,
109+
"optionMultiplier": null,
110+
"positionCurrency": "",
111+
"underlying": "XBT",
112+
"quoteCurrency": "USD",
113+
"underlyingSymbol": "XBT=",
114+
"reference": "BMEX",
115+
"referenceSymbol": ".XBT2H",
116+
"calcInterval": null,
117+
"publishInterval": null,
118+
"publishTime": null,
119+
"maxOrderQty": 10000000,
120+
"maxPrice": 1000000,
121+
"lotSize": 1,
122+
"tickSize": 0.01,
123+
"multiplier": 1000,
124+
"settlCurrency": "XBt",
125+
"underlyingToPositionMultiplier": null,
126+
"underlyingToSettleMultiplier": 100000000,
127+
"quoteToSettleMultiplier": null,
128+
"isQuanto": true,
129+
"isInverse": false,
130+
"initMargin": 0.3,
131+
"maintMargin": 0.2,
132+
"riskLimit": 25000000000,
133+
"riskStep": 5000000000,
134+
"limit": 0.2,
135+
"capped": false,
136+
"taxed": false,
137+
"deleverage": false,
138+
"makerFee": 0.00005,
139+
"takerFee": 0.00005,
140+
"settlementFee": 0.00005,
141+
"insuranceFee": 0.00015,
142+
"fundingBaseSymbol": "",
143+
"fundingQuoteSymbol": "",
144+
"fundingPremiumSymbol": "",
145+
"fundingTimestamp": null,
146+
"fundingInterval": null,
147+
"fundingRate": null,
148+
"indicativeFundingRate": null,
149+
"rebalanceTimestamp": null,
150+
"rebalanceInterval": null,
151+
"openingTimestamp": "2014-12-26T12:00:00.000Z",
152+
"closingTimestamp": "2014-12-26T12:00:00.000Z",
153+
"sessionInterval": "2000-01-01T08:00:00.000Z",
154+
"prevClosePrice": 319,
155+
"limitDownPrice": 255.2,
156+
"limitUpPrice": 382.8,
157+
"bankruptLimitDownPrice": null,
158+
"bankruptLimitUpPrice": null,
159+
"prevTotalVolume": 323564,
160+
"totalVolume": 348271,
161+
"volume": 0,
162+
"volume24h": 0,
163+
"prevTotalTurnover": 0,
164+
"totalTurnover": 0,
165+
"turnover": 0,
166+
"turnover24h": 0,
167+
"homeNotional24h": 0,
168+
"foreignNotional24h": 0,
169+
"prevPrice24h": 323.33,
170+
"vwap": null,
171+
"highPrice": null,
172+
"lowPrice": null,
173+
"lastPrice": 323.33,
174+
"lastPriceProtected": 323.33,
175+
"lastTickDirection": "PlusTick",
176+
"lastChangePcnt": 0,
177+
"bidPrice": null,
178+
"midPrice": null,
179+
"askPrice": null,
180+
"impactBidPrice": null,
181+
"impactMidPrice": null,
182+
"impactAskPrice": null,
183+
"hasLiquidity": false,
184+
"openInterest": 0,
185+
"openValue": 0,
186+
"fairMethod": "",
187+
"fairBasisRate": null,
188+
"fairBasis": 0,
189+
"fairPrice": 323.33,
190+
"markMethod": "LastPrice",
191+
"markPrice": 323.33,
192+
"indicativeTaxRate": null,
193+
"indicativeSettlePrice": 323.33,
194+
"optionUnderlyingPrice": null,
195+
"settledPriceAdjustmentRate": null,
196+
"settledPrice": 323.33,
197+
"timestamp": "2014-11-21T21:00:02.409Z"
198+
},
194199
*/
195200

196201
List<ExchangeMarket> markets = new List<ExchangeMarket>();
@@ -209,11 +214,23 @@ protected internal override async Task<IEnumerable<ExchangeMarket>> OnGetMarketS
209214
{
210215
market.PriceStepSize = marketSymbolToken["tickSize"].ConvertInvariant<decimal>();
211216
market.MaxPrice = marketSymbolToken["maxPrice"].ConvertInvariant<decimal>();
212-
//market.MinPrice = symbol["minPrice"].ConvertInvariant<decimal>();
217+
//market.MinPrice = symbol["minPrice"].ConvertInvariant<decimal>(); - BitMex does not provide min price
213218

214219
market.MaxTradeSize = marketSymbolToken["maxOrderQty"].ConvertInvariant<decimal>();
215-
//market.MinTradeSize = symbol["minQty"].ConvertInvariant<decimal>();
216-
//market.QuantityStepSize = symbol["stepSize"].ConvertInvariant<decimal>();
220+
var underlyingToPositionMultiplier = marketSymbolToken["underlyingToPositionMultiplier"].Type == JTokenType.Null ? 1 : marketSymbolToken["underlyingToPositionMultiplier"].ConvertInvariant<decimal>();
221+
var contractSize = 1 / underlyingToPositionMultiplier;
222+
var lotSize = marketSymbolToken["lotSize"].ConvertInvariant<decimal>();
223+
var minTradeAmt = contractSize * lotSize;
224+
var positionCurrency = marketSymbolToken["positionCurrency"]?.ToStringUpperInvariant();
225+
if (positionCurrency == market.BaseCurrency)
226+
{
227+
market.MinTradeSize = market.QuantityStepSize = minTradeAmt;
228+
}
229+
else if (positionCurrency == market.QuoteCurrency)
230+
{
231+
market.MinTradeSizeInQuoteCurrency = minTradeAmt;
232+
}
233+
// else positionCurrency is probably null and the intrument is not active
217234
}
218235
catch
219236
{

src/ExchangeSharp/ExchangeSharp.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
<LangVersion>8</LangVersion>
99
<PackageId>DigitalRuby.ExchangeSharp</PackageId>
1010
<Title>ExchangeSharp - C# API for cryptocurrency exchanges</Title>
11-
<PackageVersion>1.0.1</PackageVersion>
11+
<PackageVersion>1.0.2</PackageVersion>
1212
<Authors>jjxtra</Authors>
1313
<Description>ExchangeSharp is a C# API for working with various cryptocurrency exchanges. Web sockets are also supported for some exchanges.</Description>
1414
<Summary>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.</Summary>
1515
<PackageIcon>icon.png</PackageIcon>
1616
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
17-
<PackageProjectUrl>https://github.com/jjxtra/ExchangeSharp</PackageProjectUrl>
17+
<PackageProjectUrl>https://github.com/DigitalRuby/ExchangeSharp</PackageProjectUrl>
1818
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
19-
<PackageReleaseNotes>https://github.com/jjxtra/ExchangeSharp/releases</PackageReleaseNotes>
19+
<PackageReleaseNotes>https://github.com/DigitalRuby/ExchangeSharp/releases</PackageReleaseNotes>
2020
<PackageReadmeFile>README.md</PackageReadmeFile>
2121
<PackageTags>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</PackageTags>
22-
<RepositoryUrl>https://github.com/jjxtra/ExchangeSharp</RepositoryUrl>
22+
<RepositoryUrl>https://github.com/DigitalRuby/ExchangeSharp</RepositoryUrl>
2323
<RepositoryType>git</RepositoryType>
2424
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
2525
</PropertyGroup>

src/ExchangeSharp/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@
3131
//
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
34-
[assembly: AssemblyVersion("1.0.1")]
35-
[assembly: AssemblyFileVersion("1.0.1")]
34+
[assembly: AssemblyVersion("1.0.2")]
35+
[assembly: AssemblyFileVersion("1.0.2")]
3636
[assembly: InternalsVisibleTo("ExchangeSharpTests")]

src/ExchangeSharpConsole/ExchangeSharpConsole.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<AssemblyName>exchange-sharp</AssemblyName>
66
<TargetFramework>net6.0</TargetFramework>
77
<NeutralLanguage>en</NeutralLanguage>
8-
<AssemblyVersion>1.0.1</AssemblyVersion>
9-
<FileVersion>1.0.1</FileVersion>
8+
<AssemblyVersion>1.0.2</AssemblyVersion>
9+
<FileVersion>1.0.2</FileVersion>
1010
</PropertyGroup>
1111

1212
<ItemGroup>

tests/ExchangeSharpTests/ExchangeSharpTests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<TargetFramework>net6.0</TargetFramework>
55
<IsPackable>false</IsPackable>
66
<NeutralLanguage>en</NeutralLanguage>
7-
<AssemblyVersion>1.0.1</AssemblyVersion>
8-
<FileVersion>1.0.1</FileVersion>
7+
<AssemblyVersion>1.0.2</AssemblyVersion>
8+
<FileVersion>1.0.2</FileVersion>
99
<NoWin32Manifest>true</NoWin32Manifest>
1010
</PropertyGroup>
1111

0 commit comments

Comments
 (0)