Interface DeribitAuthenticated


@Path("/api/v2/private") @Produces("application/json") public interface DeribitAuthenticated
  • Method Details

    • getAccountSummary

      @GET @Path("get_account_summary") DeribitResponse<AccountSummary> getAccountSummary(@QueryParam("currency") String currency, @QueryParam("extended") Boolean extended, @HeaderParam("Authorization") si.mazi.rescu.ParamsDigest auth) throws DeribitException, IOException
      Retrieves user account summary.
      Parameters:
      currency - required, The currency symbol, BTC or ETH
      extended - Include additional fields
      Throws:
      DeribitException
      IOException
      See Also:
    • buy

      @GET @Path("buy") DeribitResponse<OrderPlacement> buy(@QueryParam("instrument_name") String instrumentName, @QueryParam("amount") BigDecimal amount, @QueryParam("type") OrderType type, @QueryParam("label") String label, @QueryParam("price") BigDecimal price, @QueryParam("time_in_force") TimeInForce timeInForce, @QueryParam("max_show") BigDecimal maxShow, @QueryParam("post_only") Boolean postOnly, @QueryParam("reject_post_only") Boolean rejectPostOnly, @QueryParam("reduce_only") Boolean reduceOnly, @QueryParam("trigger_price") BigDecimal triggerPrice, @QueryParam("trigger") Trigger trigger, @QueryParam("advanced") AdvancedOptions advanced, @QueryParam("mmp") Boolean mmp, @HeaderParam("Authorization") si.mazi.rescu.ParamsDigest auth) throws DeribitException, IOException
      Places a buy order for an instrument.
      Parameters:
      instrumentName - required, Instrument name
      amount - required, It represents the requested order size. For perpetual and futures the amount is in USD units, for options it is amount of corresponding cryptocurrency contracts, e.g., BTC or ETH
      type - optional, The order type, default: "limit"
      label - optional, user defined label for the order (maximum 32 characters)
      price - optional, The order price in base currency (Only for limit and stop_limit orders) When adding order with advanced=usd, the field price should be the option price value in USD. When adding order with advanced=implv, the field price should be a value of implied volatility in percentages. For example, price=100, means implied volatility of 100%
      timeInForce - optional, Specifies how long the order remains in effect. Default "good_til_cancelled" "good_til_cancelled" - unfilled order remains in order book until cancelled "fill_or_kill" - execute a transaction immediately and completely or not at all "immediate_or_cancel" - execute a transaction immediately, and any portion of the order that cannot be immediately filled is cancelled
      maxShow - optional, Maximum amount within an order to be shown to other customers, 0 for invisible order
      postOnly - optional, If true, the order is considered post-only. If the new price would cause the order to be filled immediately (as taker), the price will be changed to be just below the bid. Only valid in combination with time_in_force="good_til_cancelled"
      rejectPostOnly - optional, If an order is considered post-only and this field is set to true then the order is put to order book unmodified or request is rejected and order is canceled. Only valid in combination with "post_only" set to true
      reduceOnly - optional, If true, the order is considered reduce-only which is intended to only reduce a current position
      triggerPrice - optional, Trigger price, required for trigger orders only (Stop-loss or Take-profit orders)
      trigger - optional, Defines trigger type, required for "stop_limit", "stop_market", "take_limit" or "take_market" order types
      advanced - optional, Advanced option order type. (Only for options)
      mmp - optional, Order MMP flag, only for order_type 'limit'
      Throws:
      DeribitException
      IOException
      See Also:
    • sell

      @GET @Path("sell") DeribitResponse<OrderPlacement> sell(@QueryParam("instrument_name") String instrumentName, @QueryParam("amount") BigDecimal amount, @QueryParam("type") OrderType type, @QueryParam("label") String label, @QueryParam("price") BigDecimal price, @QueryParam("time_in_force") TimeInForce timeInForce, @QueryParam("max_show") BigDecimal maxShow, @QueryParam("post_only") Boolean postOnly, @QueryParam("reject_post_only") Boolean rejectPostOnly, @QueryParam("reduce_only") Boolean reduceOnly, @QueryParam("trigger_price") BigDecimal triggerPrice, @QueryParam("trigger") Trigger trigger, @QueryParam("advanced") AdvancedOptions advanced, @QueryParam("mmp") Boolean mmp, @HeaderParam("Authorization") si.mazi.rescu.ParamsDigest auth) throws DeribitException, IOException
      Places a sell order for an instrument.
      Throws:
      DeribitException
      IOException
      See Also:
    • edit

      @GET @Path("edit") DeribitResponse<OrderPlacement> edit(@QueryParam("order_id") String orderId, @QueryParam("amount") BigDecimal amount, @QueryParam("price") BigDecimal price, @QueryParam("post_only") Boolean postOnly, @QueryParam("reject_post_only") Boolean rejectPostOnly, @QueryParam("reduce_only") Boolean reduceOnly, @QueryParam("trigger_price") BigDecimal triggerPrice, @QueryParam("advanced") AdvancedOptions advanced, @QueryParam("mmp") Boolean mmp, @HeaderParam("Authorization") si.mazi.rescu.ParamsDigest auth) throws DeribitException, IOException
      Changes price, amount and/or other properties of an order.
      Throws:
      DeribitException
      IOException
      See Also:
    • cancel

      @GET @Path("cancel") DeribitResponse<Order> cancel(@QueryParam("order_id") String orderId, @HeaderParam("Authorization") si.mazi.rescu.ParamsDigest auth) throws DeribitException, IOException
      Cancels an order, specified by order id.
      Parameters:
      orderId - required, The order id
      Throws:
      DeribitException
      IOException
      See Also:
    • cancelByLabel

      @GET @Path("cancel_by_label") DeribitResponse<Integer> cancelByLabel(@QueryParam("label") String label, @HeaderParam("Authorization") si.mazi.rescu.ParamsDigest auth) throws DeribitException, IOException
      Cancels orders by label. All user's orders (trigger orders too), with given label are canceled in all currencies
      Parameters:
      label - user defined label for the order (maximum 64 characters)
      Throws:
      DeribitException
      IOException
      See Also:
    • cancelAll

      @GET @Path("cancel_all") DeribitResponse<Integer> cancelAll(@HeaderParam("Authorization") si.mazi.rescu.ParamsDigest auth) throws DeribitException, IOException
      This method cancels all users orders and trigger orders within all currencies and instrument kinds.
      Throws:
      DeribitException
      IOException
      See Also:
    • getOpenOrdersByCurrency

      @GET @Path("get_open_orders_by_currency") DeribitResponse<List<Order>> getOpenOrdersByCurrency(@QueryParam("currency") String currency, @QueryParam("kind") Kind kind, @QueryParam("type") String type, @HeaderParam("Authorization") si.mazi.rescu.ParamsDigest auth) throws DeribitException, IOException
      Retrieves list of user's open orders.
      Parameters:
      currency - required, The currency symbol
      kind - optional, Instrument kind, if not provided instruments of all kinds are considered. One of: "future", "option"
      type - optional, Order type, one of (all, limit, stop_all, stop_limit, stop_market), default - all
      Throws:
      DeribitException
      IOException
      See Also:
    • getOpenOrdersByInstrument

      @GET @Path("get_open_orders_by_instrument") DeribitResponse<List<Order>> getOpenOrdersByInstrument(@QueryParam("instrument_name") String instrumentName, @QueryParam("type") String type, @HeaderParam("Authorization") si.mazi.rescu.ParamsDigest auth) throws DeribitException, IOException
      Retrieves list of user's open orders within given Instrument.
      Parameters:
      instrumentName - required, Instrument name
      type - optional, Order type, one of (all, limit, stop_all, stop_limit, stop_market), default - all
      Throws:
      DeribitException
      IOException
      See Also:
    • getUserTradesByCurrency

      @GET @Path("get_user_trades_by_currency") DeribitResponse<UserTrades> getUserTradesByCurrency(@QueryParam("currency") String currency, @QueryParam("kind") Kind kind, @QueryParam("start_id") String startId, @QueryParam("end_id") String endId, @QueryParam("count") Integer count, @QueryParam("include_old") Boolean includeOld, @QueryParam("sorting") String sorting, @HeaderParam("Authorization") si.mazi.rescu.ParamsDigest auth) throws DeribitException, IOException
      Retrieves the latest user trades that have occurred for instruments in a specific currency symbol.
      Throws:
      DeribitException
      IOException
      See Also:
    • getUserTradesByCurrencyAndTime

      @GET @Path("get_user_trades_by_currency") DeribitResponse<UserTrades> getUserTradesByCurrencyAndTime(@QueryParam("currency") String currency, @QueryParam("kind") Kind kind, @QueryParam("start_timestamp") long startTimestamp, @QueryParam("end_timestamp") long endTimestamp, @QueryParam("count") Integer count, @QueryParam("include_old") Boolean includeOld, @QueryParam("sorting") String sorting, @HeaderParam("Authorization") si.mazi.rescu.ParamsDigest auth) throws DeribitException, IOException
      Retrieves the latest user trades that have occurred for instruments in a specific currency symbol and within given time range.
      Throws:
      DeribitException
      IOException
      See Also:
    • getUserTradesByInstrument

      @GET @Path("get_user_trades_by_instrument") DeribitResponse<UserTrades> getUserTradesByInstrument(@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, @HeaderParam("Authorization") si.mazi.rescu.ParamsDigest auth) throws DeribitException, IOException
      Retrieves the latest user 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)
      Throws:
      DeribitException
      IOException
      See Also:
    • getUserTradesByInstrumentAndTime

      @GET @Path("get_user_trades_by_instrument_and_time") DeribitResponse<UserTrades> getUserTradesByInstrumentAndTime(@QueryParam("instrument_name") String instrumentName, @QueryParam("start_timestamp") long startTimestamp, @QueryParam("end_timestamp") long endTimestamp, @QueryParam("count") Integer count, @QueryParam("include_old") Boolean includeOld, @QueryParam("sorting") String sorting, @HeaderParam("Authorization") si.mazi.rescu.ParamsDigest auth) throws DeribitException, IOException
      Retrieves the latest user trades that have occurred for a specific instrument and within given time range.
      Parameters:
      instrumentName - required Instrument name
      startTimestamp - required The earliest timestamp to return result for
      endTimestamp - required The most recent timestamp to return result for
      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)
      Throws:
      DeribitException
      IOException
      See Also:
    • getPositions

      @GET @Path("get_positions") DeribitResponse<List<Position>> getPositions(@QueryParam("currency") String currency, @QueryParam("kind") Kind kind, @HeaderParam("Authorization") si.mazi.rescu.ParamsDigest auth) throws DeribitException, IOException
      Retrieves user positions.
      Parameters:
      currency - BTC, ETH
      kind - Kind filter on positions
      Throws:
      DeribitException
      IOException
      See Also:
    • getSettlementHistoryByInstrument

      @GET @Path("get_settlement_history_by_instrument") DeribitResponse<UserSettlements> getSettlementHistoryByInstrument(@QueryParam("instrument_name") String instrumentName, @QueryParam("type") SettlementType type, @QueryParam("count") Integer count, @QueryParam("continuation") String continuation, @HeaderParam("Authorization") si.mazi.rescu.ParamsDigest auth) throws DeribitException, IOException
      Retrieves public settlement, delivery and bankruptcy events filtered by instrument name.
      Parameters:
      instrumentName - required - Instrument name
      type - optional - Settlement type
      count - optional - Number of requested items, default - 20
      continuation - optional - Continuation string for pagination
      Throws:
      DeribitException
      IOException
      See Also:
    • getOrderHistoryByCurrency

      @GET @Path("get_order_history_by_instrument") DeribitResponse<List<Order>> getOrderHistoryByCurrency(@QueryParam("currency") String currency, @QueryParam("kind") Kind kind, @QueryParam("count") Integer count, @QueryParam("offset") Integer offset, @QueryParam("include_old") Boolean includeOld, @QueryParam("include_unfilled") Boolean includeUnfilled, @HeaderParam("Authorization") si.mazi.rescu.ParamsDigest auth) throws DeribitException, IOException
      Retrieves history of orders that have been partially or fully filled.
      Throws:
      DeribitException
      IOException
      See Also:
    • getOrderHistoryByInstrument

      @GET @Path("get_order_history_by_instrument") DeribitResponse<List<Order>> getOrderHistoryByInstrument(@QueryParam("instrument_name") String instrumentName, @QueryParam("count") Integer count, @QueryParam("offset") Integer offset, @QueryParam("include_old") Boolean includeOld, @QueryParam("include_unfilled") Boolean includeUnfilled, @HeaderParam("Authorization") si.mazi.rescu.ParamsDigest auth) throws DeribitException, IOException
      Retrieves history of orders that have been partially or fully filled.
      Parameters:
      instrumentName - required - Instrument name
      count - optional - Number of requested items, default - 20
      offset - optional - The offset for pagination, default - 0
      includeOld - optional - Include orders older than 2 days, default - false
      includeUnfilled - optional - Include fully unfilled closed orders, default - false
      Throws:
      DeribitException
      IOException
      See Also:
    • getOrderState

      @GET @Path("get_order_state") DeribitResponse<Order> getOrderState(@QueryParam("order_id") String orderId, @HeaderParam("Authorization") si.mazi.rescu.ParamsDigest auth) throws DeribitException, IOException
      Retrieve the current state of an order
      Throws:
      DeribitException
      IOException
      See Also: