Module: Binance::Spot::Margin
- Included in:
- Binance::Spot
- Defined in:
- lib/binance/spot/margin.rb
Overview
Margin endpoints
Instance Method Summary collapse
-
#disable_isolated_margin_account(symbol:, **kwargs) ⇒ Object
Disable Isolated Margin Account (TRADE).
-
#enable_isolated_margin_account(symbol:, **kwargs) ⇒ Object
Enable Isolated Margin Account (TRADE).
-
#get_all_isolated_margin_pairs(**kwargs) ⇒ Object
Get All Isolated Margin Symbol(USER_DATA).
-
#get_bnb_burn(**kwargs) ⇒ Object
Get BNB Burn Status (USER_DATA).
-
#get_cross_margin_data(**kwargs) ⇒ Object
Query Cross Margin Fee Data (USER_DATA).
-
#get_isolated_margin_account(**kwargs) ⇒ Object
Query Isolated Margin Account Info (USER_DATA).
-
#get_isolated_margin_account_limit(**kwargs) ⇒ Object
Query Enabled Isolated Margin Account Limit (USER_DATA).
-
#get_isolated_margin_data(**kwargs) ⇒ Object
Query Isolated Margin Fee Data (USER_DATA).
-
#get_isolated_margin_tier(symbol:, **kwargs) ⇒ Object
Query Isolated Margin Tier Data (USER_DATA).
-
#get_margin_interest_rate_history(asset:, **kwargs) ⇒ Object
Query Margin Interest Rate History (USER_DATA).
-
#get_margin_order_usage(**kwargs) ⇒ Object
Query Current Margin Order Count Usage (TRADE).
-
#margin_account(**kwargs) ⇒ Object
Query Cross Margin Account Details (USER_DATA).
-
#margin_all_assets ⇒ Object
Get All Margin Assets (MARKET_DATA).
-
#margin_all_orders(symbol:, **kwargs) ⇒ Object
Query Margin Account’s All Order (USER_DATA).
-
#margin_all_pairs ⇒ Object
Get All Margin Pairs (MARKET_DATA).
-
#margin_cancel_all_order(symbol:, **kwargs) ⇒ Object
Margin Account Cancel all Open Orders on a Symbol (TRADE).
-
#margin_cancel_oco(symbol:, **kwargs) ⇒ Object
Margin Account Cancel OCO (TRADE).
-
#margin_cancel_order(symbol:, **kwargs) ⇒ Object
Margin Account Cancel Order (TRADE).
-
#margin_force_liquidation_record(**kwargs) ⇒ Object
Get Force Liquidation Record (USER_DATA).
-
#margin_get_all_oco(**kwargs) ⇒ Object
Query Margin Account’s all OCO (USER_DATA).
-
#margin_get_oco(**kwargs) ⇒ Object
Query Margin Account’s OCO (USER_DATA).
-
#margin_get_open_oco(**kwargs) ⇒ Object
Query Margin Account’s Open OCO (USER_DATA).
-
#margin_interest_history(**kwargs) ⇒ Object
Get Interest History (USER_DATA).
-
#margin_max_borrowable(asset:, **kwargs) ⇒ Object
Query Max Borrow (USER_DATA).
-
#margin_max_transferable(asset:, **kwargs) ⇒ Object
Query Max Transfer-Out Amount (USER_DATA).
-
#margin_my_trades(symbol:, **kwargs) ⇒ Object
Query Margin Account’s Trade List (USER_DATA).
-
#margin_new_order(symbol:, side:, type:, **kwargs) ⇒ Object
Margin Account New Order (TRADE).
-
#margin_oco_order(symbol:, side:, quantity:, price:, stopPrice:, **kwargs) ⇒ Object
Margin Account New OCO (TRADE).
-
#margin_open_orders(**kwargs) ⇒ Object
Query Margin Account’s Open Order (USER_DATA).
-
#margin_order(symbol:, **kwargs) ⇒ Object
Query Margin Account’s Order (USER_DATA).
-
#margin_price_index(symbol:) ⇒ Object
Query Margin PriceIndex (MARKET_DATA).
-
#margin_transfer_history(**kwargs) ⇒ Object
Get Cross Margin Transfer History (USER_DATA).
-
#toggle_bnb_burn(**kwargs) ⇒ Object
Toggle BNB Burn On Spot Trade And Margin Interest (USER_DATA).
Instance Method Details
#disable_isolated_margin_account(symbol:, **kwargs) ⇒ Object
Disable Isolated Margin Account (TRADE)
DELETE /sapi/v1/margin/isolated/account
390 391 392 393 394 |
# File 'lib/binance/spot/margin.rb', line 390 def disable_isolated_margin_account(symbol:, **kwargs) Binance::Utils::Validation.require_param('symbol', symbol) @session.sign_request(:delete, '/sapi/v1/margin/isolated/account', params: kwargs.merge(symbol: symbol)) end |
#enable_isolated_margin_account(symbol:, **kwargs) ⇒ Object
Enable Isolated Margin Account (TRADE)
POST /sapi/v1/margin/isolated/account
404 405 406 407 408 |
# File 'lib/binance/spot/margin.rb', line 404 def enable_isolated_margin_account(symbol:, **kwargs) Binance::Utils::Validation.require_param('symbol', symbol) @session.sign_request(:post, '/sapi/v1/margin/isolated/account', params: kwargs.merge(symbol: symbol)) end |
#get_all_isolated_margin_pairs(**kwargs) ⇒ Object
Get All Isolated Margin Symbol(USER_DATA)
GET /sapi/v1/margin/isolated/allPairs
428 429 430 |
# File 'lib/binance/spot/margin.rb', line 428 def get_all_isolated_margin_pairs(**kwargs) @session.sign_request(:get, '/sapi/v1/margin/isolated/allPairs', params: kwargs) end |
#get_bnb_burn(**kwargs) ⇒ Object
Get BNB Burn Status (USER_DATA)
GET /sapi/v1/bnbBurn
454 455 456 |
# File 'lib/binance/spot/margin.rb', line 454 def get_bnb_burn(**kwargs) @session.sign_request(:get, '/sapi/v1/bnbBurn', params: kwargs) end |
#get_cross_margin_data(**kwargs) ⇒ Object
Query Cross Margin Fee Data (USER_DATA)
GET /sapi/v1/margin/crossMarginData
485 486 487 |
# File 'lib/binance/spot/margin.rb', line 485 def get_cross_margin_data(**kwargs) @session.sign_request(:get, '/sapi/v1/margin/crossMarginData', params: kwargs) end |
#get_isolated_margin_account(**kwargs) ⇒ Object
Query Isolated Margin Account Info (USER_DATA)
GET /sapi/v1/margin/isolated/account
378 379 380 |
# File 'lib/binance/spot/margin.rb', line 378 def get_isolated_margin_account(**kwargs) @session.sign_request(:get, '/sapi/v1/margin/isolated/account', params: kwargs) end |
#get_isolated_margin_account_limit(**kwargs) ⇒ Object
Query Enabled Isolated Margin Account Limit (USER_DATA)
GET /sapi/v1/margin/isolated/accountLimit
417 418 419 |
# File 'lib/binance/spot/margin.rb', line 417 def get_isolated_margin_account_limit(**kwargs) @session.sign_request(:get, '/sapi/v1/margin/isolated/accountLimit', params: kwargs) end |
#get_isolated_margin_data(**kwargs) ⇒ Object
Query Isolated Margin Fee Data (USER_DATA)
GET /sapi/v1/margin/isolatedMarginData
498 499 500 |
# File 'lib/binance/spot/margin.rb', line 498 def get_isolated_margin_data(**kwargs) @session.sign_request(:get, '/sapi/v1/margin/isolatedMarginData', params: kwargs) end |
#get_isolated_margin_tier(symbol:, **kwargs) ⇒ Object
Query Isolated Margin Tier Data (USER_DATA)
GET /sapi/v1/margin/isolatedMarginTier
511 512 513 514 515 |
# File 'lib/binance/spot/margin.rb', line 511 def get_isolated_margin_tier(symbol:, **kwargs) Binance::Utils::Validation.require_param('symbol', symbol) @session.sign_request(:get, '/sapi/v1/margin/isolatedMarginTier', params: kwargs.merge(symbol: symbol)) end |
#get_margin_interest_rate_history(asset:, **kwargs) ⇒ Object
Query Margin Interest Rate History (USER_DATA)
GET /sapi/v1/margin/interestRateHistory
470 471 472 473 474 |
# File 'lib/binance/spot/margin.rb', line 470 def get_margin_interest_rate_history(asset:, **kwargs) Binance::Utils::Validation.require_param('asset', asset) @session.sign_request(:get, '/sapi/v1/margin/interestRateHistory', params: kwargs.merge(asset: asset)) end |
#get_margin_order_usage(**kwargs) ⇒ Object
Query Current Margin Order Count Usage (TRADE)
GET /sapi/v1/margin/rateLimit/order
526 527 528 |
# File 'lib/binance/spot/margin.rb', line 526 def get_margin_order_usage(**kwargs) @session.sign_request(:get, '/sapi/v1/margin/rateLimit/order', params: kwargs) end |
#margin_account(**kwargs) ⇒ Object
Query Cross Margin Account Details (USER_DATA)
GET /sapi/v1/margin/account
164 165 166 |
# File 'lib/binance/spot/margin.rb', line 164 def margin_account(**kwargs) @session.sign_request(:get, '/sapi/v1/margin/account', params: kwargs) end |
#margin_all_assets ⇒ Object
Get All Margin Assets (MARKET_DATA)
GET /sapi/v1/margin/allAssets
13 14 15 |
# File 'lib/binance/spot/margin.rb', line 13 def margin_all_assets @session.limit_request(path: '/sapi/v1/margin/allAssets') end |
#margin_all_orders(symbol:, **kwargs) ⇒ Object
Query Margin Account’s All Order (USER_DATA)
GET /sapi/v1/margin/allOrders
211 212 213 214 215 |
# File 'lib/binance/spot/margin.rb', line 211 def margin_all_orders(symbol:, **kwargs) Binance::Utils::Validation.require_param('symbol', symbol) @session.sign_request(:get, '/sapi/v1/margin/allOrders', params: kwargs.merge(symbol: symbol)) end |
#margin_all_pairs ⇒ Object
Get All Margin Pairs (MARKET_DATA)
GET /sapi/v1/margin/allPairs
22 23 24 |
# File 'lib/binance/spot/margin.rb', line 22 def margin_all_pairs @session.limit_request(path: '/sapi/v1/margin/allPairs') end |
#margin_cancel_all_order(symbol:, **kwargs) ⇒ Object
Margin Account Cancel all Open Orders on a Symbol (TRADE)
DELETE /sapi/v1/margin/openOrders
97 98 99 100 101 102 103 |
# File 'lib/binance/spot/margin.rb', line 97 def margin_cancel_all_order(symbol:, **kwargs) Binance::Utils::Validation.require_param('symbol', symbol) @session.sign_request(:delete, '/sapi/v1/margin/openOrders', params: kwargs.merge( symbol: symbol )) end |
#margin_cancel_oco(symbol:, **kwargs) ⇒ Object
Margin Account Cancel OCO (TRADE)
DELETE /sapi/v1/margin/orderList
Canceling an individual leg will cancel the entire OCO
269 270 271 272 273 274 275 |
# File 'lib/binance/spot/margin.rb', line 269 def margin_cancel_oco(symbol:, **kwargs) Binance::Utils::Validation.require_param('symbol', symbol) @session.sign_request(:delete, '/sapi/v1/margin/orderList', params: kwargs.merge( symbol: symbol )) end |
#margin_cancel_order(symbol:, **kwargs) ⇒ Object
Margin Account Cancel Order (TRADE)
DELETE /sapi/v1/margin/order
80 81 82 83 84 85 86 |
# File 'lib/binance/spot/margin.rb', line 80 def margin_cancel_order(symbol:, **kwargs) Binance::Utils::Validation.require_param('symbol', symbol) @session.sign_request(:delete, '/sapi/v1/margin/order', params: kwargs.merge( symbol: symbol )) end |
#margin_force_liquidation_record(**kwargs) ⇒ Object
Get Force Liquidation Record (USER_DATA)
GET /sapi/v1/margin/forceLiquidationRec
153 154 155 |
# File 'lib/binance/spot/margin.rb', line 153 def margin_force_liquidation_record(**kwargs) @session.sign_request(:get, '/sapi/v1/margin/forceLiquidationRec', params: kwargs) end |
#margin_get_all_oco(**kwargs) ⇒ Object
Query Margin Account’s all OCO (USER_DATA)
GET /sapi/v1/margin/allOrderList
305 306 307 |
# File 'lib/binance/spot/margin.rb', line 305 def margin_get_all_oco(**kwargs) @session.sign_request(:get, '/sapi/v1/margin/allOrderList', params: kwargs) end |
#margin_get_oco(**kwargs) ⇒ Object
Query Margin Account’s OCO (USER_DATA)
GET /sapi/v1/margin/orderList
288 289 290 |
# File 'lib/binance/spot/margin.rb', line 288 def margin_get_oco(**kwargs) @session.sign_request(:get, '/sapi/v1/margin/orderList', params: kwargs) end |
#margin_get_open_oco(**kwargs) ⇒ Object
Query Margin Account’s Open OCO (USER_DATA)
GET /sapi/v1/margin/openOrderList
318 319 320 |
# File 'lib/binance/spot/margin.rb', line 318 def margin_get_open_oco(**kwargs) @session.sign_request(:get, '/sapi/v1/margin/openOrderList', params: kwargs) end |
#margin_interest_history(**kwargs) ⇒ Object
Get Interest History (USER_DATA)
GET /sapi/v1/margin/interestHistory
137 138 139 |
# File 'lib/binance/spot/margin.rb', line 137 def margin_interest_history(**kwargs) @session.sign_request(:get, '/sapi/v1/margin/interestHistory', params: kwargs) end |
#margin_max_borrowable(asset:, **kwargs) ⇒ Object
Query Max Borrow (USER_DATA)
GET /sapi/v1/margin/maxBorrowable
349 350 351 352 353 |
# File 'lib/binance/spot/margin.rb', line 349 def margin_max_borrowable(asset:, **kwargs) Binance::Utils::Validation.require_param('asset', asset) @session.sign_request(:get, '/sapi/v1/margin/maxBorrowable', params: kwargs.merge(asset: asset)) end |
#margin_max_transferable(asset:, **kwargs) ⇒ Object
Query Max Transfer-Out Amount (USER_DATA)
GET /sapi/v1/margin/maxTransferable
364 365 366 367 368 |
# File 'lib/binance/spot/margin.rb', line 364 def margin_max_transferable(asset:, **kwargs) Binance::Utils::Validation.require_param('asset', asset) @session.sign_request(:get, '/sapi/v1/margin/maxTransferable', params: kwargs.merge(asset: asset)) end |
#margin_my_trades(symbol:, **kwargs) ⇒ Object
Query Margin Account’s Trade List (USER_DATA)
GET /sapi/v1/margin/myTrades
334 335 336 337 338 |
# File 'lib/binance/spot/margin.rb', line 334 def margin_my_trades(symbol:, **kwargs) Binance::Utils::Validation.require_param('symbol', symbol) @session.sign_request(:get, '/sapi/v1/margin/myTrades', params: kwargs.merge(symbol: symbol)) end |
#margin_new_order(symbol:, side:, type:, **kwargs) ⇒ Object
Margin Account New Order (TRADE)
POST /sapi/v1/margin/order
56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/binance/spot/margin.rb', line 56 def margin_new_order(symbol:, side:, type:, **kwargs) Binance::Utils::Validation.require_param('symbol', symbol) Binance::Utils::Validation.require_param('side', side) Binance::Utils::Validation.require_param('type', type) @session.sign_request(:post, '/sapi/v1/margin/order', params: kwargs.merge( symbol: symbol, side: side, type: type )) end |
#margin_oco_order(symbol:, side:, quantity:, price:, stopPrice:, **kwargs) ⇒ Object
Margin Account New OCO (TRADE)
POST /sapi/v1/margin/order/oco
239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
# File 'lib/binance/spot/margin.rb', line 239 def margin_oco_order(symbol:, side:, quantity:, price:, stopPrice:, **kwargs) Binance::Utils::Validation.require_param('symbol', symbol) Binance::Utils::Validation.require_param('side', side) Binance::Utils::Validation.require_param('quantity', quantity) Binance::Utils::Validation.require_param('price', price) Binance::Utils::Validation.require_param('stopPrice', stopPrice) @session.sign_request(:post, '/sapi/v1/margin/order/oco', params: kwargs.merge( symbol: symbol, side: side, quantity: quantity, price: price, stopPrice: stopPrice )) end |
#margin_open_orders(**kwargs) ⇒ Object
Query Margin Account’s Open Order (USER_DATA)
GET /sapi/v1/margin/openOrders
194 195 196 |
# File 'lib/binance/spot/margin.rb', line 194 def margin_open_orders(**kwargs) @session.sign_request(:get, '/sapi/v1/margin/openOrders', params: kwargs) end |
#margin_order(symbol:, **kwargs) ⇒ Object
Query Margin Account’s Order (USER_DATA)
GET /sapi/v1/margin/order
179 180 181 182 183 |
# File 'lib/binance/spot/margin.rb', line 179 def margin_order(symbol:, **kwargs) Binance::Utils::Validation.require_param('symbol', symbol) @session.sign_request(:get, '/sapi/v1/margin/order', params: kwargs.merge(symbol: symbol)) end |
#margin_price_index(symbol:) ⇒ Object
Query Margin PriceIndex (MARKET_DATA)
GET /sapi/v1/margin/priceIndex
31 32 33 34 |
# File 'lib/binance/spot/margin.rb', line 31 def margin_price_index(symbol:) Binance::Utils::Validation.require_param('symbol', symbol) @session.limit_request(path: '/sapi/v1/margin/priceIndex', params: { symbol: symbol }) end |
#margin_transfer_history(**kwargs) ⇒ Object
Get Cross Margin Transfer History (USER_DATA)
GET /sapi/v1/margin/transfer
119 120 121 |
# File 'lib/binance/spot/margin.rb', line 119 def margin_transfer_history(**kwargs) @session.sign_request(:get, '/sapi/v1/margin/transfer', params: kwargs) end |
#toggle_bnb_burn(**kwargs) ⇒ Object
Toggle BNB Burn On Spot Trade And Margin Interest (USER_DATA)
POST /sapi/v1/bnbBurn
“spotBNBBurn” and “interestBNBBurn” should be sent at least one.
443 444 445 |
# File 'lib/binance/spot/margin.rb', line 443 def toggle_bnb_burn(**kwargs) @session.sign_request(:post, '/sapi/v1/bnbBurn', params: kwargs) end |