Getting '-3041' error when trying to Repay back a Loan


I ran the following code below in order to pay back a loan:

    code = in_symbol
    amount = float( in_amount )
    currency = exchange.currency(code)

    response = exchange.sapi_post_margin_repay({
            'asset': currency['id'],
            'amount': exchange.currency_to_precision(code, amount)

The following information was entered

   CODE = btc
   AMOUNT = 0.00913055

This was the error message I got:

    # 'binance {"code":-3041,"msg":"Balance is not enough"}'

How can I get around this problem?


ETA that this is the information I get when querying the system:

[{‘asset’: ‘USDT’, ‘free’: ‘208.83167316’, ‘locked’: ‘0.00000000’, ‘borrowed’: ‘0.00000000’, ‘interest’: ‘0.00000000’, ‘netAsset’: ‘208.83167316’}, {‘asset’: ‘BTC’, ‘free’: ‘0.00000000’, ‘locked’: ‘0.00000000’, ‘borrowed’: ‘0.00913055’, ‘interest’: ‘0.00004962’, ‘netAsset’: ‘-0.00918017’}]

Also, what does the field netAsset mean?

you have need to transfer btc from spot wallet to margin wallet, then it’s able to repay.

netAsset = asset - borrowed - interest