tekr / deribitdotnet Goto Github PK
View Code? Open in Web Editor NEWC# library for connecting to the Deribit cryptocurrency derivatives exchange via the Websockets v2 API
License: MIT License
C# library for connecting to the Deribit cryptocurrency derivatives exchange via the Websockets v2 API
License: MIT License
Ticker entity has property OpenInterest with type int, that has too small size to deserialize data from deribit into the Ticker response.
Full error message:
Error processing message {"jsonrpc":"2.0","method":"subscription","params":{"channel":"ticker.BTC-PERPETUAL.raw","data":{"timestamp":1613222943860,"stats":{"volume_usd":193698960.0,"volume":4088.6392549,"price_change":-2.2837,"low":45250.0,"high":48624.5},"state":"open","settlement_price":47157.09,"open_interest":2446540246,"min_price":46191.37,"max_price":47598.22,"mark_price":46896.7,"last_price":46895.5,"instrument_name":"BTC-PERPETUAL","index_price":46881.37,"funding_8h":0.00052489,"estimated_delivery_price":46881.37,"current_funding":0.0,"best_bid_price":46898.0,"best_bid_amount":90.0,"best_ask_price":46898.5,"best_ask_amount":114580.0}}
Newtonsoft.Json.JsonReaderException: Could not convert to integer: 2446540246. Path 'open_interest'.
---> System.OverflowException: Value was either too large or too small for an Int32.
I'd like to make PR with this fix, could you review it?
Add simple console app demonstrating various bits of functionality.
Document usage and available functionality in README
Enhance test coverage with unit tests, and add (manually-run) integration tests that execute against the exchange.
when Executing the following code
'''
NewOrderRequest newOrderRequestStop = new NewOrderRequest("BTC-PERPETUAL", dirStop);
// newOrderRequest.Price = 45000;
newOrderRequestStop.OrderType = OrderType.StopMarket;
newOrderRequestStop.Quantity = 1000;
newOrderRequestStop.Label = "Testing From the bot";
newOrderRequestStop.StopPrice = 42000;
newOrderRequestStop.StopTrigger = StopTrigger.LastPrice;
OrderOperationResponse orderOperationResponseStop = await deribitApi.Send(newOrderRequestStop);
if (!orderOperationResponseStop.Succeeded) {
Concole.WriteLine("Error " + orderOperationResponseStop.Error.Code + " " + orderOperationResponseStop.Error.Message + " " + orderOperationResponseStop.Error.Data);
} else {
Concole.WriteLine((orderOperationResponse.ToString());
}
'''
I get the following exception
when I remove this line
''' newOrderRequestStop.StopTrigger = StopTrigger.LastPrice;'''
everything seems fine
If the websocket connection is lost during automatic resubscription after reconnection, DeribitApi._activeSubscriptions may end up with duplicated entries.
If this occurs multiple times, the list of entries can get large enough that Deribit disconnects upon reconnection due to the large number of subscription requests.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.