gate-exchange-dual
Resolving gate-cli (binary path)
Resolve gate-cli in order: (1) command -v gate-cli and gate-cli --version succeeds; (2) ${HOME}/.local/bin/gate-cli if executable; (3) ${HOME}/.openclaw/skills/bin/gate-cli if executable. Canonical rules: exchange-runtime-rules.md §4 (or gate-runtime-rules.md §4).
Gate Exchange Dual Investment Skill
General Rules
⚠️ 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 ./references/gate-runtime-rules.md
- Only use the
gate-clicommands explicitly listed in this skill. Commands not documented here must NOT be run for these workflows, even if other interfaces expose them.
Skill Dependencies
gate-cli commands used
Query Operations (Read-only)
gate-cli cex earn dual balancegate-cli cex earn dual plansgate-cli cex earn dual orders
Execution Operations (Write)
gate-cli cex earn dual place
Authentication
- Interactive file setup: when
GATE_API_KEYandGATE_API_SECRETare not both set on the host, rungate-cli config initto complete the wizard for API key, secret, profiles, and defaults (see gate-cli). - Env / flags:
gate-cli config initis not required when credentials are already supplied — e.g. bothGATE_API_KEYandGATE_API_SECRETset on the host, or--api-key/--api-secretwhere supported — never ask the user to paste secrets into chat. - API Key Required: Yes
- Permissions: Earn:Write
- Portal: create or rotate keys outside the chat: https://www.gate.com/myaccount/profile/api-key/manage
Installation Check
- Required:
gate-cli(runsh ./setup.shfrom this skill directory if missing; optionalGATE_CLI_SETUP_MODE=release). - Add
$HOME/.openclaw/skills/bintoPATHif you invokegate-cliby name (or the directory wheresetup.shinstalls it). - Credentials: When
GATE_API_KEYandGATE_API_SECRETare both set (non-empty) for the host, do not requiregate-cli config init— that is equivalent valid config forgate-cli. When both are unset or empty, remind the operator to rungate-cli config initor to configureGATE_API_KEY/GATE_API_SECRETin the matching skill from the skill library (never ask the user to paste secrets into chat). - Sanity check: Do not proceed with authenticated calls until the CLI behaves as expected (e.g.
gate-cli --versionor a read-onlygate-cli cex ...command from this skill); confirm credentials resolve before mutating operations.
Execution mode
Read and strictly follow references/gate-cli.md, then execute this skill's dual-investment workflow.
SKILL.mdkeeps routing and product semantics.references/gate-cli.mdis the authoritativegate-cliexecution contract for plan lookup, confirmation-gated placement, and order verification.
Prerequisites
- MCP Dependency: Requires gate-mcp to be installed.
- Authentication: All endpoints require API key authentication.
- Risk Disclaimer: Always append: "This information is for reference only and does not constitute investment advice. Dual investment is not principal-protected. You may receive settlement in a different currency than your investment. Please understand the product terms before investing."
Available MCP Tools
| Tool | Auth | Description |
|---|---|---|
gate-cli cex earn dual plans |
Yes | List available dual investment plans (optional param: plan_id) |
gate-cli cex earn dual orders |
Yes | List dual investment orders. page and limit are required: always pass page=1, limit=100. Optional: from, to. MUST loop all pages (increment page until returned rows < limit) before drawing any conclusion. |
gate-cli cex earn dual balance |
Yes | Get dual investment balance & interest stats |
gate-cli cex earn dual place |
Yes | Place a dual investment order. Params: plan_id (required), amount (required), text (optional, must start with t-, max 28 bytes after prefix, alphanumeric/_/-/. only). |
Routing Rules
| Case | User Intent | Signal Keywords | Action |
|---|---|---|---|
| 1 | Browse dual product list | "dual products", "sell-high / buy-low options" | See references/product-query.md |
| 3 | Product details | "min investment", "BTC sell-high" | See references/product-query.md (filter locally by currency; show matching plans, skip min amount) |
| 4 | Settlement simulation | "what happens at delivery", "if price reaches X" | See references/product-query.md (simulation) |
| 5 | Position summary (ongoing) | "how much locked", "active positions" | See references/product-query.md (ongoing + balance) |
| 6 | Settlement records | "settlement records", "got crypto or USDT", "last month orders" | See references/product-query.md (settled) |
| 7 | Sell-high order (invest crypto) | "sell high for me", "sell high with BTC", "sell high order" | See references/subscription.md |
| 8 | Buy-low order (invest stablecoin) | "buy low for me", "buy low BTC with USDT", "buy low order" | See references/subscription.md |
| 9 | Amount eligibility for order | "can I buy", "is 5000U enough" | See references/subscription.md |
| 10 | Min purchase check for order | "minimum to buy", "can I buy dual with 50U" | See references/subscription.md |
| 11 | Settlement result query | "what did I receive", "settlement result" | See references/settlement-assets.md (settlement) |
| 12 | Dual asset briefing | "dual balance", "total locked" | See references/settlement-assets.md (balance) |
| 13 | Currency conversion risk | "will I lose principal", "risk", "principal-protected?" | Domain Knowledge (no API) |
| 14 | Missed gains explanation | "did I lose money", "missed gains", "price surged" | Domain Knowledge (no API) |
| 15 | Restricted region | "can I buy dual in [region]", "which regions supported" | See references/subscription.md (compliance) |
| 17 | Compliance check failure | "subscription failed", "compliance check not passed" | See references/subscription.md (compliance) |
Execution
- Identify user intent from the Routing Rules table above.
- For Cases 1–6, 11–12: Read the corresponding sub-module document in
references/and follow the Workflow. - For Cases 7–10: Read
references/subscription.mdand follow the order placement Workflow. - For Cases 15, 17: Read
references/subscription.mdand follow the compliance handling Workflow. These cases are triggered bygate-cli cex earn dual placeerror responses or by the user asking about region restrictions. - For Cases 13–14: Answer directly using Domain Knowledge below (no API call needed).
- If the user's intent is ambiguous, ask a clarifying question before routing.
Domain Knowledge
Core Concepts
- Sell High (Call): User invests crypto, target price above current price. If settlement price ≥ target price → receive USDT (principal × target price × (1 + interest)); if settlement price < target price → get back crypto + interest.
- Buy Low (Put): User invests stablecoins, target price below current price. If settlement price ≤ target price → receive crypto; if settlement price > target price → get back USDT + interest.
- Target Price: The price that determines settlement outcome at delivery. Gate official term.
- Settlement Price: Market price of the underlying asset at delivery time, compared against target price.
- Interest-guaranteed, not principal-protected: Principal + interest are always received, but the settlement currency may change due to price movement.
- The closer the target price is to the current price, the higher the APY, but also the higher the probability of currency conversion.
- Once placed, dual investment orders cannot be cancelled. Settlement is automatic at delivery time.
- Order type derivation:
gate-cli cex earn dual ordershas NOtypefield. Derive frominvest_currency: crypto (BTC, ETH...) → Sell High (Call); stablecoin (USDT) → Buy Low (Put). Filter by coin usinginvest_currencyorexercise_currency— there is NOinstrument_name. - Order status values:
INIT(Pending),PROCESSING(In Position),SETTLEMENT_SUCCESS(Settled),SETTLEMENT_PROCESSING(Settling),CANCELED(Canceled),FAILED(Failed),REFUND_SUCCESS/REFUND_PROCESSING/REFUND_FAILED→ display as "Early Redemption", never "Refund". Early-redeemed orders have zero yield.
Settlement Rules (Gate Examples)
Sell High: Invest 1 BTC, target price 20,000 USDT, 31 days, 100% APY
- Settlement price < 20,000 → payout = 1 × (1 + 100%/365×31) = 1.0849 BTC
- Settlement price ≥ 20,000 → payout = 1 × 20,000 × (1 + 100%/365×31) = 21,698.63 USDT
Buy Low: Invest 20,000 USDT, target price 20,000 USDT, 31 days, 100% APY
- Settlement price ≤ 20,000 → payout = 20,000/20,000 × (1 + 100%/365×31) = 1.0849 BTC
- Settlement price > 20,000 → payout = 20,000 × (1 + 100%/365×31) = 21,698.63 USDT
Risk FAQ (Cases 13–14)
Q: Will I lose principal? (Case 13) A: Interest-guaranteed, not principal-protected. You always receive principal + interest, but the settlement currency may change. Sell-high may return crypto instead of USDT; buy-low may return USDT instead of crypto. The closer the target price to the current price, the higher the yield but also the higher the conversion risk.
Q: I sold high on BTC and it surged — did I lose money? (Case 14) A: When settlement price ≥ target price, you successfully sell at the target price and receive USDT, but miss gains above the target price. When settlement price < target price, you get back crypto + interest. This product suits sideways or mildly bullish markets; in strong bull markets you may "miss out" on excess gains.
Safety Rules
- Timestamp fields (CRITICAL): All time fields (
delivery_time,create_time,complete_time,delivery_timest) are Unix timestamps (seconds). Do NOT convert them to dates or display them to the user in any form. This includes: (1) Do NOT show timestamps as table columns. (2) Do NOT convert timestamps to dates and use them as section headers or grouping labels (e.g. "Delivery Time: 2026-03-17"). (3) Do NOT mention delivery dates in order confirmations. Simply omit all time-related information from user-facing output. - APY display (CRITICAL — applies to ALL dual tools): Any APY/rate field (
apy,apy_display,apy_settlement,apyDisplay, or any other rate field) returned by any dual investment tool is a raw value — NOT a percentage. You MUST multiply by 100 then append%for display. NEVER display the raw value directly as a percentage. Common mistake: values like1.1343or16.133look like percentages but they are NOT —1.1343→ 113.43%,16.133→ 1613.3%. Another example:0.0619→ 6.19%,2.7814→ 278.14%. Use the raw value only in settlement formulas. This rule applies to ALL dual tools (gate-cli cex earn dual plans,gate-cli cex earn dual orders,gate-cli cex earn dual balance, etc.). - APY sanity check (MANDATORY before responding): After formatting ALL APY values, scan every value in your output. Typical correct ranges after ×100: crypto sell-high plans → 10%–2000%; stablecoin buy-low plans → 5%–1800%. If you see any APY displayed as 0.05%–20% (single or low-double digits), you almost certainly forgot to multiply by 100. STOP, go back, and recompute ALL APY values before responding. For example, if a raw value is
19.9378, the correct display is1993.78%— NOT19.94%. - No investment advice: Do not recommend specific plans or predict prices. Present data and let the user decide.
- Non-principal-protected: Always clearly communicate that dual investment is NOT principal-protected and the user may receive a different currency.
- Order placement confirmation: Before calling
gate-cli cex earn dual place, MUST show the user the full order details (plan, amount, target price, APY, settlement scenarios) and get explicit user confirmation. NEVER place an order without confirmation. - Sensitive data: Never expose API keys, internal endpoint URLs, or raw error traces to the user.
Error Handling
| Condition | Response |
|---|---|
| Auth endpoint returns "not login" | "Please log in to your Gate account first." |
gate-cli cex earn dual plans returns empty |
"No dual investment plans available at the moment." |
gate-cli cex earn dual orders returns empty |
"No dual investment orders found for the specified criteria." |
gate-cli cex earn dual place returns region restriction error |
See Case 15 in references/subscription.md |
gate-cli cex earn dual place returns other compliance error |
See Case 17 in references/subscription.md |
gate-cli cex earn dual place returns insufficient balance |
"Insufficient balance. Please ensure your account has enough funds and try again." |
gate-cli cex earn dual place returns other failure |
Display the error message returned by the API to the user. |
Prompt Examples & Scenarios
See references/scenarios.md for full prompt examples and expected behaviors covering all 17 cases.
More from gate/gate-skills
gate-exchange-futures
Gate Exchange USDT perpetual futures trading skill. Use when the user wants to trade contracts, open/close perpetual positions, or manage futures leverage. Triggers on 'open long', 'close short', 'USDT perpetual', 'futures TP/SL'.
125gate-exchange-spot
Gate spot trading and account operations skill. Use when the user asks to buy/sell crypto on spot, check account value, list spot balances, or place conditional/trigger orders. Triggers on 'buy coin', 'sell spot', 'take profit', 'stop loss', 'cancel order', 'my spot balance', '查看我的现货账户余额', or '现货账户余额'.
113gate-exchange-marketanalysis
Gate Exchange market analysis tool. Use when the user asks for deep market metrics like liquidity, slippage, funding arbitrage, or manipulation risk. Triggers on 'liquidity', 'depth', 'slippage', 'momentum', 'buy/sell pressure', 'squeeze', 'funding rate', 'arbitrage', 'basis', 'premium'.
102gate-news-briefing
News briefing. Use this skill ONLY when the user's query is exclusively about recent news or headlines with no other analysis dimensions. Trigger phrases: what happened recently, today's highlights, crypto news, any new updates. If the query ALSO mentions coin analysis, risk check, technicals, or any other analysis dimension, use gate-info-research instead — it handles multi-dimension queries in a single unified report.
95gate-info-trendanalysis
Trend and technical analysis. Use this skill ONLY when the user's query is exclusively about technical indicators or trend analysis for one coin with no other analysis dimensions. Trigger phrases: technical analysis, K-line, RSI, MACD, trend, support, resistance. If the query ALSO mentions fundamentals, risk, news, sentiment, or any other analysis dimension, use gate-info-research instead — it handles multi-dimension queries in a single unified report.
84gate-dex-market
On-chain DEX market data queries via Gate: token prices/价格, K-line/OHLC candlestick charts, token rankings, security risk audits, new token discovery, holder analysis, and trading volume stats. Read-only — no transactions. Use when the user asks for 'token price', 'price of ETH', 'check SOL price', '查价格', 'K线', 'candlestick', 'OHLC', 'top gainers', 'trending tokens', 'is this token safe', 'honeypot check', 'new tokens', 'trading volume', or 'liquidity events'. Do NOT use for swap/trade execution (use gate-dex-trade) or wallet balance/account queries (use gate-dex-wallet).
76