Binance Connector JS
    Preparing search index...

    BorrowRepayApi - object-oriented interface BorrowRepayApi

    Implements

    Index

    Constructors

    Methods

    • Get Interest History

      Weight(IP): 1

      Security Type: USER_DATA

      Notes:

      • Response in descending order

      • If isolatedSymbol is not sent, crossed margin data will be returned

      • The max interval between startTime and endTime is 30 days. It is a MUST to ensure data correctness.

      • If startTimeand endTime not sent, return records of the last 7 days by default.

      • If startTime is sent and endTime is not sent, return records of [max(startTime, now-30d), now].

      • If startTime is not sent and endTime is sent, return records of [endTime-7, endTime]

      • type in response has 4 enums:

      • PERIODIC interest charged per hour

      • ON_BORROW first interest charged on borrow

      • PERIODIC_CONVERTED interest charged per hour converted into BNB

      • ON_BORROW_CONVERTED first interest charged on borrow converted into BNB

      • PORTFOLIO interest charged daily on the portfolio margin negative balance

      Parameters

      Returns Promise<RestApiResponse<GetInterestHistoryResponse>>

      BorrowRepayApi

    • Margin account borrow/repay

      Weight(UID): 1500

      Security Type: USER_DATA

      Notes:

      • -3045 INSUFFICIENT_INVENTORY: returned when system borrowable inventory is below the requested amount, or when inventory is severely insufficient (all borrow requests rejected regardless of size). Monitor system asset availability and adjust borrow strategy accordingly.
      • -3006 EXCEED_MAX_BORROWABLE: borrow amount exceeds your current max borrowable limit. Query GET /sapi/v1/margin/maxBorrowable and adjust the request.
      • -3012 ASSET_ADMIN_BAN_BORROW: this asset does not currently support borrowing. Query GET /sapi/v1/margin/allAssets for asset borrow availability.
      • -3015 REPAY_EXCEED_LIABILITY: returned in two scenarios — (1) repay amount exceeds your outstanding liability, or (2) the remaining unpaid debt after this repayment would fall below Binance's minimum threshold. Adjust the repay amount accordingly.
      • -3007 HAS_PENDING_TRANSACTION: a borrow/repay transaction is already in progress on this account. Requests are processed in submission order across all assets, and an in-flight request briefly blocks subsequent ones. Typical processing time is ~100ms; space consecutive requests by at least 100ms. Auto-repay orders can also fail silently for this reason — verify outstanding liability after an auto-repay executes.

      Parameters

      Returns Promise<RestApiResponse<MarginAccountBorrowRepayResponse>>

      BorrowRepayApi