Class: Bybit::RestApi::RfqService

Inherits:
BaseService show all
Defined in:
lib/bybit/rest_api/rfq_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

#accept_non_lp_quote(rfq_id:, **kwargs) ⇒ Hash

Accept a non-LP quote for an RFQ.

POST /v5/rfq/accept-other-quote

Parameters:

  • rfq_id (String)

    RFQ ID

Returns:

  • (Hash)

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



12
13
14
15
16
# File 'lib/bybit/rest_api/rfq_service.rb', line 12

def accept_non_lp_quote(rfq_id:, **kwargs)
  params = kwargs.merge(rfq_id: rfq_id)
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :post, path: '/v5/rfq/accept-other-quote', body: params)
end

#cancel_all_quotes(**kwargs) ⇒ Hash

Cancel all active quotes.

POST /v5/rfq/cancel-all-quotes

Returns:

  • (Hash)

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



22
23
24
25
26
# File 'lib/bybit/rest_api/rfq_service.rb', line 22

def cancel_all_quotes(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :post, path: '/v5/rfq/cancel-all-quotes', body: params)
end

#cancel_all_rfqs(**kwargs) ⇒ Hash

Cancel all active RFQs.

POST /v5/rfq/cancel-all-rfq

Returns:

  • (Hash)

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



32
33
34
35
36
# File 'lib/bybit/rest_api/rfq_service.rb', line 32

def cancel_all_rfqs(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :post, path: '/v5/rfq/cancel-all-rfq', body: params)
end

#cancel_quote(**kwargs) ⇒ Hash

Cancel a specific quote by quote ID, RFQ ID, or quote link ID.

POST /v5/rfq/cancel-quote

Parameters:

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :quote_id (String)

    Quote ID

  • :rfq_id (String)

    RFQ ID

  • :quote_link_id (String)

    User-defined quote link ID

Returns:

  • (Hash)

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



46
47
48
49
50
# File 'lib/bybit/rest_api/rfq_service.rb', line 46

def cancel_quote(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :post, path: '/v5/rfq/cancel-quote', body: params)
end

#cancel_rfq(**kwargs) ⇒ Hash

Cancel a specific RFQ by RFQ ID or RFQ link ID.

POST /v5/rfq/cancel-rfq

Parameters:

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :rfq_id (String)

    RFQ ID

  • :rfq_link_id (String)

    User-defined RFQ link ID

Returns:

  • (Hash)

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



59
60
61
62
63
# File 'lib/bybit/rest_api/rfq_service.rb', line 59

def cancel_rfq(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :post, path: '/v5/rfq/cancel-rfq', body: params)
end

#create_quote(rfq_id:, **kwargs) ⇒ Hash

Create a quote in response to an RFQ.

POST /v5/rfq/create-quote

Parameters:

  • rfq_id (String)

    RFQ ID

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :quote_link_id (String)

    User-defined quote link ID

  • :anonymous (Boolean)

    Whether to submit the quote anonymously

  • :expire_in (Integer)

    Expiration time in seconds

  • :quote_buy_list (Array)

    Buy side quote entries

  • :quote_sell_list (Array)

    Sell side quote entries

Returns:

  • (Hash)

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



76
77
78
79
80
# File 'lib/bybit/rest_api/rfq_service.rb', line 76

def create_quote(rfq_id:, **kwargs)
  params = kwargs.merge(rfq_id: rfq_id)
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :post, path: '/v5/rfq/create-quote', body: params)
end

#create_rfq(counterparties:, list:, **kwargs) ⇒ Hash

Create a new RFQ (Request for Quote).

POST /v5/rfq/create-rfq

Parameters:

  • counterparties (Array)

    List of counterparties to receive the RFQ

  • list (Array)

    List of legs for the RFQ

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :rfq_link_id (String)

    User-defined RFQ link ID

  • :anonymous (Boolean)

    Whether to submit the RFQ anonymously

  • :strategy_type (String)

    Strategy type

Returns:

  • (Hash)

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



92
93
94
95
96
# File 'lib/bybit/rest_api/rfq_service.rb', line 92

def create_rfq(counterparties:, list:, **kwargs)
  params = kwargs.merge(counterparties: counterparties, list: list)
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :post, path: '/v5/rfq/create-rfq', body: params)
end

#execute_quote(rfq_id:, quote_id:, quote_side:, **kwargs) ⇒ Hash

Execute a quote to complete the trade.

POST /v5/rfq/execute-quote

Parameters:

  • rfq_id (String)

    RFQ ID

  • quote_id (String)

    Quote ID

  • quote_side (String)

    Quote side (Buy or Sell)

Returns:

  • (Hash)

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



106
107
108
109
110
# File 'lib/bybit/rest_api/rfq_service.rb', line 106

def execute_quote(rfq_id:, quote_id:, quote_side:, **kwargs)
  params = kwargs.merge(rfq_id: rfq_id, quote_id: quote_id, quote_side: quote_side)
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :post, path: '/v5/rfq/execute-quote', body: params)
end

#get_config(**kwargs) ⇒ Hash

Query RFQ configuration information.

GET /v5/rfq/config

Returns:

  • (Hash)

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



164
165
166
167
168
# File 'lib/bybit/rest_api/rfq_service.rb', line 164

def get_config(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/rfq/config', params: params)
end

#get_public_trades(**kwargs) ⇒ Hash

Query public RFQ trades.

GET /v5/rfq/public-trades

Parameters:

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :start_time (Integer)

    Start timestamp in milliseconds

  • :end_time (Integer)

    End timestamp in milliseconds

  • :limit (Integer)

    Maximum number of records to return

  • :cursor (String)

    Pagination cursor

Returns:

  • (Hash)

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



121
122
123
124
125
# File 'lib/bybit/rest_api/rfq_service.rb', line 121

def get_public_trades(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/rfq/public-trades', params: params)
end

#get_quotes(**kwargs) ⇒ Hash

Query historical quotes.

GET /v5/rfq/quote-list

Parameters:

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :rfq_id (String)

    RFQ ID

  • :quote_id (String)

    Quote ID

  • :quote_link_id (String)

    User-defined quote link ID

  • :trader_type (String)

    Trader type (Taker or Maker)

  • :status (String)

    Quote status filter

  • :limit (Integer)

    Maximum number of records to return

  • :cursor (String)

    Pagination cursor

Returns:

  • (Hash)

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



139
140
141
142
143
# File 'lib/bybit/rest_api/rfq_service.rb', line 139

def get_quotes(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/rfq/quote-list', params: params)
end

#get_quotes_realtime(**kwargs) ⇒ Hash

Query realtime (active) quotes.

GET /v5/rfq/quote-realtime

Parameters:

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :rfq_id (String)

    RFQ ID

  • :quote_id (String)

    Quote ID

  • :quote_link_id (String)

    User-defined quote link ID

  • :trader_type (String)

    Trader type (Taker or Maker)

Returns:

  • (Hash)

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



154
155
156
157
158
# File 'lib/bybit/rest_api/rfq_service.rb', line 154

def get_quotes_realtime(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/rfq/quote-realtime', params: params)
end

#get_rfqs(**kwargs) ⇒ Hash

Query historical RFQs.

GET /v5/rfq/rfq-list

Parameters:

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :rfq_id (String)

    RFQ ID

  • :rfq_link_id (String)

    User-defined RFQ link ID

  • :trader_type (String)

    Trader type (Taker or Maker)

  • :status (String)

    RFQ status filter

  • :limit (Integer)

    Maximum number of records to return

  • :cursor (String)

    Pagination cursor

Returns:

  • (Hash)

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



181
182
183
184
185
# File 'lib/bybit/rest_api/rfq_service.rb', line 181

def get_rfqs(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/rfq/rfq-list', params: params)
end

#get_rfqs_realtime(**kwargs) ⇒ Hash

Query realtime (active) RFQs.

GET /v5/rfq/rfq-realtime

Parameters:

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :rfq_id (String)

    RFQ ID

  • :rfq_link_id (String)

    User-defined RFQ link ID

  • :trader_type (String)

    Trader type (Taker or Maker)

Returns:

  • (Hash)

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



195
196
197
198
199
# File 'lib/bybit/rest_api/rfq_service.rb', line 195

def get_rfqs_realtime(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/rfq/rfq-realtime', params: params)
end

#get_trade_history(**kwargs) ⇒ Hash

Query RFQ trade history.

GET /v5/rfq/trade-list

Parameters:

  • kwargs (Hash)

    a customizable set of options

Options Hash (**kwargs):

  • :rfq_id (String)

    RFQ ID

  • :rfq_link_id (String)

    User-defined RFQ link ID

  • :quote_id (String)

    Quote ID

  • :quote_link_id (String)

    User-defined quote link ID

  • :trader_type (String)

    Trader type (Taker or Maker)

  • :status (String)

    Trade status filter

  • :limit (Integer)

    Maximum number of records to return

  • :cursor (String)

    Pagination cursor

Returns:

  • (Hash)

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



214
215
216
217
218
# File 'lib/bybit/rest_api/rfq_service.rb', line 214

def get_trade_history(**kwargs)
  params = kwargs.dup
  params = Bybit::Utils::WireKeys.camelize(params)
  @session.sign_request(method: :get, path: '/v5/rfq/trade-list', params: params)
end