Interface BybitApiService


  • public interface BybitApiService
    Bybit's REST API URL mappings and endpoint security configuration.
    • Method Detail

      • getServerTime

        @GET("/v5/market/time")
        retrofit2.Call<Object> getServerTime()
        Get Bybit Server Time

        https://bybit-exchange.github.io/docs/v5/market/time

        Returns:
        Response Parameters Parameter Type Comments timeSecond string Bybit server timestamp (sec) timeNano string Bybit server timestamp (nano)
      • getMarketLinesData

        @GET("/v5/market/kline")
        retrofit2.Call<Object> getMarketLinesData​(@Query("category")
                                                  String category,
                                                  @Query("symbol")
                                                  String symbol,
                                                  @Query("interval")
                                                  String interval,
                                                  @Query("start")
                                                  Long start,
                                                  @Query("end")
                                                  Long end,
                                                  @Query("limit")
                                                  Integer limit)
        Get Kline Query for historical klines (also known as candles/candlesticks). Charts are returned in groups based on the requested interval.

        Covers: Spot / USDT perpetual / USDC contract / Inverse contract

        https://bybit-exchange.github.io/docs/v5/market/time

        Parameters:
        category - true string Product type. spot,linear,inverse
        symbol - true string Symbol name
        interval - true string Kline interval. 1,3,5,15,30,60,120,240,360,720,D,M,W
        start - false integer The start timestamp (ms)
        end - false integer The end timestamp (ms)
        limit - false integer Limit for data size per page. [1, 1000]. Default: 200
        Returns:
        Response Parameters * Parameter Type Comments * category string Product type * symbol string Symbol name * list array * An string array of individual candle * Sort in reverse by startTime * > list[0]: startTime string Start time of the candle (ms) * > list[1]: openPrice string Open price * > list[2]: highPrice string Highest price * > list[3]: lowPrice string Lowest price * > list[4]: closePrice string Close price. Is the last traded price when the candle is not closed * > list[5]: volume string Trade volume. Unit of contract: pieces of contract. Unit of spot: quantity of coins * > list[6]: turnover string Turnover. Unit of figure: quantity of quota coin
      • getMarketPriceLinesData

        @GET("/v5/market/mark-price-kline")
        retrofit2.Call<Object> getMarketPriceLinesData​(@Query("category")
                                                       String category,
                                                       @Query("symbol")
                                                       String symbol,
                                                       @Query("interval")
                                                       String interval,
                                                       @Query("start")
                                                       Long start,
                                                       @Query("end")
                                                       Long end,
                                                       @Query("limit")
                                                       Integer limit)
        Query for historical mark price klines. Charts are returned in groups based on the requested interval. Covers: USDT perpetual / USDC contract / Inverse contract

        https://bybit-exchange.github.io/docs/v5/market/mark-kline

        Parameters:
        category - true string Product type. spot,linear,inverse
        symbol - true string Symbol name
        interval - true string Kline interval. 1,3,5,15,30,60,120,240,360,720,D,M,W
        start - false integer The start timestamp (ms)
        end - false integer The end timestamp (ms)
        limit - false integer Limit for data size per page. [1, 1000]. Default: 200
        Returns:
        Response Parameters Parameter Type Comments category string Product type symbol string Symbol name list array An string array of individual candle Sort in reverse by startTime > list[0]: startTime string Start time of the candle (ms) > list[1]: openPrice string Open price > list[2]: highPrice string Highest price > list[3]: lowPrice string Lowest price > list[4]: closePrice string Close price. Is the last traded price when the candle is not closed
      • getIndexPriceLinesData

        @GET("/v5/market/index-price-kline")
        retrofit2.Call<Object> getIndexPriceLinesData​(@Query("category")
                                                      String category,
                                                      @Query("symbol")
                                                      String symbol,
                                                      @Query("interval")
                                                      String interval,
                                                      @Query("start")
                                                      Long start,
                                                      @Query("end")
                                                      Long end,
                                                      @Query("limit")
                                                      Integer limit)
        Get Index Price Kline Query for historical index price klines. Charts are returned in groups based on the requested interval.

        Covers: USDT perpetual / USDC contract / Inverse contract

        https://bybit-exchange.github.io/docs/v5/market/index-kline

        Parameters:
        category - true string Product type. linear,inverse
        symbol - true string Symbol name
        interval - true string Kline interval. 1,3,5,15,30,60,120,240,360,720,D,M,W
        start - false integer The start timestamp (ms)
        end - false integer The end timestamp (ms)
        limit - false integer Limit for data size per page. [1, 1000]. Default: 200
        Returns:
        Response Parameters Parameter Type Comments category string Product type symbol string Symbol name list array An string array of individual candle Sort in reverse by startTime > list[0]: startTime string Start time of the candle (ms) > list[1]: openPrice string Open price > list[2]: highPrice string Highest price > list[3]: lowPrice string Lowest price > list[4]: closePrice string Close price. Is the last traded price when the candle is not closed
      • getPremiumIndexPriceLinesData

        @GET("/v5/market/premium-index-price-kline")
        retrofit2.Call<Object> getPremiumIndexPriceLinesData​(@Query("category")
                                                             String category,
                                                             @Query("symbol")
                                                             String symbol,
                                                             @Query("interval")
                                                             String interval,
                                                             @Query("start")
                                                             Long start,
                                                             @Query("end")
                                                             Long end,
                                                             @Query("limit")
                                                             Integer limit)
        Get Premium Index Price Kline Query for historical premium index klines. Charts are returned in groups based on the requested interval.

        Covers: USDT and USDC perpetual

        https://bybit-exchange.github.io/docs/v5/market/preimum-index-kline

        Parameters:
        category - true string Product type. linear
        symbol - true string Symbol name
        interval - true string Kline interval
        start - false integer The start timestamp (ms)
        end - false integer The end timestamp (ms)
        limit - false integer Limit for data size per page. [1, 1000]. Default: 200
        Returns:
        Response Parameters Parameter Type Comments category string Product type symbol string Symbol name list array An string array of individual candle Sort in reverse by start > list[0] string Start time of the candle (ms) > list[1] string Open price > list[2] string Highest price > list[3] string Lowest price > list[4] string Close price. Is the last traded price when the candle is not closed
      • getInstrumentsInfo

        @GET("/v5/market/instruments-info")
        retrofit2.Call<Object> getInstrumentsInfo​(@Query("category")
                                                  String category,
                                                  @Query("symbol")
                                                  String symbol,
                                                  @Query("status")
                                                  String status,
                                                  @Query("baseCoin")
                                                  String baseCoin,
                                                  @Query("limit")
                                                  Integer limit,
                                                  @Query("cursor")
                                                  String cursor)
        Get Instruments Info Query for the instrument specification of online trading pairs.

        Covers: Spot / USDT perpetual / USDC contract / Inverse contract / Option

        CAUTION Spot does not support pagination, so limit, cursor are invalid. When query by baseCoin, regardless of category=linear or inverse, the result will have USDT perpetual, USDC contract and Inverse contract symbols.

        https://bybit-exchange.github.io/docs/v5/market/instrument

        Parameters:
        category - true string Product type. spot,linear,inverse,option
        symbol - false string Symbol name
        status - false string Symbol status filter spot/linear/inverse has Trading only
        baseCoin - false string Base coin. linear,inverse,option only For option, it returns BTC by default
        limit - false integer Limit for data size per page. [1, 1000]. Default: 500
        cursor - false string Cursor. Use the nextPageCursor token from the response to retrieve the next page of the result set
        Returns:
        Response Parameters Linear/Inverse Parameter Type Comments category string Product type nextPageCursor string Cursor. Used to pagination list array Object > symbol string Symbol name > contractType string Contract type > status string Instrument status > baseCoin string Base coin > quoteCoin string Quote coin > launchTime string Launch timestamp (ms) > deliveryTime string Delivery timestamp (ms) > deliveryFeeRate string Delivery fee rate > priceScale string Price scale > leverageFilter Object Leverage attributes > > minLeverage string Minimum leverage > > maxLeverage string Maximum leverage > > leverageStep string The step to increase/reduce leverage > priceFilter Object Price attributes > > minPrice string Minimum order price > > maxPrice string Maximum order price > > tickSize string The step to increase/reduce order price > lotSizeFilter Object Size attributes > > maxOrderQty string Maximum order quantity > > minOrderQty string Minimum order quantity > > qtyStep string The step to increase/reduce order quantity > > postOnlyMaxOrderQty string Maximum order qty for PostOnly order > unifiedMarginTrade boolean Whether to support unified margin trade > fundingInterval integer Funding interval (minute) > settleCoin string Settle coin > copyTrading string Copy trade symbol or not

        Option Parameter Type Comments category string Product type nextPageCursor string Cursor. Used to pagination list array Object > symbol string Symbol name > optionsType string Option type. Call, Put > status string Instrument status > baseCoin string Base coin > quoteCoin string Quote coin > settleCoin string Settle coin > launchTime string Launch timestamp (ms) > deliveryTime string Delivery timestamp (ms) > deliveryFeeRate string Delivery fee rate > priceFilter Object Price attributes > > minPrice string Minimum order price > > maxPrice string Maximum order price > > tickSize string The step to increase/reduce order price > lotSizeFilter Object Size attributes > > maxOrderQty string Maximum order quantity > > minOrderQty string Minimum order quantity > > qtyStep string The step to increase/reduce order quantity

        Spot Parameter Type Comments category string Product type list array Object > symbol string Symbol name > baseCoin string Base coin > quoteCoin string Quote coin > innovation string Whether or not this is an innovation zone token. 0: false, 1: true > status string Instrument status > marginTrading string Margin trade symbol or not This is to identify if the symbol support margin trading under different account modes You may find some symbols not supporting margin buy or margin sell, so you need to go to Collateral Info (UTA) or Borrowable Coin (Classic) to check if that coin is borrowable > lotSizeFilter Object Size attributes > > basePrecision string The precision of base coin > > quotePrecision string The precision of quote coin > > minOrderQty string Minimum order quantity > > maxOrderQty string Maximum order quantity > > minOrderAmt string Minimum order amount > > maxOrderAmt string Maximum order amount > priceFilter Object Price attributes > > tickSize string The step to increase/reduce order price

      • getMarketOrderBook

        @GET("/v5/market/orderbook")
        retrofit2.Call<Object> getMarketOrderBook​(@Query("category")
                                                  String category,
                                                  @Query("symbol")
                                                  String symbol,
                                                  @Query("limit")
                                                  Integer limit)
        Get Orderbook Query for orderbook depth data.

        Covers: Spot / USDT perpetual / USDC contract / Inverse contract / Option

        future: 200-level of orderbook data spot: 50-level of orderbook data option: 25-level of orderbook data TIP The response is in the snapshot format.

        https://bybit-exchange.github.io/docs/v5/market/orderbook

        Parameters:
        category - true string Product type. spot, linear, inverse, option
        symbol - true string Symbol name
        limit - false integer Limit size for each bid and ask spot: [1, 200]. Default: 1. linear and inverse: [1, 200]. Default: 25. option: [1, 25]. Default: 1.
        Returns:
        Response Parameters Parameter Type Comments s string Symbol name b array Bid, buyer. Sort by price desc > b[0] string Bid price > b[1] string Bid size a array Ask, seller. Order by price asc > a[0] string Ask price > a[1] string Ask size ts integer The timestamp (ms) that the system generates the data u integer Update ID, is always in sequence For future, it is corresponding to u in the wss 200-level orderbook For spot, it is corresponding to u in the wss 50-level orderbook
      • getMarketTickers

        @GET("/v5/market/tickers")
        retrofit2.Call<Object> getMarketTickers​(@Query("category")
                                                String category,
                                                @Query("symbol")
                                                String symbol,
                                                @Query("baseCoin")
                                                String baseCoin,
                                                @Query("expDate")
                                                String expDate)
        Get Tickers Query for the latest price snapshot, best bid/ask price, and trading volume in the last 24 hours.

        Covers: Spot / USDT perpetual / USDC contract / Inverse contract / Option

        TIP If category=option, symbol or baseCoin must be passed.

        https://bybit-exchange.github.io/docs/v5/market/tickers

        Parameters:
        category - true string Product type. spot,linear,inverse,option
        symbol - false string Symbol name
        baseCoin - false string Base coin. For option only
        expDate - false string Expiry date. e.g., 25DEC22. For option only
        Returns:
        Response Parameters Linear/Inverse Parameter Type Comments category string Product type list array Object > symbol string Symbol name > lastPrice string Last price > indexPrice string Index price > markPrice string Mark price > prevPrice24h string Market price 24 hours ago > price24hPcnt string Percentage change of market price relative to 24h > highPrice24h string The highest price in the last 24 hours > lowPrice24h string The lowest price in the last 24 hours > prevPrice1h string Market price an hour ago > openInterest string Open interest size > openInterestValue string Open interest value > turnover24h string Turnover for 24h > volume24h string Volume for 24h > fundingRate string Funding rate > nextFundingTime string Next funding time (ms) > predictedDeliveryPrice string Predicated delivery price. It has value when 30 min before delivery > basisRate string Basis rate > basis string Basis > deliveryFeeRate string Delivery fee rate > deliveryTime string Delivery timestamp (ms) > ask1Size string Best ask size > bid1Price string Best bid price > ask1Price string Best ask price > bid1Size string Best bid size

        Option Parameter Type Comments category string Product type list array Object > symbol string Symbol name > bid1Price string Best bid price > bid1Size string Best bid size > bid1Iv string Best bid iv > ask1Price string Best ask price > ask1Size string Best ask size > ask1Iv string Best ask iv > lastPrice string Last price > highPrice24h string The highest price in the last 24 hours > lowPrice24h string The lowest price in the last 24 hours > markPrice string Mark price > indexPrice string Index price > markIv string Mark price iv > underlyingPrice string Underlying price > openInterest string Open interest size > turnover24h string Turnover for 24h > volume24h string Volume for 24h > totalVolume string Total volume > totalTurnover string Total turnover > delta string Delta > gamma string Gamma > vega string Vega > theta string Theta > predictedDeliveryPrice string Predicated delivery price. It has value when 30 min before delivery > change24h string The change in the last 24 hous

        Spot Parameter Type Comments category string Product type list array Object > symbol string Symbol name > bid1Price string Best bid price > bid1Size string Best bid size > ask1Price string Best ask price > ask1Size string Best ask size > lastPrice string Last price > prevPrice24h string Market price 24 hours ago > price24hPcnt string Percentage change of market price relative to 24h > highPrice24h string The highest price in the last 24 hours > lowPrice24h string The lowest price in the last 24 hours > turnover24h string Turnover for 24h > volume24h string Volume for 24h > usdIndexPrice string USD index price used to calculate USD value of the assets in Unified account non-collateral margin coin returns ""

      • getFundingHistory

        @GET("/v5/market/funding/history")
        retrofit2.Call<Object> getFundingHistory​(@Query("category")
                                                 String category,
                                                 @Query("symbol")
                                                 String symbol,
                                                 @Query("startTime")
                                                 Long startTime,
                                                 @Query("endTime")
                                                 Long endTime,
                                                 @Query("limit")
                                                 Integer limit)
        Get Funding Rate History Query for historical funding rates. Each symbol has a different funding interval. For example, if the interval is 8 hours and the current time is UTC 12, then it returns the last funding rate, which settled at UTC 8.

        To query the funding rate interval, please refer to the instruments-info endpoint.

        Covers: USDT and USDC perpetual / Inverse perpetual

        TIP Passing only startTime returns an error. Passing only endTime returns 200 records up till endTime. Passing neither returns 200 records up till the current time.

        https://bybit-exchange.github.io/docs/v5/market/history-fund-rate

        Parameters:
        category - true string Product type. linear,inverse
        symbol - true string Symbol name
        startTime - false integer The start timestamp (ms)
        endTime - false integer The end timestamp (ms)
        limit - false integer Limit for data size per page. [1, 200]. Default: 200
        Returns:
        Response Parameters Parameter Type Comments category string Product type list array Object > symbol string Symbol name > fundingRate string Funding rate > fundingRateTimestamp string Funding rate timestamp (ms)
      • getRecentTradeData

        @GET("/v5/market/recent-trade")
        retrofit2.Call<Object> getRecentTradeData​(@Query("category")
                                                  String category,
                                                  @Query("symbol")
                                                  String symbol,
                                                  @Query("baseCoin")
                                                  String baseCoin,
                                                  @Query("optionType")
                                                  String optionType,
                                                  @Query("limit")
                                                  Integer limit)
        Get Public Recent Trading History Query recent public trading data in Bybit.

        Covers: Spot / USDT perpetual / USDC contract / Inverse contract / Option

        You can download archived historical trades here:

        USDT Perpetual, Inverse Perpetual and Inverse Futures Spot

        https://bybit-exchange.github.io/docs/v5/market/recent-trade

        Parameters:
        category - true string Product type. spot,linear,inverse,option
        symbol - false string Symbol name required for spot/linear/inverse optional for option
        baseCoin - false string Base coin. For option only. If not passed, return BTC data by default
        optionType - false string Option type. Call or Put. For option only
        limit - false integer Limit for data size per page. spot: [1,60], default: 60. others: [1,1000], default: 500
        Returns:
        Response Parameters Parameter Type Comments category string Products category list array Object > execId string Execution ID > symbol string Symbol name > price string Trade price > size string Trade size > side string Side of taker Buy, Sell > time string Trade time (ms) > isBlockTrade boolean Whether the trade is block trade
      • getOpenInterest

        @GET("/v5/market/open-interest")
        retrofit2.Call<Object> getOpenInterest​(@Query("category")
                                               String category,
                                               @Query("symbol")
                                               String symbol,
                                               @Query("intervalTime")
                                               String intervalTime,
                                               @Query("startTime")
                                               Long startTime,
                                               @Query("endTime")
                                               Long endTime,
                                               @Query("limit")
                                               Integer limit,
                                               @Query("cursor")
                                               String cursor)
        Get Open Interest Get the open interest of each symbol.

        Covers: USDT perpetual / USDC contract / Inverse contract

        INFO Returns single side data The upper limit time you can query is the launch time of the symbol.

        https://bybit-exchange.github.io/docs/v5/market/open-interest

        Parameters:
        category - true string Product type. linear,inverse
        symbol - true string Symbol name
        intervalTime - true string Interval time. 5min,15min,30min,1h,4h,1d
        startTime - false integer The start timestamp (ms)
        endTime - false integer The end timestamp (ms)
        limit - false integer Limit for data size per page. [1, 200]. Default: 50
        cursor - false string Cursor. Used to paginate
        Returns:
        Response Parameters Parameter Type Comments category string Product type symbol string Symbol name list array Object > openInterest string Open interest > timestamp string The timestamp (ms) nextPageCursor string Used to paginate
      • getHistoricalVolatility

        @GET("/v5/market/historical-volatility")
        retrofit2.Call<Object> getHistoricalVolatility​(@Query("category")
                                                       String category,
                                                       @Query("baseCoin")
                                                       String baseCoin,
                                                       @Query("period")
                                                       Integer period,
                                                       @Query("startTime")
                                                       Long startTime,
                                                       @Query("endTime")
                                                       Long endTime)
        Get Historical Volatility Query option historical volatility

        Covers: Option

        INFO The data is hourly. If both startTime and endTime are not specified, it will return the most recent 1 hours worth of data. startTime and endTime are a pair of params. Either both are passed or they are not passed at all. This endpoint can query the last 2 years worth of data, but make sure [endTime - startTime] ≤ 30 days.

        https://bybit-exchange.github.io/docs/v5/market/iv

        Parameters:
        category - true string Product type. option
        baseCoin - false string Base coin. Default: return BTC data
        period - false integer Period. If not specified, it will return data with a 7-day average by default
        startTime - false integer The start timestamp (ms)
        endTime - false integer The end timestamp (ms)
        Returns:
        Response Parameters Parameter Type Comments category string Product type list array Object > period integer Period > value string Volatility > time string Timestamp (ms)
      • getInsurance

        @GET("/v5/market/insurance")
        retrofit2.Call<Object> getInsurance​(@Query("coin")
                                            String coin)
        Get Insurance Query for Bybit insurance pool data (BTC/USDT/USDC etc). The data is updated every 24 hours.

        https://bybit-exchange.github.io/docs/v5/market/insurance

        Parameters:
        coin - false string coin. Default: return all insurance coins
        Returns:
        Response Parameters Parameter Type Comments updatedTime string Data updated time (ms) list array Object > coin string Coin > balance string Balance > value string USD value
      • getInsurance

        @GET("/v5/market/insurance")
        retrofit2.Call<Object> getInsurance()
        Get Insurance Query for Bybit insurance pool data (BTC/USDT/USDC etc). The data is updated every 24 hours.

        https://bybit-exchange.github.io/docs/v5/market/insurance

        Returns:
        Response Parameters Parameter Type Comments updatedTime string Data updated time (ms) list array Object > coin string Coin > balance string Balance > value string USD value
      • getRiskLimit

        @GET("/v5/market/risk-limit")
        retrofit2.Call<Object> getRiskLimit​(@Query("category")
                                            String category,
                                            @Query("symbol")
                                            String symbol)
        Get Risk Limit Query for the risk limit.

        Covers: USDT perpetual / USDC contract / Inverse contract

        https://bybit-exchange.github.io/docs/v5/market/risk-limit

        Parameters:
        category - true string Product type. linear,inverse
        symbol - false string Symbol name
        Returns:
        Response Parameters Parameter Type Comments category string Product type list array Object > id integer Risk ID > symbol string Symbol name > riskLimitValue string Position limit > maintenanceMargin number Maintain margin rate > initialMargin number Initial margin rate > isLowestRisk integer 1: true, 0: false > maxLeverage string Allowed max leverage
      • getDeliveryPrice

        @GET("/v5/market/delivery-price")
        retrofit2.Call<Object> getDeliveryPrice​(@Query("category")
                                                String category,
                                                @Query("symbol")
                                                String symbol,
                                                @Query("baseCoin")
                                                String baseCoin,
                                                @Query("limit")
                                                Integer limit,
                                                @Query("cursor")
                                                String cursor)
        Get Delivery Price Get the delivery price.

        Covers: USDC futures / Inverse futures / Option

        https://bybit-exchange.github.io/docs/v5/market/delivery-price

        Parameters:
        category - true string Product type. linear, inverse, option
        symbol - false string Symbol name
        baseCoin - false string Base coin. Default: BTC. valid for option only
        limit - false integer Limit for data size per page. [1, 200]. Default: 50
        cursor - false string Cursor. Use the nextPageCursor token from the response to retrieve the next page of the result set
        Returns:
        Response Parameters Parameter Type Comments category string Product type list array Object > symbol string Symbol name > deliveryPrice string Delivery price > deliveryTime string Delivery timestamp (ms) nextPageCursor string Refer to the cursor request parameter
      • getMarketAccountRatio

        @GET("/v5/market/account-ratio")
        retrofit2.Call<Object> getMarketAccountRatio​(@Query("category")
                                                     String category,
                                                     @Query("symbol")
                                                     String symbol,
                                                     @Query("period")
                                                     String period,
                                                     @Query("limit")
                                                     Integer limit)
        Get Long Short Ratio

        https://bybit-exchange.github.io/docs/v5/market/long-short-ratio

        Parameters:
        category - true string Product type. linear(USDT Perpetual only),inverse
        symbol - true string Symbol name
        period - true string Data recording period. 5min, 15min, 30min, 1h, 4h, 4d
        limit - false integer Limit for data size per page. [1, 500]. Default: 50
        Returns:
        Response Parameters Parameter Type Comments list array Object > symbol string Symbol name > buyRatio string The ratio of users with net long position > sellRatio string The ratio of users with net short position > timestamp string Timestamp (ms)
      • getOrderHistory

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/order/history")
        retrofit2.Call<Object> getOrderHistory​(@Query("category")
                                               String category,
                                               @Query("symbol")
                                               String symbol,
                                               @Query("baseCoin")
                                               String baseCoin,
                                               @Query("settleCoin")
                                               String settleCoin,
                                               @Query("orderId")
                                               String orderId,
                                               @Query("orderLinkId")
                                               String orderLinkId,
                                               @Query("orderFilter")
                                               String orderFilter,
                                               @Query("orderStatus")
                                               OrderStatus orderStatus,
                                               @Query("startTime")
                                               Long startTime,
                                               @Query("endTime")
                                               Long endTime,
                                               @Query("limit")
                                               Integer limit,
                                               @Query("cursor")
                                               String cursor)
        Get Order History Query order history. As order creation/cancellation is asynchronous, the data returned from this endpoint may delay. If you want to get real-time order information, you could query this endpoint or rely on the websocket stream (recommended).

        Unified account covers: Spot / USDT perpetual / USDC contract / Inverse contract / Options Classic account covers: Spot / USDT perpetual / Inverse contract

        INFO The orders in the last 7 days: supports querying all statuses The orders beyond 7 days: supports querying filled orders You can query by symbol, baseCoin, orderId and orderLinkId, and if you pass multiple params, the system will process them according to this priority: orderId > orderLinkId > symbol > baseCoin. TIP Classic account spot can get final status orders only

        https://bybit-exchange.github.io/docs/v5/order/order-list

        Parameters:
        category - true string Product type Unified account: spot, linear, inverse, option Classic account: spot, linear, inverse
        symbol - false string Symbol name
        baseCoin - false string Base coin. Unified account - inverse and Classic account does not support this param
        settleCoin - false string Settle coin. Unified account - inverse and Classic account does not support this param
        orderId - false string Order ID
        orderLinkId - false string User customised order ID
        orderFilter - false string Order: active order, StopOrder: conditional order for Futures and Spot, tpslOrder: spot TP/SL order Classic spot: return Order active order by default Others: all kinds of orders by default
        orderStatus - false string Classic spot: invalid Others: return all status orders if not passed
        startTime - false integer The start timestamp (ms) Classic spot is not supported temporarily startTime and endTime must be passed together If not passed, query the past 7 days data by default For each request, startTime and endTime interval should be less then 7 days
        endTime - false integer The end timestamp (ms) For each request, startTime and endTime interval should be less then 7 days
        limit - false integer Limit for data size per page. [1, 50]. Default: 20
        cursor - false string Cursor. Use the nextPageCursor token from the response to retrieve the next page of the result set
        Returns:
        Response Parameters Parameter Type Comments category string Product type list array Object > orderId string Order ID > orderLinkId string User customised order ID > blockTradeId string Block trade ID > symbol string Symbol name > price string Order price > qty string Order qty > side string Side. Buy,Sell > isLeverage string Whether to borrow. Unified spot only. 0: false, 1: true. . Classic spot is not supported, always 0 > positionIdx integer Position index. Used to identify positions in different position modes > orderStatus string Order status > cancelType string Cancel type > rejectReason string Reject reason. Classic spot is not supported > avgPrice string Average filled price. If unfilled, it is "" > leavesQty string The remaining qty not executed. Classic spot is not supported > leavesValue string The estimated value not executed. Classic spot is not supported > cumExecQty string Cumulative executed order qty > cumExecValue string Cumulative executed order value. Classic spot is not supported > cumExecFee string Cumulative executed trading fee. Classic spot is not supported > timeInForce string Time in force > orderType string Order type. Market,Limit. For TP/SL order, it means the order type after triggered Block trade Roll Back, Block trade-Limit: Unique enum values for Unified account block trades > stopOrderType string Stop order type > orderIv string Implied volatility > triggerPrice string Trigger price. If stopOrderType=TrailingStop, it is activate price. Otherwise, it is trigger price > takeProfit string Take profit price > stopLoss string Stop loss price > tpslMode string TP/SL mode, Full: entire position for TP/SL. Partial: partial position tp/sl. Spot does not have this field, and Option returns always "" > tpLimitPrice string The limit order price when take profit price is triggered > slLimitPrice string The limit order price when stop loss price is triggered > tpTriggerBy string The price type to trigger take profit > slTriggerBy string The price type to trigger stop loss > triggerDirection integer Trigger direction. 1: rise, 2: fall > triggerBy string The price type of trigger price > lastPriceOnCreated string Last price when place the order > reduceOnly boolean Reduce only. true means reduce position size > closeOnTrigger boolean Close on trigger. What is a close on trigger order? > placeType string Place type, option used. iv, price > smpType string SMP execution type > smpGroup integer Smp group ID. If the UID has no group, it is 0 by default > smpOrderId string The counterparty's orderID which triggers this SMP execution > createdTime string Order created timestamp (ms) > updatedTime string Order updated timestamp (ms) nextPageCursor string Refer to the cursor request parameter
      • getBorrowQuota

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/order/spot-borrow-check")
        retrofit2.Call<Object> getBorrowQuota​(@Query("category")
                                              String category,
                                              @Query("symbol")
                                              String symbol,
                                              @Query("side")
                                              String side)
        Get Borrow Quota (Spot) Query the qty and amount of borrowable coins in spot account.

        Covers: Spot (Unified Account)

        https://bybit-exchange.github.io/docs/v5/order/spot-borrow-quota

        Parameters:
        category - true string Product type. spot
        symbol - true string Symbol name
        side - true string Transaction side. Buy,Sell
        Returns:
        Response Parameters Parameter Type Comments symbol string Symbol name side string Side maxTradeQty string The maximum base coin qty can be traded If spot margin trade on and symbol is margin trading pair, it returns available balance + max.borrowable amount Otherwise, it returns actual balance maxTradeAmount string The maximum quote coin amount can be traded If spot margin trade on and symbol is margin trading pair, it returns available balance + max.borrowable amount Otherwise, it returns actual balance borrowCoin string Borrow coin
      • getOpenOrders

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/order/realtime")
        retrofit2.Call<Object> getOpenOrders​(@Query("category")
                                             String category,
                                             @Query("symbol")
                                             String symbol,
                                             @Query("baseCoin")
                                             String baseCoin,
                                             @Query("settleCoin")
                                             String settleCoin,
                                             @Query("orderId")
                                             String orderId,
                                             @Query("orderLinkId")
                                             String orderLinkId,
                                             @Query("openOnly")
                                             Integer openOnly,
                                             @Query("orderFilter")
                                             String orderFilter,
                                             @Query("limit")
                                             Integer limit,
                                             @Query("cursor")
                                             String cursor)
        Get Open Orders Query unfilled or partially filled orders in real-time. To query older order records, please use the order history interface.

        Unified account covers: Spot / USDT perpetual / USDC contract / Inverse contract / Options Classic account covers: Spot / USDT perpetual / Inverse contract

        TIP It also supports querying filled, cancelled, and rejected orders which occurred in last 10 minutes (check the openOnly param). At most, 500 orders will be returned. You can query by symbol, baseCoin, orderId and orderLinkId, and if you pass multiple params, the system will process them according to this priority: orderId > orderLinkId > symbol > baseCoin. The records are sorted by the createdTime from newest to oldest. INFO Classic account spot trade can return open orders only

        https://bybit-exchange.github.io/docs/v5/order/open-order

        Parameters:
        category - true string Product type Unified account: spot, linear, inverse, option Classic account: spot, linear, inverse
        symbol - false string Symbol name. For linear, either symbol, baseCoin, settleCoin is required
        baseCoin - false string Base coin. Supports linear, inverse and option. For option. Return all option open orders if not passed
        settleCoin - false string Settle coin linear: either symbol, baseCoin or settleCoin is required spot: invalid
        orderId - false string Order ID
        orderLinkId - false string User customised order ID
        openOnly - false integer Unified account and Classic account: 0(default) - query open orders only Unified account - spot / linear / option: 1 Unified account - inverse and Classic account - linear / inverse: 2 return cancelled, rejected or totally filled orders by last 10 minutes, A maximum of 500 records are kept under each account. If the Bybit service is restarted due to an update, this part of the data will be cleared and accumulated again, but the order records will still be queried in order history Classic spot: not supported, return open orders only
        orderFilter - false string Order: active order, StopOrder: conditional order for Futures and Spot, tpslOrder: spot TP/SL order Classic spot: return Order active order by default Others: all kinds of orders by default
        limit - false integer Limit for data size per page. [1, 50]. Default: 20
        cursor - false string Cursor. Use the nextPageCursor token from the response to retrieve the next page of the result set
        Returns:
        Response Parameters Parameter Type Comments category string Product type nextPageCursor string Refer to the cursor request parameter list array Object > orderId string Order ID > orderLinkId string User customised order ID > blockTradeId string Paradigm block trade ID > symbol string Symbol name > price string Order price > qty string Order qty > side string Side. Buy,Sell > isLeverage string Whether to borrow. Unified spot only. 0: false, 1: true. . Classic spot is not supported, always 0 > positionIdx integer Position index. Used to identify positions in different position modes. > orderStatus string Order status > cancelType string Cancel type > rejectReason string Reject reason. Classic spot is not supported > avgPrice string Average filled price. If unfilled, it is "0" > leavesQty string The remaining qty not executed. Classic spot is not supported > leavesValue string The estimated value not executed. Classic spot is not supported > cumExecQty string Cumulative executed order qty > cumExecValue string Cumulative executed order value. Classic spot is not supported > cumExecFee string Cumulative executed trading fee. Classic spot is not supported > timeInForce string Time in force > orderType string Order type. Market,Limit. For TP/SL order, it means the order type after triggered > stopOrderType string Stop order type > orderIv string Implied volatility > triggerPrice string Trigger price. If stopOrderType=TrailingStop, it is activate price. Otherwise, it is trigger price > takeProfit string Take profit price > stopLoss string Stop loss price > tpslMode string TP/SL mode, Full: entire position for TP/SL. Partial: partial position tp/sl. Spot does not have this field, and Option returns always "" > tpLimitPrice string The limit order price when take profit price is triggered > slLimitPrice string The limit order price when stop loss price is triggered > tpTriggerBy string The price type to trigger take profit > slTriggerBy string The price type to trigger stop loss > triggerDirection integer Trigger direction. 1: rise, 2: fall > triggerBy string The price type of trigger price > lastPriceOnCreated string Last price when place the order > reduceOnly boolean Reduce only. true means reduce position size > closeOnTrigger boolean Close on trigger. What is a close on trigger order? > placeType string Place type, option used. iv, price > smpType string SMP execution type > smpGroup integer Smp group ID. If the UID has no group, it is 0 by default > smpOrderId string The counterparty's orderID which triggers this SMP execution > createdTime string Order created timestamp (ms) > updatedTime string Order updated timestamp (ms)
      • getTradeHistory

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/execution/list")
        retrofit2.Call<Object> getTradeHistory​(@Query("category")
                                               String category,
                                               @Query("symbol")
                                               String symbol,
                                               @Query("orderId")
                                               String orderId,
                                               @Query("orderLinkId")
                                               String orderLinkId,
                                               @Query("baseCoin")
                                               String baseCoin,
                                               @Query("startTime")
                                               Long startTime,
                                               @Query("endTime")
                                               Long endTime,
                                               @Query("execType")
                                               String execType,
                                               @Query("limit")
                                               Integer limit,
                                               @Query("cursor")
                                               String cursor)
        New, PartiallyFilled, Untriggered orders are not returned. Please use V5 Get Open Orders (https://bybit-exchange.github.io/docs/v5/order/open-order) instead Affected account: Unified Trading Account(including Pro)
        Parameters:
        category -
        symbol -
        orderId -
        orderLinkId -
        baseCoin -
        startTime -
        endTime -
        execType -
        limit -
        cursor -
        Returns:
      • setDisconnectCancelAllTime

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/order/disconnected-cancel-all")
        retrofit2.Call<Object> setDisconnectCancelAllTime​(@Body
                                                          SetDcpRequest setDcpRequest)
        Set Disconnect Cancel All Covers: Option (Unified Account)

        INFO What is Disconnection Protect (DCP)? Based on the websocket private connection and heartbeat mechanism, Bybit provides disconnection protection function. The timing starts from the first disconnection. If the Bybit server does not receive the reconnection from the client for more than 10 (default) seconds and resumes the heartbeat "ping", then the client is in the state of "disconnection protect", all active option orders of the client will be cancelled automatically. If within 10 seconds, the client reconnects and resumes the heartbeat "ping", the timing will be reset and restarted at the next disconnection.

        How to enable DCP If you need to turn it on/off, you can contact your client manager for consultation and application. The default time window is 10 seconds.

        Applicable Effective for options only.

        TIP After the request is successfully sent, the system needs a certain time to take effect. It is recommended to query or set again after 10 seconds

        You can use this endpoint to get your current DCP configuration. Your private websocket connection must subscribe "dcp" topic in order to trigger DCP successfully

        https://bybit-exchange.github.io/docs/v5/order/dcp

        Parameters:
        setDcpRequest - timeWindow true integer Disconnection timing window time. [3, 300], unit: second
        Returns:
        Response Parameters None
      • createOrder

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/order/create")
        retrofit2.Call<Object> createOrder​(@Body
                                           PlaceOrderRequest placeOrderRequest)
        Place Order This endpoint supports to create the order for spot, spot margin, USDT perpetual, USDC perpetual, USDC futures, inverse futures and options.

        Unified account covers: Spot / USDT perpetual / USDC contract / Inverse contract / Options Classic account covers: Spot / USDT perpetual / Inverse contract

        INFO Supported order type (orderType): Limit order: orderType=Limit, it is necessary to specify order qty and price.

        Market order: orderType=Market, execute at the best price in the Bybit market until the transaction is completed. When selecting a market order, the `price` is empty. In the futures trading system, in order to protect the serious slippage of the market order, the Bybit trading system will convert the market order into a limit order for matching. will be cancelled. The slippage threshold refers to the percentage that the order price deviates from the latest transaction price. The current threshold is set to 3% for BTC contracts and 5% for other contracts. Supported timeInForce strategy: GTC IOC FOK PostOnly: If the order would be filled immediately when submitted, it will be cancelled. The purpose of this is to protect your order during the submission process. If the matching system cannot entrust the order to the order book due to price changes on the market, it will be cancelled. For the PostOnly order type, the quantity that can be submitted in a single order is more than other types of orders, please refer to the parameter lotSizeFilter > postOnlyMaxOrderQty in the instruments-info endpoint.

        How to create conditional order: When submitting an order, if triggerPrice is set, the order will be automatically converted into a conditional order. In addition, the conditional order does not occupy the margin. If the margin is insufficient after the conditional order is triggered, the order will be cancelled.

        Take profit / Stop loss: You can set TP/SL while placing orders. Besides, you could modify the position's TP/SL.

        Order quantity: The quantity of perpetual contracts you are going to buy/sell. For the order quantity, Bybit only supports positive number at present.

        Order price: Place a limit order, this parameter is required. If you have position, the price should be higher than the liquidation price. For the minimum unit of the price change, please refer to the priceFilter > tickSize field in the instruments-info endpoint.

        orderLinkId: You can customize the active order ID. We can link this ID to the order ID in the system. Once the active order is successfully created, we will send the unique order ID in the system to you. Then, you can use this order ID to cancel active orders, and if both orderId and orderLinkId are entered in the parameter input, Bybit will prioritize the orderId to process the corresponding order. Meanwhile, your customized order ID should be no longer than 36 characters and should be unique.

        Open orders up limit: Futures: Each account can hold a maximum of 500 active orders simultaneously. This is contract-specific, so the following situation is allowed: the same account can hold 300 BTCUSD active orders and 280 ETHUSD active orders at the same time. For conditional orders, each account can hold a maximum of 10 active orders simultaneously. When the upper limit of orders is reached, you can still place orders with parameters of reduceOnly or closeOnTrigger. Spot: 500 orders in total, including a maximum of 30 open TP/SL orders, a maximum of 30 open conditional orders Option: a maximum of 100 open orders

        Rate limit: Please refer to rate limit table. If you need to raise the rate limit, please contact your client manager or submit an application via here

        Risk control limit notice: Bybit will monitor on your API requests. When the total number of orders of a single user (aggregated the number of orders across main account and sub-accounts) within a day (UTC 0 - UTC 24) exceeds a certain upper limit, the platform will reserve the right to remind, warn, and impose necessary restrictions. Customers who use API default to acceptance of these terms and have the obligation to cooperate with adjustments.

        TIP To margin trade on spot on a normal account, you need to go here to borrow margin first.

        https://bybit-exchange.github.io/docs/v5/order/create-order#http-request

        Parameters:
        placeOrderRequest - category true string Product type Unified account: spot, linear, inverse, option Classic account: spot, linear, inverse symbol true string Symbol name isLeverage false integer Whether to borrow. Valid for Unified spot only. 0(default): false then spot trading, 1: true then margin trading side true string Buy, Sell orderType true string Market, Limit qty true string Order quantity. For Spot Market Buy order, please note that qty should be quote curreny amount, and make sure it satisfies quotePrecision in Spot instrument spec For other cases, please make sure the input qty is the multiples of minOrderQty from instrument info endpoint In particular, for Futures and Perps, if you pass qty="0", you can close the whole position of current symbol price false string Order price Market order will ignore this field Please check the min price and price precision from instrument info endpoint If you have position, price needs to be better than liquidation price triggerDirection false integer Conditional order param. Used to identify the expected direction of the conditional order. 1: triggered when market price rises to triggerPrice 2: triggered when market price falls to triggerPrice Valid for linear and inverse orderFilter false string If it is not passed, Order by default. Order tpslOrder: Spot TP/SL order, the assets are occupied even before the order is triggered StopOrder: Spot conditional order, the assets will not be occupied until the price of the underlying asset reaches the trigger price, and the required assets will be occupied after the Conditional order is triggered Valid for spot only triggerPrice false string For Perps and Futures, it is the conditional order trigger price. If you expect the price to rise to trigger your conditional order, make sure: triggerPrice > market price Else, triggerPrice < market price For spot, it is the TP/SL and Conditional order trigger price triggerBy false string Trigger price type, Conditional order param for Perps and Futures. LastPrice, IndexPrice, MarkPrice Valid for linear and inverse orderIv false string Implied volatility. option only. Pass the real value, e.g for 10%, 0.1 should be passed. orderIv has a higher priority when price is passed as well timeInForce false string Time in force Market order will use IOC directly If not passed, GTC is used by default positionIdx false integer Used to identify positions in different position modes. Under hedge-mode, this param is required (USDT perps and Inverse contracts have hedge mode) 0: one-way mode 1: hedge-mode Buy side 2: hedge-mode Sell side orderLinkId false string User customised order ID. A max of 36 characters. Combinations of numbers, letters (upper and lower cases), dashes, and underscores are supported. Futures and Perps: orderLinkId rules: optional param always unique option orderLinkId rules: required param always unique takeProfit false string Take profit price, valid for linear and inverse stopLoss false string Stop loss price, valid for linear and inverse tpTriggerBy false string The price type to trigger take profit. MarkPrice, IndexPrice, default: LastPrice. Valid for linear and inverse slTriggerBy false string The price type to trigger stop loss. MarkPrice, IndexPrice, default: LastPrice. Valid for linear and inverse reduceOnly false boolean What is a reduce-only order? true means your position can only reduce in size if this order is triggered. You must specify it as true when you are about to close/reduce the position When reduceOnly is true, take profit/stop loss cannot be set Valid for linear, inverse and option closeOnTrigger false boolean What is a close on trigger order? For a closing order. It can only reduce your position, not increase it. If the account has insufficient available balance when the closing order is triggered, then other active orders of similar contracts will be cancelled or reduced. It can be used to ensure your stop loss reduces your position regardless of current available margin. Valid for linear and inverse smpType false string Smp execution type. What is SMP? mmp false boolean Market maker protection. option only. true means set the order as a market maker protection order. What is mmp? tpslMode false string TP/SL mode Full: entire position for TP/SL. Then, tpOrderType or slOrderType must be Market Partial: partial position tp/sl. Limit TP/SL order are supported. Note: When create limit tp/sl, tpslMode is required and it must be Partial Valid for linear and inverse tpLimitPrice false string The limit order price when take profit price is triggered. Only works when tpslMode=Partial and tpOrderType=Limit. Valid for linear and inverse slLimitPrice false string The limit order price when stop loss price is triggered. Only works when tpslMode=Partial and slOrderType=Limit. Valid for linear and inverse tpOrderType false string The order type when take profit is triggered. Market(default), Limit. For tpslMode=Full, it only supports tpOrderType=Market. Valid for linear and inverse slOrderType false string The order type when stop loss is triggered. Market(default), Limit. For tpslMode=Full, it only supports slOrderType=Market. Valid for linear and inverse
        Returns:
        Response Parameters Parameter Type Comments orderId string Order ID orderLinkId string User customised order ID
      • createBatchOrder

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/order/create-batch")
        retrofit2.Call<Object> createBatchOrder​(@Body
                                                PlaceBatchOrderRequest placeBatchOrderRequest)
        Batch Place Order Covers: Option (UTA, UTA Pro) / USDT Perpetual, UDSC Perpetual, USDC Futures (UTA Pro)

        TIP This endpoint allows you to place more than one order in a single request.

        Make sure you have sufficient funds in your account when placing an order. Once an order is placed, according to the funds required by the order, the funds in your account will be frozen by the corresponding amount during the life cycle of the order. A maximum of 20 orders (option) and 10 orders (linear) can be placed per request. The returned data list is divided into two lists. The first list indicates whether or not the order creation was successful and the second list details the created order information. The structure of the two lists are completely consistent. INFO Check the rate limit instruction when category=linear here Risk control limit notice: Bybit will monitor on your API requests. When the total number of orders of a single user (aggregated the number of orders across main account and sub-accounts) within a day (UTC 0 - UTC 24) exceeds a certain upper limit, the platform will reserve the right to remind, warn, and impose necessary restrictions. Customers who use API default to acceptance of these terms and have the obligation to cooperate with adjustments.

        https://bybit-exchange.github.io/docs/v5/order/batch-place

        Parameters:
        placeBatchOrderRequest - category true string Product type. linear, option request true array Object > symbol true string Symbol name > side true string Buy, Sell > orderType true string Market, Limit > qty true string Order quantity In particular, for linear, if you pass qty="0", you can close the whole position of current symbol > price false string Order price Market order will ignore this field Please check the min price and price precision from instrument info endpoint If you have position, price needs to be better than liquidation price > triggerDirection false integer Conditional order param. Used to identify the expected direction of the conditional order. 1: triggered when market price rises to triggerPrice 2: triggered when market price falls to triggerPrice Valid for linear > triggerPrice false string For futures, it is the conditional order trigger price. If you expect the price to rise to trigger your conditional order, make sure: triggerPrice > market price Else, triggerPrice < market price > triggerBy false string Conditional order param. Trigger price type. LastPrice, IndexPrice, MarkPrice > orderIv false string Implied volatility. option only. Pass the real value, e.g for 10%, 0.1 should be passed. orderIv has a higher priority when price is passed as well > timeInForce false string Time in force Market order will use IOC directly If not passed, GTC is used by default > positionIdx false integer Used to identify positions in different position modes. Under hedge-mode, this param is required (USDT perps have hedge mode) 0: one-way mode 1: hedge-mode Buy side 2: hedge-mode Sell side > orderLinkId false string User customised order ID. A max of 36 characters. Combinations of numbers, letters (upper and lower cases), dashes, and underscores are supported. Futures and Perps: orderLinkId rules: optional param always unique option orderLinkId rules: required param always unique > takeProfit false string Take profit price, valid for linear > stopLoss false string Stop loss price, valid for linear > tpTriggerBy false string The price type to trigger take profit. MarkPrice, IndexPrice, default: LastPrice. Valid for linear > slTriggerBy false string The price type to trigger stop loss. MarkPrice, IndexPrice, default: LastPrice Valid for linear > reduceOnly false boolean What is a reduce-only order? true means your position can only reduce in size if this order is triggered. You must specify it as true when you are about to close/reduce the position When reduceOnly is true, take profit/stop loss cannot be set Valid for linear, and option > closeOnTrigger false boolean What is a close on trigger order? For a closing order. It can only reduce your position, not increase it. If the account has insufficient available balance when the closing order is triggered, then other active orders of similar contracts will be cancelled or reduced. It can be used to ensure your stop loss reduces your position regardless of current available margin. Valid for linear > smpType false string Smp execution type. What is SMP? > mmp false boolean Market maker protection. option only. true means set the order as a market maker protection order. What is mmp? > tpslMode false string TP/SL mode Full: entire position for TP/SL. Then, tpOrderType or slOrderType must be Market Partial: partial position tp/sl. Limit TP/SL order are supported. Note: When create limit tp/sl, tpslMode is required and it must be Partial Valid for linear > tpLimitPrice false string The limit order price when take profit price is triggered. Only works when tpslMode=Partial and tpOrderType=Limit Valid for linear > slLimitPrice false string The limit order price when stop loss price is triggered. Only works when tpslMode=Partial and slOrderType=Limit Valid for linear > tpOrderType false string The order type when take profit is triggered. Market(default), Limit. For tpslMode=Full, it only supports tpOrderType=Market Valid for linear > slOrderType false string The order type when stop loss is triggered. Market(default), Limit. For tpslMode=Full, it only supports slOrderType=Market Valid for linear
        Returns:
        Response Parameters Parameter Type Comments result Object > list array Object > > category string Product type > > symbol string Symbol name > > orderId string Order ID > > orderLinkId string User customised order ID > > createAt string Order created time (ms) retExtInfo Object > list array Object > > code number Success/error code > > msg string Success/error message
      • cancelOrder

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/order/cancel")
        retrofit2.Call<Object> cancelOrder​(@Body
                                           CancelOrderRequest cancelOrderRequest)
        Cancel Order Unified account covers: Spot / USDT perpetual / USDC contract / Inverse contract / Options Classic account covers: Spot / USDT perpetual / Inverse contract

        IMPORTANT You must specify orderId or orderLinkId to cancel the order. If orderId and orderLinkId do not match, the system will process orderId first. You can only cancel unfilled or partially filled orders.

        https://bybit-exchange.github.io/docs/v5/order/cancel-order

        Parameters:
        cancelOrderRequest - category true string Product type Unified account: spot, linear, inverse, option Classic account: spot, linear, inverse symbol true string Symbol name orderId false string Order ID. Either orderId or orderLinkId is required orderLinkId false string User customised order ID. Either orderId or orderLinkId is required orderFilter false string Valid for spot only. Order,tpslOrder,StopOrder. If not passed, Order by default
        Returns:
        Response Parameters * Parameter Type Comments * orderId string Order ID * orderLinkId string User customised order ID
      • cancelBatchOrder

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/order/cancel-batch")
        retrofit2.Call<Object> cancelBatchOrder​(@Body
                                                CancelBatchOrderRequest cancelBatchOrderRequest)
        Batch Cancel Order This endpoint allows you to cancel more than one open order in a single request.

        Covers: Option (UTA, UTA Pro) / USDT Perpetual, UDSC Perpetual, USDC Futures (UTA Pro)

        IMPORTANT You must specify orderId or orderLinkId. If orderId and orderLinkId is not matched, the system will process orderId first. You can cancel unfilled or partially filled orders. A maximum of 20 orders (option) and 10 orders (linear) can be cancelled per request.

        https://bybit-exchange.github.io/docs/v5/order/batch-cancel#http-request

        Parameters:
        cancelBatchOrderRequest - category true string Product type. linear, option request true array Object > symbol true string Symbol name > orderId false string Order ID. Either orderId or orderLinkId is required > orderLinkId false string User customised order ID. Either orderId or orderLinkId is required
        Returns:
        Response Parameters Parameter Type Comments result Object > list array Object > > category string Product type > > symbol string Symbol name > > orderId string Order ID > > orderLinkId string User customised order ID retExtInfo Object > list array Object > > code number Success/error code > > msg string Success/error message
      • cancelAllOrder

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/order/cancel-all")
        retrofit2.Call<Object> cancelAllOrder​(@Body
                                              CancelAllOrdersRequest cancelAllOrdersRequest)
        Cancel All Orders Cancel all open orders

        Unified account covers: Spot / USDT perpetual / USDC contract / Inverse contract / Options Classic account covers: Spot / USDT perpetual / Inverse contract

        INFO Support cancel orders by symbol/baseCoin/settleCoin. If you pass multiple of these params, the system will process one of param, which priority is symbol > baseCoin > settleCoin. NOTE: category=option, you can cancel all option open orders without passing any of those three params. However, for linear and inverse, you must specify one of those three params. NOTE: category=spot, you can cancel all spot open orders (normal order by default) without passing other params.

        https://bybit-exchange.github.io/docs/v5/order/cancel-all

        Parameters:
        cancelAllOrdersRequest - category true string Product type Unified account: spot, linear, inverse, option Classic account: spot, linear, inverse symbol false string Symbol name. linear and inverse: Required if not passing baseCoin or settleCoin baseCoin false string Base coin linear and inverse(Classic account): If cancel all by baseCoin, it will cancel all linear and inverse orders. Required if not passing symbol or settleCoin linear and inverse(Unified account): If cancel all by baseCoin, it will cancel all corresponding category orders. Required if not passing symbol or settleCoin Classic spot: invalid settleCoin false string Settle coin linear and inverse: Required if not passing symbol or baseCoin Does not support spot orderFilter false string category=spot, you can pass Order, tpslOrder, StopOrder. If not passed, Order by default category=linear or inverse, you can pass Order, StopOrder. If not passed, all kinds of orders will be cancelled, like active order, conditional order, TP/SL order and trailing stop order category=option, you can pass Order. No matter it is passed or not, always cancel all orders stopOrderType false string Stop order type, Stop Only used for category=linear or inverse and orderFilter=StopOrder,you can cancel conditional orders except TP/SL order and Trailing stop orders with this param
        Returns:
        Response Parameters Linear/Inverse/Option Parameter Type Comments list array Object > orderId string Order ID > orderLinkId string User customised order ID

        Spot Parameter Type Comments success string 1: success, 0: fail

      • amendOrder

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/order/amend")
        retrofit2.Call<Object> amendOrder​(@Body
                                          AmendOrderRequest amendOrderRequest)
        Amend Order Unified account covers: USDT perpetual / USDC contract / Inverse contract / Option Classic account covers: USDT perpetual / Inverse contract

        IMPORTANT You can only modify unfilled or partially filled orders.

        https://bybit-exchange.github.io/docs/v5/order/amend-order

        Parameters:
        amendOrderRequest - category true string Product type Unified account: linear, inverse, option Classic account: linear, inverse. Please note that category is not involved with business logic symbol true string Symbol name orderId false string Order ID. Either orderId or orderLinkId is required orderLinkId false string User customised order ID. Either orderId or orderLinkId is required orderIv false string Implied volatility. option only. Pass the real value, e.g for 10%, 0.1 should be passed triggerPrice false string If you expect the price to rise to trigger your conditional order, make sure: triggerPrice > market price Else, triggerPrice < market price qty false string Order quantity after modification. Do not pass it if not modify the qty price false string Order price after modification. Do not pass it if not modify the price takeProfit false string Take profit price after modification. If pass "0", it means cancel the existing take profit of the order. Do not pass it if you do not want to modify the take profit stopLoss false string Stop loss price after modification. If pass "0", it means cancel the existing stop loss of the order. Do not pass it if you do not want to modify the stop loss tpTriggerBy false string The price type to trigger take profit. When set a take profit, this param is required if no initial value for the order slTriggerBy false string The price type to trigger stop loss. When set a take profit, this param is required if no initial value for the order triggerBy false string Trigger price type tpLimitPrice false string Limit order price when take profit is triggered. Only working when original order sets partial limit tp/sl slLimitPrice false string Limit order price when stop loss is triggered. Only working when original order sets partial limit tp/sl
        Returns:
        Response Parameters Parameter Type Comments orderId string Order ID orderLinkId string User customised order ID
      • amendBatchOrder

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/order/amend-batch")
        retrofit2.Call<Object> amendBatchOrder​(@Body
                                               AmendBatchOrderRequest batchOrderRequest)
        BBatch Amend Order Covers: Option (UTA, UTA Pro) / USDT Perpetual, UDSC Perpetual, USDC Futures (UTA Pro)

        TIP This endpoint allows you to amend more than one open order in a single request.

        You can modify unfilled or partially filled orders. Conditional orders are not supported. A maximum of 20 orders (option) and 10 orders (linear) can be amended per request.

        https://bybit-exchange.github.io/docs/v5/order/batch-amend

        Parameters:
        batchOrderRequest - category true string Product type. linear, option request true array Object > symbol true string Symbol name > orderId false string Order ID. Either orderId or orderLinkId is required > orderLinkId false string User customised order ID. Either orderId or orderLinkId is required > orderIv false string Implied volatility. option only. Pass the real value, e.g for 10%, 0.1 should be passed > triggerPrice false string If you expect the price to rise to trigger your conditional order, make sure: triggerPrice > market price Else, triggerPrice < market price > qty false string Order quantity after modification. Do not pass it if not modify the qty > price false string Order price after modification. Do not pass it if not modify the price > takeProfit false string Take profit price after modification. If pass "0", it means cancel the existing take profit of the order. Do not pass it if you do not want to modify the take profit > stopLoss false string Stop loss price after modification. If pass "0", it means cancel the existing stop loss of the order. Do not pass it if you do not want to modify the stop loss > tpTriggerBy false string The price type to trigger take profit. When set a take profit, this param is required if no initial value for the order > slTriggerBy false string The price type to trigger stop loss. When set a take profit, this param is required if no initial value for the order > triggerBy false string Trigger price type > tpLimitPrice false string Limit order price when take profit is triggered. Only working when original order sets partial limit tp/sl > slLimitPrice false string Limit order price when stop loss is triggered. Only working when original order sets partial limit tp/sl
        Returns:
        Response Parameters Parameter Type Comments result Object >list array Object >> category string Product type >> symbol string Symbol name >> orderId string Order ID >> orderLinkId string User customised order ID retExtInfo Object >list array Object >> code number Success/error code >> msg string Success/error message
      • getCurrentAPIKeyInfo

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/user/query-api")
        retrofit2.Call<Object> getCurrentAPIKeyInfo()
        Get API Key Information Get the information of the api key. Use the api key pending to be checked to call the endpoint. Both master and sub user's api key are applicable.

        TIP Any permission can access this endpoint.

        https://bybit-exchange.github.io/docs/v5/user/apikey-info

        Returns:
        Response Parameters Parameter Type Comments id string Unique ID. Internal use note string The remark apiKey string Api key readOnly integer 0:Read and Write. 1:Read only secret string Always "" permissions Object The types of permission > ContractTrade array Permission of contract trade > Spot array Permission of spot > Wallet array Permission of wallet > Options array Permission of USDC Contract. It supports trade option and USDC perpetual. > Derivatives array Permission of derivatives > CopyTrading array Permission of copytrade. Not applicable to subaccount, always [] > BlockTrade array Permission of blocktrade. Not applicable to subaccount, always [] > Exchange array Permission of exchange > NFT array Permission of NFT. Not applicable to sub account, always [] ips array IP bound type integer The type of api key. 1:personal, 2:connected to the third-party app deadlineDay integer The remaining valid days of api key. Only for those api key with no IP bound or the password has been changed expiredAt datetime The expiry day of the api key. Only for those api key with no IP bound or the password has been changed createdAt datetime The create day of the api key unified integer Whether the account to which the api key belongs is a unified margin account. 0:regular account; 1:unified margin account uta integer Whether the account to which the account upgrade to unified trade account. 0:regular account; 1:unified trade account userID integer User ID inviterID integer Inviter ID (the UID of the account which invited this account to the platform) vipLevel string VIP Level mktMakerLevel string Market maker level affiliateID integer Affiliate Id. 0 represents that there is no binding relationship. rsaPublicKey string Rsa public key isMaster boolean If this api key belongs to master account or not parentUid string The main account uid. Returns "0" when the endpoint is called by main account kycLevel string Personal account kyc level. LEVEL_DEFAULT, LEVEL_1, LEVEL_2 kycRegion string Personal account kyc region
      • getSubUIDList

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/user/query-sub-members")
        retrofit2.Call<Object> getSubUIDList()
        Get Sub UID List Get all sub UID of master account. Use master user's api key only.

        TIP The API key must have one of the below permissions in order to call this endpoint..

        master API key: "Account Transfer", "Subaccount Transfer", "Withdrawal"

        https://bybit-exchange.github.io/docs/v5/user/subuid-list

        Returns:
        Response Parameters Parameter Type Comments subMembers array Object > uid string Sub user Id > username string Username > memberType integer 1: normal sub account, 6: custodial sub account > status integer The status of the user account 1: normal 2: login banned 4: frozen > accountMode integer The account mode of the user account 1: classic account 2: UMA 3: UTA > remark string The remark
      • getUIDWalletType

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/user/get-member-type")
        retrofit2.Call<Object> getUIDWalletType​(@Query("memberIds")
                                                String memberIds)
        Get UID Wallet Type Get available wallet types for the master account or sub account

        TIP Master api key: you can get master account and appointed sub account available wallet types, and support up to 200 sub UID in one request. Sub api key: you can get its own available wallet types PRACTICE "FUND" - If you never deposit or transfer capital into it, this wallet type will not be shown in the array, but your account indeed has this wallet.

        ["SPOT","OPTION","FUND","CONTRACT"] : Classic account and Funding wallet was operated before ["SPOT","OPTION","CONTRACT"] : Classic account and Funding wallet is never operated ["SPOT","UNIFIED","FUND","CONTRACT"] : UMA account and Funding wallet was operated before. (No UMA account after we forced upgrade to UTA) ["SPOT","UNIFIED","CONTRACT"] : UMA account and Funding wallet is never operated. (No UMA account after we forced upgrade to UTA) ["UNIFIED""FUND","CONTRACT"] : UTA account and Funding wallet was operated before. ["UNIFIED","CONTRACT"] : UTA account and Funding wallet is never operated.

        https://bybit-exchange.github.io/docs/v5/user/wallet-type

        Parameters:
        memberIds - false string Query itself wallet types when not passed When use master api key to query sub UID, master UID data is always returned in the top of the array Multiple sub UID are supported, separated by commas This param is ignored when you use sub account api key
        Returns:
        Response Parameters Parameter Type Comments accounts array Object > uid string Master/Sub user Id > accountType array Wallets array. SPOT, CONTRACT, FUND, OPTION, UNIFIED. Please check above practice to understand the value
      • getAffiliateUserInfo

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/user/aff-customer-info")
        retrofit2.Call<Object> getAffiliateUserInfo​(@Query("uid")
                                                    String uid)
        Get Affiliate User Info This API is used for affiliate to get their users information

        TIP Use master UID only The api key can only have "Affiliate" permission The transaction volume and deposit amount are the total amount of the user done on Bybit, and have nothing to do with commission settlement. Any transaction volume data related to commission settlement is subject to the Affiliate Portal.

        https://bybit-exchange.github.io/docs/v5/user/affiliate-info

        Parameters:
        uid - true string The master account UID of affiliate's client
        Returns:
        Response Parameters Parameter Type Comments uid string UID vipLevel string VIP level takerVol30Day string Taker volume in last 30 days (USDT). All volume related attributes below includes Derivatives, Option, Spot volume makerVol30Day string Maker volume in last 30 days (USDT) tradeVol30Day string Total trading volume in last 30 days (USDT) depositAmount30Day string Deposit amount in last 30 days (USDT) takerVol365Day string Taker volume in the past year (USDT) makerVol365Day string Maker volume in the past year (USDT) tradeVol365Day string Total trading volume in the past year (USDT) depositAmount365Day string Total deposit amount in the past year (USDT) totalWalletBalance string Wallet balance range 1: less than 100 USDT value 2: [100, 250) USDT value 3: [250, 500) USDT value 4: greater than 500 USDT value depositUpdateTime string The update date time (UTC) of deposit data volUpdateTime string The update date of volume data time (UTC)
      • createSubMember

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/user/create-sub-member")
        retrofit2.Call<Object> createSubMember​(@Body
                                               UserSubMemberRequest userSubMemberRequest)
        Create Sub UID Create a new sub user id. Use master user's api key only.

        TIP The API key must have one of the below permissions in order to call this endpoint..

        master API key: "Account Transfer", "Subaccount Transfer", "Withdrawal"

        https://bybit-exchange.github.io/docs/v5/user/create-subuid#http-request

        Parameters:
        userSubMemberRequest - username true string Give a username of the new sub user id. 6-16 characters, must include both numbers and letters. cannot be the same as the exist or deleted one. password false string Set the password for the new sub user id. 8-30 characters, must include numbers, upper and lowercase letters. memberType true integer 1: normal sub account, 6: custodial sub account switch false integer 0: turn off quick login (default) 1: turn on quick login. isUta false boolean true: create UTA account false(default): create classic account note false string Set a remark
        Returns:
        Response Parameters Parameter Type Comments uid string Sub user Id username string Give a username of the new sub user id. 6-16 characters, must include both numbers and letters. cannot be the same as the exist or deleted one. memberType integer 1: normal sub account, 6: custodial sub account status integer The status of the user account 1: normal 2: login banned 4: frozen remark string The remark
      • createSubAPI

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/user/create-sub-api")
        retrofit2.Call<Object> createSubAPI​(@Body
                                            CreateApiKeyRequest createApiKeyRequest)
        Create Sub UID API Key To create new API key for those newly created sub UID. Use master user's api key only.

        TIP The API key must have one of the below permissions in order to call this endpoint..

        master API key: "Account Transfer", "Subaccount Transfer", "Withdrawal"

        https://bybit-exchange.github.io/docs/v5/user/create-subuid-apikey#http-request

        Parameters:
        createApiKeyRequest - subuid true integer Sub user Id note false string Set a remark readOnly true integer 0:Read and Write. 1:Read only ips false string Set the IP bind. example: "192.168.0.1,192.168.0.2"note: don't pass ips or pass with "*" means no bind No ip bound api key will be invalid after 90 days api key without IP bound will be invalid after 7 days once the account password is changed permissions true Object Tick the types of permission. one of below types must be passed, otherwise the error is thrown > ContractTrade false array Contract Trade. ["Order","Position"] > Spot false array Spot Trade. ["SpotTrade"] > Wallet false array Wallet. ["AccountTransfer","SubMemberTransferList"] > Options false array USDC Contract. ["OptionsTrade"] > Derivatives false array This param is depreciated because system will automatically add this permission according to your account is UTA or Classic > Exchange false array Exchange. ["ExchangeHistory"] > CopyTrading false array Copytrade. ["CopyTrading"]
        Returns:
        Response Parameters Parameter Type Comments id string Unique id. Internal used note string The remark apiKey string Api key readOnly integer 0:Read and Write. 1:Read only secret string The secret paired with api key. The secret can't be queried by GET api. Please keep it properly permissions Object The types of permission > ContractTrade array Permisson of contract trade > Spot array Permisson of spot > Wallet array Permisson of wallet > Options array Permission of USDC Contract. It supports trade option and usdc perpetual. > Derivatives array Permission of Unified account > CopyTrading array Permission of copytrade > BlockTrade array Permission of blocktrade. Not applicable to sub account, always [] > Exchange array Permission of exchange > NFT array Permission of NFT. Not applicable to sub account, always []
      • modifyMasterApiKey

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/user/update-api")
        retrofit2.Call<Object> modifyMasterApiKey​(@Body
                                                  ModifyApiKeyRequest modifyMasterApiKeyRequest)
        Modify Master API Key Modify the settings of master api key. Use the api key pending to be modified to call the endpoint. Use master user's api key only.

        TIP The API key must have one of the below permissions in order to call this endpoint..

        master API key: "Account Transfer", "Subaccount Transfer", "Withdrawal" INFO Only the api key that calls this interface can be modified

        https://bybit-exchange.github.io/docs/v5/user/modify-master-apikey#http-request

        Parameters:
        modifyMasterApiKeyRequest - readOnly false integer 0 (default):Read and Write. 1:Read only ips false string Set the IP bind. example: "192.168.0.1,192.168.0.2"note: don't pass ips or pass with "*" means no bind No ip bound api key will be invalid after 90 days api key will be invalid after 7 days once the account password is changed permissions false Object Tick the types of permission. Don't send this param if you don't want to change the permission > ContractTrade false array Contract Trade. ["Order","Position"] > Spot false array Spot Trade. ["SpotTrade"] > Wallet false array Wallet. ["AccountTransfer","SubMemberTransfer"] > Options false array USDC Contract. ["OptionsTrade"] > Derivatives false array This param is depreciated because system will automatically add this permission according to your account is UTA or Classic > CopyTrading false array Copytrade. ["CopyTrading"] > BlockTrade false array Blocktrade. ["BlockTrade"] > Exchange false array Exchange. ["ExchangeHistory"] > NFT false array NFT. ["NFTQueryProductList"] > Affiliate false array Affiliate. ["Affiliate"] This permission is only useful for affiliate If you need this permission, make sure you remove all other permissions
        Returns:
        Response Parameters Parameter Type Comments id string Unique id. Internal used note string The remark apiKey string Api key readOnly integer 0:Read and Write. 1:Read only secret string Always "" permissions Object The types of permission > ContractTrade array Permisson of contract trade > Spot array Permisson of spot > Wallet array Permisson of wallet > Options array Permission of USDC Contract. It supports trade option and usdc perpetual. > Derivatives array Permission of Unified account > CopyTrading array Permission of copytrade. Not applicable to sub account, always [] > BlockTrade array Permission of blocktrade. Not applicable to sub account, always [] > Exchange array Permission of exchange > NFT array Permission of NFT. Not applicable to sub account, always [] ips array IP bound
      • modifySubApiKey

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/user/update-sub-api")
        retrofit2.Call<Object> modifySubApiKey​(@Body
                                               ModifyApiKeyRequest modifysubApiKeyRequest)
        Modify Sub API Key Modify the settings of sub api key. Use the sub account api key pending to be modified to call the endpoint or use master account api key to manage its sub account api key.

        TIP The API key must have one of the below permissions in order to call this endpoint

        sub API key: "Account Transfer", "Sub Member Transfer" master API Key: "Account Transfer", "Sub Member Transfer", "Withdrawal"

        https://bybit-exchange.github.io/docs/v5/user/modify-sub-apikey#http-request

        Parameters:
        modifysubApiKeyRequest - apikey false string Sub account api key You must pass this param when you use master account manage sub account api key settings If you use corresponding sub uid api key call this endpoint, apikey param cannot be passed, otherwise throwing an error readOnly false integer 0 (default):Read and Write. 1:Read only ips false string Set the IP bind. example: "192.168.0.1,192.168.0.2"note: don't pass ips or pass with "*" means no bind No ip bound api key will be invalid after 90 days api key will be invalid after 7 days once the account password is changed permissions false Object Tick the types of permission. Don't send this param if you don't want to change the permission > ContractTrade false array Contract Trade. ["Order","Position"] > Spot false array Spot Trade. ["SpotTrade"] > Wallet false array Wallet. ["AccountTransfer", "SubMemberTransferList"] > Options false array USDC Contract. ["OptionsTrade"] > Derivatives false array This param is depreciated because system will automatically add this permission according to your account is UTA or Classic > Exchange false array Exchange. ["ExchangeHistory"] > CopyTrading false array Copytrade. ["CopyTrading"]
        Returns:
        Response Parameters Parameter Type Comments id string Unique id. Internal used note string The remark apiKey string Api key readOnly integer 0:Read and Write. 1:Read only secret string Always "" permissions Object The types of permission > ContractTrade array Permisson of contract trade > Spot array Permisson of spot > Wallet array Permisson of wallet > Options array Permission of USDC Contract. It supports trade option and usdc perpetual. > Derivatives array Permission of Unified account > CopyTrading array Permission of copytrade > BlockTrade array Permission of blocktrade. Not applicable to sub account, always [] > Exchange array Permission of exchange > NFT array Permission of NFT. Not applicable to sub account, always [] ips array IP bound
      • deleteMasterApiKey

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/user/delete-api")
        retrofit2.Call<Object> deleteMasterApiKey()
        Delete Master API Key Delete the api key of master account. Use the api key pending to be delete to call the endpoint. Use master user's api key only.

        TIP The API key must have one of the below permissions in order to call this endpoint..

        master API key: "Account Transfer", "Subaccount Transfer", "Withdrawal" DANGER BE CAREFUL! The API key used to call this interface will be invalid immediately.

        https://bybit-exchange.github.io/docs/v5/user/rm-master-apikey

        Returns:
        Response Parameters None
      • deleteSubApiKey

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/user/delete-sub-api")
        retrofit2.Call<Object> deleteSubApiKey​(@Body
                                               ModifyApiKeyRequest deleteSubUidRequest)
        Delete Sub API Key Delete the api key of sub account. Use the sub api key pending to be delete to call the endpoint or use the master api key to delete corresponding sub account api key

        TIP The API key must have one of the below permissions in order to call this endpoint.

        sub API key: "Account Transfer", "Sub Member Transfer" master API Key: "Account Transfer", "Sub Member Transfer", "Withdrawal" DANGER BE CAREFUL! The Sub account API key will be invalid immediately after calling the endpoint.

        https://bybit-exchange.github.io/docs/v5/user/rm-sub-apikey#http-request

        Parameters:
        deleteSubUidRequest - apikey false string Sub account api key You must pass this param when you use master account manage sub account api key settings If you use corresponding sub uid api key call this endpoint, apikey param cannot be passed, otherwise throwing an error
        Returns:
        Response Parameters None
      • freezeSubMember

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/user/frozen-sub-member")
        retrofit2.Call<Object> freezeSubMember​(@Body
                                               FreezeSubUIDRquest freezeSubUIDRquest)
        Freeze Sub UID Freeze Sub UID. Use master user's api key only.

        TIP The API key must have one of the below permissions in order to call this endpoint..

        master API key: "Account Transfer", "Subaccount Transfer", "Withdrawal"

        https://bybit-exchange.github.io/docs/v5/user/froze-subuid#http-request

        Parameters:
        freezeSubUIDRquest - subuid true integer Sub user Id frozen true integer 0:unfreeze, 1:freeze
        Returns:
        Response Parameters None
      • getPositionInfo

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/position/list")
        retrofit2.Call<Object> getPositionInfo​(@Query("category")
                                               String category,
                                               @Query("symbol")
                                               String symbol,
                                               @Query("baseCoin")
                                               String baseCoin,
                                               @Query("settleCoin")
                                               String settleCoin,
                                               @Query("limit")
                                               Integer limit,
                                               @Query("cursor")
                                               String cursor)
        Get Position Info Query real-time position data, such as position size, cumulative realizedPNL.

        Unified account covers: USDT perpetual / USDC contract / Inverse contract / Options Classic account covers: USDT perpetual / Inverse contract

        https://bybit-exchange.github.io/docs/v5/position

        Parameters:
        category - true string Product type Unified account: linear, inverse, option Classic account: linear, inverse
        symbol - false string Symbol name If symbol passed, it returns data regardless of having position or not. If symbol=null and settleCoin specified, it returns position size greater than zero.
        baseCoin - false string Base coin. option only. Return all option positions if not passed
        settleCoin - false string Settle coin. For linear, either symbol or settleCoin is required. symbol has a higher priority
        limit - false integer Limit for data size per page. [1, 200]. Default: 20
        cursor - false string Cursor. Use the nextPageCursor token from the response to retrieve the next page of the result set
        Returns:
        Response Parameters Parameter Type Comments category string Product type list array Object > positionIdx integer Position idx, used to identify positions in different position modes 0: One-Way Mode 1: Buy side of both side mode 2: Sell side of both side mode > riskId integer Risk limit ID. Note: for portfolio margin mode, this field returns 0, which means risk limit rules are invalid > riskLimitValue string Risk limit value. Note: for portfolio margin mode, this field returns 0, which means risk limit rules are invalid > symbol string Symbol name > side string Position side. Buy: long, Sell: short. Note: under one-way mode, it returns None if empty position > size string Position size > avgPrice string Average entry price For USDC Perp and Futures, it indicates average entry price, and it will not be changed with 8-hour session settlement > positionValue string Position value > tradeMode integer Trade mode Classic and UTA (inverse): 0: cross-margin, 1: isolated margin UTA: depreciated, always 0 > autoAddMargin integer Whether to add margin automatically. 0: false, 1: true. For UTA, it is meaningful only when UTA enables ISOLATED_MARGIN > positionStatus String Position status. Normal, Liq, Adl > leverage string Position leverage. Valid for contract. Note: for portfolio margin mode, this field returns "", which means leverage rules are invalid > markPrice string Last mark price > liqPrice string Position liquidation price UTA (inverse) and UTA (isolated margin enabled) and Classic account: it is the real price for isolated and cross positions, and keeps "" when liqPrice ≤ minPrice or liqPrice ≥ maxPrice UTA (Cross margin mode): it is an estimated price for cross positions(because the unified mode controls the risk rate according to the account), and keeps "" when liqPrice ≤ minPrice or liqPrice ≥ maxPrice However, this field is empty for Portfolio Margin Mode, and no liquidation price will be provided > bustPrice string Bankruptcy price. Note: Unified mode returns "", no position bankruptcy price (exclude inverse trade under UTA) > positionIM string Initial margin. For portfolio margin mode, it returns "" > positionMM string Maintenance margin. For portfolio margin mode, it returns "" > positionBalance string Position margin. For portfolio margin mode, it returns "" > tpslMode string Depreciated, meaningless here, always "Full". Spot does not return this field. Option returns "" > takeProfit string Take profit price > stopLoss string Stop loss price > trailingStop string Trailing stop (The distance from market price) > unrealisedPnl string Unrealised PnL > cumRealisedPnl string Cumulative realised pnl Futures and Perp: it is the all time cumulative realised pnl Option: it is the realised pnl when you hold that position > adlRankIndicator integer Auto-deleverage rank indicator. What is Auto-Deleveraging? > createdTime string Position created timestamp (ms) > updatedTime string Position updated timestamp (ms) > seq long Cross sequence, used to associate each fill and each position update Different symbols may have the same seq, please use seq + symbol to check unique Returns "-1" if the symbol has never been traded Returns the seq updated by the last transaction when there are settings like leverage, risk limit nextPageCursor string Refer to the cursor request parameter
      • getMovePositionHistory

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/position/move-history")
        retrofit2.Call<Object> getMovePositionHistory​(@Query("category")
                                                      String category,
                                                      @Query("symbol")
                                                      String symbol,
                                                      @Query("startTime")
                                                      Long startTime,
                                                      @Query("endTime")
                                                      Long endTime,
                                                      @Query("status")
                                                      String status,
                                                      @Query("blockTradeId")
                                                      String blockTradeId,
                                                      @Query("limit")
                                                      Integer limit,
                                                      @Query("cursor")
                                                      String cursor)
        Get Move Position History You can query moved position data by master UID api key Unified account covers: USDT perpetual / USDC contract / Spot / Option https://bybit-exchange.github.io/docs/v5/position/move-position-history HTTP Request GET /v5/position/move-history
        Parameters:
        category - false string Product type. linear, spot, option
        symbol - false string Symbol name
        startTime - false number The order creation start timestamp. The interval is 7 days
        endTime - false number The order creation end timestamp. The interval is 7 days
        status - false string Order status. Processing, Filled, Rejected
        blockTradeId - false string Block trade ID
        limit - false string Limit for data size per page. [1, 200]. Default: 20
        cursor - false string Cursor. Use the nextPageCursor token from the response to retrieve the next page of the result set
        Returns:
        Response Parameters Parameter Type Comments list array Object > blockTradeId string Block trade ID > category string Product type.Linear, spot, option > orderId string Bybit order ID > userId integer User ID > symbol string Symbol name > side string Order side from taker's perspective. Buy, Sell > price string Order price > qty string Order quantity > execFee string The fee for taker or maker in the base currency paid to the Exchange executing the block trade > status string Block trade status. Processing, Filled, Rejected > execId string The unique trade ID from the exchange > resultCode integer The result code of the order. 0 means success > resultMessage string The error message. "" when resultCode=0 > createdAt number The timestamp (ms) when the order is created > updatedAt number The timestamp (ms) when the order is updated > rejectParty string "" means the status=Filled Taker, Maker when status=Rejected bybit means error is occurred on the Bybit side nextPageCursor string Used to get the next page data
      • batchMovePositions

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/position/move-positions")
        retrofit2.Call<Object> batchMovePositions​(@Body
                                                  BatchMovePositionRequest batchMovePositionRequest)
        Move Position You can move positions between sub-master, master-sub, or sub-sub UIDs when necessary Unified account covers: USDT perpetual / USDC contract / Spot / Option INFO The endpoint can only be called by master UID api key UIDs must be the same master-sub account relationship The trades generated from move-position endpoint will not be displayed in the Recent Trade (Rest API and Websocket) There is no trading fee fromUid and toUid both should be Unified trading accounts, and they need to be one-way mode when moving the positions Please note that once executed, you will get execType=MovePosition entry from Get Trade History, Get Closed Pnl, and stream from Execution. HTTP Request POST /v5/position/move-positions https://bybit-exchange.github.io/docs/v5/position/move-position
        Parameters:
        batchMovePositionRequest - fromUid true string From UID Must be UTA Must be in one-way mode for Futures toUid true string To UID Must be UTA Must be in one-way mode for Futures list true array Object. Up to 25 legs per request > category true string Product type. linear, spot, option > symbol true string Symbol name > price true string Trade price linear: the price needs to be between [95% of mark price, 105% of mark price] spot and option: the price needs to follow the price rule from Instruments Info > side true string Trading side of fromUid For example, fromUid has a long position, when side=Sell, then once executed, the position of fromUid will be reduced or open a short position depending on qty input > qty true string Executed qty The value must satisfy the qty rule from Instruments Info, in particular, category=linear is able to input maxOrderQty * 5
        Returns:
        Response Parameters retCode integer Result code. 0 means request is successfully accepted retMsg string Result message result map Object > blockTradeId string Block trade ID > status string Status. Processing, Rejected > rejectParty string emtty string means initial validation is passed, please check the order status via Get Move Position History Taker, Maker when status=Rejected bybit means error is occurred on the Bybit side
      • setPositionLeverage

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/position/set-leverage")
        retrofit2.Call<Object> setPositionLeverage​(@Body
                                                   SetLeverageRequest setLeverageRequest)
        Set Leverage Set the leverage

        Unified account covers: USDT perpetual / USDC contract / Inverse contract Classic account covers: USDT perpetual / Inverse contract

        https://bybit-exchange.github.io/docs/v5/position/leverage#http-request

        Parameters:
        setLeverageRequest - category true string Product type Unified account: linear, inverse Classic account: linear, inverse. Please note that category is not involved with business logic symbol true string Symbol name buyLeverage true string [1, max leverage of corresponding risk limit] Classic account: under one-way mode, buyLeverage must be the same as sellLeverage Unified account: buyLeverage must be the same as sellLeverage all the time sellLeverage true string [1, max leverage of corresponding risk limit] Classic account: under one-way mode, buyLeverage must be the same as sellLeverage Unified account: buyLeverage must be the same as sellLeverage all the time
        Returns:
        Response Parameters None
      • confirmPositionRiskLimit

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/position/confirm-pending-mmr")
        retrofit2.Call<Object> confirmPositionRiskLimit​(@Body
                                                        ConfirmNewRiskLimitRequest confirmNewRiskLimitRequest)
        Confirm New Risk Limit It is only applicable when the user is marked as only reducing positions (please see the isReduceOnly field in the Get Position Info interface). After the user actively adjusts the risk level, this interface is called to try to calculate the adjusted risk level, and if it passes (retCode=0), the system will remove the position reduceOnly mark. You are recommended to call Get Position Info to check isReduceOnly field.

        Unified account covers: USDT perpetual / USDC contract / Inverse contract Classic account covers: USDT perpetual / Inverse contract

        https://bybit-exchange.github.io/docs/v5/position/confirm-mmr

        Parameters:
        confirmNewRiskLimitRequest - category true string Product type Unified account: linear, inverse Classic account: linear, inverse symbol true string Symbol name
        Returns:
        Response Parameters None
      • swithMarginRequest

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/position/switch-isolated")
        retrofit2.Call<Object> swithMarginRequest​(@Body
                                                  SwitchMarginRequest switchMarginRequest)
        Switch Cross/Isolated Margin Select cross margin mode or isolated margin mode per symbol level

        Unified account covers: Inverse contract Classic account covers: USDT perpetual / Inverse contract

        https://bybit-exchange.github.io/docs/v5/position/cross-isolate#http-request

        Parameters:
        switchMarginRequest - category true string Product type Unified account: inverse Classic account: linear, inverse. Please note that category is not involved with business logic symbol true string Symbol name tradeMode true integer 0: cross margin. 1: isolated margin buyLeverage true string The value must be equal to sellLeverage value sellLeverage true string The value must be equal to buyLeverage value
        Returns:
        Response Parameters None
      • switchPositionMode

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/position/switch-mode")
        retrofit2.Call<Object> switchPositionMode​(@Body
                                                  SwitchPositionModeRequest switchPositionModeRequest)
        Switch Position Mode It supports to switch the position mode for USDT perpetual and Inverse futures. If you are in one-way Mode, you can only open one position on Buy or Sell side. If you are in hedge mode, you can open both Buy and Sell side positions simultaneously.

        Unified account covers: USDT perpetual / Inverse Futures Classic account covers: USDT perpetual / Inverse Futures

        TIP Priority for configuration to take effect: symbol > coin > system default System default: one-way mode If the request is by coin (settleCoin), then all symbols based on this setteCoin that do not have position and open order will be batch switched, and new listed symbol based on this settleCoin will be the same mode you set. Example System default coin symbol Initial setting one-way never configured never configured Result All USDT perpetual trading pairs are one-way mode Change 1 - - Set BTCUSDT to hedge-mode Result BTCUSDT becomes hedge-mode, and all other symbols keep one-way mode list new symbol ETHUSDT ETHUSDT is one-way mode (inherit default rules) Change 2 - Set USDT to hedge-mode - Result All current trading pairs with no positions or orders are hedge-mode, and no adjustments will be made for trading pairs with positions and orders list new symbol SOLUSDT SOLUSDT is hedge-mode (Inherit coin rule) Change 3 - - Set ASXUSDT to one-mode Take effect result AXSUSDT is one-way mode, other trading pairs have no change list new symbol BITUSDT BITUSDT is hedge-mode (Inherit coin rule) The position-switch ability for each contract Classic account Unified account USDT perpetual Support one-way and hedge-mode Support one-way and hedge-mode USDC perpetual Support one-way only Support one-way only Inverse perpetua Support one-way only Support one-way only Inverse future Support one-way and hedge-mode Support one-way and hedge-mode

        https://bybit-exchange.github.io/docs/v5/position/position-mode#http-request

        Parameters:
        switchPositionModeRequest - category true string Product type Unified account: linear, USDT Perp; inverse, Inverse Futures Classic account: linear, USDT Perp; inverse, Inverse Futures. Please note that category is not involved with business logic symbol false string Symbol name. Either symbol or coin is required. symbol has a higher priority coin false string Coin mode true integer Position mode. 0: Merged Single. 3: Both Sides
        Returns:
        Response Parameters None
      • setTpslMode

        @Deprecated
        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/position/set-tpsl-mode")
        retrofit2.Call<Object> setTpslMode​(@Body
                                           SetTpSlModeRequest setTpSlModeRequest)
        Deprecated.
        Set TP/SL Mode TIP To some extent, this endpoint is depreciated because now tpsl is based on order level. This API was used for position level change before.

        However, you still can use it to set an implicit tpsl mode for a certain symbol because when you don't pass "tpslMode" in the place order or trading stop request, system will get the tpslMode by the default setting.

        Set TP/SL mode to Full or Partial

        Unified account covers: USDT perpetual / Inverse contract Classic account covers: USDT perpetual / Inverse contract

        INFO For partial TP/SL mode, you can set the TP/SL size smaller than position size.

        https://bybit-exchange.github.io/docs/v5/position/tpsl-mode#http-request

        Parameters:
        setTpSlModeRequest - category true string Product type Unified account: linear, inverse Classic account: linear, inverse. Please note that category is not involved with business logic symbol true string Symbol name tpSlMode true string TP/SL mode. Full,Partial
        Returns:
        Response Parameters Parameter Type Comments tpSlMode string Full,Partial
      • setRiskLimit

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/position/set-risk-limit")
        @Deprecated
        retrofit2.Call<Object> setRiskLimit​(@Body
                                            SetRiskLimitRequest setRiskLimitRequest)
        Deprecated.
        Set Risk Limit The risk limit will limit the maximum position value you can hold under different margin requirements. If you want to hold a bigger position size, you need more margin. This interface can set the risk limit of a single position. If the order exceeds the current risk limit when placing an order, it will be rejected. Click here to learn more about risk limit.

        Unified account covers: USDT perpetual / USDC contract / Inverse contract Classic account covers: USDT perpetual / Inverse contract

        TIP Set the risk limit of the position. You can get risk limit information for each symbol here.

        https://bybit-exchange.github.io/docs/v5/position/set-risk-limit#http-request

        Parameters:
        setRiskLimitRequest - category true string Product type Unified account: linear, inverse Classic account: linear, inverse. Please note that category is not involved with business logic symbol true string Symbol name riskId true integer Risk limit ID positionIdx false integer Used to identify positions in different position modes. For hedge mode, it is required 0: one-way mode 1: hedge-mode Buy side 2: hedge-mode Sell side
        Returns:
        Response Parameters Parameter Type Comments category string Product type riskId integer Risk limit ID riskLimitValue string The position limit value corresponding to this risk ID
      • setTradingStop

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/position/trading-stop")
        retrofit2.Call<Object> setTradingStop​(@Body
                                              TradingStopRequest tradingStopRequest)
        Set Trading Stop Set the take profit, stop loss or trailing stop for the position.

        Unified account covers: USDT perpetual / USDC contract / Inverse contract Classic account covers: USDT perpetual / Inverse contract

        TIP Passing these parameters will create conditional orders by the system internally. The system will cancel these orders if the position is closed, and adjust the qty according to the size of the open position.

        INFO New version of TP/SL function supports both holding entire position TP/SL orders and holding partial position TP/SL orders.

        Full position TP/SL orders: This API can be used to modify the parameters of existing TP/SL orders. Partial position TP/SL orders: This API can only add partial position TP/SL orders. NOTE Under the new version of Tp/SL function, when calling this API to perform one-sided take profit or stop loss modification on existing TP/SL orders on the holding position, it will cause the paired tp/sl orders to lose binding relationship. This means that when calling the cancel API through the tp/sl order ID, it will only cancel the corresponding one-sided take profit or stop loss order ID.

        https://bybit-exchange.github.io/docs/v5/position/trading-stop#http-request

        Parameters:
        tradingStopRequest - category true string Product type Unified account: linear, inverse Classic account: linear, inverse. Please note that category is not involved with business logic symbol true string Symbol name takeProfit false string Cannot be less than 0, 0 means cancel TP stopLoss false string Cannot be less than 0, 0 means cancel SL trailingStop false string Trailing stop by price distance. Cannot be less than 0, 0 means cancel TS tpTriggerBy false string Take profit trigger price type slTriggerBy false string Stop loss trigger price type activePrice false string Trailing stop trigger price. Trailing stop will be triggered when this price is reached only tpslMode false string TP/SL mode. Full: entire position TP/SL, Partial: partial position TP/SL. As each contract has an initial full TP/SL mode, if it has been modified before, it may be partial. Therefore, if not provided, the system will automatically retrieve the current TP/SL mode configuration for the contract. tpSize false string Take profit size. Valid in TP/SL partial mode. Note: the value of tpSize and slSize must equal slSize false string Stop loss size. Valid in TP/SL partial mode. Note: the value of tpSize and slSize must equal tpLimitPrice false string The limit order price when take profit price is triggered. Only works when tpslMode=Partial and tpOrderType=Limit slLimitPrice false string The limit order price when stop loss price is triggered. Only works when tpslMode=Partial and slOrderType=Limit tpOrderType false string The order type when take profit is triggered. Market(default), Limit. For tpslMode=Full, it only supports tpOrderType=Market slOrderType false string The order type when stop loss is triggered. Market(default), Limit. For tpslMode=Full, it only supports slOrderType=Market positionIdx true integer Used to identify positions in different position modes. 0: one-way mode 1: hedge-mode Buy side 2: hedge-mode Sell side
        Returns:
        Response Parameters None
      • setAutoAddMargin

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/position/set-auto-add-margin")
        retrofit2.Call<Object> setAutoAddMargin​(@Body
                                                SetAutoAddMarginRequest setAutoAddMarginRequest)
        Set Auto Add Margin Turn on/off auto-add-margin for isolated margin position

        Unified account covers: USDT perpetual / USDC perpetual / USDC futures / Inverse contract Classic account covers: USDT perpetual / Inverse contract

        https://bybit-exchange.github.io/docs/v5/position/auto-add-margin#http-request

        Parameters:
        setAutoAddMarginRequest - category true string Product type Unified account: linear, inverse Classic account: linear, inverse symbol true string Symbol name autoAddMargin true integer Turn on/off. 0: off. 1: on positionIdx false integer Used to identify positions in different position modes. For hedge mode position, this param is required 0: one-way mode 1: hedge-mode Buy side 2: hedge-mode Sell side
        Returns:
        Response Parameters None
      • modifyPositionMargin

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/position/add-margin")
        retrofit2.Call<Object> modifyPositionMargin​(@Body
                                                    ModifyMarginRequest modifyMarginRequest)
        Add Or Reduce Margin Manually add or reduce margin for isolated margin position

        Unified account covers: USDT perpetual / USDC perpetual / USDC futures / Inverse contract Classic account covers: USDT perpetual / Inverse contract

        https://bybit-exchange.github.io/docs/v5/position/manual-add-margin#http-request

        Parameters:
        modifyMarginRequest - category true string Product type Unified account: linear, inverse Classic account: linear, inverse symbol true string Symbol name margin true string Add or reduce. To add, then 10; To reduce, then -10. Support up to 4 decimal positionIdx false integer Used to identify positions in different position modes. For hedge mode position, this param is required 0: one-way mode 1: hedge-mode Buy side 2: hedge-mode Sell side
        Returns:
        Response Parameters Parameter Type Comments category string Product type symbol string Symbol name positionIdx integer Position idx, used to identify positions in different position modes 0: One-Way Mode 1: Buy side of both side mode 2: Sell side of both side mode riskId integer Risk limit ID riskLimitValue string Risk limit value size string Position size avgPrice string Average entry price liqPrice string Liquidation price bustPrice string Bankruptcy price markPrice string Last mark price positionValue string Position value leverage string Position leverage autoAddMargin integer Whether to add margin automatically. 0: false, 1: true positionStatus String Position status. Normal, Liq, Adl positionIM string Initial margin positionMM string Maintenance margin takeProfit string Take profit price stopLoss string Stop loss price trailingStop string Trailing stop (The distance from market price) unrealisedPnl string Unrealised PnL cumRealisedPnl string Cumulative realised pnl createdTime string Position created timestamp (ms) updatedTime string Position updated timestamp (ms)
      • getExecutionList

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/execution/list")
        @Deprecated
        retrofit2.Call<Object> getExecutionList​(@Query("category")
                                                String category,
                                                @Query("symbol")
                                                String symbol,
                                                @Query("orderId")
                                                String orderId,
                                                @Query("orderLinkId")
                                                String orderLinkId,
                                                @Query("baseCoin")
                                                String baseCoin,
                                                @Query("startTime")
                                                Long startTime,
                                                @Query("endTime")
                                                Long endTime,
                                                @Query("execType")
                                                String execType,
                                                @Query("limit")
                                                Integer limit,
                                                @Query("cursor")
                                                String cursor)
        Deprecated.
        Get Execution Query users' execution records, sorted by execTime in descending order. However, for Classic spot, they are sorted by execId in descending order.

        Unified account covers: Spot / USDT perpetual / USDC contract / Inverse contract / Options Classic account covers: Spot / USDT perpetual / Inverse contract

        TIP Response items will have sorting issues When 'execTime' is the same. This issue is currently being optimized and will be released at the end of October. If you want to receive real-time execution information, Use the websocket stream (recommended). You may have multiple executions in a single order. You can query by symbol, baseCoin, orderId and orderLinkId, and if you pass multiple params, the system will process them according to this priority: orderId > orderLinkId > symbol > baseCoin.

        https://bybit-exchange.github.io/docs/v5/position/execution

        Parameters:
        category - true string Product type Unified account: spot, linear, inverse, option Classic account: spot, linear, inverse
        symbol - false string Symbol name
        orderId - false string Order ID
        orderLinkId - false string User customised order ID. Classic account does not support this param
        baseCoin - false string Base coin. Unified account - inverse and Classic account do not support this param
        startTime - false integer The start timestamp (ms)
        endTime - false integer The end timestamp (ms)
        execType - false string Execution type. Classic spot is not supported
        limit - false integer Limit for data size per page. [1, 100]. Default: 50
        cursor - false string Cursor. Use the nextPageCursor token from the response to retrieve the next page of the result set
        Returns:
        Response Parameters Parameter Type Comments category string Product type list array Object > symbol string Symbol name > orderId string Order ID > orderLinkId string User customized order ID. Classic spot is not supported > side string Side. Buy,Sell > orderPrice string Order price > orderQty string Order qty > leavesQty string The remaining qty not executed. Classic spot is not supported > orderType string Order type. Market,Limit > stopOrderType string Stop order type. If the order is not stop order, any type is not returned. Classic spot is not supported > execFee string Executed trading fee. You can get spot fee currency instruction here > execId string Execution ID > execPrice string Execution price > execQty string Execution qty > execType string Executed type. Classic spot is not supported > execValue string Executed order value. Classic spot is not supported > execTime string Executed timestamp(ms) > isMaker boolean Is maker order. true: maker, false: taker > feeRate string Trading fee rate. Classic spot is not supported > tradeIv string Implied volatility. Valid for option > markIv string Implied volatility of mark price. Valid for option > markPrice string The mark price of the symbol when executing. Classic spot is not supported > indexPrice string The index price of the symbol when executing. Valid for option only > underlyingPrice string The underlying price of the symbol when executing. Valid for option > blockTradeId string Paradigm block trade ID > closedSize string Closed position size > seq long Cross sequence, used to associate each fill and each position update The seq will be the same when conclude multiple transactions at the same time Different symbols may have the same seq, please use seq + symbol to check unique Classic account Spot trade does not have this field nextPageCursor string Refer to the cursor request parameter
      • getClosePnlList

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/position/closed-pnl")
        retrofit2.Call<Object> getClosePnlList​(@Query("category")
                                               String category,
                                               @Query("symbol")
                                               String symbol,
                                               @Query("startTime")
                                               Long startTime,
                                               @Query("endTime")
                                               Long endTime,
                                               @Query("limit")
                                               Integer limit,
                                               @Query("cursor")
                                               String cursor)
        Get Closed PnL Query user's closed profit and loss records. The results are sorted by createdTime in descending order.

        Unified account covers: USDT perpetual / USDC contract / Inverse contract Classic account covers: USDT perpetual / Inverse contract

        https://bybit-exchange.github.io/docs/v5/position/close-pnl

        Parameters:
        category - true string Product type Unified account: linear, inverse Classic account: linear, inverse. Please note that category is not involved with business logic
        symbol - false string Symbol name
        startTime - false integer The start timestamp (ms)
        endTime - false integer The end timestamp (ms)
        limit - false integer Limit for data size per page. [1, 100]. Default: 50
        cursor - false string Cursor. Use the nextPageCursor token from the response to retrieve the next page of the result set
        Returns:
        Response Parameters Parameter Type Comments category string Product type list array Object > symbol string Symbol name > orderId string Order ID > side string Buy, Sell > qty string Order qty > orderPrice string Order price > orderType string Order type. Market,Limit > execType string Exec type. Trade, BustTrade, SessionSettlePnL, Settle > closedSize string Closed size > cumEntryValue string Cumulated Position value > avgEntryPrice string Average entry price > cumExitValue string Cumulated exit position value > avgExitPrice string Average exit price > closedPnl string Closed PnL > fillCount string The number of fills in a single order > leverage string leverage > createdTime string The created time (ms) > updatedTime string The updated time (ms) nextPageCursor string Refer to the cursor request parameter
      • getPreUpgradeClosePnl

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/pre-upgrade/position/closed-pnl")
        retrofit2.Call<Object> getPreUpgradeClosePnl​(@Query("category")
                                                     String category,
                                                     @Query("symbol")
                                                     String symbol,
                                                     @Query("startTime")
                                                     Long startTime,
                                                     @Query("endTime")
                                                     Long endTime,
                                                     @Query("limit")
                                                     Integer limit,
                                                     @Query("cursor")
                                                     String cursor)
        Get Pre-upgrade Closed PnL Query user's closed profit and loss records from before you upgraded the account to a Unified account. The results are sorted by createdTime in descending order.

        For now, it only supports to query USDT perpetual, Inverse perpetual and futures.

        https://bybit-exchange.github.io/docs/v5/pre-upgrade/close-pnl

        Parameters:
        category - true string Product type linear, inverse
        symbol - true string Symbol name
        startTime - false integer The start timestamp (ms)
        endTime - false integer The end timestamp (ms)
        limit - false integer Limit for data size per page. [1, 100]. Default: 50
        cursor - false string Cursor. Use the nextPageCursor token from the response to retrieve the next page of the result set
        Returns:
        Response Parameters Parameter Type Comments category string Product type list array Object > symbol string Symbol name > orderId string Order ID > side string Buy, Side > qty string Order qty > orderPrice string Order price > orderType string Order type. Market,Limit > execType string Exec type. Trade, BustTrade, SessionSettlePnL, Settle > closedSize string Closed size > cumEntryValue string Cumulated Position value > avgEntryPrice string Average entry price > cumExitValue string Cumulated exit position value > avgExitPrice string Average exit price > closedPnl string Closed PnL > fillCount string The number of fills in a single order > leverage string leverage > createdTime string The created time (ms) > updatedTime string The updated time (ms) nextPageCursor string Refer to the cursor request parameter
      • getPreUpgradeOptionDelivery

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/pre-upgrade/asset/delivery-record")
        retrofit2.Call<Object> getPreUpgradeOptionDelivery​(@Query("category")
                                                           String category,
                                                           @Query("symbol")
                                                           String symbol,
                                                           @Query("expDate")
                                                           String expDate,
                                                           @Query("limit")
                                                           Integer limit,
                                                           @Query("cursor")
                                                           String cursor)
        Get Pre-upgrade Option Delivery Record Query delivery records of Option before you upgraded the account to a Unified account, sorted by deliveryTime in descending order

        https://bybit-exchange.github.io/docs/v5/pre-upgrade/delivery

        Parameters:
        category - true string Product type. option
        symbol - false string Symbol name
        expDate - false string Expiry date. 25MAR22. Default: return all
        limit - false integer Limit for data size per page. [1, 50]. Default: 20
        cursor - false string Cursor. Used for pagination
        Returns:
        Response Parameters Parameter Type Comments category string Product type list array Object > deliveryTime number Delivery time (ms) > symbol string Symbol name > side string Buy,Sell > position string Executed size > deliveryPrice string Delivery price > strike string Exercise price > fee string Trading fee > deliveryRpl string Realized PnL of the delivery nextPageCursor string Cursor. Used for pagination
      • getPreUpgradeOrderHistory

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/pre-upgrade/order/history")
        retrofit2.Call<Object> getPreUpgradeOrderHistory​(@Query("category")
                                                         String category,
                                                         @Query("symbol")
                                                         String symbol,
                                                         @Query("baseCoin")
                                                         String baseCoin,
                                                         @Query("orderId")
                                                         String orderId,
                                                         @Query("orderLinkId")
                                                         String orderLinkId,
                                                         @Query("orderFilter")
                                                         String orderFilter,
                                                         @Query("orderStatus")
                                                         String orderStatus,
                                                         @Query("startTime")
                                                         Long startTime,
                                                         @Query("endTime")
                                                         Long endTime,
                                                         @Query("limit")
                                                         Integer limit,
                                                         @Query("cursor")
                                                         String cursor)
        Get Pre-upgrade Order History After the account is upgraded to a Unified account, you can get the orders which occurred before the upgrade.

        INFO can get all status in 7 days can only get filled orders beyond 7 days

        https://bybit-exchange.github.io/docs/v5/pre-upgrade/order-list

        Parameters:
        category - true string Product type. linear, inverse, option
        symbol - false string Symbol name. If not passed, return settleCoin=USDT by default To get USDC perp, please pass symbol
        baseCoin - false string Base coin. Used for option query
        orderId - false string Order ID
        orderLinkId - false string User customised order ID
        orderFilter - false string Order: active order, StopOrder: conditional order
        orderStatus - false string Order status. Not supported for spot category
        startTime - false integer The start timestamp (ms) startTime and endTime must be passed together If not passed, query the past 7 days data by default
        endTime - false integer The end timestamp (ms)
        limit - false integer Limit for data size per page. [1, 50]. Default: 20
        cursor - false string Cursor. Use the nextPageCursor token from the response to retrieve the next page of the result set
        Returns:
        Response Parameters Parameter Type Comments category string Product type list array Object > orderId string Order ID > orderLinkId string User customised order ID > blockTradeId string Block trade ID > symbol string Symbol name > price string Order price > qty string Order qty > side string Side. Buy,Sell > isLeverage string Useless field for those orders before upgraded > positionIdx integer Position index. Used to identify positions in different position modes > orderStatus string Order status > cancelType string Cancel type > rejectReason string Reject reason > avgPrice string Average filled price. If unfilled, it is "" > leavesQty string The remaining qty not executed > leavesValue string The estimated value not executed > cumExecQty string Cumulative executed order qty > cumExecValue string Cumulative executed order value > cumExecFee string Cumulative executed trading fee > timeInForce string Time in force > orderType string Order type. Market,Limit > stopOrderType string Stop order type > orderIv string Implied volatility > triggerPrice string Trigger price. If stopOrderType=TrailingStop, it is activate price. Otherwise, it is trigger price > takeProfit string Take profit price > stopLoss string Stop loss price > tpTriggerBy string The price type to trigger take profit > slTriggerBy string The price type to trigger stop loss > triggerDirection integer Trigger direction. 1: rise, 2: fall > triggerBy string The price type of trigger price > lastPriceOnCreated string Last price when place the order > reduceOnly boolean Reduce only. true means reduce position size > closeOnTrigger boolean Close on trigger. What is a close on trigger order? > placeType string Place type, option used. iv, price > smpType string SMP execution type > smpGroup integer Smp group ID. If the UID has no group, it is 0 by default > smpOrderId string The counterparty's orderID which triggers this SMP execution > createdTime string Order created timestamp (ms) > updatedTime string Order updated timestamp (ms) nextPageCursor string Refer to the cursor request parameter
      • getPreUpgradeTradeHistory

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/pre-upgrade/execution/list")
        retrofit2.Call<Object> getPreUpgradeTradeHistory​(@Query("category")
                                                         String category,
                                                         @Query("symbol")
                                                         String symbol,
                                                         @Query("orderId")
                                                         String orderId,
                                                         @Query("orderLinkId")
                                                         String orderLinkId,
                                                         @Query("baseCoin")
                                                         String baseCoin,
                                                         @Query("startTime")
                                                         Long startTime,
                                                         @Query("endTime")
                                                         Long endTime,
                                                         @Query("execType")
                                                         String execType,
                                                         @Query("limit")
                                                         Integer limit,
                                                         @Query("cursor")
                                                         String cursor)
        Get Pre-upgrade Trade History Get users' execution records which occurred before you upgraded the account to a Unified account, sorted by execTime in descending order

        For now, it supports to query USDT perpetual, USDC perpetual, Inverse perpetual and futures, Option.

        TIP Response items will have sorting issues When 'execTime' is the same. This issue is currently being optimized and will be released at the end of October. If you want to receive real-time execution information, Use the websocket stream (recommended). You may have multiple executions in a single order. You can query by symbol, baseCoin, orderId and orderLinkId, and if you pass multiple params, the system will process them according to this priority: orderId > orderLinkId > symbol > baseCoin.

        https://bybit-exchange.github.io/docs/v5/pre-upgrade/execution

        Parameters:
        category - true string Product type linear, inverse, option
        symbol - false string Symbol name
        orderId - false string Order ID
        orderLinkId - false string User customised order ID
        baseCoin - false string Base coin. Used for option
        startTime - false integer The start timestamp (ms)
        endTime - false integer The end timestamp (ms)
        execType - false string Execution type
        limit - false integer Limit for data size per page. [1, 100]. Default: 50
        cursor - false string Cursor. Use the nextPageCursor token from the response to retrieve the next page of the result set
        Returns:
        Response Parameters Parameter Type Comments category string Product type list array Object > symbol string Symbol name > orderId string Order ID > orderLinkId string User customized order ID > side string Side. Buy,Sell > orderPrice string Order price > orderQty string Order qty > leavesQty string The remaining qty not executed > orderType string Order type. Market,Limit > stopOrderType string Stop order type. If the order is not stop order, any type is not returned > execFee string Executed trading fee > execId string Execution ID > execPrice string Execution price > execQty string Execution qty > execType string Executed type > execValue string Executed order value > execTime string Executed timestamp(ms) > isMaker boolean Is maker order. true: maker, false: taker > feeRate string Trading fee rate > tradeIv string Implied volatility > markIv string Implied volatility of mark price > markPrice string The mark price of the symbol when executing > indexPrice string The index price of the symbol when executing > underlyingPrice string The underlying price of the symbol when executing > blockTradeId string Paradigm block trade ID > closedSize string Closed position size nextPageCursor string Refer to the cursor request parameter
      • getPreUpgradeTransaction

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/pre-upgrade/account/transaction-log")
        retrofit2.Call<Object> getPreUpgradeTransaction​(@Query("category")
                                                        String category,
                                                        @Query("baseCoin")
                                                        String baseCoin,
                                                        @Query("type")
                                                        String type,
                                                        @Query("startTime")
                                                        Long startTime,
                                                        @Query("endTime")
                                                        Long endTime,
                                                        @Query("limit")
                                                        Integer limit,
                                                        @Query("cursor")
                                                        String cursor)
        Get Pre-upgrade Transaction Log Query transaction logs which occurred in the USDC Derivatives wallet before the account was upgraded to a Unified account.

        You can get USDC Perpetual, Option records.

        https://bybit-exchange.github.io/docs/v5/pre-upgrade/transaction-log

        Parameters:
        category - false string Product type. linear,option
        baseCoin - false string BaseCoin. e.g., BTC of BTCPERP
        type - false string Types of transaction logs
        startTime - false integer The start timestamp (ms) of creation
        endTime - false integer The end timestamp (ms) of creation
        limit - false integer Limit for data size per page. [1, 50]. Default: 20
        cursor - false string Cursor. Used for pagination
        Returns:
        Response Parameters Parameter Type Comments list array Object > symbol string Symbol name > category string Product type > side string Side. Buy,Sell,None > transactionTime string Transaction timestamp (ms) > type string Type > qty string Quantity > size string Size > currency string USDC USDT BTC ETH > tradePrice string Trade price > funding string Funding fee Positive value means receiving funding fee Negative value means deducting funding fee > fee string Trading fee Positive fee value means expense Negative fee value means rebates > cashFlow string Cash flow > change string Change > cashBalance string Cash balance > feeRate string When type=TRADE, then it is trading fee rate When type=SETTLEMENT, it means funding fee rate. For side=Buy, feeRate=market fee rate; For side=Sell, feeRate= - market fee rate > bonusChange string The change of bonus > tradeId string Trade ID > orderId string Order ID > orderLinkId string User customised order ID nextPageCursor string Cursor. Used for pagination
      • getPreUpgradeUsdcSettlement

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/pre-upgrade/asset/settlement-record")
        retrofit2.Call<Object> getPreUpgradeUsdcSettlement​(@Query("category")
                                                           String category,
                                                           @Query("symbol")
                                                           String symbol,
                                                           @Query("limit")
                                                           Integer limit,
                                                           @Query("cursor")
                                                           String cursor)
        Get Pre-upgrade USDC Session Settlement Query session settlement records of USDC perpetual before you upgrade the account to Unified account.

        https://bybit-exchange.github.io/docs/v5/pre-upgrade/settlement

        Parameters:
        category - true string Product type. linear
        symbol - false string Symbol name
        limit - false integer Limit for data size per page. [1, 50]. Default: 20
        cursor - false string Cursor. Used for pagination
        Returns:
        Response Parameters Parameter Type Comments category string Product type list array Object > symbol string Symbol name > side string Buy,Sell > size string Position size > sessionAvgPrice string Settlement price > markPrice string Mark price > realisedPnl string Realised PnL > createdTime string Created time (ms) nextPageCursor string Cursor. Used for pagination
      • getWalletBalance

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/account/wallet-balance")
        retrofit2.Call<Object> getWalletBalance​(@Query("accountType")
                                                String accountType,
                                                @Query("coin")
                                                String coin)
        Get Wallet Balance Obtain wallet balance, query asset information of each currency, and account risk rate information. By default, currency information with assets or liabilities of 0 is not returned.

        TIP The trading of UTA inverse contracts is conducted through the CONTRACT wallet. To get Funding wallet balance, please go to this endpoint

        https://bybit-exchange.github.io/docs/v5/account/wallet-balance

        Parameters:
        accountType - true string Account type Unified account: UNIFIED (trade spot/linear/options), CONTRACT(trade inverse) Classic account: CONTRACT, SPOT
        coin - false string Coin name If not passed, it returns non-zero asset info You can pass multiple coins to query, separated by comma. USDT,USDC
        Returns:
        Response Parameters Parameter Type Comments list array Object > accountType string Account type > accountLTV string Account LTV: account total borrowed size / (account total equity + account total borrowed size). In non-unified mode and unified (inverse) and unified (isolated_margin), the field will be returned as an empty string. > accountIMRate string Initial Margin Rate: Account Total Initial Margin Base Coin / Account Margin Balance Base Coin. In non-unified mode and unified (inverse) and unified (isolated_margin), the field will be returned as an empty string. > accountMMRate string Maintenance Margin Rate: Account Total Maintenance Margin Base Coin / Account Margin Balance Base Coin. In non-unified mode and unified (inverse) and unified (isolated_margin), the field will be returned as an empty string. > totalEquity string Equity of account converted to usd:Account Margin Balance Base Coin + Account Option Value Base Coin. In non-unified mode and unified (inverse), the field will be returned as an empty string. > totalWalletBalance string Wallet Balance of account converted to usd:∑ Asset Wallet Balance By USD value of each asset。In non-unified mode and unified (inverse) and unified (isolated_margin), the field will be returned as an empty string. > totalMarginBalance string Margin Balance of account converted to usd:totalWalletBalance + totalPerpUPL. In non-unified mode and unified (inverse) and unified (isolated_margin), the field will be returned as an empty string. > totalAvailableBalance string Available Balance of account converted to usd:Regular mode:totalMarginBalance - totalInitialMargin. In non-unified mode and unified (inverse) and unified (isolated_margin), the field will be returned as an empty string. > totalPerpUPL string Unrealised pnl of Perpetuals and USDC Futures of account converted to usd:∑ Each Perp and USDC Futures upl by base coin. In non-unified mode and unified (inverse), the field will be returned as an empty string. > totalInitialMargin string Initial Margin of account converted to usd:∑ Asset Total Initial Margin Base Coin. In non-unified mode and unified (inverse) and unified (isolated_margin), the field will be returned as an empty string. > totalMaintenanceMargin string Maintenance Margin of account converted to usd: ∑ Asset Total Maintenance Margin Base Coin. In non-unified mode and unified (inverse) and unified (isolated_margin), the field will be returned as an empty string. > coin array Object > > coin string Coin name, such as BTC, ETH, USDT, USDC > > equity string Equity of current coin > > usdValue string USD value of current coin. If this coin cannot be collateral, then it is 0 > > walletBalance string Wallet balance of current coin > > free string Available balance for Spot wallet. This is a unique field for Classic SPOT > > locked string Locked balance due to the Spot open order > > borrowAmount string Borrow amount of current coin > > availableToBorrow string Depreciated field, always return "" due to feature of main-sub UID sharing borrow quota. Please refer to availableToBorrow in the Get Collateral Info > > availableToWithdraw string Available amount to withdraw of current coin > > accruedInterest string Accrued interest > > totalOrderIM string Pre-occupied margin for order. For portfolio margin mode, it returns "" > > totalPositionIM string Sum of initial margin of all positions + Pre-occupied liquidation fee. For portfolio margin mode, it returns "" > > totalPositionMM string Sum of maintenance margin for all positions. For portfolio margin mode, it returns "" > > unrealisedPnl string Unrealised pnl > > cumRealisedPnl string Cumulative Realised pnl > > bonus string Bonus. This is a unique field for UNIFIED account > > collateralSwitch boolean Whether it can be used as a margin collateral currency (platform) When marginCollateral=false, then collateralSwitch is meaningless This is a unique field for UNIFIED account > > marginCollateral boolean Whether the collateral is turned on by user (user) When marginCollateral=true, then collateralSwitch is meaningful This is a unique field for UNIFIED account
      • upgradeAccountToUTA

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/account/upgrade-to-uta")
        retrofit2.Call<Object> upgradeAccountToUTA()
        Upgrade to Unified Account Upgrade Unified Account

        UPGRADE GUIDANCE Check your current account status by calling this Get Account Info

        if unifiedMarginStatus=1, then it is classic account, you can call below upgrade endpoint to UTA Pro. Check Get Account Info after a while and if unifiedMarginStatus=4, then it is successfully upgraded to UTA Pro.

        if unifiedMarginStatus=2, then it is UMA, you need to call below upgrade endpoint twice. The first call, your account will be upgraded to UTA, please make sure you call this Get Account Info and unifiedMarginStatus=3, then you can start the 2nd call, if you see unifiedMarginStatus=4, then it is UTA Pro.

        if unifiedMarginStatus=3, then it is UTA, you need to call below upgrade endpoint to UTA Pro. Check Get Account Info after a while and if unifiedMarginStatus=4, then it is successfully upgraded to UTA Pro.

        IMPORTANT Banned / Express path users cannot upgrade the account to Unified Account for now.

        INFO You can upgrade the normal acct to unified acct without closing positions now, but please note belows:

        Please avoid upgrading during these period: every hour 50th minute to 5th minute of next hour Please ensure: No open order and debt in the Spot account No open order and positions are either isolated or cross mode in the Derivatives account No open order in the USDC Derivatives account Cannot have TPSL order either When the unifiedUpgradeProcess = PROCESS, it means that the system needs asynchronous verification processing, and the upgrade result cannot be returned in real time. You can check API Get Account Info after 3-5 minutes, check whether the upgrade is successful according to the "unifiedMarginStatus" field in the return. During the account upgrade process, the data of Rest API/Websocket stream may be inaccurate due to the fact that the account-related asset data is in the processing state. It is recommended to query and use it after the upgrade is completed. https://bybit-exchange.github.io/docs/v5/account/upgrade-unified-account

        Returns:
        Response Parameters Parameter Type Comments unifiedUpdateStatus string Upgrade status. FAIL,PROCESS,SUCCESS unifiedUpdateMsg Object If PROCESS,SUCCESS, it returns null > msg array Error message array. Only FAIL will have this field
      • getAccountBorrowHistory

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/account/borrow-history")
        retrofit2.Call<Object> getAccountBorrowHistory​(@Query("currency")
                                                       String currency,
                                                       @Query("startTime")
                                                       Long startTime,
                                                       @Query("endTime")
                                                       Long endTime,
                                                       @Query("limit")
                                                       Integer limit,
                                                       @Query("cursor")
                                                       String cursor)
        Get Borrow History Get interest records, sorted in reverse order of creation time. https://bybit-exchange.github.io/docs/v5/account/borrow-history
        Parameters:
        currency - false string USDC,USDT,BTC,ETH
        startTime - false integer The start timestamp (ms)
        endTime - false integer The end time. timestamp (ms)
        limit - false integer Limit for data size per page. [1, 50]. Default: 20
        cursor - false string Cursor. Use the nextPageCursor token from the response to retrieve the next page of the result set
        Returns:
        Response Parameters Parameter Type Comments list array Object > currency string USDC,USDT,BTC,ETH > createdTime integer Created timestamp (ms) > borrowCost string Interest > hourlyBorrowRate string Hourly Borrow Rate > InterestBearingBorrowSize string Interest Bearing Borrow Size > costExemption string Cost exemption > borrowAmount string Total borrow amount > unrealisedLoss string Unrealised loss > freeBorrowedAmount string The borrowed amount for interest free nextPageCursor string Refer to the cursor request parameter
      • setAccountCollateralCoin

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/account/set-collateral-switch")
        retrofit2.Call<Object> setAccountCollateralCoin​(@Body
                                                        SetCollateralCoinRequest setCollateralCoinRequest)
        Set Collateral Coin You can decide whether the assets in the Unified account needs to be collateral coins. https://bybit-exchange.github.io/docs/v5/account/set-collateral#http-request
        Parameters:
        setCollateralCoinRequest - coin true string Coin name You can get collateral coin from here USDT, USDC cannot be switched off collateralSwitch true string ON: switch on collateral, OFF: switch off collateral
        Returns:
        Response Parameters None
      • batchSetAccountCollateralCoin

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/account/set-collateral-switch-batch")
        retrofit2.Call<Object> batchSetAccountCollateralCoin​(@Body
                                                             BatchSetCollateralCoinRequest batchSetCollateralCoinRequest)
      • setAccountSpotHedging

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/account/set-hedging-mode")
        retrofit2.Call<Object> setAccountSpotHedging​(@Body
                                                     SetSpotHedgingRequest setSpotHedgingRequest)
        Set Spot Hedging You can turn on/off Spot hedging feature in Portfolio margin for Unified account. INFO Only unified account is applicable Only portfolio margin mode is applicable Institutional lending account is not supported https://bybit-exchange.github.io/docs/v5/account/set-spot-hedge
        Parameters:
        setSpotHedgingRequest - setHedgingMode true string ON, OFF
        Returns:
        Response Parameters Parameter Type Comments retCode integer Result code retMsg string Result message
      • getAccountCollateralInfo

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/account/collateral-info")
        retrofit2.Call<Object> getAccountCollateralInfo​(@Query("currency")
                                                        String currency)
        Get Collateral Info Get the collateral information of the current unified margin account, including loan interest rate, loanable amount, collateral conversion rate, whether it can be mortgaged as margin, etc. https://bybit-exchange.github.io/docs/v5/account/collateral-info
        Parameters:
        currency - false string Asset currency of all current collateral
        Returns:
        Response Parameters Parameter Type Comments list array Object > currency string Currency of all current collateral > hourlyBorrowRate string Hourly borrow rate > maxBorrowingAmount string Max borrow amount. This value is shared across main-sub UIDs > freeBorrowingAmount string Depreciated field, always return "", please refer to freeBorrowingLimit > freeBorrowingLimit string The maximum limit for interest-free borrowing > freeBorrowAmount string The amount of borrowing within your total borrowing amount that is exempt from interest charges > borrowAmount string Borrow amount > availableToBorrow string Available amount to borrow. This value is shared across main-sub UIDs > borrowable boolean Whether currency can be borrowed > borrowUsageRate string Borrow usage rate: borrowAmount/maxBorrowingAmount. It is an actual value between 0 and 1 > marginCollateral boolean Whether it can be used as a margin collateral currency (platform) When marginCollateral=false, then collateralSwitch is meaningless > collateralSwitch boolean Whether the collateral is turned on by user (user) When marginCollateral=true, then collateralSwitch is meaningful > collateralRatio string Collateral ratio
      • getAccountCoinGeeks

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/asset/coin-greeks")
        retrofit2.Call<Object> getAccountCoinGeeks​(@Query("baseCoin")
                                                   String baseCoin)
        Get Coin Greeks Get current account Greeks information

        https://bybit-exchange.github.io/docs/v5/account/coin-greeks

        Parameters:
        baseCoin - false string Base coin. If not passed, all supported base coin greeks will be returned by default
        Returns:
        Response Parameters Parameter Type Comments list array Object > baseCoin string Base coin. e.g.,BTC,ETH,SOL > totalDelta string Delta value > totalGamma string Gamma value > totalVega string Vega value > totalTheta string Theta value
      • getAccountFreeRate

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/account/fee-rate")
        retrofit2.Call<Object> getAccountFreeRate​(@Query("category")
                                                  String category,
                                                  @Query("symbol")
                                                  String symbol,
                                                  @Query("baseCoin")
                                                  String baseCoin)
        Get Fee Rate Get the trading fee rate.

        Covers: Spot / USDT perpetual / USDC perpetual / USDC futures / Inverse perpetual / Inverse futures / Options

        https://bybit-exchange.github.io/docs/v5/account/fee-rate

        Parameters:
        category - true string Product type. spot, linear, inverse, option
        symbol - false string Symbol name. Valid for linear, inverse, spot
        baseCoin - false string Base coin. SOL, BTC, ETH. Valid for option
        Returns:
        Response Parameters Parameter Type Comments category string Product type. spot, option. Derivatives does not have this field list array Object > symbol string Symbol name. Keeps "" for Options > baseCoin string Base coin. SOL, BTC, ETH Derivatives does not have this field Keeps "" for Spot > takerFeeRate string Taker fee rate > makerFeeRate string Maker fee rate
      • getAccountInfo

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/account/info")
        retrofit2.Call<Object> getAccountInfo()
        Get Account Info Query the margin mode configuration of the account.

        ttps://bybit-exchange.github.io/docs/v5/account/account-info

        Returns:
        Request Parameters None
      • getTransactionLog

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/account/transaction-log")
        retrofit2.Call<Object> getTransactionLog​(@Query("accountType")
                                                 String accountType,
                                                 @Query("category")
                                                 String category,
                                                 @Query("currency")
                                                 String currency,
                                                 @Query("baseCoin")
                                                 String baseCoin,
                                                 @Query("type")
                                                 String type,
                                                 @Query("startTime")
                                                 Long startTime,
                                                 @Query("endTime")
                                                 Long endTime,
                                                 @Query("limit")
                                                 Integer limit,
                                                 @Query("cursor")
                                                 String cursor)
        Get Transaction Log Query transaction logs in Unified account.

        https://bybit-exchange.github.io/docs/v5/account/transaction-log

        Parameters:
        accountType - false string Account Type. UNIFIED
        category - false string Product type. spot,linear,option
        currency - false string Currency
        baseCoin - false string BaseCoin. e.g., BTC of BTCPERP
        type - false string Types of transaction logs
        startTime - false integer The start timestamp (ms)
        endTime - false integer The end timestamp (ms)
        limit - false integer Limit for data size per page. [1, 50]. Default: 20
        cursor - false string Cursor. Use the nextPageCursor token from the response to retrieve the next page of the result set
        Returns:
        Response Parameters Parameter Type Comments list array Object > id string Unique id > symbol string Symbol name > category string Product type > side string Side. Buy,Sell,None > transactionTime string Transaction timestamp (ms) > type string Type > qty string Quantity. It is the quantity for each trade entry and it does not have direction > size string Size. The rest position size after the trade is executed, and it has direction, i.e., short with "-" > currency string USDC USDT BTC ETH > tradePrice string Trade price > funding string Funding fee Positive value means receiving funding fee Negative value means deducting funding fee > fee string Trading fee Positive fee value means expense Negative fee value means rebates > cashFlow string Cash flow, e.g., (1) close the position, and unRPL converts to RPL, (2) 8-hour session settlement for USDC Perp and Futures, (3) transfer in or transfer out. This does not include trading fee, funding fee > change string Change = cashFlow + funding - fee > cashBalance string Cash balance. This is the wallet balance after a cash change > feeRate string When type=TRADE, then it is trading fee rate When type=SETTLEMENT, it means funding fee rate. For side=Buy, feeRate=market fee rate; For side=Sell, feeRate= - market fee rate > bonusChange string The change of bonus > tradeId string Trade ID > orderId string Order ID > orderLinkId string User customised order ID nextPageCursor string Refer to the cursor request parameter
      • setAccountMarginMode

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/account/set-margin-mode")
        retrofit2.Call<Object> setAccountMarginMode​(@Body
                                                    SetMarginModeRequest setMarginMode)
        Set Margin Mode Default is regular margin mode

        INFO UTA account can be switched between these 3 kinds of margin modes, which is across UID level, working for USDT Perp, USDC Perp, USDC Futures and Options (Option does not support ISOLATED_MARGIN) Classic account can be switched between REGULAR_MARGIN and PORTFOLIO_MARGIN, only work for USDC Perp and Options trading.

        https://bybit-exchange.github.io/docs/v5/account/set-margin-mode#http-request

        Parameters:
        setMarginMode - setMarginMode true string ISOLATED_MARGIN, REGULAR_MARGIN(i.e. Cross margin), PORTFOLIO_MARGIN
        Returns:
        Response Parameters Parameter Type Comments reasons array Object. If requested successfully, it is an empty array > reasonCode string Fail reason code > reasonMsg string Fail reason msg
      • modifyAccountMMP

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/account/mmp-modify")
        retrofit2.Call<Object> modifyAccountMMP​(@Body
                                                SetMMPRequest setMMPRequest)
        Set MMP INFO What is MMP? Market Maker Protection (MMP) is an automated mechanism designed to protect market makers (MM) against liquidity risks and over-exposure in the market. It prevents simultaneous trade executions on quotes provided by the MM within a short time span. The MM can automatically pull their quotes if the number of contracts traded for an underlying asset exceeds the configured threshold within a certain time frame. Once MMP is triggered, any pre-existing MMP orders will be automatically canceled, and new orders tagged as MMP will be rejected for a specific duration — known as the frozen period — so that MM can reassess the market and modify the quotes.

        How to enable MMP Send an email to Bybit (financial.inst@bybit.com) or contact your business development (BD) manager to apply for MMP. After processed, the default settings are as below table:

        Parameter Type Comments Default value baseCoin string Base coin BTC window string Time window (millisecond) 5000 frozenPeriod string Frozen period (millisecond) 100 qtyLimit string Quantity limit 100 deltaLimit string Delta limit 100 Applicable Effective for options only. When you place an option order, set mmp=true, which means you mark this order as a mmp order.

        https://bybit-exchange.github.io/docs/v5/account/set-mmp#http-request

        Parameters:
        setMMPRequest - baseCoin true string Base coin window true string Time window (ms) frozenPeriod true string Frozen period (ms). "0" means the trade will remain frozen until manually reset qtyLimit true string Trade qty limit (positive and up to 2 decimal places) deltaLimit true string Delta limit (positive and up to 2 decimal places)
        Returns:
        Response Parameters None
      • resetAccountMMP

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/account/mmp-reset")
        retrofit2.Call<Object> resetAccountMMP​(@Body
                                               ResetMMPRequest resetMMPRequest)
        Reset MMP INFO Once the mmp triggered, you can unfreeze the account by this endpoint, then qtyLimit and deltaLimit will be reset to 0. If the account is not frozen, reset action can also remove previous accumulation, i.e., qtyLimit and deltaLimit will be reset to 0.

        https://bybit-exchange.github.io/docs/v5/account/reset-mmp

        Parameters:
        resetMMPRequest - baseCoin true string Base coin
        Returns:
        Response Parameters None
      • getAccountMMPState

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/account/mmp-state")
        retrofit2.Call<Object> getAccountMMPState​(@Query("baseCoin")
                                                  String baseCoin)
        Get MMP State

        https://bybit-exchange.github.io/docs/v5/account/get-mmp-state

        Parameters:
        baseCoin - true string Base coin
        Returns:
        Response Parameters Parameter Type Comments result array Object > baseCoin string Base coin > mmpEnabled boolean Whether the account is enabled mmp > window string Time window (ms) > frozenPeriod string Frozen period (ms) > qtyLimit string Trade qty limit > deltaLimit string Delta limit > mmpFrozenUntil string Unfreeze timestamp (ms) > mmpFrozen boolean Whether the mmp is triggered. true: mmpFrozenUntil is meaningful false: please ignore the value of mmpFrozenUntil
      • getAssetCoinExchangeRecords

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/asset/exchange/order-record")
        retrofit2.Call<Object> getAssetCoinExchangeRecords​(@Query("fromCoin")
                                                           String fromCoin,
                                                           @Query("toCoin")
                                                           String toCoin,
                                                           @Query("limit")
                                                           Integer limit,
                                                           @Query("cursor")
                                                           String cursor)
        Get Coin Exchange Records Query the coin exchange records.

        INFO This endpoint currently is not available to get data after 12 Mar 2023. We will make it fully available later.

        CAUTION You may have a long delay of this endpoint.

        https://bybit-exchange.github.io/docs/v5/asset/exchange

        Parameters:
        fromCoin - false string The currency to convert from. e.g,BTC
        toCoin - false string The currency to convert to. e.g,USDT
        limit - false integer Limit for data size per page. [1, 50]. Default: 10
        cursor - false string Cursor. Use the nextPageCursor token from the response to retrieve the next page of the result set
        Returns:
        Response Parameters Parameter Type Comments nextPageCursor string Refer to the cursor request parameter orderBody array Object > fromCoin string The currency to convert from > fromAmount string The amount to convert from > toCoin string The currency to convert to > toAmount string The amount to convert to > exchangeRate string Exchange rate > createdTime string Exchange created timestamp (sec) > exchangeTxId string Exchange transaction ID
      • getAssetDeliveryRecords

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/asset/delivery-record")
        retrofit2.Call<Object> getAssetDeliveryRecords​(@Query("category")
                                                       String category,
                                                       @Query("symbol")
                                                       String symbol,
                                                       @Query("expDate")
                                                       String expDate,
                                                       @Query("limit")
                                                       Integer limit,
                                                       @Query("cursor")
                                                       String cursor)
        Get Delivery Record Query delivery records of USDC futures and Options, sorted by deliveryTime in descending order

        https://bybit-exchange.github.io/docs/v5/asset/delivery

        Parameters:
        category - true string Product type. option, linear
        symbol - false string Symbol name
        expDate - false string Expiry date. 25MAR22. Default: return all
        limit - false integer Limit for data size per page. [1, 50]. Default: 20
        cursor - false string Cursor. Use the nextPageCursor token from the response to retrieve the next page of the result set
        Returns:
        Response Parameters Parameter Type Comments category string Product type list array Object > deliveryTime number Delivery time (ms) > symbol string Symbol name > side string Buy,Sell > position string Executed size > deliveryPrice string Delivery price > strike string Exercise price > fee string Trading fee > deliveryRpl string Realized PnL of the delivery nextPageCursor string Refer to the cursor request parameter
      • getAssetUSDCSettlementRecords

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/asset/settlement-record")
        retrofit2.Call<Object> getAssetUSDCSettlementRecords​(@Query("category")
                                                             String category,
                                                             @Query("symbol")
                                                             String symbol,
                                                             @Query("limit")
                                                             Integer limit,
                                                             @Query("cursor")
                                                             String cursor)
        Get USDC Session Settlement Query session settlement records of USDC perpetual and futures

        Unified account covers: USDC perpetual / USDC futures

        https://bybit-exchange.github.io/docs/v5/asset/settlement

        Parameters:
        category - true string Product type. linear
        symbol - false string Symbol name
        limit - false integer Limit for data size per page. [1, 50]. Default: 20
        cursor - false string Cursor. Use the nextPageCursor token from the response to retrieve the next page of the result set
        Returns:
        category string Product type list array Object > symbol string Symbol name > side string Buy,Sell > size string Position size > sessionAvgPrice string Settlement price > markPrice string Mark price > realisedPnl string Realised PnL > createdTime string Created time (ms) nextPageCursor string Refer to the cursor request parameter
      • getAssetInfo

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/asset/transfer/query-asset-info")
        retrofit2.Call<Object> getAssetInfo​(@Query("accountType")
                                            String accountType,
                                            @Query("coin")
                                            String coin)
        Get Asset Info Query asset information

        INFO For now, it can query SPOT only.

        https://bybit-exchange.github.io/docs/v5/asset/asset-info

        Parameters:
        accountType - true string Account type. SPOT
        coin - false string Coin name
        Returns:
        Response Parameters Parameter Type Comments spot Object > status string account status. ACCOUNT_STATUS_NORMAL: normal, ACCOUNT_STATUS_UNSPECIFIED: banned > assets array Object > > coin string Coin > > frozen string Freeze amount > > free string Free balance > > withdraw string Amount in withdrawing
      • getAssetAllCoinsBalance

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/asset/transfer/query-account-coins-balance")
        retrofit2.Call<Object> getAssetAllCoinsBalance​(@Query("accountType")
                                                       String accountType,
                                                       @Query("memberId")
                                                       String memberId,
                                                       @Query("coin")
                                                       String coin,
                                                       @Query("withBonus")
                                                       String withBonus)
        Get All Coins Balance You could get all coin balance of all account types under the master account, and sub account.

        IMPORTANT It is not allowed to get master account coin balance via sub account api key.

        https://bybit-exchange.github.io/docs/v5/asset/all-balance

        Parameters:
        accountType - true string Account type
        memberId - false string User Id. It is required when you use master api key to check sub account coin balance
        coin - false string Coin name Query all coins if not passed Can query multiple coins, separated by comma. USDT,USDC,ETH
        withBonus - false string Whether query bonus or not. 0(default):false; 1:true
        Returns:
        Response Parameters Parameter Type Comments accountType string Account type memberId string UserID balance array Object > coin string Currency type > walletBalance string Wallet balance > transferBalance string Transferable balance > bonus string The bonus
      • getAssetSingleCoinBalance

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/asset/transfer/query-account-coin-balance")
        retrofit2.Call<Object> getAssetSingleCoinBalance​(@Query("accountType")
                                                         String accountType,
                                                         @Query("toAccountType")
                                                         String toAccountType,
                                                         @Query("memberId")
                                                         String memberId,
                                                         @Query("toMemberId")
                                                         String toMemberId,
                                                         @Query("coin")
                                                         String coin,
                                                         @Query("withBonus")
                                                         Integer withBonus,
                                                         @Query("withTransferSafeAmount")
                                                         Integer withTransferSafeAmount,
                                                         @Query("withLtvTransferSafeAmount")
                                                         Integer withLtvTransferSafeAmount)
        Get Single Coin Balance Query the balance of a specific coin in a specific account type. Supports querying sub UID's balance. Also, you can check the transferable amount from master to sub account, sub to master account or sub to sub account, especially for user who has INS loan.

        INFO Sub account cannot query master account balance Sub account can only check its own balance Master account can check its own and its sub UIDs balance

        https://bybit-exchange.github.io/docs/v5/asset/account-coin-balance

        Parameters:
        accountType - true string Account type
        toAccountType - false string To account type. Required when querying the transferable balance between different account types
        memberId - false string UID. Required when querying sub UID balance with master api key
        toMemberId - false string UID. Required when querying the transferable balance between different UIDs
        coin - true string Coin
        withBonus - false integer 0: not query bonus. 1: query bonus
        withTransferSafeAmount - false integer Whether query delay withdraw/transfer safe amount 0(default):false, 1:true What is delay withdraw amount?
        withLtvTransferSafeAmount - false integer For OTC loan users in particular, you can check the transferable amount under risk level 0(default):false, 1:true toAccountType is mandatory
        Returns:
        Response Parameters Parameter Type Comments accountType string Account type bizType integer Biz type accountId string Account ID memberId string Uid balance Object > coin string Coin > walletBalance string Wallet balance > transferBalance string Transferable balance > bonus string bonus > transferSafeAmount string Safe amount to transfer. Keep "" if not query > ltvTransferSafeAmount string Transferable amount for ins loan account. Keep "" if not query
      • getAssetTransferableCoins

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/asset/transfer/query-transfer-coin-list")
        retrofit2.Call<Object> getAssetTransferableCoins​(@Query("fromAccountType")
                                                         String fromAccountType,
                                                         @Query("toAccountType")
                                                         String toAccountType)
        Get Transferable Coin Query the transferable coin list between each account type

        https://bybit-exchange.github.io/docs/v5/asset/transferable-coin

        Parameters:
        fromAccountType - true string From account type
        toAccountType - true string To account type
        Returns:
        Response Parameters Parameter Type Comments list array A list of coins (as strings)
      • createAssetInternalTransfer

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/asset/transfer/inter-transfer")
        retrofit2.Call<Object> createAssetInternalTransfer​(@Body
                                                           AssetInternalTransferRequest assetInternalTransferRequest)
        Create Internal Transfer Create the internal transfer between different account types under the same UID.

        TIP Each account type has its own acceptable coins, e.g, you cannot transfer USDC from SPOT to CONTRACT. Please refer to transferable coin list API to find out more.

        https://bybit-exchange.github.io/docs/v5/asset/create-inter-transfer#http-request

        Parameters:
        assetInternalTransferRequest - transferId true string UUID. Please manually generate a UUID coin true string Coin amount true string Amount fromAccountType true string From account type toAccountType true string To account type
        Returns:
        Response Parameters Parameter Type Comments transferId string UUID
      • getAssetTransferSubUidList

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/asset/transfer/query-sub-member-list")
        retrofit2.Call<Object> getAssetTransferSubUidList()
        Get Sub UID Query the sub UIDs under a main UID

        CAUTION Can query by the master UID's api key only

        https://bybit-exchange.github.io/docs/v5/asset/sub-uid-list

        Returns:
        Response Parameters Parameter Type Comments subMemberIds array string All sub UIDs under the main UID transferableSubMemberIds array string All sub UIDs that have universal transfer enabled
      • createAssetUniversalTransfer

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/asset/transfer/universal-transfer")
        retrofit2.Call<Object> createAssetUniversalTransfer​(@Body
                                                            AssetUniversalTransferRequest assetUniversalTransferRequest)
        Create Universal Transfer Transfer between sub-sub or main-sub.

        CAUTION Can use master or sub acct api key to request To use sub acct api key, it must have "SubMemberTransferList" permission When use sub acct api key, it can only transfer to main account If you encounter errorCode: 131228 and msg: your balance is not enough, please go to Get Single Coin Balance to check transfer safe amount. You can not transfer between the same UID

        https://bybit-exchange.github.io/docs/v5/asset/unitransfer#http-request

        Parameters:
        assetUniversalTransferRequest - transferId true string UUID. Please manually generate a UUID coin true string Coin amount true string Amount fromMemberId true integer From UID toMemberId true integer To UID fromAccountType true string From account type toAccountType true string To account type
        Returns:
        Response Parameters Parameter Type Comments transferId string UUID
      • getAssetInternalTransferRecords

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/asset/transfer/query-inter-transfer-list")
        retrofit2.Call<Object> getAssetInternalTransferRecords​(@Query("transferId")
                                                               String transferId,
                                                               @Query("coin")
                                                               String coin,
                                                               @Query("status")
                                                               String status,
                                                               @Query("startTime")
                                                               Long startTime,
                                                               @Query("endTime")
                                                               Long endTime,
                                                               @Query("limit")
                                                               Integer limit,
                                                               @Query("cursor")
                                                               String cursor)
        Get Internal Transfer Records Query the internal transfer records between different account types under the same UID.

        https://bybit-exchange.github.io/docs/v5/asset/inter-transfer-list

        Parameters:
        transferId - false string UUID. Use the one you generated in createTransfer
        coin - false string Coin
        status - false string Transfer status
        startTime - false integer The start timestamp (ms) Note: the query logic is actually effective based on second level
        endTime - false integer The end timestamp (ms) Note: the query logic is actually effective based on second level
        limit - false integer Limit for data size per page. [1, 50]. Default: 20
        cursor - false string Cursor. Use the nextPageCursor token from the response to retrieve the next page of the result set
        Returns:
        Response Parameters Parameter Type Comments list array Object > transferId string Transfer ID > coin string Transferred coin > amount string Transferred amount > fromAccountType string From account type > toAccountType string To account type > timestamp string Transfer created timestamp (ms) > status string Transfer status nextPageCursor string Refer to the cursor request parameter
      • getAssetUniversalTransferRecords

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/asset/transfer/query-universal-transfer-list")
        retrofit2.Call<Object> getAssetUniversalTransferRecords​(@Query("transferId")
                                                                String transferId,
                                                                @Query("coin")
                                                                String coin,
                                                                @Query("status")
                                                                String status,
                                                                @Query("startTime")
                                                                Long startTime,
                                                                @Query("endTime")
                                                                Long endTime,
                                                                @Query("limit")
                                                                Integer limit,
                                                                @Query("cursor")
                                                                String cursor)
        Get Universal Transfer Records Query universal transfer records

        TIP Main acct api key or Sub acct api key are both supported Main acct api key needs "SubMemberTransfer" permission Sub acct api key needs "SubMemberTransferList" permission

        https://bybit-exchange.github.io/docs/v5/asset/unitransfer-list

        Parameters:
        transferId - false string UUID. Use the one you generated in createTransfer
        coin - false string Coin
        status - false string Transfer status. SUCCESS,FAILED,PENDING
        startTime - false integer The start timestamp (ms) Note: the query logic is actually effective based on second level
        endTime - false integer The end timestamp (ms) Note: the query logic is actually effective based on second level
        limit - false integer Limit for data size per page. [1, 50]. Default: 20
        cursor - false string Cursor. Use the nextPageCursor token from the response to retrieve the next page of the result set
        Returns:
        Response Parameters Parameter Type Comments list array Object > transferId string Transfer ID > coin string Transferred coin > amount string Transferred amount > fromMemberId string From UID > toMemberId string TO UID > fromAccountType string From account type > toAccountType string To account type > timestamp string Transfer created timestamp (ms) > status string Transfer status nextPageCursor string Refer to the cursor request parameter
      • getAssetAllowedDepositCoinInfo

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/asset/deposit/query-allowed-list")
        retrofit2.Call<Object> getAssetAllowedDepositCoinInfo​(@Query("coin")
                                                              String coin,
                                                              @Query("chain")
                                                              String chain,
                                                              @Query("limit")
                                                              Integer limit,
                                                              @Query("cursor")
                                                              String cursor)
        Get Allowed Deposit Coin Info Query allowed deposit coin information. To find out paired chain of coin, please refer coin info api.

        TIP This is an endpoint that does not need authentication

        https://bybit-exchange.github.io/docs/v5/asset/deposit-coin-spec

        Parameters:
        coin - false string Coin. coin and chain must be paired if passed
        chain - false string Chain. coin and chain must be paired if passed
        limit - false integer Limit for data size per page. [1, 35]. Default: 10
        cursor - false string Cursor. Use the nextPageCursor token from the response to retrieve the next page of the result set
        Returns:
        Response Parameters Parameter Type Comments configList array Object > coin string Coin > chain string Chain > coinShowName string Coin name > chainType string Chain type > blockConfirmNumber integer Deposit confirmation number > minDepositAmount string Minimum deposit amount nextPageCursor string Refer to the cursor request parameter
      • setAssetDepositAccount

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/asset/deposit/deposit-to-account")
        retrofit2.Call<Object> setAssetDepositAccount​(@Body
                                                      SetAssetDepositAccountRequest setAssetDepositAccountRequest)
        Set Deposit Account Set auto transfer account after deposit. The same function as the setting for Deposit on web GUI

        INFO Your funds will be deposited into FUND wallet by default. You can set the wallet for auto-transfer after deposit by this API. Only main UID can access. TIP Unified trading account has FUND, UNIFIED, CONTRACT(for inverse derivatives) Unified margin account has FUND, UNIFIED, CONTRACT(for inverse derivatives), SPOT Classic account has FUND, OPTION(USDC account), CONTRACT(for inverse derivatives and derivatives), SPOT

        https://bybit-exchange.github.io/docs/v5/asset/set-deposit-acct

        Parameters:
        setAssetDepositAccountRequest - accountType true string Account type UNIFIED SPOT OPTION CONTRACT FUND
        Returns:
        Response Parameters Parameter Type Comments status integer Request result: 1: SUCCESS 0: FAIL
      • getAssetDepositRecords

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/asset/deposit/query-record")
        retrofit2.Call<Object> getAssetDepositRecords​(@Query("coin")
                                                      String coin,
                                                      @Query("startTime")
                                                      Long startTime,
                                                      @Query("endTime")
                                                      Long endTime,
                                                      @Query("limit")
                                                      Integer limit,
                                                      @Query("cursor")
                                                      String cursor)
        Get Deposit Records (on-chain) Query deposit records.

        TIP endTime - startTime should be less than 30 days. Query last 30 days records by default. Can use main or sub UID api key to query deposit records respectively.

        https://bybit-exchange.github.io/docs/v5/asset/deposit-record

        Parameters:
        coin - false string Coin
        startTime - false integer The start timestamp (ms)
        endTime - false integer The end timestamp (ms)
        limit - false integer Limit for data size per page. [1, 50]. Default: 50
        cursor - false string Cursor. Use the nextPageCursor token from the response to retrieve the next page of the result set
        Returns:
        Response Parameters Parameter Type Comments rows array Object > coin string Coin > chain string Chain > amount string Amount > txID string Transaction ID > status integer Deposit status > toAddress string Deposit target address > tag string Tag of deposit target address > depositFee string Deposit fee > successAt string Last updated time > confirmations string Number of confirmation blocks > txIndex string Transaction sequence number > blockHash string Hash number on the chain > batchReleaseLimit string The deposit limit for this coin in this chain. "-1" means no limit > depositType integer The deposit type. 0: normal deposit, 10: the deposit reaches daily deposit limit, 20: abnormal deposit nextPageCursor string Refer to the cursor request parameter
      • getAssetSubMembersDepositRecords

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/asset/deposit/query-sub-member-record")
        retrofit2.Call<Object> getAssetSubMembersDepositRecords​(@Query("subMemberId")
                                                                String subMemberId,
                                                                @Query("coin")
                                                                String coin,
                                                                @Query("startTime")
                                                                Long startTime,
                                                                @Query("endTime")
                                                                Long endTime,
                                                                @Query("limit")
                                                                Integer limit,
                                                                @Query("cursor")
                                                                String cursor)
        Get Sub Deposit Records (on-chain) Query subaccount's deposit records by main UID's API key.

        TIP endTime - startTime should be less than 30 days. Queries for the last 30 days worth of records by default.

        https://bybit-exchange.github.io/docs/v5/asset/sub-deposit-record

        Parameters:
        subMemberId - true string Sub UID
        coin - false string Coin
        startTime - false integer The start timestamp (ms)
        endTime - false integer The end timestamp (ms)
        limit - false integer Limit for data size per page. [1, 50]. Default: 50
        cursor - false string Cursor. Use the nextPageCursor token from the response to retrieve the next page of the result set
        Returns:
        Response Parameters Parameter Type Comments rows array Object > coin string Coin > chain string Chain > amount string Amount > txID string Transaction ID > status integer Deposit status > toAddress string Deposit target address > tag string Tag of deposit target address > depositFee string Deposit fee > successAt string Last updated time > confirmations string Number of confirmation blocks > txIndex string Transaction sequence number > blockHash string Hash number on the chain > batchReleaseLimit string The deposit limit for this coin in this chain. "-1" means no limit > depositType integer The deposit type. 0: normal deposit, 10: the deposit reaches daily deposit limit, 20: abnormal deposit nextPageCursor string Refer to the cursor request parameter
      • getAssetInternalDepositRecords

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/asset/deposit/query-internal-record")
        retrofit2.Call<Object> getAssetInternalDepositRecords​(@Query("coin")
                                                              String coin,
                                                              @Query("startTime")
                                                              Long startTime,
                                                              @Query("endTime")
                                                              Long endTime,
                                                              @Query("limit")
                                                              Integer limit,
                                                              @Query("cursor")
                                                              String cursor)
        Get Internal Deposit Records (off-chain) Query deposit records within the Bybit platform. These transactions are not on the blockchain.

        RULES The maximum difference between the start time and the end time is 30 days. Support to get deposit records by Master or Sub Member Api Key

        https://bybit-exchange.github.io/docs/v5/asset/internal-deposit-record

        Parameters:
        coin - false string Coin name: for example, BTC. Default value: all
        startTime - false integer Start time (ms). Default value: 30 days before the current time
        endTime - false integer End time (ms). Default value: current time
        limit - false integer Number of items per page, [1, 50]. Default value: 50
        cursor - false string Cursor, used for pagination
        Returns:
        Response Parameters Parameter Type Comments rows array Object > id string ID > type integer 1: Internal deposit > coin string Deposit coin > amount string Deposit amount > status integer 1=Processing 2=Success 3=deposit failed > address string Email address or phone number > createdTime string Deposit created timestamp nextPageCursor string cursor information: used for pagination. Default value: ""
      • getAssetMasterDepositAddress

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/asset/deposit/query-address")
        retrofit2.Call<Object> getAssetMasterDepositAddress​(@Query("coin")
                                                            String coin,
                                                            @Query("chainType")
                                                            String chainType)
        Get Master Deposit Address Query the deposit address information of MASTER account.

        https://bybit-exchange.github.io/docs/v5/asset/master-deposit-addr

        Parameters:
        coin - true string Coin
        chainType - false string Chain, e.g.,ETH
        Returns:
        Response Parameters Parameter Type Comments coin string Coin chains array Object > chainType string Chain type > addressDeposit string The address for deposit > tagDeposit string Tag of deposit > chain string Chain > batchReleaseLimit string The deposit limit for this coin in this chain. "-1" means no limit
      • getAssetSubMemberDepositAddress

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/asset/deposit/query-sub-member-address")
        retrofit2.Call<Object> getAssetSubMemberDepositAddress​(@Query("coin")
                                                               String coin,
                                                               @Query("chainType")
                                                               String chainType,
                                                               @Query("subMemberId")
                                                               String subMemberId)
        Get Sub Deposit Address Query the deposit address information of SUB account.

        CAUTION Can use master UID's api key only

        https://bybit-exchange.github.io/docs/v5/asset/sub-deposit-addr

        Parameters:
        coin - true string Coin
        chainType - true string Chain, e.g.,ETH
        subMemberId - true string Sub user ID
        Returns:
        Response Parameters Parameter Type Comments coin string Coin chains array Object > chainType string Chain type > addressDeposit string The address for deposit > tagDeposit string Tag of deposit > chain string Chain > batchReleaseLimit string The deposit limit for this coin in this chain. "-1" means no limit
      • getAssetCoinInfo

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/asset/coin/query-info")
        retrofit2.Call<Object> getAssetCoinInfo​(@Query("coin")
                                                String coin)
        Get Coin Info Query coin information, including chain information, withdraw and deposit status.

        https://bybit-exchange.github.io/docs/v5/asset/coin-info

        Parameters:
        coin - false string Coin
        Returns:
        Response Parameters Parameter Type Comments rows array Object > name integer Coin name > coin string Coin > remainAmount string Remaining amount > chains array Object > > chain string Chain > > chainType string Chain type > > confirmation string The number of confirmation for deposit > > withdrawFee string withdraw fee. If withdraw fee is empty, It means that this coin does not support withdrawal > > depositMin string Min. deposit > > withdrawMin string Min. withdraw > > minAccuracy string The precision of withdraw or deposit > > chainDeposit string The chain status of deposit. 0: suspend. 1: normal > > chainWithdraw string The chain status of withdraw. 0: suspend. 1: normal > > withdrawPercentageFee string The withdraw fee percentage. It is a real figure, e.g., 0.022 means 2.2%
      • getAssetWithdrawalAmount

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/asset/withdraw/withdrawable-amount")
        retrofit2.Call<Object> getAssetWithdrawalAmount​(@Query("coin")
                                                        String coin)
        Get Withdrawable Amount INFO How can partial funds be subject to delayed withdrawal requests?

        On-chain deposit: If the number of on-chain confirmations has not reached a risk-controlled level, a portion of the funds will be frozen for a period of time until they are unfrozen. Buying crypto: If there is a risk, the funds will be frozen for a certain period of time and cannot be withdrawn.

        https://bybit-exchange.github.io/docs/v5/asset/delay-amount

        Parameters:
        coin - true string Coin name
        Returns:
        Response Parameters Parameter Type Comments limitAmountUsd string The frozen amount due to risk, in USD withdrawableAmount array Object > SPOT Object Spot wallet, it is not returned if spot wallet is removed > > coin string Coin name > > withdrawableAmount string Amount that can be withdrawn > > availableBalance string Available balance > FUND Object Funding wallet > > coin string Coin name > > withdrawableAmount string Amount that can be withdrawn > > availableBalance string Available balance
      • getAssetWithdrawalRecords

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/asset/withdraw/query-record")
        retrofit2.Call<Object> getAssetWithdrawalRecords​(@Query("withdrawID")
                                                         String withdrawID,
                                                         @Query("coin")
                                                         String coin,
                                                         @Query("withdrawType")
                                                         Integer withdrawType,
                                                         @Query("startTime")
                                                         Long startTime,
                                                         @Query("endTime")
                                                         Long endTime,
                                                         @Query("limit")
                                                         Integer limit,
                                                         @Query("cursor")
                                                         String cursor)
        Get Withdrawal Records Query withdrawal records.

        TIP endTime - startTime should be less than 30 days. Query last 30 days records by default. Can query by the master UID's api key only

        https://bybit-exchange.github.io/docs/v5/asset/withdraw-record

        Parameters:
        withdrawID - false string Withdraw ID
        coin - false string Coin
        withdrawType - false integer Withdraw type. 0(default): on chain. 1: off chain. 2: all.
        startTime - false integer The start timestamp (ms)
        endTime - false integer The end timestamp (ms)
        limit - false integer Limit for data size per page. [1, 50]. Default: 50
        cursor - false string Cursor. Use the nextPageCursor token from the response to retrieve the next page of the result set
        Returns:
        Response Parameters Parameter Type Comments rows array Object > withdrawId string Withdraw ID > txID string Transaction ID. It returns "" when withdrawal failed, withdrawal cancelled or internal transfer > withdrawType string Withdraw type. 0: on chain. 1: off chain > coin string Coin > chain string Chain > amount string Amount > withdrawFee string Withdraw fee > status string Withdraw status > toAddress string To withdrawal address. Shows an email or mobile number for internal transfers > tag string Tag > createTime string Withdraw created timestamp (ms) > updateTime string Withdraw updated timestamp (ms) nextPageCursor string Cursor. Used for pagination
      • cancelAssetWithdraw

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/asset/withdraw/cancel")
        retrofit2.Call<Object> cancelAssetWithdraw​(@Body
                                                   AssetCancelWithdrawRequest assetCancelWithdrawRequest)
        Cancel Withdrawal Cancel the withdrawal

        CAUTION Can query by the master UID's api key only

        https://bybit-exchange.github.io/docs/v5/asset/cancel-withdraw#http-request

        Parameters:
        assetCancelWithdrawRequest - id true string Withdrawal ID
        Returns:
        Response Parameters Parameter Type Comments status integer 0: fail. 1: success
      • createAssetWithdraw

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/asset/withdraw/create")
        retrofit2.Call<Object> createAssetWithdraw​(@Body
                                                   AssetWithdrawRequest assetWithdrawRequest)
        Withdraw Withdraw assets from your Bybit account. You can make an off-chain transfer if the target wallet address is from Bybit. This means that no blockchain fee will be charged.

        DANGER UTA does not have SPOT account How do I know if my account is a UTA account? Call this endpoint, and if uta=1, then it is a UTA account. CAUTION Make sure you have whitelisted your wallet address here Can query by the master UID's api key only FORMULA feeType=0:

        withdrawPercentageFee != 0: handlingFee = inputAmount / (1 - withdrawPercentageFee) * withdrawPercentageFee + withdrawFee withdrawPercentageFee = 0: handlingFee = withdrawFee feeType=1:

        withdrawPercentageFee != 0: handlingFee = withdrawFee + (inputAmount - withdrawFee) * withdrawPercentageFee withdrawPercentageFee = 0: handlingFee = withdrawFee

        https://bybit-exchange.github.io/docs/v5/asset/withdraw#http-request

        Parameters:
        assetWithdrawRequest - coin true string Coin chain true string Chain address true string Wallet address. Please note that the address is case sensitive, so use the exact same address added in address book tag false string Tag Required if tag exists in the wallet address list. Note: please do not set a tag/memo in the address book if the chain does not support tag amount true string Withdraw amount timestamp true integer Current timestamp (ms). Used for preventing from withdraw replay forceChain false integer Whether or not to force an on-chain withdrawal 0(default): If the address is parsed out to be an internal address, then internal transfer 1: Force the withdrawal to occur on-chain accountType false string Select the wallet to be withdrawn from SPOT:spot wallet (default) FUND:Funding wallet feeType false integer Handling fee option 0(default): input amount is the actual amount received, so you have to calculate handling fee manually 1: input amount is not the actual amount you received, the system will help to deduct the handling fee automatically
        Returns:
        Response Parameters Parameter Type Comments id string Withdrawal ID
      • updateInstitutionLoanUid

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/ins-loan/association-uid")
        retrofit2.Call<Object> updateInstitutionLoanUid​(@Body
                                                        UpdateInstitutionLoadUidRequest updateInstitutionLoadUidRequest)
        Bind Or Unbind UID For the institutional loan product, you can bind new UIDs to the risk unit or unbind UID from the risk unit.

        INFO Risk unit designated UID cannot be unbound This endpoint can only be called by uids in the risk unit list The UID must be upgraded to UTA Pro if you try to bind it. https://bybit-exchange.github.io/docs/v5/otc/bind-uid

        Parameters:
        updateInstitutionLoadUidRequest -
        Returns:
        Response Parameters Parameter Type Comments uid string UID operate string 0: bind, 1: unbind
      • getInsProductInfo

        @GET("/v5/ins-loan/product-infos")
        retrofit2.Call<Object> getInsProductInfo​(@Query("productId")
                                                 String productId)
        Get Product Info TIP This endpoint can be queried without api key and secret, then it returns public product data If your uid is bound with OTC loan product, then you can get your private product data by calling the endpoint with api key and secret If your uid is not bound with OTC loan product but api key and secret are also passed, it will return public data only

        https://bybit-exchange.github.io/docs/v5/otc/margin-product-info

        Parameters:
        productId - false string Product Id. If not passed, then return all products info
        Returns:
        Response Parameters Parameter Type Comments marginProductInfo array Object > productId string Product Id > leverage string The maximum leverage for this loan product > supportSpot integer Whether to support Spot. 0:false; 1:true > supportContract integer Whether to support USDT Perpetual. 0:false; 1:true > supportMarginTrading integer Whether to support Spot margin trading. 0:false; 1:true > withdrawLine string Restrict line for withdrawal > transferLine string Restrict line for transfer > spotBuyLine string Restrict line for Spot buy > spotSellLine string Restrict line for Spot trading > contractOpenLine string Restrict line for USDT Perpetual open position > liquidationLine string Line for liquidation > stopLiquidationLine string Line for stop liquidation > contractLeverage string The allowed default leverage for USDT Perpetual > transferRatio string The transfer ratio for loan funds to transfer from Spot wallet to Contract wallet > spotSymbols array The whitelist of spot trading pairs If supportSpot="0", then it returns "[]" If empty array, then you can trade any symbols If not empty, then you can only trade listed symbols > contractSymbols array The whitelist of contract trading pairs If supportContract="0", then it returns "[]" If empty array, then you can trade any symbols If not empty, then you can only trade listed symbols > supportUSDCContract integer Whether to support USDC contract. '0':false; '1':true > supportUSDCOptions integer Whether to support Option. '0':false; '1':true > USDTPerpetualOpenLine string Restrict line to open USDT Perpetual position > USDCContractOpenLine string Restrict line to open USDC Contract position > USDCOptionsOpenLine string Restrict line to open Option position > USDTPerpetualCloseLine string Restrict line to trade USDT Perpetual > USDCContractCloseLine string Restrict line to trade USDC Contract > USDCOptionsCloseLine string Restrict line to trade Option > USDCContractSymbols array The whitelist of USDC contract trading pairs If supportContract="0", then it returns "[]" If no whitelist symbols, it is [], and you can trade any If supportUSDCContract="0", it is [] > USDCOptionsSymbols array The whitelist of Option symbols If supportContract="0", then it returns "[]" If no whitelisted, it is [], and you can trade any If supportUSDCOptions="0", it is [] > marginLeverage string The allowable maximum leverage for Spot margin trading. If supportMarginTrading=0, then it returns "" > USDTPerpetualLeverage array Object If supportContract="0", it is [] If no whitelist USDT perp symbols, it returns all trading symbols and leverage by default If there are whitelist symbols, it return those whitelist data > > symbol string Symbol name > > leverage string Maximum leverage > USDCContractLeverage array Object If supportUSDCContract="0", it is [] If no whitelist USDC contract symbols, it returns all trading symbols and leverage by default If there are whitelist symbols, it return those whitelist data > > symbol string Symbol name > > leverage string Maximum leverage
      • getInsMarginCoinInfo

        @GET("/v5/ins-loan/ensure-tokens-convert")
        retrofit2.Call<Object> getInsMarginCoinInfo​(@Query("productId")
                                                    String productId)
        Get Margin Coin Info TIP This endpoint can be queried without api key and secret, then it returns public margin data If your uid is bound with OTC loan product, then you can get your private margin data by calling the endpoint with api key and secret If your uid is not bound with OTC loan product but api key and secret are also passed, it will return public data only

        https://bybit-exchange.github.io/docs/v5/otc/margin-coin-convert-info

        Parameters:
        productId - false string ProductId. If not passed, then return all product margin coin. For spot, it returns coin that convertRation greater than 0.
        Returns:
        Response Parameters Parameter Type Comments marginToken array Object > productId string Product Id > tokenInfo array Spot margin coin > > token string Margin coin > > convertRatioList array Margin coin convert ratio List > > > ladder string ladder > > > convertRatio string Margin coin convert ratio
      • getInsLoanOrders

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/ins-loan/loan-order")
        retrofit2.Call<Object> getInsLoanOrders​(@Query("orderId")
                                                String orderId,
                                                @Query("startTime")
                                                Long startTime,
                                                @Query("endTime")
                                                Long endTime,
                                                @Query("limit")
                                                Integer limit)
        Get Loan Orders Get loan orders information

        TIP Get the past 2 years data by default Get up to the past 2 years of data

        https://bybit-exchange.github.io/docs/v5/otc/loan-info

        Parameters:
        orderId - false string Loan order id. If not passed, then return all orders, sort by loanTime in descend
        startTime - false integer The start timestamp (ms)
        endTime - false integer The end timestamp (ms)
        limit - false integer Limit for data size. [1, 100], Default: 10
        Returns:
        Response Parameters Parameter Type Comments loanInfo array Object > orderId string Loan order ID > orderProductId string Product ID > parentUid string The uid that used to bind OTC loan product > loanTime string Loan timestamp, in milliseconds > loanCoin string Loan coin > loanAmount string Loan amount > unpaidAmount string Unpaid principal > unpaidInterest string Unpaid interest > repaidAmount string Repaid principal > repaidInterest string Repaid interest > interestRate string Daily interest rate > status string 1:outstanding; 2:paid off > leverage string The maximum leverage for this loan product > supportSpot string Whether to support spot. 0:false; 1:true > supportContract string Whether to support contract . 0:false; 1:true > withdrawLine string Restrict line for withdrawal > transferLine string Restrict line for transfer > spotBuyLine string Restrict line for SPOT buy > spotSellLine string Restrict line for SPOT sell > contractOpenLine string Restrict line for USDT Perpetual open position > liquidationLine string Line for liquidation > stopLiquidationLine string Line for stop liquidation > contractLeverage string The allowed default leverage for USDT Perpetual > transferRatio string The transfer ratio for loan funds to transfer from Spot wallet to Contract wallet > spotSymbols array The whitelist of spot trading pairs. If there is no whitelist, then "[]" > contractSymbols array The whitelist of contract trading pairs If supportContract="0", then this is "[]" If there is no whitelist, this is "[]" > supportUSDCContract string Whether to support USDC contract. "0":false; "1":true > supportUSDCOptions string Whether to support Option. "0":false; "1":true > supportMarginTrading string Whether to support Spot margin trading. "0":false; "1":true > USDTPerpetualOpenLine string Restrict line to open USDT Perpetual position > USDCContractOpenLine string Restrict line to open USDC Contract position > USDCOptionsOpenLine string Restrict line to open Option position > USDTPerpetualCloseLine string Restrict line to trade USDT Perpetual position > USDCContractCloseLine string Restrict line to trade USDC Contract position > USDCOptionsCloseLine string Restrict line to trade Option position > USDCContractSymbols array The whitelist of USDC contract trading pairs If no whitelist symbols, it is [], and you can trade any If supportUSDCContract="0", it is [] > USDCOptionsSymbols array The whitelist of Option symbols If no whitelisted, it is [], and you can trade any If supportUSDCOptions="0", it is [] > marginLeverage string The allowable maximum leverage for Spot margin > USDTPerpetualLeverage array Object If supportContract="0", it is [] If no whitelist USDT perp symbols, it returns all trading symbols and leverage by default If there are whitelist symbols, it return those whitelist data > > symbol string Symbol name > > leverage string Maximum leverage > USDCContractLeverage array Object If supportUSDCContract="0", it is [] If no whitelist USDC contract symbols, it returns all trading symbols and leverage by default If there are whitelist symbols, it return those whitelist data > > symbol string Symbol name > > leverage string Maximum leverage
      • getInsRepayOrders

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/ins-loan/repaid-history")
        retrofit2.Call<Object> getInsRepayOrders​(@Query("startTime")
                                                 Long startTime,
                                                 @Query("endTime")
                                                 Long endTime,
                                                 @Query("limit")
                                                 Integer limit)
        Get Repay Orders Get repaid order information

        TIP Get the past 2 years data by default Get up to the past 2 years of data

        https://bybit-exchange.github.io/docs/v5/otc/repay-info

        Parameters:
        startTime - false integer The start timestamp (ms)
        endTime - false integer The end timestamp (ms)
        limit - false integer Limit for data size. [1, 100]. Default: 100
        Returns:
        Response Parameters Parameter Type Comments repayInfo array Object > repayOrderId string Repaid order ID > repaidTime string Repaid timestamp (ms) > token string Repaid coin > quantity string Repaid principle > interest string Repaid interest > businessType string Repaid type. 1:normal repayment; 2:repaid by liquidation > status string 1:outstanding; 2:paid off
      • getInsLoanToValue

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/ins-loan/ltv-convert")
        retrofit2.Call<Object> getInsLoanToValue()
        Get LTV Get LTV

        https://bybit-exchange.github.io/docs/v5/otc/ltv-convert

        Returns:
        Response Parameters Parameter Type Comments ltvInfo array Object > ltv string Risk rate > parentUid string The uid that used to bind OTC loan product > subAccountUids array Bound user id > unpaidAmount string Total debt(USDT) > unpaidInfo array Debt details > > token string coin > > unpaidQty string Unpaid principle > > unpaidInterest string Useless field, please ignore this for now > balance string Total asset. (margin coins converted to USDT). Please read here to understand the calculation > balanceInfo array Asset details > > token string Margin coin > > price string Margin coin price > > qty string Margin coin quantity > > convertedAmount string Margin conversion amount
      • getSpotLeverageTokenInfo

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/spot-lever-token/info")
        retrofit2.Call<Object> getSpotLeverageTokenInfo​(@Query("ltCoin")
                                                        String ltCoin)
        Get Leverage Token Info Query leverage token information

        https://bybit-exchange.github.io/docs/v5/lt/leverage-token-info#http-request

        Parameters:
        ltCoin - false string Abbreviation of the LT, such as BTC3L
        Returns:
        Response Parameters Parameter Type Comments list array Object > ltCoin string Abbreviation > ltName string Full name of leveraged token > maxPurchase string Single maximum purchase amount > minPurchase string Single minimum purchase amount > maxPurchaseDaily string Maximum purchase amount in a single day > maxRedeem string Single Maximum redemption quantity > minRedeem string Single Minimum redemption quantity > maxRedeemDaily string Maximum redemption quantity in a single day > purchaseFeeRate string Purchase fee rate > redeemFeeRate string Redeem fee rate > ltStatus string Whether the leverage token can be purchased or redeemed > fundFee string Funding fee charged daily for users holding leveraged token > fundFeeTime string The time to charge funding fee > manageFeeRate string Management fee rate > manageFeeTime string The time to charge management fee > value string Nominal asset value > netValue string Net value > total string Total purchase upper limit
      • getSpotLeverageTokenMarket

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/spot-lever-token/reference")
        retrofit2.Call<Object> getSpotLeverageTokenMarket​(@Query("ltCoin")
                                                          String ltCoin)
        Get Leveraged Token Market Get leverage token market information

        https://bybit-exchange.github.io/docs/v5/lt/leverage-token-reference

        Parameters:
        ltCoin - true string Abbreviation of the LT, such as BTC3L
        Returns:
        Response Parameters Parameter Type Comments ltCoin string Abbreviation of the LT, such as BTC3L nav string net value navTime string Update time for net asset value (in milliseconds and UTC time zone) circulation string Circulating supply in the secondary market basket string basket leverage string Real leverage calculated by last traded price
      • purchaseSpotLeverageToken

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/spot-lever-token/purchase")
        retrofit2.Call<Object> purchaseSpotLeverageToken​(@Body
                                                         SpotLeverageTokenRequest spotLeverageTokenRequest)
        Purchase Purchase levearge token

        https://bybit-exchange.github.io/docs/v5/lt/purchase

        Parameters:
        spotLeverageTokenRequest - ltCoin true string Abbreviation of the LT, such as BTC3L ltAmount true string Purchase amount serialNo false string Serial number
        Returns:
        Response Parameters Parameter Type Comments ltCoin string Abbreviation of the LT, such as BTC3L ltOrderStatus string Order status. 1: completed, 2: in progress, 3: failed execQty string Executed qty of LT execAmt string Executed amount of LT amount string Purchase amount purchaseId string Order ID serialNo string Serial number, customised order ID valueCoin string Quote coin
      • redeemSpotLeverageToken

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/spot-lever-token/redeem")
        retrofit2.Call<Object> redeemSpotLeverageToken​(@Body
                                                       SpotLeverageTokenRequest spotLeverageTokenRequest)
        Redeem Redeem leverage token

        https://bybit-exchange.github.io/docs/v5/lt/redeem

        Parameters:
        spotLeverageTokenRequest - ltCoin true string Abbreviation of the LT, such as BTC3L quantity ture string Redeem quantity of LT serialNo false string Serial number
        Returns:
        Response Parameters Parameter Type Comments ltCoin string Abbreviation of the LT ltOrderStatus string Order status. 1: completed, 2: in progress, 3: failed quantity string Quantity execQty string LT quantity execAmt string Executed amount of LT redeemId string Order ID serialNo string Serial number valueCoin string Quote coin
      • getSpotLeverageRecords

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/spot-lever-token/order-record")
        retrofit2.Call<Object> getSpotLeverageRecords​(@Query("ltCoin")
                                                      String ltCoin,
                                                      @Query("orderId")
                                                      String orderId,
                                                      @Query("startTime")
                                                      Long startTime,
                                                      @Query("endTime")
                                                      Long endTime,
                                                      @Query("limit")
                                                      Integer limit,
                                                      @Query("ltOrderType")
                                                      Integer ltOrderType,
                                                      @Query("serialNo")
                                                      String serialNo)
        Get Purchase/Redemption Records Get purchase or redeem history

        https://bybit-exchange.github.io/docs/v5/lt/order-record

        Parameters:
        ltCoin - false string Abbreviation of the LT, such as BTC3L
        orderId - false string Order ID
        startTime - false integer The start timestamp (ms)
        endTime - false integer The end timestamp (ms)
        limit - false integer Limit for data size per page. [1, 500]. Default: 100
        ltOrderType - false integer LT order type. 1: purchase, 2: redemption
        serialNo - false string Serial number
        Returns:
        Response Parameters Parameter Type Comments list array Object > ltCoin string Abbreviation of the LT, such as BTC3L > orderId string Order ID > ltOrderType integer LT order type. 1: purchase, 2: redeem > orderTime number Order time > updateTime number Last update time of the order status > ltOrderStatus string Order status. 1: completed, 2: in progress, 3: failed > fee string Trading fees > amount string Order quantity of the LT > value string Filled value > valueCoin string Quote coin > serialNo string Serial number
      • getUtaVipSpotMarginTradeData

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/spot-margin-trade/data")
        retrofit2.Call<Object> getUtaVipSpotMarginTradeData​(@Query("vipLevel")
                                                            String vipLevel,
                                                            @Query("currency")
                                                            String currency)
        Get VIP Margin Data This margin data is for Unified account in particular.

        INFO Do not need authentication

        https://bybit-exchange.github.io/docs/v5/spot-margin-uta/vip-margin

        Parameters:
        vipLevel - false string Vip level
        currency - false string Coin name
        Returns:
        Response Parameters Parameter Type Comments vipCoinList array Object > list array Object > > borrowable boolean Whether it is allowed to be borrowed > > collateralRatio string Collateral ratio > > currency string Coin name > > hourlyBorrowRate string Borrow interest rate per hour > > liquidationOrder string Liquidation order > > marginCollateral boolean Whether it can be used as a margin collateral currency > > maxBorrowingAmount string Max borrow amount > vipLevel string Vip level
      • setUTASpotMarginTrade

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/spot-margin-trade/switch-mode")
        retrofit2.Call<Object> setUTASpotMarginTrade​(@Body
                                                     String spotMarginMode)
        Toggle Margin Trade Turn on / off spot margin trade

        Covers: Margin trade (Unified Account)

        CAUTION Your account needs to activate spot margin first; i.e., you must have finished the quiz on web / app.

        https://bybit-exchange.github.io/docs/v5/spot-margin-uta/switch-mode

        Parameters:
        spotMarginMode - spotMarginMode true string 1: on, 0: off
        Returns:
        Response Parameters Parameter Type Comments spotMarginMode string Spot margin status. 1: on, 0: off
      • setUTASpotMarginTradeLeverage

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/spot-margin-trade/set-leverage")
        retrofit2.Call<Object> setUTASpotMarginTradeLeverage​(@Body
                                                             String leverage)
        Set Leverage Set the user's maximum leverage in spot cross margin

        Covers: Margin trade (Unified Account)

        CAUTION Your account needs to activate spot margin first; i.e., you must have finished the quiz on web / app.

        https://bybit-exchange.github.io/docs/v5/spot-margin-uta/set-leverage

        Parameters:
        leverage - leverage true string Leverage. [2, 10].
        Returns:
        Response Parameters None
      • getUTASpotMarginTradeLeverageState

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/spot-margin-trade/state")
        retrofit2.Call<Object> getUTASpotMarginTradeLeverageState()
        Get Status And Leverage Query the Spot margin status and leverage of Unified account

        Covers: Margin trade (Unified Account)

        https://bybit-exchange.github.io/docs/v5/spot-margin-uta/status

        Returns:
        Response Parameters Parameter Type Comments spotLeverage string Spot margin leverage. Returns "" if the margin trade is turned off spotMarginMode string Spot margin status. 1: on, 0: off
      • getNormalVipSpotMarginTradeData

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/spot-cross-margin-trade/data")
        retrofit2.Call<Object> getNormalVipSpotMarginTradeData​(@Query("vipLevel")
                                                               String vipLevel,
                                                               @Query("currency")
                                                               String currency)
        Get VIP Margin Data This margin data is for Classic account in particular.

        INFO Do not need authentication

        https://bybit-exchange.github.io/docs/v5/spot-margin-normal/vip-margin#http-request

        Parameters:
        vipLevel - false string Vip level
        currency - false string Coin name
        Returns:
        Response Parameters Parameter Type Comments vipCoinList array Object > list array Object > > borrowable boolean Whether it is allowed to be borrowed > > collateralRatio string Collateral ratio > > currency string Coin name > > hourlyBorrowRate string Borrow interest rate per hour > > liquidationOrder string Liquidation order > > marginCollateral boolean Whether it can be used as a margin collateral currency > > maxBorrowingAmount string Max borrow amount > vipLevel string Vip level
      • getNormalSpotMarginTradeCoinInfo

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/spot-cross-margin-trade/pledge-token")
        retrofit2.Call<Object> getNormalSpotMarginTradeCoinInfo​(@Query("coin")
                                                                String coin)
        Get Margin Coin Info INFO Do not need authentication

        https://bybit-exchange.github.io/docs/v5/spot-margin-normal/margin-data#http-request

        Parameters:
        coin - false string Coin name
        Returns:
        Response Parameters Parameter Type Comments list array Object > coin string Coin name > conversionRate string Convert ratio > liquidationOrder integer Liquidation order
      • getNormalSpotMarginTradeBorrowCoinInfo

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/spot-cross-margin-trade/borrow-token")
        retrofit2.Call<Object> getNormalSpotMarginTradeBorrowCoinInfo​(@Query("coin")
                                                                      String coin)
        Get Borrowable Coin Info INFO Do not need authentication

        https://bybit-exchange.github.io/docs/v5/spot-margin-normal/borrowable-data

        Parameters:
        coin - false string Coin name
        Returns:
        Request Parameters Parameter Required Type Comments coin false string Coin name Response Parameters Parameter Type Comments list array Object > coin string Coin name > borrowingPrecision integer Accuracy of loan amount > repaymentPrecision integer Accuracy of repayment amount
      • getNormalSpotMarginTradeInterestQuota

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/spot-cross-margin-trade/loan-info")
        retrofit2.Call<Object> getNormalSpotMarginTradeInterestQuota​(@Query("coin")
                                                                     String coin)
        Get Interest and Quota Covers: Margin trade (Classic Account)

        https://bybit-exchange.github.io/docs/v5/spot-margin-normal/interest-quota#http-request

        Parameters:
        coin - true string Coin name
        Returns:
        Response Parameters Parameter Type Comments coin string Coin name interestRate string Daily interest rate loanAbleAmount string The estimated amount can be loaned maxLoanAmount string The fixed loanable amount per user on platform
      • getNormalSpotMarginTradeAccountInfo

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/spot-cross-margin-trade/account")
        retrofit2.Call<Object> getNormalSpotMarginTradeAccountInfo()
        Get Loan Account Info Covers: Margin trade (Classic Account)

        https://bybit-exchange.github.io/docs/v5/spot-margin-normal/account-info

        Returns:
        Response Parameters Parameter Type Comments acctBalanceSum string Total equity (BTC) debtBalanceSum string Total liability (BTC) loanAccountList array Object > free string Available balance > interest string Outstanding interest > loan string Outstanding principle > remainAmount string Remaining debt = interest + loan > locked string Locked amount > tokenId string Coin name > total string Total riskRate string Risk rate status integer Loan account status 1: normal 2: withdrawal/transfer restricted 3: liquidation alert triggered 4: liquidated switchStatus integer 0: margin trade off, 1: margin trade on
      • setNormalSpotToggleMarginTrade

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/spot-cross-margin-trade/switch")
        retrofit2.Call<Object> setNormalSpotToggleMarginTrade​(@Body
                                                              int switchStatus)
        Toggle Margin Trade Turn on / off spot margin trade

        Covers: Margin trade (Classic Account)

        https://bybit-exchange.github.io/docs/v5/spot-margin-normal/switch-mode#http-request

        Parameters:
        switchStatus - switch true integer 1: on, 0: off
        Returns:
        Response Parameters Parameter Type Comments switchStatus integer Margin trade status. 1: on, 0: off
      • loanNormalSpotMarginTrade

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/spot-cross-margin-trade/loan")
        retrofit2.Call<Object> loanNormalSpotMarginTrade​(@Body
                                                         SpotMarginTradeBorrowRequest spotMarginTradeBorrowRequest)
        Borrow Covers: Margin trade (Classic Account)

        https://bybit-exchange.github.io/docs/v5/spot-margin-normal/borrow#http-request

        Parameters:
        spotMarginTradeBorrowRequest - coin true string Coin name qty true string Amount to borrow
        Returns:
        Response Parameters Parameter Type Comments transactId string Borrow transaction ID
      • repayNormalSpotMarginTrade

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/spot-cross-margin-trade/repay")
        retrofit2.Call<Object> repayNormalSpotMarginTrade​(@Body
                                                          SpotMarginTradeRePayRequest spotMarginTradeRePayRequest)
        Repay Covers: Margin trade (Classic Account)

        https://bybit-exchange.github.io/docs/v5/spot-margin-normal/repay#http-request

        Parameters:
        spotMarginTradeRePayRequest - coin true string Coin name qty false string Amount to repay qty is required when completeRepayment=0 qty is invalid when completeRepayment=1 completeRepayment false integer Whether to pay off all debts. 0(default): false, 1: true
        Returns:
        Response Parameters Parameter Type Comments repayId string Repayment transaction ID
      • getNormalMarginTradeBorrowOrders

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/spot-cross-margin-trade/orders")
        retrofit2.Call<Object> getNormalMarginTradeBorrowOrders​(@Query("startTime")
                                                                Long startTime,
                                                                @Query("endTime")
                                                                Long endTime,
                                                                @Query("coin")
                                                                String coin,
                                                                @Query("status")
                                                                Integer status,
                                                                @Query("limit")
                                                                Integer limit)
        Get Borrow Order Detail Covers: Margin trade (Classic Account)

        https://bybit-exchange.github.io/docs/v5/spot-margin-normal/borrow-order#http-request

        Parameters:
        startTime - false long The start timestamp (ms)
        endTime - false long The end timestamp (ms)
        coin - false string Coin name
        status - false integer Status 0(default):get all kinds of status 1:uncleared 2:cleared
        limit - false integer Limit for data size per page. [1, 500]. Default: 500
        Returns:
        Response Parameters Parameter Type Comments list array Object > accountId string Account ID > coin string Coin name > createdTime number Borrow order created timestamp (ms) > id string Borrow order ID > interestAmount string Total interest > interestBalance string Outstanding interest > loanAmount string Principal amount > loanBalance string Outstanding principal > remainAmount string Remaining debt = interestBalance + loanBalance > status integer Status 1:uncleared, 2:cleared > type integer Order Type 1: manual loan, 2: auto loan
      • getNormalMarginTradeRepayOrders

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/spot-cross-margin-trade/repay-history")
        retrofit2.Call<Object> getNormalMarginTradeRepayOrders​(@Query("startTime")
                                                               Long startTime,
                                                               @Query("endTime")
                                                               Long endTime,
                                                               @Query("coin")
                                                               String coin,
                                                               @Query("limit")
                                                               Integer limit)
        Get Repayment Order Detail Covers: Margin trade (Classic Account)

        https://bybit-exchange.github.io/docs/v5/spot-margin-normal/repay-order#http-request

        Parameters:
        startTime - false long The start timestamp (ms)
        endTime - false long The end timestamp (ms)
        coin - false string Coin name
        limit - false integer Limit for data size per page. [1, 500], Default: 500
        Returns:
        Response Parameters Parameter Type Comments list array Object > accountId string Account ID > coin string Coin name > repaidAmount string Repaid amount > repayId string Repay ID > repayMarginOrderId string Repay margin order ID > repayTime string Repay timestamp (ms) > transactIds array Object > > repaidInterest string Interest repaid > > repaidPrincipal string Principal repaid > > repaidSerialNumber string Repayment No. (Borrowing Order) > > transactId string Borrowing transaction ID
      • getBrokerEarningData

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/broker/earnings-info")
        retrofit2.Call<Object> getBrokerEarningData​(@Query("bizType")
                                                    String bizType,
                                                    @Query("startTime")
                                                    Long startTime,
                                                    @Query("endTime")
                                                    Long endTime,
                                                    @Query("limit")
                                                    Integer limit,
                                                    @Query("cursor")
                                                    String cursor)
        Get Broker Earning INFO Use exchange broker master account to query The data can support up to past 6 months until T-1 startTime and endTime are either entered at the same time or not entered

        https://bybit-exchange.github.io/docs/v5/broker/earning

        Parameters:
        bizType - false string Business type. SPOT, DERIVATIVES, OPTIONS
        startTime - false integer The start timestamp(ms)e
        endTime - false integer The end timestamp(ms)
        limit - false integer Limit for data size per page. [1, 1000]. Default: 1000
        cursor - false string Cursor. Use the nextPageCursor token from the response to retrieve the next page of the result set
        Returns:
        Response Parameters Parameter Type Comments list array Object > userId string UID > bizType string Business type > symbol string Symbol name > coin string Coin name. The currency of earning > earning string Earning > orderId string Order ID > execTime string Execution timestamp (ms) nextPageCursor string Refer to the cursor request parameter
      • getBrokerAccountInfo

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/broker/account-info")
        retrofit2.Call<Object> getBrokerAccountInfo()
        Get Exchange Broker Account Info INFO Use exchange broker master account to query API rate limit: 10 req / sec https://bybit-exchange.github.io/docs/v5/broker/account-info
        Returns:
        Response Parameters Parameter Type Comments subAcctQty string The qty of subaccount has been created maxSubAcctQty string The max limit of subaccount can be created baseFeeRebateRate Object Rebate percentage of the base fee > spot string Rebate percentage of the base fee for spot, e.g., 10.00% > derivatives string Rebate percentage of the base fee for derivatives, e.g., 10.00% markupFeeRebateRate Object Rebate percentage of the mark-up fee > spot string Rebate percentage of the mark-up fee for spot, e.g., 10.00% > derivatives string Rebate percentage of the mark-up fee for derivatives, e.g., 10.00% ts string System timestamp (ms)
      • getC2CLendingCoinInfo

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/lending/info")
        retrofit2.Call<Object> getC2CLendingCoinInfo​(@Query("coin")
                                                     String coin)
        Get the basic information of lending coins

        INFO All v5/lending APIs need SPOT permission.

        https://bybit-exchange.github.io/docs/v5/c2c-lend/coin-info

        Parameters:
        coin - false string Coin name. Return all currencies by default
        Returns:
        Response Parameters Parameter Type Comments list array Object > coin string Coin name > maxRedeemQty string The maximum redeemable qty per day (measured from 0 - 24 UTC) > minPurchaseQty string The minimum qty that can be deposited per request > precision string Deposit quantity accuracy > rate string Annualized interest rate. e.g. 0.0002 means 0.02% > loanToPoolRatio string Capital utilization rate. e.g. 0.0004 means 0.04% > actualApy string The actual annualized interest rate
      • C2cLendingDepositFunds

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/lending/purchase")
        retrofit2.Call<Object> C2cLendingDepositFunds​(@Body
                                                      ClientLendingFundsRequest depositFundRequest)
        Deposit Funds Lending funds to Bybit asset pool

        INFO normal and UMA account: deduct funds from Spot wallet UTA account: deduct funds from Unified wallet

        https://bybit-exchange.github.io/docs/v5/c2c-lend/deposit

        Parameters:
        depositFundRequest - coin true string Coin name quantity true string Deposit quantity serialNo false string Customised ID. If not passed, system will create one by default
        Returns:
        Response Parameters Parameter Type Comments coin string Coin name createdTime string Created timestamp (ms) orderId string Order ID quantity string Deposit quantity serialNo string Serial No status string Order status. 0: Initial, 1: Processing, 2: Success, 10: Failed updatedTime string Updated timestamp (ms)
      • C2cLendingRedeemFunds

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/lending/redeem")
        retrofit2.Call<Object> C2cLendingRedeemFunds​(@Body
                                                     ClientLendingFundsRequest depositFundRequest)
        Withdraw funds from the Bybit asset pool.

        TIP There will be two redemption records: one for the redeemed quantity, and the other one is for the total interest occurred.

        https://bybit-exchange.github.io/docs/v5/c2c-lend/redeem

        Parameters:
        depositFundRequest - coin true string Coin name quantity ture string Redemption quantity serialNo false string Serial no. A customised ID, and it will automatically generated if not passed
        Returns:
        Response Parameters Parameter Type Comments coin string Coin name createdTime string Created timestamp (ms) orderId string Order ID principalQty string Redemption quantity serialNo string Serial No status string Order status. 0: Initial, 1: Processing, 2: Success, 10: Failed updatedTime string Updated timestamp (ms)
      • C2cLendingRedeemCancel

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @POST("/v5/lending/redeem-cancel")
        retrofit2.Call<Object> C2cLendingRedeemCancel​(@Body
                                                      ClientLendingFundsRequest depositFundRequest)
        Cancel Redeem Cancel the withdrawal operation.

        https://bybit-exchange.github.io/docs/v5/c2c-lend/cancel-redeem

        Parameters:
        depositFundRequest - coin false string Coin name orderId false string The order ID of redemption serialNo false string Serial no. The customised ID of redemption
        Returns:
        Response Parameters Parameter Type Comments orderId string Order ID serialNo string Serial No updatedTime string Updated timestamp (ms)
      • getC2cOrdersRecords

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/lending/history-order")
        retrofit2.Call<Object> getC2cOrdersRecords​(@Query("coin")
                                                   String coin,
                                                   @Query("orderId")
                                                   String orderId,
                                                   @Query("startTime")
                                                   Long startTime,
                                                   @Query("endTime")
                                                   Long endTime,
                                                   @Query("limit")
                                                   Integer limit,
                                                   @Query("orderType")
                                                   String orderType)
        Get Order Records Get lending or redeem history

        https://bybit-exchange.github.io/docs/v5/c2c-lend/order-record

        Parameters:
        coin - false string Coin name
        orderId - false string Order ID
        startTime - false long The start timestamp (ms)
        endTime - false long The end timestamp (ms)
        limit - false integer Limit for data size per page. [1, 500]. Default: 50
        orderType - false string Order type. 1: deposit, 2: redemption, 3: Payment of proceeds
        Returns:
        Response Parameters Parameter Type Comments list array Object > coin string Coin name > createdTime string Created timestamp (ms) > orderId string Order ID > quantity string quantity > serialNo string Serial No > status string Order status. 0: Initial, 1: Processing, 2: Success, 10: Failed, 11: Cancelled > updatedTime string Updated timestamp (ms)
      • getC2CLendingAccountInfo

        @Headers("X-BAPI-SIGN-TYPE: 2")
        @GET("/v5/lending/account")
        retrofit2.Call<Object> getC2CLendingAccountInfo​(@Query("coin")
                                                        String coin)
        Get Lending Account Info

        https://bybit-exchange.github.io/docs/v5/c2c-lend/account-info

        Parameters:
        coin - true string Coin name
        Returns:
        Response Parameters Parameter Type Comments coin string Coin name principalInterest string User Redeemable interest principalQty string Leftover quantity you can redeem for today (measured from 0 - 24 UTC), formula: min(the rest amount of principle, the amount that the user can redeem on the day) principalTotal string Total amount redeemable by user quantity string Current deposit quantity
      • getAnouncementInfo

        @GET("/v5/announcements/index")
        retrofit2.Call<Object> getAnouncementInfo​(@Query("locale")
                                                  String locale,
                                                  @Query("type")
                                                  String type,
                                                  @Query("tag")
                                                  String tag,
                                                  @Query("page")
                                                  Integer page,
                                                  @Query("limit")
                                                  Integer limit)
        Get Announcement

        https://bybit-exchange.github.io/docs/v5/announcement#http-request

        Parameters:
        locale - true string Language symbol
        type - false string Announcement type
        tag - false string Announcement tag
        page - false integer Page number. Default: 1
        limit - false integer Limit for data size per page. Default: 20
        Returns:
        Response Parameters Parameter Type Comments total integer Total records list array Object > title string Announcement title > description string Announcement description > type Object > > title string The title of announcement type > > key string The key of announcement type > tags array string The tag of announcement > url string Announcement url > dateTimestamp number Publish timestamp (ms) of announcement > startDataTimestamp number The start timestamp (ms) of the event, only valid when list.type.key == "latest_activities" > endDataTimestamp number The end timestamp (ms) of the event, only valid when list.type.key == "latest_activities"