Skip to main content

Create DCA Bot

Create a new DCA (Dollar-Cost Averaging) bot that automatically invests at regular intervals across specified trading pairs.

info
  • How it works:
    The bot buys a fixed amount of each configured trading pair at every frequency_in_second interval, regardless of market price.

  • Supported trading pairs:
    Maximum 5 pairs per bot.

  • Minimum frequency:
    10 seconds. Common values: 600 (10 min), 3600 (1 hour), 86400 (1 day).

  • max_invest_amount:
    Optional cap on total cumulative investment. The bot auto-closes when cumulative spending reaches this amount.

  • Response bot_id:
    Returned on success. Use this ID for subsequent Close operations.

  • Rate limit:
    3 requests per second per UID.

  • Subject to compliance wall and KYC verification.
    If the user is banned (status_code=421), ban_reason_text provides a localized explanation.

HTTP Request

POST/v5/dca/create-bot

Request Parameters

ParameterRequiredTypeComments
parameterstrueobjectDCA bot configuration object (see below)
> frequency_in_secondtrueintegerInvestment frequency in seconds. Minimum 10. Common: 600 (10 min), 3600 (1 hr), 86400 (1 day)
> quote_cointruestringQuote token used for purchasing (e.g. USDT, USDC)
> pairstruearrayTrading pairs to invest in. Maximum 5 pairs
>> basetruestringcoin to be invested (e.g. BTC)
>> amounttruestringPer-round investment amount in quote coin (decimal string, e.g. "10" for 10 USDT)
> max_invest_amountfalsestringOptional. Maximum total investment in quote coin (decimal string). Bot auto-closes when reached

Response Parameters

ParameterTypeComments
status_codeinteger200 = success, 421 = user banned
bot_idintegerCreated DCA bot ID. Use for subsequent close operations
debug_msgstringReason for creation failure (testnet: debug info)
ban_reason_textstringBan reason in user's locale. Returned only when status_code=421

Request Example

POST /v5/dca/create-bot HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: xxxxxxxxxxxxxxxxxx
X-BAPI-TIMESTAMP: 1672211928338
X-BAPI-RECV-WINDOW: 5000
Content-Type: application/json

{
"parameters": {
"frequency_in_second": "600",
"quote_coin": "USDT",
"max_invest_amount": "2000",
"pairs": [
{
"base": "BTC",
"amount": "66"
},
{
"base": "ETH",
"amount": "88"
}
]
}
}

Response Example

{
"status_code": 200,
"bot_id": 9876543210,
"debug_msg": "",
"ban_reason_text": ""
}