Giter Site home page Giter Site logo

tekr / deribitdotnet Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 6.0 52 KB

C# library for connecting to the Deribit cryptocurrency derivatives exchange via the Websockets v2 API

License: MIT License

C# 100.00%
api-wrapper cryptocurrency csharp deribit deribit-api deribit-api-v2 derivatives

deribitdotnet's People

Contributors

onikiro avatar tekr avatar

Watchers

 avatar  avatar

deribitdotnet's Issues

Error: "Value was either too large or too small for an Int32 - 'open_interest'"

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?

Demo app

Add simple console app demonstrating various bits of functionality.

Documentation

Document usage and available functionality in README

Unit & integration tests

Enhance test coverage with unit tests, and add (manually-run) integration tests that execute against the exchange.

Issue when sending a NewOrderRequest with limit stop market order type and stop trigger #7

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

image

when I remove this line

''' newOrderRequestStop.StopTrigger = StopTrigger.LastPrice;'''

everything seems fine

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.