A: Let’s say Alice has assets in the futures account:
USDT: 0
BTC: 1
then she wish to borrow USDT for futures trading.
From this endpoint, POST /sapi/v1/futures/loan/borrow, she sent a request to borrow USDT, then there will be USDT in the account, but also some BTC is locked.
Time to repay
Alice has enough USDT in account.
Call POST /sapi/v1/futures/loan/repay to pay with USDT from the balance, the BTC will be released.
Call POST /sapi/v1/futures/loan/collateralRepay to pay USDT by BTC. If Alice wish to keep USDT, but sell BTC, this is the endpoint to go with.
Alice don’t have enough USDT in the account.
Call POST /sapi/v1/futures/loan/collateralRepay to pay USDT by BTC, the quoted amount of BTC is sold for the repay.
To repay by this POST /sapi/v1/futures/loan/collateralRepay endpoint, it’s required to get a quote first, which can be done from here: