Binance.AutoInvest (binance v2.0.1)

Account/Trade

Summary

Functions

Link to this function

get_lending_auto_invest_all_asset(opts \\ [])

@spec get_lending_auto_invest_all_asset(recvWindow: any(), timestamp: any()) ::
  {:ok, any()} | {:error, any()}

Query all source asset and target asset(USER_DATA)

Query all source assets and target assets

Weight(IP): 1

Details:

  • METHOD: get
  • URL: /sapi/v1/lending/auto-invest/all/asset

Mandatory params:

Optional params:

  • timestamp - timestamp
  • recvWindow - no more than 60000
Link to this function

get_lending_auto_invest_history_list(opts \\ [])

@spec get_lending_auto_invest_history_list(
  recvWindow: any(),
  current: any(),
  size: any(),
  planType: any(),
  targetAsset: any(),
  endTime: any(),
  startTime: any(),
  planId: any(),
  timestamp: any()
) :: {:ok, any()} | {:error, any()}

Query subscription transaction history (USER_DATA)

Query subscription transaction history of a plan

Max span between startTime and endTime is 30days

If both startTime and endTime are null, then default is 30days

Weight(IP): 1

Details:

  • METHOD: get
  • URL: /sapi/v1/lending/auto-invest/history/list

Mandatory params:

Optional params:

  • timestamp - timestamp
  • planId - Plan identifier
  • startTime -
  • endTime -
  • targetAsset - eg. BTC、ETH、BNB
  • planType - SINGLE, PORTFOLIO, INDEX, ALL
  • size - Default:10, Max:100
  • current - Currently querying page. Start from 1. Default:1
  • recvWindow - no more than 60000
Link to this function

get_lending_auto_invest_plan_id(opts \\ [])

@spec get_lending_auto_invest_plan_id(
  recvWindow: any(),
  requestId: any(),
  planId: any(),
  timestamp: any()
) :: {:ok, any()} | {:error, any()}

Query holding details of the plan (USER_DATA)

Query holding details of the plan

max one request every 3s per account

Weight(IP): 1

Details:

  • METHOD: get
  • URL: /sapi/v1/lending/auto-invest/plan/id

Mandatory params:

Optional params:

  • timestamp - timestamp
  • planId - Plan identifier
  • requestId - requestId when create
  • recvWindow - no more than 60000
Link to this function

get_lending_auto_invest_plan_list(planType, opts \\ [])

@spec get_lending_auto_invest_plan_list(any(), recvWindow: any(), timestamp: any()) ::
  {:ok, any()} | {:error, any()}

Get list of plans (USER_DATA)

Query plan lists

max one request every 3s per account

Weight(IP): 1

Details:

  • METHOD: get
  • URL: /sapi/v1/lending/auto-invest/plan/list

Mandatory params:

  • planType - Plan identifier

Optional params:

  • timestamp - timestamp
  • recvWindow - no more than 60000
Link to this function

get_lending_auto_invest_source_asset_list(usageType, opts \\ [])

@spec get_lending_auto_invest_source_asset_list(any(),
  recvWindow: any(),
  flexibleAllowedToUse: any(),
  indexId: any(),
  targetAsset: any(),
  timestamp: any()
) :: {:ok, any()} | {:error, any()}

Query source asset list(USER_DATA)

Query Source Asset to be used for investment

Weight(IP): 1

Details:

  • METHOD: get
  • URL: /sapi/v1/lending/auto-invest/source-asset/list

Mandatory params:

  • usageType - eg. RECURRING, ONE_TIME

Optional params:

  • timestamp - timestamp
  • targetAsset - eg. BTC、ETH、BNB
  • indexId - identifier, value = 1
  • flexibleAllowedToUse -
  • recvWindow - no more than 60000
Link to this function

get_lending_auto_invest_target_asset_list(targetAsset, size, opts \\ [])

@spec get_lending_auto_invest_target_asset_list(any(), any(),
  recvWindow: any(),
  current: any(),
  timestamp: any()
) :: {:ok, any()} | {:error, any()}

Get target asset list(USER_DATA)

Weight(IP): 1

Details:

  • METHOD: get
  • URL: /sapi/v1/lending/auto-invest/target-asset/list

Mandatory params:

  • targetAsset -
  • size - Default: 8, Max:100

Optional params:

  • timestamp - timestamp
  • current - Current query page. Default: 1, start from 1
  • recvWindow - no more than 60000
Link to this function

get_lending_auto_invest_target_asset_roi_list(targetAsset, hisRoiType, opts \\ [])

@spec get_lending_auto_invest_target_asset_roi_list(any(), any(),
  recvWindow: any(),
  timestamp: any()
) ::
  {:ok, any()} | {:error, any()}

Get target asset ROI data(USER_DATA)

ROI return list for target asset

Weight(IP): 1

Details:

  • METHOD: get
  • URL: /sapi/v1/lending/auto-invest/target-asset/roi/list

Mandatory params:

  • targetAsset -
  • hisRoiType - FIVE_YEAR,THREE_YEAR,ONE_YEAR,SIX_MONTH,THREE_MONTH,SEVEN_DAY

Optional params:

  • timestamp - timestamp
  • recvWindow - no more than 60000
Link to this function

post_lending_auto_invest_plan_add(UID, sourceType, planType, subscriptionAmount, subscriptionCycle, subscriptionStartTime, sourceAsset, details, opts \\ [])

@spec post_lending_auto_invest_plan_add(
  any(),
  any(),
  any(),
  any(),
  any(),
  any(),
  any(),
  any(),
  recvWindow: any(),
  flexibleAllowedToUse: any(),
  subscriptionStartWeekday: any(),
  subscriptionStartDay: any(),
  IndexId: any(),
  requestId: any(),
  timestamp: any()
) :: {:ok, any()} | {:error, any()}

Investment plan creation(USER_DATA)

Post an investment plan creation

max one request every 3s per account

Weight(IP): 1

Details:

  • METHOD: post
  • URL: /sapi/v1/lending/auto-invest/plan/add

Mandatory params:

  • UID -
  • sourceType - eg. MAIN_SITE,TR
  • planType - eg. SINGLE, PORTFOLIO, INDEX
  • subscriptionAmount - BUSD/USDT: 2dp, Fiat:5dp, BNB/ETH/BTC: 4dp
  • subscriptionCycle - eg. H1, H4, H8,H12, WEEKLY, DAILY, MONTHLY, BI_WEEKLY
  • subscriptionStartTime - “0,1,2,3,4,5,6,7,8,..23”;Must be sent in form of UTC+0
  • sourceAsset - eg. USDT
  • details - sum(all node's percentage) == 100, when in request parameter, just like this details[0].targetAsset=BTC details[0].percentage=60 details[1].targetAsset=ETH

Optional params:

  • timestamp - timestamp
  • requestId - if not null, must follow businessReference + unique string, e.g: TR12354859
  • IndexId - Only for planType = INDEX , value = 1
  • subscriptionStartDay - “1”,...”31”; Mandatory if “subscriptionCycleNumberUnit” = “MONTHLY”, Must be sent in form of UTC+0
  • subscriptionStartWeekday - “MON”,”TUE”,”WED”,”THU”,”FRI”,”SAT”,”SUN”; Mandatory if “subscriptionCycleNumberUnit” = “WEEKLY” or “BI_WEEKLY”, Must be sent in form of UTC+0
  • flexibleAllowedToUse -
  • recvWindow - no more than 60000
Link to this function

post_lending_auto_invest_plan_edit(planId, subscriptionAmount, subscriptionCycle, subscriptionStartTime, sourceAsset, details, opts \\ [])

@spec post_lending_auto_invest_plan_edit(any(), any(), any(), any(), any(), any(),
  recvWindow: any(),
  flexibleAllowedToUse: any(),
  subscriptionStartWeekday: any(),
  subscriptionStartDay: any(),
  timestamp: any()
) :: {:ok, any()} | {:error, any()}

Investment plan adjustment (TRADE)

Query Source Asset to be used for investment

max one request every 3s per account

Weight(IP): 1

Details:

  • METHOD: post
  • URL: /sapi/v1/lending/auto-invest/plan/edit

Mandatory params:

  • planId - Plan identifier
  • subscriptionAmount - BUSD/USDT: 2dp, Fiat:5dp, BNB/ETH/BTC: 4dp
  • subscriptionCycle - eg. H1, H4, H8,H12, WEEKLY, DAILY, MONTHLY, BI_WEEKLY
  • subscriptionStartTime - “0,1,2,3,4,5,6,7,8,..23”;Must be sent in form of UTC+0
  • sourceAsset - eg. USDT
  • details - sum(all node's percentage) == 100, when in request parameter, just like this details[0].targetAsset=BTC details[0].percentage=60 details[1].targetAsset=ETH

Optional params:

  • timestamp - timestamp
  • subscriptionStartDay - “1”,...”31”; Mandatory if “subscriptionCycleNumberUnit” = “MONTHLY”, Must be sent in form of UTC+0
  • subscriptionStartWeekday - “MON”,”TUE”,”WED”,”THU”,”FRI”,”SAT”,”SUN”; Mandatory if “subscriptionCycleNumberUnit” = “WEEKLY” or “BI_WEEKLY”, Must be sent in form of UTC+0
  • flexibleAllowedToUse -
  • recvWindow - no more than 60000
Link to this function

post_lending_auto_invest_plan_edit_status(planId, status, opts \\ [])

@spec post_lending_auto_invest_plan_edit_status(any(), any(),
  recvWindow: any(),
  timestamp: any()
) ::
  {:ok, any()} | {:error, any()}

Change Plan Status (TRADE)

Change Plan Status

max one request every 3s per account

Weight(IP): 1

Details:

  • METHOD: post
  • URL: /sapi/v1/lending/auto-invest/plan/edit-status

Mandatory params:

  • planId - Plan identifier
  • status - eg. ONGOING, PAUSED, REMOVED

Optional params:

  • timestamp - timestamp
  • recvWindow - no more than 60000