gate-exchange-subaccount

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Gate Exchange Sub-Account Skill

Gate Exchange子账户管理Skill

Provide sub-account management capabilities on Gate, including querying sub-account status, listing all sub-accounts, creating new sub-accounts, and locking/unlocking sub-accounts.
提供Gate上的子账户管理功能,包括查询子账户状态、列出所有子账户、创建新子账户以及锁定/解锁子账户。

Prerequisites

前提条件

  • MCP Dependency: Requires gate-mcp to be installed.
  • Authentication: All sub-account operations require API key authentication with main-account privileges.
  • Permission: The current user must be a main account holder to manage sub-accounts.
  • MCP依赖:需要安装gate-mcp
  • 身份验证:所有子账户操作均需要拥有主账户权限的API密钥进行身份验证。
  • 权限:当前用户必须是主账户持有者才能管理子账户。

Available MCP Tools

可用的MCP工具

ToolAuthDescription
cex_sa_get_sa
YesGet details of a specific sub-account by user ID
cex_sa_list_sas
YesList all sub-accounts under the main account
cex_sa_create_sa
YesCreate a new normal sub-account
cex_sa_lock_sa
YesLock a sub-account to disable login and trading
cex_sa_unlock_sa
YesUnlock a previously locked sub-account
工具需身份验证描述
cex_sa_get_sa
通过用户ID获取特定子账户的详细信息
cex_sa_list_sas
列出主账户下的所有子账户
cex_sa_create_sa
创建一个新的普通子账户
cex_sa_lock_sa
锁定子账户以禁用登录和交易功能
cex_sa_unlock_sa
解锁之前被锁定的子账户

Workflow

工作流程

Step 1: Identify User Intent

步骤1:识别用户意图

Parse the user's message to determine which sub-account operation they need.
Key data to extract:
  • intent
    : One of
    query_status
    ,
    list_all
    ,
    create
    ,
    lock
    ,
    unlock
  • user_id
    : Sub-account UID (required for
    query_status
    ,
    lock
    ,
    unlock
    )
  • login_name
    : Desired username (for
    create
    , may need to ask user)
Intent detection rules:
Signal KeywordsIntent
"status of sub-account", "sub-account UID {id}", "check sub-account"
query_status
"all sub-accounts", "list sub-accounts", "my sub-accounts", "which sub-accounts"
list_all
"create sub-account", "new sub-account", "add sub-account"
create
"lock sub-account", "disable sub-account", "freeze sub-account"
lock
"unlock sub-account", "enable sub-account", "unfreeze sub-account"
unlock
解析用户消息,确定他们需要的子账户操作类型。
需要提取的关键数据:
  • intent
    query_status
    (查询状态)、
    list_all
    (列出全部)、
    create
    (创建)、
    lock
    (锁定)、
    unlock
    (解锁)中的一种
  • user_id
    :子账户UID(
    query_status
    lock
    unlock
    操作必填)
  • login_name
    :所需的用户名(
    create
    操作需要,可能需要询问用户)
意图检测规则:
关键词信号意图
"status of sub-account"、"sub-account UID {id}"、"check sub-account"
query_status
"all sub-accounts"、"list sub-accounts"、"my sub-accounts"、"which sub-accounts"
list_all
"create sub-account"、"new sub-account"、"add sub-account"
create
"lock sub-account"、"disable sub-account"、"freeze sub-account"
lock
"unlock sub-account"、"enable sub-account"、"unfreeze sub-account"
unlock

Step 2: Execute by Intent

步骤2:按意图执行操作

Case A: Query Sub-Account Status (
query_status
)

场景A:查询子账户状态(
query_status

Call
cex_sa_get_sa
with:
  • user_id
    : The sub-account UID provided by the user
Key data to extract:
  • login_name
    : Sub-account username
  • remark
    : Sub-account remark/note
  • state
    : Account state (normal / locked)
  • type
    : Account type (normal / pool)
  • create_time
    : Account creation timestamp
Present the sub-account details in a structured format.
调用
cex_sa_get_sa
,传入:
  • user_id
    :用户提供的子账户UID
需要提取的关键数据:
  • login_name
    :子账户用户名
  • remark
    :子账户备注
  • state
    :账户状态(正常/锁定)
  • type
    :账户类型(普通/池化)
  • create_time
    :账户创建时间戳
以结构化格式展示子账户详细信息。

Case B: List All Sub-Accounts (
list_all
)

场景B:列出所有子账户(
list_all

Call
cex_sa_list_sas
with:
  • type
    : "0" (normal sub-accounts only)
Key data to extract:
  • For each sub-account:
    user_id
    ,
    login_name
    ,
    remark
    ,
    state
    ,
    create_time
Present results as a table with username, UID, remark (if any), and current status.
调用
cex_sa_list_sas
,传入:
  • type
    :"0"(仅普通子账户)
需要提取的关键数据:
  • 每个子账户的:
    user_id
    login_name
    remark
    state
    create_time
以表格形式展示结果,包含用户名、UID、备注(如有)和当前状态。

Case C: Create Sub-Account (
create
)

场景C:创建子账户(
create

Pre-check: Call
cex_sa_list_sas
with
type
: "0" to get the current list of normal sub-accounts. Check if the user can still create more sub-accounts based on the returned count.
If creation is available:
  1. Ask the user to provide a login name for the new sub-account
  2. Optionally collect: email, remark
  3. Confirm all details with the user before proceeding
  4. Call
    cex_sa_create_sa
    with:
    • login_name
      : User-provided login name (required)
    • email
      : User-provided email (optional)
    • remark
      : User-provided remark (optional)
  5. Present the newly created sub-account details
Key data to extract:
  • user_id
    : Newly created sub-account UID
  • login_name
    : Confirmed username
  • state
    : Should be "normal"
Important: Only normal sub-accounts can be created through this skill.
预检查:调用
cex_sa_list_sas
并传入
type
:"0"获取当前普通子账户列表,根据返回的数量检查用户是否还能创建更多子账户。
如果可以创建:
  1. 请用户提供新子账户的登录名
  2. 可选收集:邮箱、备注
  3. 执行前与用户确认所有信息
  4. 调用
    cex_sa_create_sa
    ,传入:
    • login_name
      :用户提供的登录名(必填)
    • email
      :用户提供的邮箱(可选)
    • remark
      :用户提供的备注(可选)
  5. 展示新创建的子账户详细信息
需要提取的关键数据:
  • user_id
    :新创建的子账户UID
  • login_name
    :确认后的用户名
  • state
    :应为“normal”(正常)
重要提示:通过该Skill仅能创建普通子账户。

Case D: Lock Sub-Account (
lock
)

场景D:锁定子账户(
lock

  1. Validate that
    user_id
    is provided; if not, ask the user
  2. Call
    cex_sa_get_sa
    with
    user_id
    to verify the sub-account exists and belongs to the main account
  3. If the sub-account is already locked, inform the user and stop
  4. Confirm with the user: "Are you sure you want to lock sub-account {user_id} ({login_name})? This will disable login and trading for this sub-account."
  5. On confirmation, call
    cex_sa_lock_sa
    with:
    • user_id
      : The sub-account UID
  6. Report the result
Key data to extract:
  • Lock operation success/failure status
  1. 验证是否提供了
    user_id
    ;如果没有,询问用户
  2. 调用
    cex_sa_get_sa
    传入
    user_id
    ,验证子账户存在且属于当前主账户
  3. 如果子账户已被锁定,告知用户并停止操作
  4. 与用户确认:“您确定要锁定子账户{user_id}({login_name})吗?这将禁用该子账户的登录和交易功能。”
  5. 用户确认后,调用
    cex_sa_lock_sa
    ,传入:
    • user_id
      :子账户UID
  6. 反馈操作结果
需要提取的关键数据:
  • 锁定操作的成功/失败状态

Case E: Unlock Sub-Account (
unlock
)

场景E:解锁子账户(
unlock

  1. Validate that
    user_id
    is provided; if not, ask the user
  2. Call
    cex_sa_get_sa
    with
    user_id
    to verify the sub-account exists and is currently locked
  3. If the sub-account is already unlocked/normal, inform the user and stop
  4. Confirm with the user: "Are you sure you want to unlock sub-account {user_id} ({login_name})?"
  5. On confirmation, call
    cex_sa_unlock_sa
    with:
    • user_id
      : The sub-account UID
  6. Report the result
Key data to extract:
  • Unlock operation success/failure status
  1. 验证是否提供了
    user_id
    ;如果没有,询问用户
  2. 调用
    cex_sa_get_sa
    传入
    user_id
    ,验证子账户存在且当前处于锁定状态
  3. 如果子账户已解锁/状态正常,告知用户并停止操作
  4. 与用户确认:“您确定要解锁子账户{user_id}({login_name})吗?”
  5. 用户确认后,调用
    cex_sa_unlock_sa
    ,传入:
    • user_id
      :子账户UID
  6. 反馈操作结果
需要提取的关键数据:
  • 解锁操作的成功/失败状态

Step 3: Format and Respond

步骤3:格式化并响应

Present results using the Report Template below. Always include relevant context and next-step suggestions.
使用下方的报告模板展示结果,始终包含相关上下文和下一步建议。

Judgment Logic Summary

判断逻辑汇总

ConditionAction
User asks for a specific sub-account status with UIDRoute to Case A:
query_status
User asks to see all sub-accountsRoute to Case B:
list_all
User wants to create a new sub-accountRoute to Case C:
create
User wants to lock a sub-account with UIDRoute to Case D:
lock
User wants to unlock a sub-account with UIDRoute to Case E:
unlock
UID not provided for operations requiring itAsk user for the sub-account UID
Login name not provided for creationAsk user for a login name
Sub-account already in target state (lock/unlock)Inform user, no action needed
API returns authentication errorPrompt user to log in
API returns permission errorInform user that main account privileges are required
Sub-account does not exist or does not belong to userInform user the UID is invalid
条件操作
用户提供UID并询问特定子账户状态路由到场景A:
query_status
用户要求查看所有子账户路由到场景B:
list_all
用户想要创建新子账户路由到场景C:
create
用户提供UID并想要锁定子账户路由到场景D:
lock
用户提供UID并想要解锁子账户路由到场景E:
unlock
需UID的操作未提供UID询问用户获取子账户UID
创建操作未提供登录名询问用户提供登录名
子账户已处于目标状态(锁定/解锁)告知用户,无需执行操作
API返回身份验证错误提示用户登录
API返回权限错误告知用户需要主账户权限
子账户不存在或不属于当前用户告知用户UID无效

Report Template

报告模板

Query Status Response

查询状态响应

Sub-Account Details
---
Username:      {login_name}
UID:           {user_id}
Status:        {state}
Type:          {type}
Remark:        {remark or "N/A"}
Created:       {create_time}
子账户详细信息
---
用户名:      {login_name}
UID:           {user_id}
状态:        {state}
类型:          {type}
备注:        {remark 或 "无"}
创建时间:       {create_time}

List All Sub-Accounts Response

列出所有子账户响应

Your Sub-Accounts
---
| # | Username | UID | Status | Remark |
|---|----------|-----|--------|--------|
| 1 | {login_name} | {user_id} | {state} | {remark or "-"} |
| 2 | ... | ... | ... | ... |

Total: {count} sub-account(s)
您的子账户列表
---
| 序号 | 用户名 | UID | 状态 | 备注 |
|---|----------|-----|--------|--------|
| 1 | {login_name} | {user_id} | {state} | {remark 或 "-"} |
| 2 | ... | ... | ... | ... |

总计: {count} 个子账户

Create Sub-Account Response

创建子账户响应

Sub-Account Created Successfully
---
Username:      {login_name}
UID:           {user_id}
Status:        Normal
Remark:        {remark or "N/A"}

Note: Only normal sub-accounts can be created through this interface.
子账户创建成功
---
用户名:      {login_name}
UID:           {user_id}
状态:        正常
备注:        {remark 或 "无"}

注意:通过该接口仅能创建普通子账户。

Lock/Unlock Response

锁定/解锁响应

Sub-Account {Action} Successfully
---
Username:      {login_name}
UID:           {user_id}
Previous Status: {previous_state}
Current Status:  {new_state}
子账户{Action}成功
---
用户名:      {login_name}
UID:           {user_id}
之前状态: {previous_state}
当前状态:  {new_state}

Domain Knowledge

领域知识

  • A main account on Gate can create multiple sub-accounts for asset isolation, strategy separation, or team management.
  • Sub-accounts share the main account's KYC verification but have independent trading and wallet capabilities.
  • Locking a sub-account disables both login and trading; the assets remain safe but inaccessible until unlocked.
  • There are two types of sub-accounts: normal (type=0) and pool (type=1). This skill only supports creating normal sub-accounts.
  • Sub-account creation requires a unique login name. Email and remark are optional.
  • Gate上的主账户可以创建多个子账户,用于资产隔离、策略分离或团队管理。
  • 子账户共享主账户的KYC验证,但拥有独立的交易和钱包功能。
  • 锁定子账户会禁用登录和交易功能;资产会保持安全,但在解锁前无法访问。
  • 子账户分为两种类型:普通(type=0)和池化(type=1)。该Skill仅支持创建普通子账户。
  • 创建子账户需要唯一的登录名,邮箱和备注为可选信息。

Safety Rules

安全规则

  • Write operations (
    cex_sa_create_sa
    ,
    cex_sa_lock_sa
    ,
    cex_sa_unlock_sa
    ): Always require explicit user confirmation before execution. Never auto-execute.
  • UID validation: Before lock/unlock, always verify the sub-account exists and belongs to the current main account.
  • State check: Before lock/unlock, check current state to avoid redundant operations.
  • No sensitive data exposure: Never expose API keys, internal endpoint URLs, or raw error traces.
  • Normal sub-accounts only: Creation is restricted to normal sub-accounts (type=0). Do not attempt to create pool sub-accounts.
  • 写入操作
    cex_sa_create_sa
    cex_sa_lock_sa
    cex_sa_unlock_sa
    ):执行前必须获得用户明确确认,绝不能自动执行。
  • UID验证:锁定/解锁操作前,必须验证子账户存在且属于当前主账户。
  • 状态检查:锁定/解锁操作前,检查当前状态以避免重复操作。
  • 敏感数据不暴露:绝不能暴露API密钥、内部端点URL或原始错误跟踪信息。
  • 仅普通子账户:创建操作仅限于普通子账户(type=0),请勿尝试创建池化子账户。

Error Handling

错误处理

ConditionResponse
Auth endpoint returns "not login""Please log in to your Gate account first."
User is not a main account"Sub-account management requires main account privileges. Please switch to your main account."
Sub-account UID not found"Sub-account with UID {user_id} was not found. Please verify the UID and try again."
Sub-account does not belong to user"This sub-account does not belong to your main account."
Sub-account already locked"Sub-account {user_id} is already locked. No action needed."
Sub-account already unlocked"Sub-account {user_id} is already in normal (unlocked) state. No action needed."
Create sub-account fails (limit reached)"You have reached the maximum number of sub-accounts. Please contact support if you need more."
Create sub-account fails (duplicate name)"The login name '{login_name}' is already taken. Please choose a different name."
Unknown error"An error occurred while processing your request. Please try again later."
条件响应
身份验证端点返回"not login""请先登录您的Gate账户。"
用户不是主账户"子账户管理需要主账户权限,请切换到您的主账户。"
子账户UID未找到"未找到UID为{user_id}的子账户,请验证UID后重试。"
子账户不属于当前用户"该子账户不属于您的主账户。"
子账户已被锁定"子账户{user_id}已处于锁定状态,无需执行操作。"
子账户已解锁"子账户{user_id}已处于正常(解锁)状态,无需执行操作。"
创建子账户失败(达到数量上限)"您已达到子账户创建上限,如需更多请联系客服。"
创建子账户失败(用户名重复)"登录名'{login_name}'已被占用,请选择其他名称。"
未知错误"处理您的请求时发生错误,请稍后重试。"

Prompt Examples & Scenarios

提示示例与场景

See scenarios.md for full prompt examples and expected behaviors.
完整的提示示例和预期行为请查看scenarios.md。",