Interface BitmexAuthenticated

All Superinterfaces:
Bitmex

@Path("api/v1") @Produces("application/json") public interface BitmexAuthenticated extends Bitmex
  • Method Details

    • getExecutions

      @GET @Path("execution") HttpResponseAwareList<BitmexPrivateExecution> getExecutions(@HeaderParam("api-key") String apiKey, @HeaderParam("api-expires") si.mazi.rescu.SynchronizedValueFactory<Long> nonce, @HeaderParam("api-signature") si.mazi.rescu.ParamsDigest paramsDigest, @Nullable @QueryParam("symbol") String symbol, @Nullable @QueryParam("filter") String filter, @Nullable @QueryParam("columns") String columns, @Nullable @QueryParam("count") Integer count, @Nullable @QueryParam("start") Long start, @Nullable @QueryParam("reverse") Boolean reverse, @Nullable @QueryParam("startTime") Date startTime, @Nullable @QueryParam("endTime") Date endTime) throws IOException, BitmexException
      Get all raw executions for your account. This returns all raw transactions, which includes order opening and cancelation, and order status changes. It can be quite noisy. More focused information is available at /execution/tradeHistory.
      Throws:
      IOException
      BitmexException
    • getTradeHistory

      @GET @Path("execution/tradeHistory") HttpResponseAwareList<BitmexPrivateExecution> getTradeHistory(@HeaderParam("api-key") String apiKey, @HeaderParam("api-expires") si.mazi.rescu.SynchronizedValueFactory<Long> nonce, @HeaderParam("api-signature") si.mazi.rescu.ParamsDigest paramsDigest, @Nullable @QueryParam("symbol") String symbol, @Nullable @QueryParam("filter") String filter, @Nullable @QueryParam("columns") String columns, @Nullable @QueryParam("count") Integer count, @Nullable @QueryParam("start") Long start, @Nullable @QueryParam("reverse") Boolean reverse, @Nullable @QueryParam("startTime") Date startTime, @Nullable @QueryParam("endTime") Date endTime) throws IOException, BitmexException
      Get all balance-affecting executions. This includes each trade, insurance charge, and settlement.
      Throws:
      IOException
      BitmexException
    • getOrders

      @GET @Path("order") BitmexPrivateOrderList getOrders(@HeaderParam("api-key") String apiKey, @HeaderParam("api-expires") si.mazi.rescu.SynchronizedValueFactory<Long> nonce, @HeaderParam("api-signature") si.mazi.rescu.ParamsDigest paramsDigest, @Nullable @QueryParam("symbol") String symbol, @Nullable @QueryParam("filter") String filter, @Nullable @QueryParam("columns") String columns, @Nullable @QueryParam("count") Integer count, @Nullable @QueryParam("start") Long start, @Nullable @QueryParam("reverse") Boolean reverse, @Nullable @QueryParam("startTime") Date startTime, @Nullable @QueryParam("endTime") Date endTime) throws IOException, BitmexException
      Parameters:
      apiKey -
      nonce -
      paramsDigest -
      symbol - Instrument symbol. Send a bare series (e.g. XBU) to get data for the nearest expiring contract in that series. You can also send a timeframe, e.g. XBU:monthly. Timeframes are daily, weekly, monthly, quarterly, and biquarterly.
      filter - Generic table filter. Send JSON key/value pairs, such as {"key": "value"}. You can key on individual fields, and do more advanced querying on timestamps. See the Timestamp Docs for more details.
      columns - Generic table filter. Send JSON key/value pairs, such as {"key": "value"}. You can key on individual fields, and do more advanced querying on timestamps. See the Timestamp Docs for more details.
      count - Number of results to fetch.
      start - Starting point for results.
      reverse - If true, will sort results newest first.
      startTime - Starting date filter for results.
      endTime - Ending date filter for results.
      Returns:
      BitmexPrivateOrderList containing the requested order(s).
      Throws:
      IOException
      BitmexException
    • placeOrder

      @POST @Path("order") BitmexPrivateOrder placeOrder(@HeaderParam("api-key") String apiKey, @HeaderParam("api-expires") si.mazi.rescu.SynchronizedValueFactory<Long> nonce, @HeaderParam("api-signature") si.mazi.rescu.ParamsDigest paramsDigest, @FormParam("symbol") String symbol, @Nullable @FormParam("side") String side, @Nullable @FormParam("orderQty") BigDecimal orderQuantity, @Nullable @FormParam("simpleOrderQty") BigDecimal simpleOrderQuantity, @Nullable @FormParam("displayQty") BigDecimal displayQuantity, @Nullable @FormParam("price") BigDecimal price, @Nullable @FormParam("stopPx") BigDecimal stopPrice, @Nullable @FormParam("ordType") String orderType, @Nullable @FormParam("clOrdID") String clOrdID, @Nullable @FormParam("execInst") String executionInstructions, @Nullable @FormParam("clOrdLinkID") String clOrdLinkID, @Nullable @FormParam("contingencyType") String contingencyType, @Nullable @FormParam("pegOffsetValue") BigDecimal pegOffsetValue, @Nullable @FormParam("pegPriceType") String pegPriceType, @Nullable @FormParam("timeInForce") String timeInForce, @Nullable @FormParam("text") String text) throws IOException, BitmexException
      Parameters:
      apiKey -
      nonce -
      paramsDigest -
      symbol - Instrument symbol. e.g. XBTUSD.
      side - Optional Order side. Valid options: Buy, Sell. Defaults to Buy unless orderQty or simpleOrderQty is negative.
      orderQuantity - Optional Order quantity in units of the instrument (i.e. contracts).
      simpleOrderQuantity - Optional Order quantity in units of the underlying instrument (i.e. Bitcoin).
      displayQuantity - Optional quantity to display in the book. Use 0 for a fully hidden order.
      price - Optional limit price for Limit, StopLimit, and LimitIfTouched orders.
      stopPrice - Optional trigger price for Stop, StopLimit, MarketIfTouched, and LimitIfTouched orders. Use a price below the current price for stop-sell orders and buy-if-touched orders. Use execInst of MarkPrice or LastPrice to define the current price used for triggering.
      orderType - Optional Order type. Valid options: Market, Limit, Stop, StopLimit, MarketIfTouched, LimitIfTouched, MarketWithLeftOverAsLimit, Pegged. Defaults to Limit when price is specified. Defaults to Stop when stopPx is specified. Defaults to StopLimit when price and stopPx are specified.
      clOrdID - Optional Client Order ID. This clOrdID will come back on the order and any related executions.
      executionInstructions - Optional execution instructions. Valid options: ParticipateDoNotInitiate, AllOrNone, MarkPrice, IndexPrice, LastPrice, Close, ReduceOnly, Fixed. AllOrNone instruction requires displayQty to be 0. MarkPrice, IndexPrice or LastPrice instruction valid for Stop, StopLimit, MarketIfTouched, and LimitIfTouched orders.
      clOrdLinkID - Optional Client Order Link ID for contingent orders.
      contingencyType - Optional contingency type for use with clOrdLinkID. Valid options: OneCancelsTheOther, OneTriggersTheOther, OneUpdatesTheOtherAbsolute, OneUpdatesTheOtherProportional.
      pegOffsetValue - Optional trailing offset from the current price for Stop, StopLimit, MarketIfTouched, and LimitIfTouched orders; use a negative offset for stop-sell orders and buy-if-touched orders. Optional offset from the peg price for Pegged orders.
      pegPriceType - Optional peg price type. Valid options: LastPeg, MidPricePeg, MarketPeg, PrimaryPeg, TrailingStopPeg.
      timeInForce - Optional Time in force. Valid options: Day, GoodTillCancel, ImmediateOrCancel, FillOrKill. Defaults to GoodTillCancel for Limit, StopLimit, LimitIfTouched, and MarketWithLeftOverAsLimit orders.
      text - Optional order annotation. e.g. Take profit.
      Returns:
      BitmexPrivateOrder contains the result of the call.
      Throws:
      IOException
      BitmexException
    • replaceOrder

      @PUT @Path("order") @Consumes("application/x-www-form-urlencoded") BitmexPrivateOrder replaceOrder(@HeaderParam("api-key") String apiKey, @HeaderParam("api-expires") si.mazi.rescu.SynchronizedValueFactory<Long> nonce, @HeaderParam("api-signature") si.mazi.rescu.ParamsDigest paramsDigest, @Nullable @FormParam("orderID") String orderId, @Nullable @FormParam("origClOrdID") String origClOrdID, @Nullable @FormParam("clOrdID") String clOrdID, @Nullable @FormParam("simpleOrderQty") BigDecimal simpleOrderQty, @Nullable @FormParam("orderQty") BigDecimal orderQuantity, @Nullable @FormParam("simpleLeavesQty") BigDecimal simpleLeavesQty, @Nullable @FormParam("leavesQty") BigDecimal leavesQty, @Nullable @FormParam("price") BigDecimal price, @Nullable @FormParam("stopPx") BigDecimal stopPrice, @Nullable @FormParam("pegOffsetValue") BigDecimal pegOffsetValue, @Nullable @FormParam("text") String text) throws IOException, BitmexException
      Parameters:
      apiKey -
      nonce -
      paramsDigest -
      orderId - Order ID
      origClOrdID - Client Order ID. See
      invalid @link
      Bitmex#placeOrder
      .
      clOrdID - Optional new Client Order ID, requires origClOrdID.
      simpleOrderQty - Optional order quantity in units of the underlying instrument (i.e. Bitcoin).
      orderQuantity - Optional order quantity in units of the instrument (i.e. contracts).
      simpleLeavesQty - Optional leaves quantity in units of the underlying instrument (i.e. Bitcoin). Useful for amending partially filled orders.
      leavesQty - Optional leaves quantity in units of the instrument (i.e. contracts). Useful for amending partially filled orders.
      price - Optional limit price for Limit, StopLimit, and LimitIfTouched orders.
      stopPrice - Optional trigger price for Stop, StopLimit, MarketIfTouched, and LimitIfTouched orders. Use a price below the current price for stop-sell orders and buy-if-touched orders.
      pegOffsetValue - Optional trailing offset from the current price for Stop, StopLimit, MarketIfTouched, and LimitIfTouched orders; use a negative offset for stop-sell orders and buy-if-touched orders. Optional offset from the peg price for Pegged orders.
      text - Optional amend annotation. e.g. Adjust skew.
      Returns:
      BitmexPrivateOrder contains the result of the call.
      Throws:
      IOException
      BitmexException
    • placeOrderBulk

      @POST @Path("order/bulk") BitmexPrivateOrderList placeOrderBulk(@HeaderParam("api-key") String apiKey, @HeaderParam("api-expires") si.mazi.rescu.SynchronizedValueFactory<Long> nonce, @HeaderParam("api-signature") si.mazi.rescu.ParamsDigest paramsDigest, @FormParam("orders") String orderCommands) throws IOException, BitmexException
      Parameters:
      apiKey -
      nonce -
      paramsDigest -
      orderCommands - JSON Array of order(s). Use PlaceOrderCommand to generate JSON.
      Returns:
      BitmexPrivateOrderList contains the results of the call.
      Throws:
      IOException
      BitmexException
    • replaceOrderBulk

      @PUT @Path("order/bulk") @Consumes("application/x-www-form-urlencoded") BitmexPrivateOrderList replaceOrderBulk(@HeaderParam("api-key") String apiKey, @HeaderParam("api-expires") si.mazi.rescu.SynchronizedValueFactory<Long> nonce, @HeaderParam("api-signature") si.mazi.rescu.ParamsDigest paramsDigest, @FormParam("orders") String orderCommands) throws IOException, BitmexException
      Parameters:
      apiKey -
      nonce -
      paramsDigest -
      orderCommands - JSON Array of order(s). Use ReplaceOrderCommand to generate JSON.
      Returns:
      BitmexPrivateOrderList contains the results of the call.
      Throws:
      IOException
      BitmexException
    • cancelOrder

      @DELETE @Path("order") BitmexPrivateOrderList cancelOrder(@HeaderParam("api-key") String apiKey, @HeaderParam("api-expires") si.mazi.rescu.SynchronizedValueFactory<Long> nonce, @HeaderParam("api-signature") si.mazi.rescu.ParamsDigest paramsDigest, @Nullable @FormParam("orderID") String orderID, @Nullable @FormParam("clOrdID") String clOrdID) throws IOException, BitmexException
      Either an orderID or a clOrdID must be provided.
      Parameters:
      apiKey -
      nonce -
      paramsDigest -
      orderID - Order ID(s).
      clOrdID - Client Order ID(s). See
      invalid @link
      Bitmex#placeOrder
      .
      Returns:
      BitmexPrivateOrderList contains the results of the call.
      Throws:
      IOException
      BitmexException
    • cancelAllOrders

      @DELETE @Path("order/all") BitmexPrivateOrderList cancelAllOrders(@HeaderParam("api-key") String apiKey, @HeaderParam("api-expires") si.mazi.rescu.SynchronizedValueFactory<Long> nonce, @HeaderParam("api-signature") si.mazi.rescu.ParamsDigest paramsDigest, @Nullable @FormParam("symbol") String symbol, @Nullable @FormParam("filter") String filter, @Nullable @FormParam("text") String text) throws IOException, BitmexException
      Parameters:
      apiKey -
      nonce -
      paramsDigest -
      symbol - Optional symbol. If provided, only cancels orders for that symbol.
      filter - Optional filter for cancellation. Use to only cancel some orders, e.g. {"side": "Buy"}.
      text - Optional cancellation annotation. e.g. 'Spread Exceeded'
      Returns:
      BitmexPrivateOrderList contains the results of the call.
      Throws:
      IOException
      BitmexException
    • cancelAllAfter

      @POST @Path("order/cancelAllAfter") BitmexCancelAll cancelAllAfter(@HeaderParam("api-key") String apiKey, @HeaderParam("api-expires") si.mazi.rescu.SynchronizedValueFactory<Long> nonce, @HeaderParam("api-signature") si.mazi.rescu.ParamsDigest paramsDigest, @FormParam("timeout") long timeout) throws IOException, BitmexException
      Useful as a dead-man's switch to ensure your orders are canceled in case of an outage. If called repeatedly, the existing offset will be canceled and a new one will be inserted in its place. Example usage: call this route at 15s intervals with an offset of 60000 (60s). If this route is not called within 60 seconds, all your orders will be automatically canceled.
      Parameters:
      timeout - Timeout in ms. Set to 0 to cancel this timer.
      Returns:
      BitmexPrivateOrderList contains the results of the call.
      Throws:
      IOException
      BitmexException
    • updateLeveragePosition

      @POST @Path("position/leverage") BitmexPosition updateLeveragePosition(@HeaderParam("api-key") String apiKey, @HeaderParam("api-expires") si.mazi.rescu.SynchronizedValueFactory<Long> nonce, @HeaderParam("api-signature") si.mazi.rescu.ParamsDigest paramsDigest, @FormParam("symbol") String symbol, @FormParam("leverage") BigDecimal leverage) throws IOException, BitmexException
      Throws:
      IOException
      BitmexException
    • getPositions

      @GET @Path("position") BitmexPositionList getPositions(@HeaderParam("api-key") String apiKey, @HeaderParam("api-expires") si.mazi.rescu.SynchronizedValueFactory<Long> nonce, @HeaderParam("api-signature") si.mazi.rescu.ParamsDigest paramsDigest) throws IOException, BitmexException
      Throws:
      IOException
      BitmexException
    • getPositions

      @GET @Path("position") BitmexPositionList getPositions(@HeaderParam("api-key") String apiKey, @HeaderParam("api-expires") si.mazi.rescu.SynchronizedValueFactory<Long> nonce, @HeaderParam("api-signature") si.mazi.rescu.ParamsDigest paramsDigest, @Nullable @QueryParam("filter") String filter) throws IOException, BitmexException
      Throws:
      IOException
      BitmexException
    • getAccount

      @GET @Path("user") BitmexAccount getAccount(@HeaderParam("api-key") String apiKey, @HeaderParam("api-expires") si.mazi.rescu.SynchronizedValueFactory<Long> nonce, @HeaderParam("api-signature") si.mazi.rescu.ParamsDigest paramsDigest) throws IOException, BitmexException
      Throws:
      IOException
      BitmexException
    • getWallet

      @GET @Path("user/wallet") BitmexWallet getWallet(@HeaderParam("api-key") String apiKey, @HeaderParam("api-expires") si.mazi.rescu.SynchronizedValueFactory<Long> nonce, @HeaderParam("api-signature") si.mazi.rescu.ParamsDigest paramsDigest) throws IOException, BitmexException
      Throws:
      IOException
      BitmexException
    • getWalletHistory

      @GET @Path("user/walletHistory") BitmexWalletTransactionList getWalletHistory(@HeaderParam("api-key") String apiKey, @HeaderParam("api-expires") si.mazi.rescu.SynchronizedValueFactory<Long> nonce, @HeaderParam("api-signature") si.mazi.rescu.ParamsDigest paramsDigest, @QueryParam("currency") String currency, @Nullable @QueryParam("count") Integer count, @Nullable @QueryParam("start") Long start) throws IOException, BitmexException
      Get a history of all of your wallet transactions (deposits, withdrawals, PNL)
      Throws:
      IOException
      BitmexException
    • getWalletSummary

      @GET @Path("user/walletSummary") BitmexWalletTransactionList getWalletSummary(@HeaderParam("api-key") String apiKey, @HeaderParam("api-expires") si.mazi.rescu.SynchronizedValueFactory<Long> nonce, @HeaderParam("api-signature") si.mazi.rescu.ParamsDigest paramsDigest, @Nullable @QueryParam("currency") String currency) throws IOException, BitmexException
      Get a summary of all of your wallet transactions (deposits, withdrawals, PNL)
      Throws:
      IOException
      BitmexException
    • getMarginAccountStatus

      @GET @Path("user/margin") BitmexMarginAccount getMarginAccountStatus(@HeaderParam("api-key") String apiKey, @HeaderParam("api-expires") si.mazi.rescu.SynchronizedValueFactory<Long> nonce, @HeaderParam("api-signature") si.mazi.rescu.ParamsDigest paramsDigest, @Nullable @QueryParam("currency") String currency) throws IOException, BitmexException
      Throws:
      IOException
      BitmexException
    • getMarginAccountsStatus

      @GET @Path("user/margin?currency=all") BitmexMarginAccountList getMarginAccountsStatus(@HeaderParam("api-key") String apiKey, @HeaderParam("api-expires") si.mazi.rescu.SynchronizedValueFactory<Long> nonce, @HeaderParam("api-signature") si.mazi.rescu.ParamsDigest paramsDigest) throws IOException, BitmexException
      Throws:
      IOException
      BitmexException
    • getDepositAddress

      @GET @Path("user/depositAddress") String getDepositAddress(@HeaderParam("api-key") String apiKey, @HeaderParam("api-expires") si.mazi.rescu.SynchronizedValueFactory<Long> nonce, @HeaderParam("api-signature") si.mazi.rescu.ParamsDigest paramsDigest, @QueryParam("currency") String currency) throws IOException, BitmexException
      Throws:
      IOException
      BitmexException
    • withdrawFunds

      @POST @Path("user/requestWithdrawal") BitmexWalletTransaction withdrawFunds(@HeaderParam("api-key") String apiKey, @HeaderParam("api-expires") si.mazi.rescu.SynchronizedValueFactory<Long> nonce, @HeaderParam("api-signature") si.mazi.rescu.ParamsDigest paramsDigest, @FormParam("currency") String currency, @FormParam("amount") BigDecimal amount, @FormParam("address") String address) throws IOException, BitmexException
      Throws:
      IOException
      BitmexException