Class: Bybit::RestApi::MarketService
- Inherits:
-
BaseService
- Object
- BaseService
- Bybit::RestApi::MarketService
- Defined in:
- lib/bybit/rest_api/market_service.rb
Instance Method Summary collapse
-
#get_adl_alert(**kwargs) ⇒ Hash
Get ADL alert information for the specified symbol.
-
#get_delivery_price(category:, **kwargs) ⇒ Hash
Get the delivery price for delivery contracts.
-
#get_fee_group_info(product_type:, **kwargs) ⇒ Hash
Get the fee group structure information.
-
#get_funding_rate_history(category:, symbol:, **kwargs) ⇒ Hash
Get the historical funding rate for a symbol.
-
#get_historical_volatility(category:, **kwargs) ⇒ Hash
Get the historical volatility for options.
-
#get_index_price_components(index_name:, **kwargs) ⇒ Hash
Get the components of the index price.
-
#get_index_price_kline(symbol:, interval:, **kwargs) ⇒ Hash
Get index price kline data for a symbol.
-
#get_instruments_info(category:, **kwargs) ⇒ Hash
Get the specification of instruments.
-
#get_insurance_pool(**kwargs) ⇒ Hash
Get the insurance pool balance data.
-
#get_kline(symbol:, interval:, **kwargs) ⇒ Hash
Get kline (candlestick) data for a symbol.
-
#get_long_short_ratio(category:, symbol:, period:, **kwargs) ⇒ Hash
Get the long/short account ratio for a symbol.
-
#get_mark_price_kline(symbol:, interval:, **kwargs) ⇒ Hash
Get mark price kline data for a symbol.
-
#get_new_delivery_price(category:, base_coin:, **kwargs) ⇒ Hash
Get the new delivery price for delivery contracts.
-
#get_open_interest(category:, symbol:, interval_time:, **kwargs) ⇒ Hash
Get the open interest data for a symbol.
-
#get_order_price_limit(symbol:, **kwargs) ⇒ Hash
Get the order price limit for a symbol.
-
#get_orderbook(category:, symbol:, **kwargs) ⇒ Hash
Get orderbook data for a specified symbol and category.
-
#get_premium_index_price_kline(symbol:, interval:, **kwargs) ⇒ Hash
Get premium index price kline data.
-
#get_recent_public_trades(category:, **kwargs) ⇒ Hash
Get recent public trades.
-
#get_risk_limit(category:, **kwargs) ⇒ Hash
Get risk limit information.
-
#get_rpi_orderbook(symbol:, limit:, **kwargs) ⇒ Hash
Get RPI (Retail Price Improvement) orderbook data.
-
#get_server_time ⇒ Object
Get Bybit server time.
-
#get_tickers(category:, **kwargs) ⇒ Hash
Get tickers information for a specified category.
Methods inherited from BaseService
Constructor Details
This class inherits a constructor from Bybit::RestApi::BaseService
Instance Method Details
#get_adl_alert(**kwargs) ⇒ Hash
Get ADL alert information for the specified symbol.
GET /v5/market/adlalert
13 14 15 16 17 |
# File 'lib/bybit/rest_api/market_service.rb', line 13 def get_adl_alert(**kwargs) params = kwargs.dup params = Bybit::Utils::WireKeys.camelize(params) @session.public_request(path: '/v5/market/adlAlert', params: params) end |
#get_delivery_price(category:, **kwargs) ⇒ Hash
Get the delivery price for delivery contracts.
GET /v5/market/delivery-price
31 32 33 34 35 |
# File 'lib/bybit/rest_api/market_service.rb', line 31 def get_delivery_price(category:, **kwargs) params = kwargs.merge(category: category) params = Bybit::Utils::WireKeys.camelize(params) @session.public_request(path: '/v5/market/delivery-price', params: params) end |
#get_fee_group_info(product_type:, **kwargs) ⇒ Hash
Get the fee group structure information.
GET /v5/market/fee-group-info
45 46 47 48 49 |
# File 'lib/bybit/rest_api/market_service.rb', line 45 def get_fee_group_info(product_type:, **kwargs) params = kwargs.merge(product_type: product_type) params = Bybit::Utils::WireKeys.camelize(params) @session.public_request(path: '/v5/market/fee-group-info', params: params) end |
#get_funding_rate_history(category:, symbol:, **kwargs) ⇒ Hash
Get the historical funding rate for a symbol.
GET /v5/market/funding/history
62 63 64 65 66 |
# File 'lib/bybit/rest_api/market_service.rb', line 62 def get_funding_rate_history(category:, symbol:, **kwargs) params = kwargs.merge(category: category, symbol: symbol) params = Bybit::Utils::WireKeys.camelize(params) @session.public_request(path: '/v5/market/funding/history', params: params) end |
#get_historical_volatility(category:, **kwargs) ⇒ Hash
Get the historical volatility for options.
GET /v5/market/historical-volatility
80 81 82 83 84 |
# File 'lib/bybit/rest_api/market_service.rb', line 80 def get_historical_volatility(category:, **kwargs) params = kwargs.merge(category: category) params = Bybit::Utils::WireKeys.camelize(params) @session.public_request(path: '/v5/market/historical-volatility', params: params) end |
#get_index_price_components(index_name:, **kwargs) ⇒ Hash
Get the components of the index price.
GET /v5/market/index-price-components
92 93 94 95 96 |
# File 'lib/bybit/rest_api/market_service.rb', line 92 def get_index_price_components(index_name:, **kwargs) params = kwargs.merge(index_name: index_name) params = Bybit::Utils::WireKeys.camelize(params) @session.public_request(path: '/v5/market/index-price-components', params: params) end |
#get_index_price_kline(symbol:, interval:, **kwargs) ⇒ Hash
Get index price kline data for a symbol.
GET /v5/market/index-price-kline
110 111 112 113 114 115 |
# File 'lib/bybit/rest_api/market_service.rb', line 110 def get_index_price_kline(symbol:, interval:, **kwargs) params = kwargs.merge(symbol: symbol, interval: interval) params[:end] = params.delete(:end_) if params.key?(:end_) params = Bybit::Utils::WireKeys.camelize(params) @session.public_request(path: '/v5/market/index-price-kline', params: params) end |
#get_instruments_info(category:, **kwargs) ⇒ Hash
Get the specification of instruments.
GET /v5/market/instruments-info
129 130 131 132 133 |
# File 'lib/bybit/rest_api/market_service.rb', line 129 def get_instruments_info(category:, **kwargs) params = kwargs.merge(category: category) params = Bybit::Utils::WireKeys.camelize(params) @session.public_request(path: '/v5/market/instruments-info', params: params) end |
#get_insurance_pool(**kwargs) ⇒ Hash
Get the insurance pool balance data.
GET /v5/market/insurance
142 143 144 145 146 |
# File 'lib/bybit/rest_api/market_service.rb', line 142 def get_insurance_pool(**kwargs) params = kwargs.dup params = Bybit::Utils::WireKeys.camelize(params) @session.public_request(path: '/v5/market/insurance', params: params) end |
#get_kline(symbol:, interval:, **kwargs) ⇒ Hash
Get kline (candlestick) data for a symbol.
GET /v5/market/kline
198 199 200 201 202 203 |
# File 'lib/bybit/rest_api/market_service.rb', line 198 def get_kline(symbol:, interval:, **kwargs) params = kwargs.merge(symbol: symbol, interval: interval) params[:end] = params.delete(:end_) if params.key?(:end_) params = Bybit::Utils::WireKeys.camelize(params) @session.public_request(path: '/v5/market/kline', params: params) end |
#get_long_short_ratio(category:, symbol:, period:, **kwargs) ⇒ Hash
Get the long/short account ratio for a symbol.
GET /v5/market/account-ratio
161 162 163 164 165 |
# File 'lib/bybit/rest_api/market_service.rb', line 161 def get_long_short_ratio(category:, symbol:, period:, **kwargs) params = kwargs.merge(category: category, symbol: symbol, period: period) params = Bybit::Utils::WireKeys.camelize(params) @session.public_request(path: '/v5/market/account-ratio', params: params) end |
#get_mark_price_kline(symbol:, interval:, **kwargs) ⇒ Hash
Get mark price kline data for a symbol.
GET /v5/market/mark-price-kline
179 180 181 182 183 184 |
# File 'lib/bybit/rest_api/market_service.rb', line 179 def get_mark_price_kline(symbol:, interval:, **kwargs) params = kwargs.merge(symbol: symbol, interval: interval) params[:end] = params.delete(:end_) if params.key?(:end_) params = Bybit::Utils::WireKeys.camelize(params) @session.public_request(path: '/v5/market/mark-price-kline', params: params) end |
#get_new_delivery_price(category:, base_coin:, **kwargs) ⇒ Hash
Get the new delivery price for delivery contracts.
GET /v5/market/new-delivery-price
214 215 216 217 218 |
# File 'lib/bybit/rest_api/market_service.rb', line 214 def get_new_delivery_price(category:, base_coin:, **kwargs) params = kwargs.merge(category: category, base_coin: base_coin) params = Bybit::Utils::WireKeys.camelize(params) @session.public_request(path: '/v5/market/new-delivery-price', params: params) end |
#get_open_interest(category:, symbol:, interval_time:, **kwargs) ⇒ Hash
Get the open interest data for a symbol.
GET /v5/market/open-interest
233 234 235 236 237 |
# File 'lib/bybit/rest_api/market_service.rb', line 233 def get_open_interest(category:, symbol:, interval_time:, **kwargs) params = kwargs.merge(category: category, symbol: symbol, interval_time: interval_time) params = Bybit::Utils::WireKeys.camelize(params) @session.public_request(path: '/v5/market/open-interest', params: params) end |
#get_order_price_limit(symbol:, **kwargs) ⇒ Hash
Get the order price limit for a symbol.
GET /v5/market/price-limit
246 247 248 249 250 |
# File 'lib/bybit/rest_api/market_service.rb', line 246 def get_order_price_limit(symbol:, **kwargs) params = kwargs.merge(symbol: symbol) params = Bybit::Utils::WireKeys.camelize(params) @session.public_request(path: '/v5/market/price-limit', params: params) end |
#get_orderbook(category:, symbol:, **kwargs) ⇒ Hash
Get orderbook data for a specified symbol and category.
GET /v5/market/orderbook
261 262 263 264 265 |
# File 'lib/bybit/rest_api/market_service.rb', line 261 def get_orderbook(category:, symbol:, **kwargs) params = kwargs.merge(category: category, symbol: symbol) params = Bybit::Utils::WireKeys.camelize(params) @session.public_request(path: '/v5/market/orderbook', params: params) end |
#get_premium_index_price_kline(symbol:, interval:, **kwargs) ⇒ Hash
Get premium index price kline data.
GET /v5/market/premium-index-price-kline
279 280 281 282 283 284 |
# File 'lib/bybit/rest_api/market_service.rb', line 279 def get_premium_index_price_kline(symbol:, interval:, **kwargs) params = kwargs.merge(symbol: symbol, interval: interval) params[:end] = params.delete(:end_) if params.key?(:end_) params = Bybit::Utils::WireKeys.camelize(params) @session.public_request(path: '/v5/market/premium-index-price-kline', params: params) end |
#get_recent_public_trades(category:, **kwargs) ⇒ Hash
Get recent public trades.
GET /v5/market/recent-trade
297 298 299 300 301 |
# File 'lib/bybit/rest_api/market_service.rb', line 297 def get_recent_public_trades(category:, **kwargs) params = kwargs.merge(category: category) params = Bybit::Utils::WireKeys.camelize(params) @session.public_request(path: '/v5/market/recent-trade', params: params) end |
#get_risk_limit(category:, **kwargs) ⇒ Hash
Get risk limit information.
GET /v5/market/risk-limit
312 313 314 315 316 |
# File 'lib/bybit/rest_api/market_service.rb', line 312 def get_risk_limit(category:, **kwargs) params = kwargs.merge(category: category) params = Bybit::Utils::WireKeys.camelize(params) @session.public_request(path: '/v5/market/risk-limit', params: params) end |
#get_rpi_orderbook(symbol:, limit:, **kwargs) ⇒ Hash
Get RPI (Retail Price Improvement) orderbook data.
GET /v5/market/rpi_orderbook
327 328 329 330 331 |
# File 'lib/bybit/rest_api/market_service.rb', line 327 def get_rpi_orderbook(symbol:, limit:, **kwargs) params = kwargs.merge(symbol: symbol, limit: limit) params = Bybit::Utils::WireKeys.camelize(params) @session.public_request(path: '/v5/market/rpi_orderbook', params: params) end |
#get_server_time ⇒ Object
Get Bybit server time.
GET /v5/market/time
338 339 340 |
# File 'lib/bybit/rest_api/market_service.rb', line 338 def get_server_time @session.public_request(path: '/v5/market/time') end |
#get_tickers(category:, **kwargs) ⇒ Hash
Get tickers information for a specified category.
GET /v5/market/tickers
352 353 354 355 356 |
# File 'lib/bybit/rest_api/market_service.rb', line 352 def get_tickers(category:, **kwargs) params = kwargs.merge(category: category) params = Bybit::Utils::WireKeys.camelize(params) @session.public_request(path: '/v5/market/tickers', params: params) end |