Interface Deribit


  • @Path("/api/v2/public")
    @Produces("application/json")
    public interface Deribit
    • Method Detail

      • getOrderBook

        @GET
        @Path("get_order_book")
        DeribitResponse<DeribitOrderBook> getOrderBook​(@QueryParam("instrument_name")
                                                       String instrumentName,
                                                       @QueryParam("depth")
                                                       Integer depth)
                                                throws DeribitException,
                                                       IOException
        Retrieves the order book, along with other market values for a given instrument.
        Parameters:
        instrumentName - required, the instrument name for which to retrieve the order book, see getInstruments to obtain instrument names.
        depth - optional, the number of entries to return for bids and asks. max: 10000, default: 20
        Returns:
        Throws:
        DeribitException
        IOException
      • getLastTradesByInstrument

        @GET
        @Path("get_last_trades_by_instrument")
        DeribitResponse<DeribitTrades> getLastTradesByInstrument​(@QueryParam("instrument_name")
                                                                 String instrumentName,
                                                                 @QueryParam("start_seq")
                                                                 Integer startSeq,
                                                                 @QueryParam("end_seq")
                                                                 Integer endSeq,
                                                                 @QueryParam("count")
                                                                 Integer count,
                                                                 @QueryParam("include_old")
                                                                 Boolean includeOld,
                                                                 @QueryParam("sorting")
                                                                 String sorting)
                                                          throws DeribitException,
                                                                 IOException
        Retrieve the latest trades that have occurred for a specific instrument.
        Parameters:
        instrumentName - required, Instrument name
        startSeq - optional, The sequence number of the first trade to be returned
        endSeq - optional, The sequence number of the last trade to be returned
        count - optional, Number of requested items, default: 10
        includeOld - optional, Include trades older than 7 days, default: false
        sorting - optional, (asc, desc, default) Direction of results sorting (default value means no sorting, results will be returned in order in which they left the database)
        Returns:
        Throws:
        DeribitException
        IOException
      • auth

        @GET
        @Path("auth")
        DeribitResponse<DeribitAuthentication> auth​(@QueryParam("grant_type")
                                                    GrantType grantType,
                                                    @QueryParam("username")
                                                    String username,
                                                    @QueryParam("password")
                                                    String password,
                                                    @QueryParam("client_id")
                                                    String clientId,
                                                    @QueryParam("client_secret")
                                                    String clientSecret,
                                                    @QueryParam("refresh_token")
                                                    String refreshToken,
                                                    @QueryParam("timestamp")
                                                    String timestamp,
                                                    @QueryParam("signature")
                                                    String signature,
                                                    @QueryParam("nonce")
                                                    String nonce,
                                                    @QueryParam("state")
                                                    String state,
                                                    @QueryParam("scope")
                                                    String scope)
                                             throws DeribitException,
                                                    IOException
        Retrieve an Oauth access token, to be used for authentication of 'private' requests.
        Parameters:
        grantType - Method of authentication
        username - Required for grant type 'password'
        password - Required for grant type 'password'
        clientId - Required for grant type 'client_credentials' and 'client_signature'
        clientSecret - Required for grant type 'client_credentials'
        refreshToken - Required for grant type 'refresh_token'
        timestamp - Required for grant type 'client_signature', provides time when request has been generated
        signature - Required for grant type 'client_signature'; it's a cryptographic signature calculated over provided fields using user secret key. The signature should be calculated as an HMAC (Hash-based Message Authentication Code) with SHA256 hash algorithm
        nonce - Optional for grant type 'client_signature'; delivers user generated initialization vector for the server token
        state - Will be passed back in the response
        scope - Describes type of the access for assigned token, possible values: connection, session, session:name, trade:[read, read_write, none], wallet:[read, read_write, none], account:[read, read_write, none], expires:NUMBER, ip:ADDR. NOTICE: Depending on choosing an authentication method (grant type) some scopes could be narrowed by the server. e.g. when grant_type = client_credentials and scope = wallet:read_write it's modified by the server as scope = wallet:read
        Returns:
        Throws:
        DeribitException
        IOException