Class: Bybit::RestApi::SpotMarginService

Inherits:
BaseService show all
Defined in:
lib/bybit/rest_api/spot_margin_service.rb

Instance Method Summary collapse

Methods inherited from BaseService

#initialize

Constructor Details

This class inherits a constructor from Bybit::RestApi::BaseService

Instance Method Details

#get_historical_interest_rate(currency:, **kwargs) ⇒ Hash

Get historical interest rate for spot margin trading.

GET /v5/spot-margin-trade/interest-rate-history

Parameters:

  • currency (String)

    Currency

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :vip_level (String)

    VIP level

  • :start_time (Integer)

    Start time in milliseconds

  • :end_time (Integer)

    End time in milliseconds

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



16
17
18
19
20
# File 'lib/bybit/rest_api/spot_margin_service.rb', line 16

def get_historical_interest_rate(currency:, **kwargs)
  params = kwargs.merge(currency: currency)
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/spot-margin-trade/interest-rate-history', params: params)
end

#get_position_tiers(**kwargs) ⇒ Hash

Get spot margin position tiers.

GET /v5/spot-margin-trade/position-tiers

Parameters:

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :currency (String)

    Currency

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



29
30
31
32
33
# File 'lib/bybit/rest_api/spot_margin_service.rb', line 29

def get_position_tiers(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/spot-margin-trade/position-tiers', params: params)
end

#get_tiered_collateral_ratio(**kwargs) ⇒ Hash

Get tiered collateral ratio for spot margin trading.

GET /v5/spot-margin-trade/collateral

Parameters:

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :currency (String)

    Currency

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).



41
42
43
44
45
# File 'lib/bybit/rest_api/spot_margin_service.rb', line 41

def get_tiered_collateral_ratio(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.public_request(path: '/v5/spot-margin-trade/collateral', params: params)
end

#get_vip_margin_data(**kwargs) ⇒ Hash

Get VIP margin data for spot margin trading.

GET /v5/spot-margin-trade/data

Parameters:

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :vip_level (String)

    VIP level

  • :currency (String)

    Currency

Returns:

  • (Hash)

    Bybit V5 ApiResponse envelope (retCode / retMsg / result / retExtInfo / time).

See Also:



55
56
57
58
59
# File 'lib/bybit/rest_api/spot_margin_service.rb', line 55

def get_vip_margin_data(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.public_request(path: '/v5/spot-margin-trade/data', params: params)
end