Module: Binance::Spot::Futures
- Included in:
- Binance::Spot
- Defined in:
- lib/binance/spot/futures.rb
Overview
Futures endpoints
Instance Method Summary collapse
-
#adjust_cross_collateral(loanCoin:, collateralCoin:, amount:, direction:, **kwargs) ⇒ Object
Adjust Cross-Collateral LTV (TRADE).
-
#adjust_cross_collateral_history(**kwargs) ⇒ Object
Adjust Cross-Collateral LTV History (USER_DATA).
-
#calculate_adjust_max_amount(loanCoin:, collateralCoin:, **kwargs) ⇒ Object
Get Max Amount for Adjust Cross-Collateral LTV (USER_DATA).
-
#calculate_adjust_rate(loanCoin:, collateralCoin:, amount:, direction:, **kwargs) ⇒ Object
Calculate Rate After Adjust Cross-Collateral LTV (USER_DATA).
-
#collateral_repay_limit(coin:, collateralCoin:, **kwargs) ⇒ Object
Check Collateral Repay Limit (USER_DATA).
-
#collateral_repay_quote(coin:, collateralCoin:, amount:, **kwargs) ⇒ Object
Get Collateral Repay Quote (USER_DATA).
-
#cross_collateral_borrow(coin:, collateralCoin:, **kwargs) ⇒ Object
Borrow For Cross-Collateral (TRADE).
-
#cross_collateral_borrow_history(**kwargs) ⇒ Object
Cross-Collateral Borrow History (USER_DATA).
-
#cross_collateral_info(**kwargs) ⇒ Object
Cross-Collateral Information (USER_DATA).
-
#cross_collateral_interest_history(**kwargs) ⇒ Object
Cross-Collateral Interest History (USER_DATA).
-
#cross_collateral_liquidation_history(**kwargs) ⇒ Object
Cross-Collateral Liquidation History (USER_DATA).
-
#cross_collateral_repay(coin:, collateralCoin:, amount:, **kwargs) ⇒ Object
Repay For Cross-Collateral (TRADE).
-
#cross_collateral_repay_history(**kwargs) ⇒ Object
Cross-Collateral Repayment History (USER_DATA).
-
#cross_collateral_wallet(**kwargs) ⇒ Object
Cross-Collateral Wallet (USER_DATA).
-
#futures_account_transfer(asset:, amount:, type:, **kwargs) ⇒ Object
New Future Account Transfer (USER_DATA).
-
#futures_account_transfer_history(asset:, startTime:, **kwargs) ⇒ Object
Get Future Account Transaction History List (USER_DATA).
-
#repay_with_collateral(quoteId:, **kwargs) ⇒ Object
Repay with Collateral (USER_DATA).
-
#repayment_result(quoteId:, **kwargs) ⇒ Object
Collateral Repayment Result (USER_DATA).
Instance Method Details
#adjust_cross_collateral(loanCoin:, collateralCoin:, amount:, direction:, **kwargs) ⇒ Object
Adjust Cross-Collateral LTV (TRADE)
POST /sapi/v2/futures/loan/adjustCollateral
209 210 211 212 213 214 215 216 217 218 219 220 221 |
# File 'lib/binance/spot/futures.rb', line 209 def adjust_cross_collateral(loanCoin:, collateralCoin:, amount:, direction:, **kwargs) Binance::Utils::Validation.require_param('loanCoin', loanCoin) Binance::Utils::Validation.require_param('collateralCoin', collateralCoin) Binance::Utils::Validation.require_param('amount', amount) Binance::Utils::Validation.require_param('direction', direction) @session.sign_request(:post, '/sapi/v2/futures/loan/adjustCollateral', params: kwargs.merge( loanCoin: loanCoin, collateralCoin: collateralCoin, amount: amount, direction: direction )) end |
#adjust_cross_collateral_history(**kwargs) ⇒ Object
Adjust Cross-Collateral LTV History (USER_DATA)
GET /sapi/v1/futures/loan/adjustCollateral/history
All data will be returned if loanCoin or collateralCoin is not sent
237 238 239 |
# File 'lib/binance/spot/futures.rb', line 237 def adjust_cross_collateral_history(**kwargs) @session.sign_request(:get, '/sapi/v1/futures/loan/adjustCollateral/history', params: kwargs) end |
#calculate_adjust_max_amount(loanCoin:, collateralCoin:, **kwargs) ⇒ Object
Get Max Amount for Adjust Cross-Collateral LTV (USER_DATA)
GET /sapi/v2/futures/loan/calcMaxAdjustAmount
188 189 190 191 192 193 194 195 196 |
# File 'lib/binance/spot/futures.rb', line 188 def calculate_adjust_max_amount(loanCoin:, collateralCoin:, **kwargs) Binance::Utils::Validation.require_param('loanCoin', loanCoin) Binance::Utils::Validation.require_param('collateralCoin', collateralCoin) @session.sign_request(:get, '/sapi/v2/futures/loan/calcMaxAdjustAmount', params: kwargs.merge( loanCoin: loanCoin, collateralCoin: collateralCoin )) end |
#calculate_adjust_rate(loanCoin:, collateralCoin:, amount:, direction:, **kwargs) ⇒ Object
Calculate Rate After Adjust Cross-Collateral LTV (USER_DATA)
GET /sapi/v2/futures/loan/calcAdjustLevel
165 166 167 168 169 170 171 172 173 174 175 176 177 |
# File 'lib/binance/spot/futures.rb', line 165 def calculate_adjust_rate(loanCoin:, collateralCoin:, amount:, direction:, **kwargs) Binance::Utils::Validation.require_param('loanCoin', loanCoin) Binance::Utils::Validation.require_param('collateralCoin', collateralCoin) Binance::Utils::Validation.require_param('amount', amount) Binance::Utils::Validation.require_param('direction', direction) @session.sign_request(:get, '/sapi/v2/futures/loan/calcAdjustLevel', params: kwargs.merge( loanCoin: loanCoin, collateralCoin: collateralCoin, amount: amount, direction: direction )) end |
#collateral_repay_limit(coin:, collateralCoin:, **kwargs) ⇒ Object
Check Collateral Repay Limit (USER_DATA)
GET /sapi/v1/futures/loan/collateralRepayLimit
Check the maximum and minimum limit when repay with collateral.
270 271 272 273 274 275 276 277 278 |
# File 'lib/binance/spot/futures.rb', line 270 def collateral_repay_limit(coin:, collateralCoin:, **kwargs) Binance::Utils::Validation.require_param('coin', coin) Binance::Utils::Validation.require_param('collateralCoin', collateralCoin) @session.sign_request(:get, '/sapi/v1/futures/loan/collateralRepayLimit', params: kwargs.merge( coin: coin, collateralCoin: collateralCoin )) end |
#collateral_repay_quote(coin:, collateralCoin:, amount:, **kwargs) ⇒ Object
Get Collateral Repay Quote (USER_DATA)
GET /sapi/v1/futures/loan/collateralRepay
Get quote before repay with collateral is mandatory, the quote will be valid within 25 seconds.
292 293 294 295 296 297 298 299 300 301 302 |
# File 'lib/binance/spot/futures.rb', line 292 def collateral_repay_quote(coin:, collateralCoin:, amount:, **kwargs) Binance::Utils::Validation.require_param('coin', coin) Binance::Utils::Validation.require_param('collateralCoin', collateralCoin) Binance::Utils::Validation.require_param('amount', amount) @session.sign_request(:get, '/sapi/v1/futures/loan/collateralRepay', params: kwargs.merge( coin: coin, collateralCoin: collateralCoin, amount: amount )) end |
#cross_collateral_borrow(coin:, collateralCoin:, **kwargs) ⇒ Object
Borrow For Cross-Collateral (TRADE)
POST /sapi/v1/futures/loan/borrow
68 69 70 71 72 73 74 75 76 |
# File 'lib/binance/spot/futures.rb', line 68 def cross_collateral_borrow(coin:, collateralCoin:, **kwargs) Binance::Utils::Validation.require_param('coin', coin) Binance::Utils::Validation.require_param('collateralCoin', collateralCoin) @session.sign_request(:post, '/sapi/v1/futures/loan/borrow', params: kwargs.merge( coin: coin, collateralCoin: collateralCoin )) end |
#cross_collateral_borrow_history(**kwargs) ⇒ Object
Cross-Collateral Borrow History (USER_DATA)
GET /sapi/v1/futures/loan/borrow/history
89 90 91 |
# File 'lib/binance/spot/futures.rb', line 89 def cross_collateral_borrow_history(**kwargs) @session.sign_request(:get, '/sapi/v1/futures/loan/borrow/history', params: kwargs) end |
#cross_collateral_info(**kwargs) ⇒ Object
Cross-Collateral Information (USER_DATA)
GET /sapi/v2/futures/loan/configs
150 151 152 |
# File 'lib/binance/spot/futures.rb', line 150 def cross_collateral_info(**kwargs) @session.sign_request(:get, '/sapi/v2/futures/loan/configs', params: kwargs) end |
#cross_collateral_interest_history(**kwargs) ⇒ Object
Cross-Collateral Interest History (USER_DATA)
GET /sapi/v1/futures/loan/interestHistory
352 353 354 |
# File 'lib/binance/spot/futures.rb', line 352 def cross_collateral_interest_history(**kwargs) @session.sign_request(:get, '/sapi/v1/futures/loan/interestHistory', params: kwargs) end |
#cross_collateral_liquidation_history(**kwargs) ⇒ Object
Cross-Collateral Liquidation History (USER_DATA)
GET /sapi/v1/futures/loan/liquidationHistory
All data will be returned if loanCoin or collateralCoin is not sent
255 256 257 |
# File 'lib/binance/spot/futures.rb', line 255 def cross_collateral_liquidation_history(**kwargs) @session.sign_request(:get, '/sapi/v1/futures/loan/liquidationHistory', params: kwargs) end |
#cross_collateral_repay(coin:, collateralCoin:, amount:, **kwargs) ⇒ Object
Repay For Cross-Collateral (TRADE)
POST /sapi/v1/futures/loan/repay
103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/binance/spot/futures.rb', line 103 def cross_collateral_repay(coin:, collateralCoin:, amount:, **kwargs) Binance::Utils::Validation.require_param('coin', coin) Binance::Utils::Validation.require_param('collateralCoin', collateralCoin) Binance::Utils::Validation.require_param('amount', amount) @session.sign_request(:post, '/sapi/v1/futures/loan/repay', params: kwargs.merge( coin: coin, collateralCoin: collateralCoin, amount: amount )) end |
#cross_collateral_repay_history(**kwargs) ⇒ Object
Cross-Collateral Repayment History (USER_DATA)
GET /sapi/v1/futures/loan/repay/history
126 127 128 |
# File 'lib/binance/spot/futures.rb', line 126 def cross_collateral_repay_history(**kwargs) @session.sign_request(:get, '/sapi/v1/futures/loan/repay/history', params: kwargs) end |
#cross_collateral_wallet(**kwargs) ⇒ Object
Cross-Collateral Wallet (USER_DATA)
GET /sapi/v2/futures/loan/wallet
137 138 139 |
# File 'lib/binance/spot/futures.rb', line 137 def cross_collateral_wallet(**kwargs) @session.sign_request(:get, '/sapi/v2/futures/loan/wallet', params: kwargs) end |
#futures_account_transfer(asset:, amount:, type:, **kwargs) ⇒ Object
New Future Account Transfer (USER_DATA)
POST /sapi/v1/futures/transfer
Execute transfer between spot account and futures account.
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/binance/spot/futures.rb', line 23 def futures_account_transfer(asset:, amount:, type:, **kwargs) Binance::Utils::Validation.require_param('asset', asset) Binance::Utils::Validation.require_param('amount', amount) Binance::Utils::Validation.require_param('type', type) @session.sign_request(:post, '/sapi/v1/futures/transfer', params: kwargs.merge( asset: asset, amount: amount, type: type )) end |
#futures_account_transfer_history(asset:, startTime:, **kwargs) ⇒ Object
Get Future Account Transaction History List (USER_DATA)
GET /sapi/v1/futures/transfer
47 48 49 50 51 52 53 54 55 |
# File 'lib/binance/spot/futures.rb', line 47 def futures_account_transfer_history(asset:, startTime:, **kwargs) Binance::Utils::Validation.require_param('asset', asset) Binance::Utils::Validation.require_param('startTime', startTime) @session.sign_request(:get, '/sapi/v1/futures/transfer', params: kwargs.merge( asset: asset, startTime: startTime )) end |
#repay_with_collateral(quoteId:, **kwargs) ⇒ Object
Repay with Collateral (USER_DATA)
POST /sapi/v1/futures/loan/collateralRepay
Repay with collateral. Get quote before repay with collateral is mandatory, the quote will be valid within 25 seconds.
314 315 316 317 318 319 320 |
# File 'lib/binance/spot/futures.rb', line 314 def repay_with_collateral(quoteId:, **kwargs) Binance::Utils::Validation.require_param('quoteId', quoteId) @session.sign_request(:post, '/sapi/v1/futures/loan/collateralRepay', params: kwargs.merge( quoteId: quoteId )) end |
#repayment_result(quoteId:, **kwargs) ⇒ Object
Collateral Repayment Result (USER_DATA)
GET /sapi/v1/futures/loan/collateralRepayResult
Check collateral repayment result.
332 333 334 335 336 337 338 |
# File 'lib/binance/spot/futures.rb', line 332 def repayment_result(quoteId:, **kwargs) Binance::Utils::Validation.require_param('quoteId', quoteId) @session.sign_request(:get, '/sapi/v1/futures/loan/collateralRepayResult', params: kwargs.merge( quoteId: quoteId )) end |