创建定投计划 (TRADE)
接口描述
创建定投计划
HTTP请求
POST /sapi/v1/lending/auto-invest/plan/add
请求权重(IP)
1
请求参数
名称 | 类型 | 是否必需 | 描述 |
---|---|---|---|
sourceType | ENUM | YES | "MAIN_SITE" 币安,“TR”为币安土耳其 |
requestId | STRING | NO | 若不为空, 字段规则为 sourceType + unique string e.g: TR12354859 |
planType | ENUM | YES | “SINGLE”,”PORTFOLIO”,”INDEX” |
indexId | LONG | NO | 只有当 planType = INDEX , value = 1 |
subscriptionAmount | DECIMAL | YES | Fiat&stablecoin: 2dp, BNB/ETH/BTC: 4dp |
subscriptionCycle | ENUM | YES | "H1", "H4", "H8","H12", "WEEKLY","DAILY","MONTHLY","BI_WEEKLY" |
subscriptionStartDay | INTEGER | NO | “1”,...”31”; 如果 “subscriptionCycleNumberUnit” = “MONTHLY”则必填,数值必须为 UTC+0 |
subscriptionStartWeekday | ENUM | NO | “MON”,”TUE”,”WED”,”THU”,”FRI”,”SAT”,”SUN”; 如果 “subscriptionCycleNumberUnit” = “MONTHLY”则必填,数值必须为 UTC+0 |
subscriptionStartTime | INTEGER | YES | “0,1,2,3,4,5,6,7,8,..23”;数值必须为 UTC+0 |
sourceAsset | STRING | YES | 如 “USDT” |
flexibleAllowedToUse | BOOLEAN | NO | true/false;true:使用 flexible wallet |
details | Array<PortfolioDetail> | YES | sum(all node's percentage) == 100,sum(all node's percentage) == 100, When input request parameter, each entry should be like details[0].targetAsset=BTC, Example of the request parameter array: |
details[0].targetAsset=BTC details[0].percentage=60 details[1].targetAsset=ETH details[1].percentage=40 | |||
recvWindow | LONG | NO | 不超过 60000 |
timestamp | LONG | YES |
- 单个账户每秒最多请求3次
响应示例
{
"planId": 12345, //成功创建后planId不变
"nextExecutionDateTime":1648378800000, //计划下次执行时间
}