Fixed-Rate Borrow
HTTP Request
POST/v5/spot-margin-trade/fixedborrowRequest Parameters
| Parameter | Required | Type | Comments |
|---|---|---|---|
| orderCurrency | true | string | Currency to borrow |
| orderAmount | true | string | Amount to borrow |
| annualRate | true | string | Customizable annual interest rate, e.g., 0.02 means 2% |
| term | true | string | Fixed term. 7: 7 days; 14: 14 days; 30: 30 days; 90: 90 days; 180: 180 days |
| repayType | false | string | 1: Auto Repayment (default). Enable "Auto Repayment" to automatically repay your loan using assets in your UTA account when it is due, avoiding overdue penalties. 2: Transfer to flexible loan |
Response Parameters
| Parameter | Type | Comments |
|---|---|---|
| orderId | string | Loan order ID |
Request Example
- HTTP
- Python
- Node.js
POST /v5/spot-margin-trade/fixedborrow HTTP/1.1
Host: api.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: xxxxxxxxxxxxxxxxxx
X-BAPI-TIMESTAMP: 1692696840996
X-BAPI-RECV-WINDOW: 5000
Content-Type: application/json
{
"orderCurrency": "BTC",
"orderAmount": "0.01",
"annualRate": "0.02",
"term": "30"
}
from pybit.unified_trading import HTTP
session = HTTP(
testnet=True,
api_key="xxxxxxxxxxxxxxxxxx",
api_secret="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
)
print(session.spot_margin_trade_fixed_borrow(
orderCurrency="BTC",
orderAmount="0.01",
annualRate="0.02",
term="30"
))
Response Example
{
"retCode": 0,
"retMsg": "success",
"result": {
"orderId": "FIXED_BORROW_4563567182f746ec9f73e4357264d8c7187"
},
"retExtInfo": {},
"time": 1775616124837
}