Package org.knowm.xchange.deribit.v2
Interface DeribitAuthenticated
@Path("/api/v2/private")
@Produces("application/json")
public interface DeribitAuthenticated
-
Method Summary
Modifier and Type Method Description DeribitResponse<OrderPlacement>
buy(String instrumentName, BigDecimal amount, OrderType type, String label, BigDecimal price, TimeInForce timeInForce, BigDecimal maxShow, Boolean postOnly, Boolean rejectPostOnly, Boolean reduceOnly, BigDecimal triggerPrice, Trigger trigger, AdvancedOptions advanced, Boolean mmp, si.mazi.rescu.ParamsDigest auth)
Places a buy order for an instrument.DeribitResponse<Order>
cancel(String orderId, si.mazi.rescu.ParamsDigest auth)
Cancels an order, specified by order id.DeribitResponse<Integer>
cancelAll(si.mazi.rescu.ParamsDigest auth)
This method cancels all users orders and trigger orders within all currencies and instrument kinds.DeribitResponse<Integer>
cancelByLabel(String label, si.mazi.rescu.ParamsDigest auth)
Cancels orders by label.DeribitResponse<OrderPlacement>
edit(String orderId, BigDecimal amount, BigDecimal price, Boolean postOnly, Boolean rejectPostOnly, Boolean reduceOnly, BigDecimal triggerPrice, AdvancedOptions advanced, Boolean mmp, si.mazi.rescu.ParamsDigest auth)
Changes price, amount and/or other properties of an order.DeribitResponse<AccountSummary>
getAccountSummary(String currency, Boolean extended, si.mazi.rescu.ParamsDigest auth)
Retrieves user account summary.DeribitResponse<List<Order>>
getOpenOrdersByCurrency(String currency, Kind kind, String type, si.mazi.rescu.ParamsDigest auth)
Retrieves list of user's open orders.DeribitResponse<List<Order>>
getOpenOrdersByInstrument(String instrumentName, String type, si.mazi.rescu.ParamsDigest auth)
Retrieves list of user's open orders within given Instrument.DeribitResponse<List<Order>>
getOrderHistoryByCurrency(String currency, Kind kind, Integer count, Integer offset, Boolean includeOld, Boolean includeUnfilled, si.mazi.rescu.ParamsDigest auth)
Retrieves history of orders that have been partially or fully filled.DeribitResponse<List<Order>>
getOrderHistoryByInstrument(String instrumentName, Integer count, Integer offset, Boolean includeOld, Boolean includeUnfilled, si.mazi.rescu.ParamsDigest auth)
Retrieves history of orders that have been partially or fully filled.DeribitResponse<Order>
getOrderState(String orderId, si.mazi.rescu.ParamsDigest auth)
Retrieve the current state of an orderDeribitResponse<List<Position>>
getPositions(String currency, Kind kind, si.mazi.rescu.ParamsDigest auth)
Retrieves user positions.DeribitResponse<UserSettlements>
getSettlementHistoryByInstrument(String instrumentName, SettlementType type, Integer count, String continuation, si.mazi.rescu.ParamsDigest auth)
Retrieves public settlement, delivery and bankruptcy events filtered by instrument name.DeribitResponse<UserTrades>
getUserTradesByCurrency(String currency, Kind kind, String startId, String endId, Integer count, Boolean includeOld, String sorting, si.mazi.rescu.ParamsDigest auth)
Retrieves the latest user trades that have occurred for instruments in a specific currency symbol.DeribitResponse<UserTrades>
getUserTradesByCurrencyAndTime(String currency, Kind kind, long startTimestamp, long endTimestamp, Integer count, Boolean includeOld, String sorting, si.mazi.rescu.ParamsDigest auth)
Retrieves the latest user trades that have occurred for instruments in a specific currency symbol and within given time range.DeribitResponse<UserTrades>
getUserTradesByInstrument(String instrumentName, Integer startSeq, Integer endSeq, Integer count, Boolean includeOld, String sorting, si.mazi.rescu.ParamsDigest auth)
Retrieves the latest user trades that have occurred for a specific instrument.DeribitResponse<UserTrades>
getUserTradesByInstrumentAndTime(String instrumentName, long startTimestamp, long endTimestamp, Integer count, Boolean includeOld, String sorting, si.mazi.rescu.ParamsDigest auth)
Retrieves the latest user trades that have occurred for a specific instrument and within given time range.DeribitResponse<OrderPlacement>
sell(String instrumentName, BigDecimal amount, OrderType type, String label, BigDecimal price, TimeInForce timeInForce, BigDecimal maxShow, Boolean postOnly, Boolean rejectPostOnly, Boolean reduceOnly, BigDecimal triggerPrice, Trigger trigger, AdvancedOptions advanced, Boolean mmp, si.mazi.rescu.ParamsDigest auth)
Places a sell order for an instrument.
-
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, IOExceptionRetrieves user account summary.- Parameters:
currency
- required, The currency symbol, BTC or ETHextended
- Include additional fields- Throws:
DeribitException
IOException
- See Also:
- docs.deribit.com
-
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, IOExceptionPlaces a buy order for an instrument.- Parameters:
instrumentName
- required, Instrument nameamount
- 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 ETHtype
- 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 cancelledmaxShow
- optional, Maximum amount within an order to be shown to other customers, 0 for invisible orderpostOnly
- 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 truereduceOnly
- optional, If true, the order is considered reduce-only which is intended to only reduce a current positiontriggerPrice
- 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 typesadvanced
- optional, Advanced option order type. (Only for options)mmp
- optional, Order MMP flag, only for order_type 'limit'- Throws:
DeribitException
IOException
- See Also:
- docs.deribit.com
-
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, IOExceptionPlaces a sell order for an instrument.- Throws:
DeribitException
IOException
- See Also:
- docs.deribit.com
-
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, IOExceptionChanges price, amount and/or other properties of an order.- Throws:
DeribitException
IOException
- See Also:
- docs.deribit.com
-
cancel
@GET @Path("cancel") DeribitResponse<Order> cancel(@QueryParam("order_id") String orderId, @HeaderParam("Authorization") si.mazi.rescu.ParamsDigest auth) throws DeribitException, IOExceptionCancels an order, specified by order id.- Parameters:
orderId
- required, The order id- Throws:
DeribitException
IOException
- See Also:
- docs.deribit.com
-
cancelByLabel
@GET @Path("cancel_by_label") DeribitResponse<Integer> cancelByLabel(@QueryParam("label") String label, @HeaderParam("Authorization") si.mazi.rescu.ParamsDigest auth) throws DeribitException, IOExceptionCancels 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:
- docs.deribit.com
-
cancelAll
@GET @Path("cancel_all") DeribitResponse<Integer> cancelAll(@HeaderParam("Authorization") si.mazi.rescu.ParamsDigest auth) throws DeribitException, IOExceptionThis method cancels all users orders and trigger orders within all currencies and instrument kinds.- Throws:
DeribitException
IOException
- See Also:
- docs.deribit.com
-
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, IOExceptionRetrieves list of user's open orders.- Parameters:
currency
- required, The currency symbolkind
- 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:
- docs.deribit.com
-
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, IOExceptionRetrieves list of user's open orders within given Instrument.- Parameters:
instrumentName
- required, Instrument nametype
- optional, Order type, one of (all, limit, stop_all, stop_limit, stop_market), default - all- Throws:
DeribitException
IOException
- See Also:
- docs.deribit.com
-
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, IOExceptionRetrieves the latest user trades that have occurred for instruments in a specific currency symbol.- Throws:
DeribitException
IOException
- See Also:
- docs.deribit.com
-
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, IOExceptionRetrieves the latest user trades that have occurred for instruments in a specific currency symbol and within given time range.- Throws:
DeribitException
IOException
- See Also:
- docs.deribit.com
-
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, IOExceptionRetrieves the latest user trades that have occurred for a specific instrument.- Parameters:
instrumentName
- required Instrument namestartSeq
- optional The sequence number of the first trade to be returnedendSeq
- optional The sequence number of the last trade to be returnedcount
- optional Number of requested items, default - 10includeOld
- optional Include trades older than 7 days, default - falsesorting
- 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:
- docs.deribit.com
-
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, IOExceptionRetrieves the latest user trades that have occurred for a specific instrument and within given time range.- Parameters:
instrumentName
- required Instrument namestartTimestamp
- required The earliest timestamp to return result forendTimestamp
- required The most recent timestamp to return result forcount
- optional Number of requested items, default - 10includeOld
- optional Include trades older than 7 days, default - falsesorting
- 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:
- docs.deribit.com
-
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, IOExceptionRetrieves user positions.- Parameters:
currency
- BTC, ETHkind
- Kind filter on positions- Throws:
DeribitException
IOException
- See Also:
- docs.deribit.com
-
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, IOExceptionRetrieves public settlement, delivery and bankruptcy events filtered by instrument name.- Parameters:
instrumentName
- required - Instrument namecount
- optional - Number of requested items, default - 20type
- optional - Settlement typecontinuation
- optional - Continuation string for pagination- Throws:
DeribitException
IOException
- See Also:
- docs.deribit.com
-
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, IOExceptionRetrieves history of orders that have been partially or fully filled.- Throws:
DeribitException
IOException
- See Also:
- docs.deribit.com
-
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, IOExceptionRetrieves history of orders that have been partially or fully filled.- Parameters:
instrumentName
- required - Instrument namecount
- optional - Number of requested items, default - 20offset
- optional - The offset for pagination, default - 0includeOld
- optional - Include orders older than 2 days, default - falseincludeUnfilled
- optional - Include fully unfilled closed orders, default - false- Throws:
DeribitException
IOException
- See Also:
- docs.deribit.com
-
getOrderState
@GET @Path("get_order_state") DeribitResponse<Order> getOrderState(@QueryParam("order_id") String orderId, @HeaderParam("Authorization") si.mazi.rescu.ParamsDigest auth) throws DeribitException, IOExceptionRetrieve the current state of an order- Throws:
DeribitException
IOException
- See Also:
- docs.deribit.com
-