Class: Bybit::RestApi::CryptoLoanService
- Inherits:
-
BaseService
- Object
- BaseService
- Bybit::RestApi::CryptoLoanService
- Defined in:
- lib/bybit/rest_api/crypto_loan_service.rb
Instance Method Summary collapse
-
#adjust_ltv(currency:, amount:, direction:, **kwargs) ⇒ Hash
Adjust collateral by adding or removing amount for crypto loan.
-
#borrow_fixed(order_currency:, order_amount:, annual_rate:, term:, collateral_list:, **kwargs) ⇒ Hash
Create Fixed-Term Borrow Order.
-
#borrow_flexible(loan_currency:, loan_amount:, collateral_list:, **kwargs) ⇒ Hash
Create Flexible Borrow Order.
-
#cancel_fixed_borrow_order(order_id:, **kwargs) ⇒ Hash
Cancel Borrow Order.
-
#cancel_fixed_supply_order(order_id:, **kwargs) ⇒ Hash
Cancel Supply Order.
-
#get_adjustment_history(**kwargs) ⇒ Hash
Get collateral adjustment history for crypto loan positions.
-
#get_collateral_data(**kwargs) ⇒ Hash
Get collateral currency data for crypto loan.
-
#get_fixed_borrow_contract_info(**kwargs) ⇒ Hash
Get Borrow Contract Info.
-
#get_fixed_borrow_order_info(**kwargs) ⇒ Hash
Get Borrow Order Info.
-
#get_fixed_borrow_order_quote(**kwargs) ⇒ Hash
Get Borrow Market Quotes.
-
#get_fixed_renew_info(**kwargs) ⇒ Hash
Get Renewal Information.
-
#get_fixed_supply_contract_info(**kwargs) ⇒ Hash
Get Supply Contract Info.
-
#get_fixed_supply_order_info(**kwargs) ⇒ Hash
Get Supply Order Info.
-
#get_fixed_supply_order_quote(**kwargs) ⇒ Hash
Get Supply Market Quotes.
-
#get_flexible_borrow_history(**kwargs) ⇒ Hash
Get Flexible Borrow History.
-
#get_flexible_ongoing_coin(**kwargs) ⇒ Hash
Get Ongoing Flexible Borrow Info.
-
#get_flexible_repayment_history(**kwargs) ⇒ Hash
Get Flexible Repayment History.
-
#get_loanable_data(**kwargs) ⇒ Hash
Get loanable currency data for crypto loan.
-
#get_max_collateral_amount(currency:, **kwargs) ⇒ Hash
Get maximum collateral redeem amount for a currency.
-
#get_max_loan(currency:, collateral_list:, **kwargs) ⇒ Hash
Calculate the maximum borrowable amount given collateral list.
-
#get_position ⇒ Object
Get current crypto loan position.
-
#renew_fixed(loan_id:, collateral_list:, **kwargs) ⇒ Hash
Renew Loan.
-
#repay_fixed_fully(loan_id:, loan_currency:, **kwargs) ⇒ Hash
Fully Repay Loan.
-
#repay_fixed_with_collateral(loan_id:, loan_currency:, collateral_coin:, amount:, **kwargs) ⇒ Hash
Repay with Collateral.
-
#repay_flexible(loan_currency:, amount:, **kwargs) ⇒ Hash
Repay Flexible Loan.
-
#repay_flexible_with_collateral(loan_currency:, collateral_coin:, amount:, **kwargs) ⇒ Hash
Repay with Collateral.
Methods inherited from BaseService
Constructor Details
This class inherits a constructor from Bybit::RestApi::BaseService
Instance Method Details
#adjust_ltv(currency:, amount:, direction:, **kwargs) ⇒ Hash
Adjust collateral by adding or removing amount for crypto loan.
POST /v5/crypto-loan-common/adjust-ltv
14 15 16 17 18 |
# File 'lib/bybit/rest_api/crypto_loan_service.rb', line 14 def adjust_ltv(currency:, amount:, direction:, **kwargs) params = kwargs.merge(currency: currency, amount: amount, direction: direction) params = Bybit::Utils::WireKeys.camelize(params) @session.sign_request(method: :post, path: '/v5/crypto-loan-common/adjust-ltv', body: params) end |
#borrow_fixed(order_currency:, order_amount:, annual_rate:, term:, collateral_list:, **kwargs) ⇒ Hash
Create Fixed-Term Borrow Order
POST /v5/crypto-loan-fixed/borrow
219 220 221 222 223 |
# File 'lib/bybit/rest_api/crypto_loan_service.rb', line 219 def borrow_fixed(order_currency:, order_amount:, annual_rate:, term:, collateral_list:, **kwargs) params = kwargs.merge(order_currency: order_currency, order_amount: order_amount, annual_rate: annual_rate, term: term, collateral_list: collateral_list) params = Bybit::Utils::WireKeys.camelize(params) @session.sign_request(method: :post, path: '/v5/crypto-loan-fixed/borrow', body: params) end |
#borrow_flexible(loan_currency:, loan_amount:, collateral_list:, **kwargs) ⇒ Hash
Create Flexible Borrow Order
POST /v5/crypto-loan-flexible/borrow
341 342 343 344 345 |
# File 'lib/bybit/rest_api/crypto_loan_service.rb', line 341 def borrow_flexible(loan_currency:, loan_amount:, collateral_list:, **kwargs) params = kwargs.merge(loan_currency: loan_currency, loan_amount: loan_amount, collateral_list: collateral_list) params = Bybit::Utils::WireKeys.camelize(params) @session.sign_request(method: :post, path: '/v5/crypto-loan-flexible/borrow', body: params) end |
#cancel_fixed_borrow_order(order_id:, **kwargs) ⇒ Hash
Cancel Borrow Order
POST /v5/crypto-loan-fixed/borrow-order-cancel
231 232 233 234 235 |
# File 'lib/bybit/rest_api/crypto_loan_service.rb', line 231 def cancel_fixed_borrow_order(order_id:, **kwargs) params = kwargs.merge(order_id: order_id) params = Bybit::Utils::WireKeys.camelize(params) @session.sign_request(method: :post, path: '/v5/crypto-loan-fixed/borrow-order-cancel', body: params) end |
#cancel_fixed_supply_order(order_id:, **kwargs) ⇒ Hash
Cancel Supply Order
POST /v5/crypto-loan-fixed/supply-order-cancel
285 286 287 288 289 |
# File 'lib/bybit/rest_api/crypto_loan_service.rb', line 285 def cancel_fixed_supply_order(order_id:, **kwargs) params = kwargs.merge(order_id: order_id) params = Bybit::Utils::WireKeys.camelize(params) @session.sign_request(method: :post, path: '/v5/crypto-loan-fixed/supply-order-cancel', body: params) end |
#get_adjustment_history(**kwargs) ⇒ Hash
Get collateral adjustment history for crypto loan positions.
GET /v5/crypto-loan-common/adjustment-history
29 30 31 32 33 |
# File 'lib/bybit/rest_api/crypto_loan_service.rb', line 29 def get_adjustment_history(**kwargs) params = kwargs.dup params = Bybit::Utils::WireKeys.camelize(params) @session.sign_request(method: :get, path: '/v5/crypto-loan-common/adjustment-history', params: params) end |
#get_collateral_data(**kwargs) ⇒ Hash
Get collateral currency data for crypto loan.
GET /v5/crypto-loan-common/collateral-data
41 42 43 44 45 |
# File 'lib/bybit/rest_api/crypto_loan_service.rb', line 41 def get_collateral_data(**kwargs) params = kwargs.dup params = Bybit::Utils::WireKeys.camelize(params) @session.public_request(path: '/v5/crypto-loan-common/collateral-data', params: params) end |
#get_fixed_borrow_contract_info(**kwargs) ⇒ Hash
Get Borrow Contract Info
GET /v5/crypto-loan-fixed/borrow-contract-info
103 104 105 106 107 |
# File 'lib/bybit/rest_api/crypto_loan_service.rb', line 103 def get_fixed_borrow_contract_info(**kwargs) params = kwargs.dup params = Bybit::Utils::WireKeys.camelize(params) @session.sign_request(method: :get, path: '/v5/crypto-loan-fixed/borrow-contract-info', params: params) end |
#get_fixed_borrow_order_info(**kwargs) ⇒ Hash
Get Borrow Order Info
GET /v5/crypto-loan-fixed/borrow-order-info
120 121 122 123 124 |
# File 'lib/bybit/rest_api/crypto_loan_service.rb', line 120 def get_fixed_borrow_order_info(**kwargs) params = kwargs.dup params = Bybit::Utils::WireKeys.camelize(params) @session.sign_request(method: :get, path: '/v5/crypto-loan-fixed/borrow-order-info', params: params) end |
#get_fixed_borrow_order_quote(**kwargs) ⇒ Hash
Get Borrow Market Quotes
GET /v5/crypto-loan-fixed/borrow-order-quote
136 137 138 139 140 |
# File 'lib/bybit/rest_api/crypto_loan_service.rb', line 136 def get_fixed_borrow_order_quote(**kwargs) params = kwargs.dup params = Bybit::Utils::WireKeys.camelize(params) @session.public_request(path: '/v5/crypto-loan-fixed/borrow-order-quote', params: params) end |
#get_fixed_renew_info(**kwargs) ⇒ Hash
Get Renewal Information
GET /v5/crypto-loan-fixed/renew-info
151 152 153 154 155 |
# File 'lib/bybit/rest_api/crypto_loan_service.rb', line 151 def get_fixed_renew_info(**kwargs) params = kwargs.dup params = Bybit::Utils::WireKeys.camelize(params) @session.sign_request(method: :get, path: '/v5/crypto-loan-fixed/renew-info', params: params) end |
#get_fixed_supply_contract_info(**kwargs) ⇒ Hash
Get Supply Contract Info
GET /v5/crypto-loan-fixed/supply-contract-info
168 169 170 171 172 |
# File 'lib/bybit/rest_api/crypto_loan_service.rb', line 168 def get_fixed_supply_contract_info(**kwargs) params = kwargs.dup params = Bybit::Utils::WireKeys.camelize(params) @session.sign_request(method: :get, path: '/v5/crypto-loan-fixed/supply-contract-info', params: params) end |
#get_fixed_supply_order_info(**kwargs) ⇒ Hash
Get Supply Order Info
GET /v5/crypto-loan-fixed/supply-order-info
185 186 187 188 189 |
# File 'lib/bybit/rest_api/crypto_loan_service.rb', line 185 def get_fixed_supply_order_info(**kwargs) params = kwargs.dup params = Bybit::Utils::WireKeys.camelize(params) @session.sign_request(method: :get, path: '/v5/crypto-loan-fixed/supply-order-info', params: params) end |
#get_fixed_supply_order_quote(**kwargs) ⇒ Hash
Get Supply Market Quotes
GET /v5/crypto-loan-fixed/supply-order-quote
201 202 203 204 205 |
# File 'lib/bybit/rest_api/crypto_loan_service.rb', line 201 def get_fixed_supply_order_quote(**kwargs) params = kwargs.dup params = Bybit::Utils::WireKeys.camelize(params) @session.public_request(path: '/v5/crypto-loan-fixed/supply-order-quote', params: params) end |
#get_flexible_borrow_history(**kwargs) ⇒ Hash
Get Flexible Borrow History
GET /v5/crypto-loan-flexible/borrow-history
300 301 302 303 304 |
# File 'lib/bybit/rest_api/crypto_loan_service.rb', line 300 def get_flexible_borrow_history(**kwargs) params = kwargs.dup params = Bybit::Utils::WireKeys.camelize(params) @session.sign_request(method: :get, path: '/v5/crypto-loan-flexible/borrow-history', params: params) end |
#get_flexible_ongoing_coin(**kwargs) ⇒ Hash
Get Ongoing Flexible Borrow Info
GET /v5/crypto-loan-flexible/ongoing-coin
312 313 314 315 316 |
# File 'lib/bybit/rest_api/crypto_loan_service.rb', line 312 def get_flexible_ongoing_coin(**kwargs) params = kwargs.dup params = Bybit::Utils::WireKeys.camelize(params) @session.sign_request(method: :get, path: '/v5/crypto-loan-flexible/ongoing-coin', params: params) end |
#get_flexible_repayment_history(**kwargs) ⇒ Hash
Get Flexible Repayment History
GET /v5/crypto-loan-flexible/repayment-history
327 328 329 330 331 |
# File 'lib/bybit/rest_api/crypto_loan_service.rb', line 327 def get_flexible_repayment_history(**kwargs) params = kwargs.dup params = Bybit::Utils::WireKeys.camelize(params) @session.sign_request(method: :get, path: '/v5/crypto-loan-flexible/repayment-history', params: params) end |
#get_loanable_data(**kwargs) ⇒ Hash
Get loanable currency data for crypto loan.
GET /v5/crypto-loan-common/loanable-data
54 55 56 57 58 |
# File 'lib/bybit/rest_api/crypto_loan_service.rb', line 54 def get_loanable_data(**kwargs) params = kwargs.dup params = Bybit::Utils::WireKeys.camelize(params) @session.sign_request(method: :get, path: '/v5/crypto-loan-common/loanable-data', params: params) end |
#get_max_collateral_amount(currency:, **kwargs) ⇒ Hash
Get maximum collateral redeem amount for a currency.
GET /v5/crypto-loan-common/max-collateral-amount
66 67 68 69 70 |
# File 'lib/bybit/rest_api/crypto_loan_service.rb', line 66 def get_max_collateral_amount(currency:, **kwargs) params = kwargs.merge(currency: currency) params = Bybit::Utils::WireKeys.camelize(params) @session.sign_request(method: :get, path: '/v5/crypto-loan-common/max-collateral-amount', params: params) end |
#get_max_loan(currency:, collateral_list:, **kwargs) ⇒ Hash
Calculate the maximum borrowable amount given collateral list.
POST /v5/crypto-loan-common/max-loan
79 80 81 82 83 |
# File 'lib/bybit/rest_api/crypto_loan_service.rb', line 79 def get_max_loan(currency:, collateral_list:, **kwargs) params = kwargs.merge(currency: currency, collateral_list: collateral_list) params = Bybit::Utils::WireKeys.camelize(params) @session.sign_request(method: :post, path: '/v5/crypto-loan-common/max-loan', body: params) end |
#get_position ⇒ Object
Get current crypto loan position.
GET /v5/crypto-loan-common/position
88 89 90 |
# File 'lib/bybit/rest_api/crypto_loan_service.rb', line 88 def get_position @session.sign_request(method: :get, path: '/v5/crypto-loan-common/position') end |
#renew_fixed(loan_id:, collateral_list:, **kwargs) ⇒ Hash
Renew Loan
POST /v5/crypto-loan-fixed/renew
257 258 259 260 261 |
# File 'lib/bybit/rest_api/crypto_loan_service.rb', line 257 def renew_fixed(loan_id:, collateral_list:, **kwargs) params = kwargs.merge(loan_id: loan_id, collateral_list: collateral_list) params = Bybit::Utils::WireKeys.camelize(params) @session.sign_request(method: :post, path: '/v5/crypto-loan-fixed/renew', body: params) end |
#repay_fixed_fully(loan_id:, loan_currency:, **kwargs) ⇒ Hash
Fully Repay Loan
POST /v5/crypto-loan-fixed/fully-repay
244 245 246 247 248 |
# File 'lib/bybit/rest_api/crypto_loan_service.rb', line 244 def repay_fixed_fully(loan_id:, loan_currency:, **kwargs) params = kwargs.merge(loan_id: loan_id, loan_currency: loan_currency) params = Bybit::Utils::WireKeys.camelize(params) @session.sign_request(method: :post, path: '/v5/crypto-loan-fixed/fully-repay', body: params) end |
#repay_fixed_with_collateral(loan_id:, loan_currency:, collateral_coin:, amount:, **kwargs) ⇒ Hash
Repay with Collateral
POST /v5/crypto-loan-fixed/repay-collateral
272 273 274 275 276 |
# File 'lib/bybit/rest_api/crypto_loan_service.rb', line 272 def repay_fixed_with_collateral(loan_id:, loan_currency:, collateral_coin:, amount:, **kwargs) params = kwargs.merge(loan_id: loan_id, loan_currency: loan_currency, collateral_coin: collateral_coin, amount: amount) params = Bybit::Utils::WireKeys.camelize(params) @session.sign_request(method: :post, path: '/v5/crypto-loan-fixed/repay-collateral', body: params) end |
#repay_flexible(loan_currency:, amount:, **kwargs) ⇒ Hash
Repay Flexible Loan
POST /v5/crypto-loan-flexible/repay
354 355 356 357 358 |
# File 'lib/bybit/rest_api/crypto_loan_service.rb', line 354 def repay_flexible(loan_currency:, amount:, **kwargs) params = kwargs.merge(loan_currency: loan_currency, amount: amount) params = Bybit::Utils::WireKeys.camelize(params) @session.sign_request(method: :post, path: '/v5/crypto-loan-flexible/repay', body: params) end |
#repay_flexible_with_collateral(loan_currency:, collateral_coin:, amount:, **kwargs) ⇒ Hash
Repay with Collateral
POST /v5/crypto-loan-flexible/repay-collateral
368 369 370 371 372 |
# File 'lib/bybit/rest_api/crypto_loan_service.rb', line 368 def repay_flexible_with_collateral(loan_currency:, collateral_coin:, amount:, **kwargs) params = kwargs.merge(loan_currency: loan_currency, collateral_coin: collateral_coin, amount: amount) params = Bybit::Utils::WireKeys.camelize(params) @session.sign_request(method: :post, path: '/v5/crypto-loan-flexible/repay-collateral', body: params) end |