gate-exchange-staking
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGate Staking Query Suite
Gate质押查询工具集
General Rules
通用规则
Read and follow the shared runtime rules before proceeding:
→ exchange-runtime-rules.md
This skill is the single entry for Gate Exchange staking (on-chain earn). It supports five modules: positions, rewards, products, order history, and stake/redeem (swap). User intent is routed to the matching reference and MCP tool.
在操作前请阅读并遵循共享运行时规则:
→ exchange-runtime-rules.md
本技能是Gate交易所链上质押(赚币)功能的唯一入口,支持五大模块:仓位查询、收益查询、产品查询、订单历史以及质押/赎回(Swap)。用户的需求会被路由到对应的参考文档和MCP工具。
Module overview
模块概述
| Module | Description | Trigger keywords |
|---|---|---|
| Positions | Query staking positions, balances, available vs locked | |
| Rewards | Query reward history, yesterday/monthly earnings | |
| Products | Discover available staking products, APY, min amount | |
| Order history | Query stake/redeem order list and pagination | |
| Stake / Redeem | Execute stake or redeem via swap (pid required) | |
Mint: Treated as immediate stake. Route to the same Stake workflow: read , resolve product (pid) and amount, then call with side=0. For GUSD products, require the user to choose USDT or USDC and pass .
references/staking-swap.mdcex_earn_swap_staking_coincoinCancel redeem (not supported): When the user intends to cancel or revoke a redeem (e.g. cancel a redemption order already submitted), do not call any tool. Reply in English that this operation is not supported.
| 模块 | 描述 | 触发关键词 |
|---|---|---|
| 仓位查询 | 查询质押仓位、余额、可用与锁定资产 | |
| 收益查询 | 查询收益历史、昨日/月度收益 | |
| 产品查询 | 查看可用质押产品、APY、最低质押金额 | |
| 订单历史 | 查询质押/赎回订单列表及分页 | |
| 质押/赎回 | 通过Swap执行质押或赎回(需pid) | |
Mint:视为即时质押,路由至与质押相同的工作流:阅读,确定产品(pid)和金额,然后调用并传入side=0。对于GUSD产品,需让用户选择USDT或USDC,并传入参数。
references/staking-swap.mdcex_earn_swap_staking_coincoin取消赎回(不支持):当用户想要取消或撤销赎回操作(例如取消已提交的赎回订单),请勿调用任何工具,需用英文回复该操作不支持。
Domain Knowledge
领域知识
Product types
产品类型
| productType | Label | Description |
|---|---|---|
| 0 | Certificate | Flexible staking with instant redemption (redeemPeriod = 0) |
| 1 | Lock-up | Fixed-term staking with a defined lock period (redeemPeriod > 0) |
| 2 | US Treasury Bond | Products backed by US Treasury bonds (e.g. GUSD). Users stake crypto and receive yield derived from US Treasury interest rates. Typically has a fixed or semi-fixed APR with low risk. |
| productType | 标签 | 描述 |
|---|---|---|
| 0 | 活期质押 | 可即时赎回的灵活质押(redeemPeriod = 0) |
| 1 | 定期质押 | 有固定锁仓期的质押(redeemPeriod > 0) |
| 2 | 美国国债产品 | 由美国国债背书的产品(如GUSD)。用户质押加密货币,收益来自美国国债利率,通常为固定或半固定APR,风险较低。 |
Redeemable amount calculation
可赎回金额计算
The redeemable amount for a position is not . The correct formula is:
mortgage_amount − freeze_amountredeemable = mortgage_amount × exchangeRateWhere comes from for the same and matching . Some products have exchangeRate = 1 (e.g. USDT flexible), while others vary (e.g. liquid staking tokens).
exchangeRatecex_earn_find_coinpidcurrency仓位的可赎回金额不是,正确公式为:
mortgage_amount − freeze_amountredeemable = mortgage_amount × exchangeRate其中来自针对相同和匹配的查询结果。部分产品的exchangeRate = 1(如USDT活期质押),其他产品则可能不同(如流动性质押代币)。
exchangeRatepidcurrencycex_earn_find_coinDynamic exchange rate (exchangeRate ≠ 1)
动态汇率(exchangeRate ≠ 1)
When a product’s exchange rate is not equal to 1, it is a dynamic-rate product. In stake/redeem response data (swap result or order list): amount = staked/redeemed base coin quantity; exchangeAmount (or exchange_amount) = received quote/reward coin quantity.
Display rule (English only):
- Stake: Show exchangeAmount (what the user receives).
- Redeem: Show amount (what the user receives).
When exchangeRate = 1, either field may be omitted or shown as equal; prefer showing the single amount.
当产品的汇率不等于1时,属于动态汇率产品。在质押/赎回的响应数据中(Swap结果或订单列表):amount = 质押/赎回的基础币数量;exchangeAmount(或exchange_amount) = 收到的报价币/收益币数量。
显示规则(仅英文):
- 质押:展示exchangeAmount(用户收到的金额)。
- 赎回:展示amount(用户收到的金额)。
当exchangeRate = 1时,任一字段可省略或显示为相等值,优先展示单一金额。
Reward distribution
收益分发
- means the reward is paid on redeem, not periodically.
reward_delay_days = -1 - indicates the delay after staking before rewards start accruing (typically 1 day / T+1).
interest_delay_days - Multi-coin rewards: a single position can generate rewards in multiple coins (e.g. stake USDT in Compound V3, receive USDT + COMP).
- 表示收益在赎回时发放,而非定期发放。
reward_delay_days = -1 - 表示质押后开始产生收益的延迟时间(通常为1天 / T+1)。
interest_delay_days - 多币种收益:单个仓位可产生多种币种的收益(例如在Compound V3中质押USDT,可获得USDT + COMP收益)。
GUSD / multi-currency products (USDT or USDC)
GUSD / 多币种产品(USDT或USDC)
When staking, redeeming, or minting GUSD (or any product whose or is ):
currencymortgage_coin"USDT,USDC"- Require the user to choose a coin. Only USDT and USDC are supported.
- Prompt: e.g. "This product accepts USDT or USDC. Which do you want to use: USDT or USDC?"
- Pass the user’s choice as the parameter to the swap (or mint) tool. Do not call the tool until the user has selected one of the two.
coin
当质押、赎回或Mint GUSD(或任何或为的产品)时:
currencymortgage_coin"USDT,USDC"- 需让用户选择币种,仅支持USDT和USDC。
- 提示语示例:"该产品支持USDT或USDC,您想使用哪种:USDT还是USDC?"
- 将用户的选择作为参数传入Swap(或Mint)工具,在用户选择完成前请勿调用工具。
coin
Positions: status field
仓位:status字段
When viewing staking positions (position/balance/holdings queries), ignore and do not display the field. Omit it from all user-facing position output.
status在查看质押仓位(仓位/余额/持仓查询)时,忽略且不显示字段,所有面向用户的仓位输出均需省略该字段。
statusTimestamps in results
结果中的时间戳
Do not display or format timestamp-related fields in any result. Omit from user-facing output all timestamp fields (e.g. , , , ). Do not convert timestamps to dates, times, or relative time (e.g. no "YYYY-MM-DD", "HH:mm", "2 hours ago"). If a field is purely timestamp-based, do not show it.
createStampredeem_stampupdateStampshould_bonus_stamp请勿在任何结果中显示或格式化时间戳相关字段。省略所有面向用户输出中的时间戳字段(如, , , )。请勿将时间戳转换为日期、时间或相对时间(如不显示"YYYY-MM-DD"、"HH:mm"、"2小时前")。若字段仅为时间戳类型,请勿展示。
createStampredeem_stampupdateStampshould_bonus_stampNumber formatting
数字格式化
| Category | Precision | Trailing zeros | Examples |
|---|---|---|---|
| General amounts (mortgage_amount, freeze_amount, income_total, fee, etc.) | 8 decimals | Removed | |
| Rate fields (estimateApr, APY, APR, exchangeRate) | 2 decimals | Retained | |
| 类别 | 精度 | 尾随零 | 示例 |
|---|---|---|---|
| 通用金额(mortgage_amount, freeze_amount, income_total, fee等) | 8位小数 | 移除 | |
| 利率字段(estimateApr, APY, APR, exchangeRate) | 2位小数 | 保留 | |
Routing rules
路由规则
| Intent | Example phrases | Route to |
|---|---|---|
| Positions | "Show my staking positions", "Check my staking assets", "What can I unstake?" | Read |
| Rewards | "Staking rewards", "Yesterday's earnings", "Monthly earnings", "Earning records" | Read |
| Products | "Available staking", "Stakeable coins", "Best APY", "Flexible only" | Read |
| Order history | "Staking history", "Staking records", "Show redemptions", "Recent activity" | Read |
| Stake / Redeem | "Stake 1 BTC", "Stake 100 USDT", "Redeem my ETH", "redeem", "I want to stake", "unstake", "help me redeem" | Read |
| Mint | "mint", "I want to mint", "Mint", "mint GT", "help me mint" | Same as Stake: route to |
| Cancel redeem (not supported) | "cancel redeem", "revoke redeem", "undo redeem", "cancel my redemption", "withdraw redeem request" | Do not call tools. Reply in English: Cancelling or revoking a redeem is not supported here; please use the Gate website or app if needed. I can help you query positions or order history. |
| Unclear | "Help with staking", "on-chain earn" | Clarify: positions / rewards / products / history, then route |
| 意图 | 示例短语 | 路由至 |
|---|---|---|
| 仓位查询 | "展示我的质押仓位", "查看我的质押资产", "我可以赎回哪些资产?" | 阅读 |
| 收益查询 | "质押收益", "昨日收益", "月度收益", "收益记录" | 阅读 |
| 产品查询 | "可用质押产品", "可质押币种", "最高APY", "仅活期" | 阅读 |
| 订单历史 | "质押历史", "质押记录", "展示赎回记录", "近期活动" | 阅读 |
| 质押/赎回 | "质押1 BTC", "质押100 USDT", "赎回我的ETH", "redeem", "我要质押", "unstake", "帮我赎回" | 阅读 |
| Mint | "mint", "我要mint", "Mint", "mint GT", "帮我mint" | 与质押相同:路由至 |
| 取消赎回(不支持) | "cancel redeem", "revoke redeem", "undo redeem", "cancel my redemption", "withdraw redeem request" | 请勿调用工具,用英文回复:Cancelling or revoking a redeem is not supported here; please use the Gate website or app if needed. I can help you query positions or order history. |
| 意图不明确 | "质押相关帮助", "on-chain earn" | 澄清:询问用户是要查询仓位/收益/产品/历史还是执行操作,或默认展示仓位 |
Execution
执行步骤
1. Intent and parameters
1. 意图与参数提取
- Determine module (Positions / Rewards / Products / Order history / Stake or Redeem) or whether the user intends to mint or cancel a redeem.
- Stake / Redeem intent: If the user wants to execute a stake or redeem (e.g. "stake 1 BTC", "stake 100 USDT", "redeem my ETH"), route to . Follow the swap workflow: pid is required for
references/staking-swap.md; use side=0 for stake, side=1 for redeem; before stake callcex_earn_swap_staking_coinand if multiple protocols for the same coin, list them and ask the user to confirm which product (pid) before calling the swap tool.cex_earn_find_coin - Mint intent: If the user wants to mint (e.g. "mint", "I want to mint", "mint GT", "help me mint")—treat as stake. Route to and execute the Stake workflow (side=0). Mint = immediate stake; same product selection, amount, and GUSD coin rule (USDT/USDC) as stake.
references/staking-swap.md - Cancel redeem intent: If the user wants to cancel or revoke a redeem (e.g. "cancel redeem", "revoke my redemption", "undo redeem")—do not call any MCP tool. Reply in English: "Cancelling or revoking a redeem is not supported here; please use the Gate website or app if needed. I can help you query positions or order history." Then stop.
- Extract: ,
coin,pid,page; for order list alsoamount(0=stake, 1=redeem); for swap always resolve or confirmtypebefore callingpid.cex_earn_swap_staking_coin - Missing: if user says "my staking" without specifying positions/rewards/products/history/action, ask which one or show positions by default.
- 确定模块(仓位查询/收益查询/产品查询/订单历史/质押或赎回)或用户是否想要Mint或取消赎回。
- 质押/赎回意图:若用户想要执行质押或赎回(例如"stake 1 BTC", "stake 100 USDT", "redeem my ETH"),路由至。遵循Swap工作流:
references/staking-swap.md必须传入pid;使用side=0(质押)或side=1(赎回);质押前调用cex_earn_swap_staking_coin,若同一币种有多个协议,列出并让用户确认产品(pid)后再调用Swap工具。cex_earn_find_coin - Mint意图:若用户想要Mint(例如"mint", "我要mint"),视为质押,路由至并执行质押工作流(side=0)。Mint = 即时质押;产品选择、金额及GUSD币种规则(USDT/USDC)与质押一致。
references/staking-swap.md - 取消赎回意图:若用户想要取消或撤销赎回(例如"cancel redeem", "revoke my redemption"),请勿调用任何MCP工具,用英文回复:"Cancelling or revoking a redeem is not supported here; please use the Gate website or app if needed. I can help you query positions or order history." 然后停止操作。
- 提取参数:,
coin,pid,page;订单列表还需amount(0=质押, 1=赎回);Swap操作需在调用type前确定或确认cex_earn_swap_staking_coin。pid - 参数缺失:若用户仅说"我的质押"而未指定仓位/收益/产品/历史/操作,询问具体需求或默认展示仓位。
2. Tool selection
2. 工具选择
| Module | MCP tool | Required | Optional params |
|---|---|---|---|
| Positions | | - | |
| Rewards | | - | |
| Products | | - | |
| Order history | | - | |
| Stake / Redeem | | pid | |
- Positions: When showing redeemable amount, call (optionally with
cex_earn_find_coin), find the product with same pid and matching currency as each position; use that item’s exchangeRate (or exchangeRateReserve per API). Redeemable = mortgage_amount × that rate. Do not use mortgage_amount − freeze_amount.cointype - Stake / Redeem: Read . pid is required for
references/staking-swap.md. Usecex_earn_swap_staking_coin: 0 = stake, 1 = redeem. Before stake: callside; if multiple products (multiple pids) for that coin, list them and ask the user to confirm which product before calling the swap. Before redeem: if user did not give pid, usecex_earn_find_coin(cointype=<coin>)to get positions; if multiple positions, ask user to choose pid.cex_earn_asset_list(coin=<coin>) - Response structures: Positions → array of items (pid, mortgage_coin, mortgage_amount, freeze_amount, income_total, yesterday_income / yesterday_income_multi, etc.). Redeemable is not mortgage_amount − freeze_amount; redeemable = mortgage_amount × exchange rate, where exchange rate comes from for the same pid and matching currency (coin). Order list → object with page, pageSize, pageCount, totalCount, list[]. Reward list → object with page, pageSize, pageCount, totalCount, list[] (pid, mortgage_coin, reward_coin, interest, bonus_date, etc.). Products → array (pid, currency, estimateApr, minStakeAmount, protocolName, redeemPeriod, productType, isDefi, currencyRewards, exchangeRate, etc.).
cex_earn_find_coin
| 模块 | MCP工具 | 必填参数 | 可选参数 |
|---|---|---|---|
| 仓位查询 | | - | |
| 收益查询 | | - | |
| 产品查询 | | - | |
| 订单历史 | | - | |
| 质押/赎回 | | pid | |
- 仓位查询:展示可赎回金额时,调用**(可选传入
cex_earn_find_coin),找到与每个仓位相同pid和匹配currency的产品;使用该产品的exchangeRate**(或API返回的exchangeRateReserve)。可赎回金额 = mortgage_amount × 该汇率。请勿使用mortgage_amount − freeze_amount计算。cointype - 质押/赎回:阅读,
references/staking-swap.md必须传入pid。使用**cex_earn_swap_staking_coin**:0=质押,1=赎回。质押前:调用side;若该币种有多个产品(多个pid),列出并让用户确认产品后再调用Swap工具。赎回前:若用户未提供pid,调用cex_earn_find_coin(cointype=<coin>)获取仓位;若有多个仓位,让用户选择pid。cex_earn_asset_list(coin=<coin>) - 响应结构:仓位查询 → 数组项(pid, mortgage_coin, mortgage_amount, freeze_amount, income_total, yesterday_income / yesterday_income_multi等)。可赎回金额不是mortgage_amount − freeze_amount,而是mortgage_amount × 汇率,汇率来自针对相同pid和匹配currency的****查询结果。订单列表 → 对象,包含page, pageSize, pageCount, totalCount, list[]。收益列表 → 对象,包含page, pageSize, pageCount, totalCount, list[](pid, mortgage_coin, reward_coin, interest, bonus_date等)。产品查询 → 数组(pid, currency, estimateApr, minStakeAmount, protocolName, redeemPeriod, productType, isDefi, currencyRewards, exchangeRate等)。
cex_earn_find_coin
3. Format response
3. 响应格式化
- Use the Response Template and field names from the reference file for the chosen module.
- Positions: show mortgage_amount, freeze_amount, redeemable (mortgage_amount × exchange rate; get exchange rate from for the same pid and matching currency), income_total, yesterday_income; group by coin or show per pid. Do not use mortgage_amount − freeze_amount for redeemable. Do not display or format timestamp fields (omit createStamp, updateStamp). Do not display status (ignore status field when showing positions).
cex_earn_find_coin - Rewards: show list entries with reward_coin, interest, bonus_date, pid, mortgage_coin; sum by reward_coin; use totalCount/page/pageCount when relevant. Do not display or format timestamp fields (e.g. omit should_bonus_stamp).
- Products: show protocolName, currency, estimateApr, minStakeAmount, maxStakeAmount, redeemPeriod, productType, isDefi; sort by estimateApr or filter by cointype. <<<<<<< HEAD
- Order history: show list with coin, amount, type (0=Stake, 1=Redeem), createStamp, status, pid, fee; use totalCount, page, pageCount for pagination. For dynamic-rate products (exchangeRate ≠ 1): for Stake show exchange_amount, for Redeem show amount (see Domain Knowledge). =======
- Order history: show list with coin, amount, type (0=Stake, 1=Redeem), status, pid, fee; use totalCount, page, pageCount for pagination. Do not display or format timestamps (omit createStamp, redeem_stamp, etc.). For dynamic-rate products (exchangeRate ≠ 1): for Stake show exchange_amount, for Redeem show amount (see Domain Knowledge).
master
- Stake / Redeem: follow ; confirm pid (and amount) before calling
references/staking-swap.md; show success or error message in English. For dynamic-rate products: stake confirmation shows exchangeAmount, redeem shows amount.cex_earn_swap_staking_coin
- 使用所选模块参考文件中的响应模板和字段名称。
- 仓位查询:展示mortgage_amount, freeze_amount, 可赎回金额(mortgage_amount × 汇率;汇率来自针对相同pid和匹配currency的**查询结果), income_total, yesterday_income;按币种分组或按pid展示。请勿使用mortgage_amount − freeze_amount计算可赎回金额。请勿显示或格式化时间戳字段(省略createStamp, updateStamp)。请勿展示status**字段(展示仓位时忽略该字段)。
cex_earn_find_coin - 收益查询:展示包含reward_coin, interest, bonus_date, pid, mortgage_coin的列表项;按reward_coin汇总;必要时使用totalCount/page/pageCount。请勿显示或格式化时间戳字段(如省略should_bonus_stamp)。
- 产品查询:展示protocolName, currency, estimateApr, minStakeAmount, maxStakeAmount, redeemPeriod, productType, isDefi;按estimateApr排序或按cointype筛选。
- 订单历史:展示包含coin, amount, type (0=质押, 1=赎回), status, pid, fee的列表;使用totalCount, page, pageCount实现分页。请勿显示或格式化时间戳(省略createStamp, redeem_stamp等)。对于动态汇率产品(exchangeRate ≠ 1):质押展示exchange_amount,赎回展示amount(见领域知识)。
- 质押/赎回:遵循;调用
references/staking-swap.md前确认pid(和金额);用英文展示成功或错误信息。对于动态汇率产品:质押确认展示exchangeAmount,赎回展示amount。cex_earn_swap_staking_coin
Report template
报告模板
After each query, output a short standardized result consistent with the reference (e.g. positions summary, reward summary, product table, or order list). Use the exact response fields from the API (see references) so the user sees correct field names and values.
每次查询后,输出与参考文件一致的简短标准化结果(如仓位摘要、收益摘要、产品表格或订单列表)。使用API返回的准确响应字段,确保用户看到正确的字段名称和值。
Safety rules
安全规则
Stake, redeem, and mint
质押、赎回与Mint
- Stake / Redeem: Supported via . Follow
cex_earn_swap_staking_coin. pid is required; use side=0 (stake) or side=1 (redeem); before stake, fetch products and if multiple protocols for the same coin, ask the user to confirm which product (pid) before calling the swap. All responses in English.references/staking-swap.md - Mint: Supported as immediate stake. When the user asks to mint, execute the Stake workflow: route to , resolve pid and amount, call
references/staking-swap.mdwith side=0. For GUSD, require the user to choose USDT or USDC and passcex_earn_swap_staking_coin.coin - Cancel redeem: Not supported. When the user asks to cancel or revoke a redeem (e.g. cancel a redemption order), reply in English: "Cancelling or revoking a redeem is not supported here; please use the Gate website or app if needed. I can help you query positions or order history." Do not call any tool.
- 质押/赎回:通过支持,遵循
cex_earn_swap_staking_coin。必须传入pid;使用side=0(质押)或side=1(赎回);质押前获取产品列表,若同一币种有多个协议,让用户确认产品(pid)后再调用Swap工具。所有响应使用英文。references/staking-swap.md - Mint:作为即时质押支持。当用户要求Mint时,执行质押工作流:路由至,确定pid和金额,调用
references/staking-swap.md并传入side=0。对于GUSD产品,需让用户选择USDT或USDC并传入cex_earn_swap_staking_coin参数。coin - 取消赎回:不支持。当用户要求取消或撤销赎回(例如取消赎回订单),用英文回复:"Cancelling or revoking a redeem is not supported here; please use the Gate website or app if needed. I can help you query positions or order history." 请勿调用任何工具。
Errors
错误处理
| Scenario | Action |
|---|---|
Empty positions ( | "You don't have any staking positions. Browse available products to start earning." Suggest |
| No rewards yet | "No rewards found. Rewards typically start accruing 24 hours after staking." Optionally show positions from |
| Product not found / no capacity | Suggest alternatives from |
| API error / 401 | "Unable to fetch staking data. Please try again later." or "Please log in to view staking data." |
| 场景 | 操作 |
|---|---|
无仓位( | 回复:"您暂无任何质押仓位。可浏览可用产品开始赚币。" 建议查看 |
| 暂无收益 | 回复:"未找到收益记录。收益通常在质押24小时后开始累积。" 可选择性展示 |
| 产品未找到/无额度 | 推荐 |
| API错误/401 | 回复:"无法获取质押数据,请稍后重试。" 或 "请登录后查看质押数据。" |