Skip to main content

Set Auto Repay Mode

Set spot automatic repayment mode

info
  1. If currency is not passed, autoRepayMode sets the global automatic repayment switch for all currencies. When it is set to 1, automatic repayment applies to all currently borrowable currencies and to currencies that become borrowable later. For example, if BTC, ETH, and EOS are borrowable when the switch is enabled, a newly added borrowable currency such as PEPE is automatically included without another API request.
  2. If currency is passed, autoRepayMode sets automatic repayment for that currency only. This single-currency behavior is unchanged.
  3. If autoRepayMode of a currency is set to 1, the system will automatically make repayments without asset conversion to that currency at 0 and 30 minutes every hour.
  4. The amount of repayments without asset conversion is the minimum of available spot balance in that currency and liability of that currency.
  5. If you missed the automatic repayment batches for 0 and 30 minutes every hour, you can manually make the repayment via the API. Please refer to Manual Repay Without Asset Conversion

HTTP Request​

POST/v5/spot-margin-trade/set-auto-repay-mode

Request Parameters​

ParameterRequiredTypeComments
currencyfalsestringCoin name, uppercase only. If omitted, autoRepayMode sets the global automatic repayment switch for all currencies. When enabled, it also applies to currencies that become borrowable in the future. If passed, only the specified currency is updated.
autoRepayModetruestring
  • 1: On
  • 0: Off

Response Parameters​

ParameterTypeComments
dataarrayObject
> currencystringCoin name, uppercase only.
> autoRepayModestring
  • 1: On
  • 0: Off

Request Example​

POST /v5/spot-margin-trade/set-auto-repay-mode HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: xxxxxxxxxxxxxxxxxx
X-BAPI-TIMESTAMP: 1672299806626
X-BAPI-RECV-WINDOW: 5000
Content-Type: application/json

{
"currency": "ETH",
"autoRepayMode":"1"
}

Response Example​

{
"retCode": 0,
"retMsg": "success",
"result": {
"data": [
{
"currency": "ETH",
"autoRepayMode": "1"
}
]
},
"retExtInfo": {},
"time": 1766976677678
}