The fast auto-invest (DCA) function of Gate Exchange Earn, supporting create, update, stop plans, and query related information.
⚠️ STOP — You MUST read and strictly follow the shared runtime rules before proceeding.
Do NOT select or call any tool until all rules are read. These rules have the highest priority.
→ Read exchange-runtime-rules.md first (mirror: exchange-runtime-rules.md on GitHub).
Digital Asset Trading Risk Statement: Digital asset trading carries significant risks. Prices are subject to high volatility and market manipulation. Past performance is not indicative of future results. This skill provides informational tools only and does not constitute investment advice. Users are solely responsible for their investment decisions. Only invest what you can afford to lose. For full risk disclosure, please visit Gate's official website.
Data Handling Notice: When you use this skill, your queries and account data are processed through AI systems to provide trading assistance. This includes:
Important:
ModuleDescriptionTrigger KeywordsPlan ManagementCreate, update, stop, and add position to auto-invest planscreate DCA, auto-invest, stop plan, add to my DCA, dollar cost averagingInformation QueryQuery supported coins, minimum amounts, execution records, order details, and plan detailsmin amount, execution history, records, plan detail
Required Parameters:
Optional Parameters (with defaults):
spot (spot account)auto_invest (purchased assets remain in Spot account)Execution Time Restriction:
plan_period_hour must be an integer from 0 to 23plan_period_hour uses UTC time zone
plan_period_hour: 2references/autoinvest-plans.md → Time Zone Handling section for detailed conversion rulesplan_period_day (create plans only):
Required on create; value must not be 0. Full workflow: references/autoinvest-plans.md → Workflow step 6.
By plan_period_type:
monthly: Day of month 1–30weekly or biweekly: Weekday 1–7 ( 1 = Monday, 7 = Sunday)daily, hourly, or 4-hourly: Use 1Investment Amount Limits:
cex_earn_get_auto_invest_min_amountcex_earn_list_auto_invest_configcex_earn_get_auto_invest_min_amount to query the minimum amountcex_earn_list_auto_invest_config to query the maximum amountTarget Coins Constraints (for multi-target plans):
Fund Flow (where purchased assets go):
After creating a plan, purchased assets will flow to one of two destinations based on the fund_flow parameter (API field: post-purchase destination):
API fund_flowMeaning (EN)Typical Gate app label (localized; may vary)earnSimple Earn / flexible earnOften labeled Simple Earn / flexible earn in English localesauto_investSpot account (default)Spot account
fund_flow: "earn" → Assets automatically transfer to Simple Earn to earn interestfund_flow: "auto_invest" → Assets remain in Spot account for manual management (default)Important:
earn is recommended for passive income on accumulated assetsauto_invest is recommended if user plans to trade or withdraw assets frequentlyearn or auto_invest respectively when calling MCP create/update< or >) in user-facing replies.#Tool NameTypeFunction1cex_earn_create_auto_invest_planWriteCreate a new auto-invest plan **(See Create Plan Constraints)**2cex_earn_update_auto_invest_planWriteUpdate an existing plan3cex_earn_stop_auto_invest_planWriteStop a plan **(explicit user confirmation before call — same as other writes)**4cex_earn_add_position_auto_invest_planWrite ⚠️Add position immediately **(Call only once after confirmation, strictly no repeated calls)**5cex_earn_list_auto_invest_plansQueryList user's auto-invest plans6cex_earn_get_auto_invest_plan_detailQueryView single plan details7cex_earn_list_auto_invest_coinsQueryQuery supported target coins8cex_earn_get_auto_invest_min_amountQueryQuery minimum investment amount9cex_earn_list_auto_invest_plan_recordsQueryQuery plan execution records10cex_earn_list_auto_invest_ordersQueryQuery order details11cex_earn_list_auto_invest_configQueryQuery auto-invest configuration options
Tool NameFunctioncex_spot_get_spot_accountsQuery spot account balancecex_earn_list_user_uni_lendsOptional read-only context for Simple Earn / Uni balances when fund source or debits involve earn (see Execution → balance check)
User RequestTool to UseList my auto-invest planscex_earn_list_auto_invest_plansView single plan detailscex_earn_get_auto_invest_plan_detailQuery supported coinscex_earn_list_auto_invest_coinsQuery minimum investment amountcex_earn_get_auto_invest_min_amountView plan execution recordscex_earn_list_auto_invest_plan_recordsView order detailscex_earn_list_auto_invest_ordersQuery auto-invest configcex_earn_list_auto_invest_config
Example Questions:
Operation: Use the cex_earn_list_auto_invest_coins tool to query, which will return a list of all coins that support auto-invest.
Example Questions:
Operation: Use the cex_earn_get_auto_invest_min_amount tool, need to specify the investment currency (USDT or BTC) and target coins.
Example Questions:
Operation: Use cex_earn_list_auto_invest_plan_records to view execution records, use cex_earn_list_auto_invest_orders to view specific order details.
Return Information Example:
text
📋 Auto-Invest Execution Records
- Plan: {Plan name or ID}
- Execution count: {count}
- Latest execution: {amount} {currency} → {target coin}
Situation: No matching auto-invest plan found during query.
Prompt: No matching auto-invest plan found. You can create a new auto-invest plan.
cex_earn_list_auto_invest_plans to view all your auto-invest planscex_earn_list_auto_invest_config to view available auto-invest settings and preset optionsModuleDocumentPurposePlan Managementreferences/autoinvest-plans.mdCreate, update, stop, and top-up (add position) workflows with detailed scenariosCompliance & Rulesreferences/autoinvest-compliance.mdInvestment currency restrictions, region compliance, and funding source rules
User IntentRoute toKey DecisionCreate planreferences/autoinvest-plans.md → Scenario 1/2Single or multi-targetUpdate planreferences/autoinvest-plans.mdModify existing plan parametersStop planreferences/autoinvest-plans.md → Scenario 9Terminate automatic deductionsTop-up / Add positionreferences/autoinvest-plans.md → Scenario 10One-off extra purchaseQuery plansSKILL.md → Tool Mappingcex_earn_list_auto_invest_plansQuery plan detailSKILL.md → Tool Mappingcex_earn_get_auto_invest_plan_detailQuery supported coinsSKILL.md → Scenario 1cex_earn_list_auto_invest_coinsQuery minimum amountSKILL.md → Scenario 2cex_earn_get_auto_invest_min_amountQuery execution recordsSKILL.md → Scenario 3cex_earn_list_auto_invest_plan_recordsQuery ordersSKILL.md → Tool Mappingcex_earn_list_auto_invest_ordersAsk about restrictionsreferences/autoinvest-compliance.mdInvestment currency, region, funding
Intent Detection: Analyze user request to determine operation type (create/update/stop/top-up/query/compliance)
Route Selection:
references/autoinvest-plans.md and follow workflowsreferences/autoinvest-compliance.md for rules and restrictionsParameter Validation:
plan_period_day per Create Plan ConstraintsBalance Check (for write operations):
cex_spot_get_spot_accounts to verify sufficient fundscex_earn_list_user_uni_lends if applicableConfirmation (for write operations):
cex_earn_stop_auto_invest_plan): Show Action Draft and stop — do not call the tool in that same assistant turn. Call stop only after the user's next message contains explicit confirmation ( references/autoinvest-plans.md → Scenario 9).MCP Tool Call:
Response Formatting:
Dollar-Cost Averaging (DCA) is an investment strategy where you invest a fixed amount at regular intervals, regardless of market conditions. This approach:
AspectAuto-Invest (DCA)Manual TradingExecutionAutomatic, scheduledManual, on-demandDisciplineHigh (no emotion)Varies (emotion-driven)TimingSpread over timeSingle pointUse caseLong-term accumulationActive tradingSkill requiredLowHigh
Period TypeDescriptionMin IntervalHourlyEvery N hours1 hourDailyEvery day at specified hour1 dayWeeklyEvery week on specified day7 daysBiweeklyEvery 2 weeks14 daysMonthlyEvery month on specified day~30 days
After creating a plan, purchased assets flow to one of two destinations:
OptionField ValueDestinationChinese UI (typical)DescriptionUse CaseSimple Earnfund_flow: "earn"Simple EarnLocalized app labelAssets automatically transfer to Simple Earn to earn interestRecommended for: Passive income seekers, long-term holders who want to maximize returnsSpot Accountfund_flow: "auto_invest"Spot AccountLocalized app labelAssets remain in Spot account for manual management (default)Recommended for: Active traders, users who plan to withdraw or transfer assets frequently
Important Notes:
earn maps to Simple Earn; auto_invest maps to spot account. API values align with localized app strings; if docs and the app disagree, follow the in-app wording.earn option provides additional passive income on accumulated assetsauto_invest option gives you full control to trade, withdraw, or transfer at any timeauto_invest if not specifiedUntil the user has given explicit confirmation for the current Action Draft, do not call any write tool ( cex_earn_create_auto_invest_plan, cex_earn_update_auto_invest_plan, cex_earn_stop_auto_invest_plan, cex_earn_add_position_auto_invest_plan). Only read/query operations are allowed—for example: list/detail plans, supported coins, min/max config, execution records and orders, and supporting balance reads ( cex_spot_get_spot_accounts, cex_earn_list_user_uni_lends).
All write operations (create, update, stop, add position) MUST follow this confirmation workflow:
Stop plan ( cex_earn_stop_auto_invest_plan): Show Action Draft (plan ID, name, effect: future deductions stop) and end the turn asking for confirmation. Call MCP only after the user's following message explicitly confirms — never call stop in the same assistant response as the first draft, even if the user already named a plan ID.
If the user changes any material detail after seeing an Action Draft (amount, targets, cadence, plan ID, fund flow, plan_period_hour, plan_period_day, etc.), treat earlier confirmation as void. Show an updated Action Draft and obtain a fresh explicit confirmation before any write tool call.
⚠️ The cex_earn_add_position_auto_invest_plan tool is extremely sensitive:
Bad practice ❌:
text
User: "Add more to my plan"
Assistant: [Calls add_position multiple times to show different amounts]
Good practice ✅:
text
User: "Add more to my plan"
Assistant: "How much would you like to add? Your current plan is 100 USDT per period."
User: "Add 50 USDT"
Assistant: [Shows draft] "Confirm to add 50 USDT?"
User: "Yes"
Assistant: [Calls add_position ONCE]
Before calling any write tool:
ValidationRuleAction if FailedInvestment currencyMust be USDT or BTCReject and explain restrictionAmountMust be within [min, max] rangeQuery min/max, then reject with valid rangeExecution timeMust be integer 0-23 (on the hour)Reject and explain hourly restrictionplan_period_day (create)Must not be 0; ranges per plan_period_type (see Create Plan Constraints)Reject with allowed ranges; see references/autoinvest-plans.md Workflow step 6BalanceMust be sufficient for first periodShow shortfall, suggest top-up or lower amount
Error ConditionDetectionResponseToo many target coinsUser specifies > 10 target coinsReject immediately: "A plan can have at most 10 target coins. You specified {N} coins. Please reduce the number of targets."Coin allocation too smallAny target coin has ratio < 10Reject immediately: "Each target coin must have at least 10% allocation. Coin {X} has only {Y}%. Please adjust the ratios to ensure each coin has at least 10%."Insufficient balancecex_spot_get_spot_accounts shows balance < amountDo not proceed. Inform user of shortfall: "Your current balance is {X} {currency}, but {Y} {currency} is required. Please deposit more funds or reduce the investment amount."Invalid investment currencyUser specifies currency other than USDT/BTCReject immediately: "Only USDT or BTC are supported as investment currency. Please choose USDT or BTC."Amount below minimumUser amount < cex_earn_get_auto_invest_min_amountCall min amount tool, then inform: "Minimum amount is {min} {currency}. Please increase your investment amount."Amount above maximumUser amount > cex_earn_list_auto_invest_config maxCall config tool, then inform: "Maximum amount is {max} {currency}. Please reduce your investment amount."Invalid execution timeUser specifies minutes/seconds or hour outside 0-23Reject: "Auto-invest only supports execution on the hour (0-23). Please choose an hour between 0 and 23."Invalid plan_period_day0 or out of range for plan_period_type on createDo not call create; state valid ranges: monthly 1–30; weekly/biweekly 1–7 (1 = Monday); daily/hourly/4-hourly use 1 ( references/autoinvest-plans.md Workflow step 6)Plan not foundQuery returns no matching planInform: "No matching auto-invest plan found. You can create a new plan." (See Scenario 4)MCP tool missingRequired tool not available in MCP serviceExplain: "Auto-invest feature requires updated MCP service. Please ensure gate-mcp is properly configured."API error (401/403)Authentication failureGuide: "Authentication error. Please check your API key permissions include Earn (auto-invest) access." See exchange-runtime-rules.md for auth handling.API error (4xx/5xx)Other API errorsReport error message and suggest retry or contact supportMissing required parameterTool schema requires param with no defaultDo not guess. Ask user: "Please specify {parameter_name} (e.g., {example})."
ConditionActionTool(s) to UseUser wants to create planRoute to references/autoinvest-plans.md Scenario 1/2Validate (incl. plan_period_day) → cex_spot_get_spot_accounts (and cex_earn_list_user_uni_lends if earn fund source) → cex_earn_get_auto_invest_min_amount → cex_earn_list_auto_invest_config → Confirm → cex_earn_create_auto_invest_planUser wants to update planRoute to references/autoinvest-plans.md``cex_earn_list_auto_invest_plans (if no ID) → Confirm → cex_earn_update_auto_invest_planUser wants to stop planRoute to references/autoinvest-plans.md Scenario 9cex_earn_list_auto_invest_plans (if no ID) → Action Draft (end turn) → user's next message confirms → cex_earn_stop_auto_invest_planUser wants to top-up (add position)Route to references/autoinvest-plans.md Scenario 10cex_earn_list_auto_invest_plans (if no ID) → cex_earn_get_auto_invest_plan_detail (if no amount) → cex_spot_get_spot_accounts → Confirm → cex_earn_add_position_auto_invest_plan (ONCE ONLY)User wants to list plansDirect querycex_earn_list_auto_invest_plansUser wants plan detailDirect querycex_earn_get_auto_invest_plan_detailUser asks "which coins?"Scenario 1cex_earn_list_auto_invest_coinsUser asks "minimum amount?"Scenario 2cex_earn_get_auto_invest_min_amountUser asks "execution history?"Scenario 3cex_earn_list_auto_invest_plan_recordsUser asks "order details?"Direct querycex_earn_list_auto_invest_ordersUser asks about investment currency restrictionsRoute to references/autoinvest-compliance.mdExplain USDT/BTC only ruleUser asks about fund sourceRoute to references/autoinvest-compliance.mdExplain spot vs earn optionsPlan not found in queryScenario 4Inform user, offer to create new planInsufficient balanceError HandlingShow shortfall, do not proceedInvalid parametersError HandlingValidate against Business Rules, reject with explanation
markdown
✅ Auto-invest plan created
- Invest currency: {USDT|BTC}
- Amount per period: {amount}
- Cadence: {cadence description}
- Target(s): {target coin(s) with ratios if multi-target}
- Fund source: {spot|earn}
- Fund flow: {auto_invest|earn} (spot account|Simple Earn)
markdown
✅ Auto-invest plan updated
- Plan: {id or name}
- Updated: {changed fields and new values}
markdown
✅ Auto-invest plan stopped
- Plan: {id or name}
- Status: Automatic deductions ceased
- Note: Purchased assets remain in {account type}
markdown
✅ Top-up executed
- Plan: {id or name}
- Amount: {amount} {invest_currency}
- Target allocation: {per Business Rules}
markdown
📋 Your Auto-Invest Plans
{For each plan:}
**Plan {N}: {plan_name}**
- Investment: {amount} {currency} per {cadence}
- Target(s): {coin(s)}
- Execution count: {period} times
- Status: Active
{If no plans:}
You have no active auto-invest plans. Create one to start DCA investing.
markdown
📋 Supported Auto-Invest Coins
{List coins returned by cex_earn_list_auto_invest_coins}
You can use any of these coins as targets in your auto-invest plan.
markdown
📋 Minimum Investment Amount
- Investment currency: {USDT|BTC}
- Target(s): {coin(s)}
- Minimum per period: {min_amount} {currency}
markdown
❌ {Error type}
{Explanation of what went wrong}
{Actionable suggestion to resolve}
DocumentContentreferences/scenarios.mdComprehensive scenario index covering all 16 scenarios (plan lifecycle, queries, compliance)references/autoinvest-plans.mdPlan lifecycle operations and scenarios (create, update, stop, top-up)references/autoinvest-compliance.mdCompliance rules and restrictions (investment currency, region, funding)