← Back to Skills Marketplace
gate-exchange

Gate Exchange Unified Account

by Gate · GitHub ↗ · v1.0.4 · MIT-0
cross-platform ✓ Security Clean
283
Downloads
0
Stars
0
Active Installs
5
Versions
Install in OpenClaw
/install gate-exchange-unified
Description
Gate unified account operations skill. Use when the user asks about unified account equity, margin borrowing, or leverage modes. Triggers on 'unified account...
README (SKILL.md)

Gate Unified Account Assistant

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 call MCP tools explicitly listed in this skill. Tools not documented here must NOT be called, even if they exist in the MCP server.

MCP Dependencies

Required MCP Servers

MCP Server Status
Gate (main) ✅ Required

Authentication

  • Credentials Source: Local Gate MCP deployment (GATE_API_KEY, GATE_API_SECRET)
  • API Key Required: Yes
  • Permissions: Unified:Read, Unified:Write
  • Never ask the user to paste secrets into chat; rely on the configured MCP session only.
  • API Key Provisioning Reference: https://www.gate.com/myaccount/profile/api-key/manage (create or rotate keys outside the chat when the local MCP setup requires them).

Installation Check

  • Required: Gate (main)
  • Install: Use the local Gate MCP installation flow for the current host IDE before continuing.
  • Continue only after the Gate MCP session is configured with the credentials listed above; do not switch to browser auth or ask the user to paste secrets into chat.

MCP Mode

Read and strictly follow references/mcp.md, then execute this skill's unified-account routing.

  • SKILL.md keeps scenario routing and confirmation policy.
  • references/mcp.md is the authoritative MCP execution layer for limits checks, mutation drafts, and post-state verification.

Domain Knowledge

Tool Mapping by Domain

Group Tool Calls (jsonrpc: call.method)
Account and mode get_unified_accounts, get_unified_mode, set_unified_mode
Borrowing and repayment get_unified_borrowable, create_unified_loan, list_unified_loan_records, list_unified_loan_interest_records
Borrow rates and currency universe get_unified_estimate_rate, list_unified_currencies
Transferability get_unified_transferable
Leverage and collateral settings get_user_leverage_currency_setting, set_user_leverage_currency_setting, set_unified_collateral
Risk tiers and collateral discount list_currency_discount_tiers

Capability Notes and API Coverage

  • Batch borrowable and batch transferable endpoints may not be exposed as dedicated tools; for multi-currency requests, iterate single-currency queries and aggregate results.
  • Loan repayment uses create_unified_loan with type=repay; full repayment uses repaid_all=true.
  • Unified mode switching is high-impact and may fail if account risk constraints are not satisfied.
  • Per-currency leverage settings should be validated against current account mode and platform limits.
  • Collateral configuration changes can alter borrow power and liquidation risk.

Response Rendering Rules (Mandatory)

  • Do not round API numeric strings for equity, borrowable, transferable, rates, or leverage values unless the user explicitly asks for formatted rounding.
  • Do not trim, shorten, or normalize decimal strings. If API returns trailing zeros or long decimals, display the exact raw value string as returned.
  • When API returns timestamps, show both raw timestamp and human-readable time (local timezone).
  • For account-overview replies, always include account-level IMR/MMR using API fields:
    • IMR: totalInitialMarginRate
    • MMR: totalMaintenanceMarginRate
  • When per-currency risk fields are present in balances, include imr and mmr for each reported currency (preserve original API numeric strings).
  • Unified mode display labels must use this mapping:
    • classic -> 经典现货模式
    • single_currency -> 单币种保证金模式
    • multi_currency -> 跨币种保证金模式
    • portfolio -> 组合保证金模式
  • If unified account is not enabled/opened, place this warning at the top of the response: ⚠️ 当前账户未开通统一账户功能。

Risk-Sensitive Action Rules

Mutating unified actions are treated as high risk:

  • create_unified_loan (borrow/repay)
  • set_unified_mode
  • set_user_leverage_currency_setting
  • set_unified_collateral

For each of the actions above, always require explicit user confirmation immediately before execution.

Workflow

When the user asks for any unified account operation, follow this sequence.

Step 1: Identify Task Type

Classify the request into one of these six categories:

  1. Account overview and mode query
  2. Borrowable/transferable limit query
  3. Borrow/repay execution
  4. Loan/interest history query
  5. Leverage/collateral configuration
  6. Mixed risk-and-funding actions (for example check limit, then borrow)

Step 2: Extract Parameters and Run Pre-checks

Extract key fields:

  • currency or currency list
  • operation type (borrow/repay, query vs mutation)
  • amount and repaid_all intent
  • target mode (classic / single_currency / multi_currency / portfolio)
  • leverage value and collateral enable/disable lists

Pre-check order:

  1. Required parameters completeness
  2. Limit sufficiency (borrowable / transferable) for requested amount
  3. Account mode and risk compatibility
  4. User intent clarity for high-risk configuration changes

Step 3: Final User Confirmation Before Any Mutation (Mandatory)

Before every mutating call, provide an Action Draft first, then wait for explicit confirmation.

Required execution flow:

  1. Send draft summary (no mutation call yet)
  2. Wait for explicit user approval
  3. Submit real mutation call only after approval
  4. Treat confirmation as single-use
  5. If parameters change, invalidate old confirmation and re-confirm

Required confirmation fields:

  • operation type (borrow/repay/mode switch/leverage/collateral)
  • target object (currency, mode, leverage, enable/disable lists)
  • amount or config value
  • key risk note

Recommended draft wording:

  • Action Draft: borrow 100 USDT in unified account. Pre-check: max borrowable 250 USDT. Risk: interest accrues hourly. Reply "Confirm action" to proceed.

Hard blocking rules (non-bypassable):

  • NEVER call mutation tools without explicit confirmation from the immediately previous user turn.
  • If request scope changes (currency, amount, mode, leverage, collateral set), request fresh confirmation.
  • For multi-step actions, require confirmation per mutation step.

Step 4: Call Tools by Scenario

Use only the minimal tool set required for the task:

  • Account overview: get_unified_accounts
  • Mode query/switch: get_unified_mode / set_unified_mode
  • Borrowable checks: get_unified_borrowable
  • Transferable checks: get_unified_transferable
  • Borrow/repay: create_unified_loan
  • Loan and interest records: list_unified_loan_records, list_unified_loan_interest_records
  • Currency support and rates: list_unified_currencies, get_unified_estimate_rate
  • Leverage settings: get_user_leverage_currency_setting, set_user_leverage_currency_setting
  • Collateral settings: set_unified_collateral
  • Risk tiers: list_currency_discount_tiers

Step 5: Return Actionable Result and Status

The response must include:

  • Whether execution succeeded (or why it did not execute)
  • Core numbers (amount, limit, rate, leverage, mode, key risk fields)
  • For overview queries: explicitly include IMR/MMR (totalInitialMarginRate / totalMaintenanceMarginRate) and include per-currency imr/mmr when present
  • For all money/rate outputs: preserve exact API string precision; do not trim or format decimals automatically
  • For record queries: provide readable time alongside timestamps
  • If condition not met, clearly explain gap and next option

Case Routing Map (1-18)

A. Account and Mode (1-3)

Case User Intent Core Decision Tool Sequence
1 Unified account overview Return total equity and margin indicators (including IMR/MMR when available) get_unified_accounts
2 Query current unified mode Return current mode with readable label get_unified_mode
3 Switch unified mode Validate target mode, then switch after confirmation get_unified_mode -> set_unified_mode

B. Borrow Limits and Borrowing (4-8)

Case User Intent Core Decision Tool Sequence
4 Single-currency borrowable Return max borrowable for one currency get_unified_borrowable
5 Multi-currency borrowable Iterate per currency and aggregate get_unified_borrowable(loop)
6 Borrow specific amount Check max borrowable then submit borrow after confirmation get_unified_borrowable -> create_unified_loan
7 List borrowable currencies Return supported currency list list_unified_currencies
8 Query estimated borrow rate Return estimated rate with disclaimer get_unified_estimate_rate

C. Repayment and Records (9-12)

Case User Intent Core Decision Tool Sequence
9 Partial repay Validate repay amount and submit after confirmation create_unified_loan
10 Full repay Submit repaid_all=true after confirmation create_unified_loan
11 Query loan records Return borrow/repay history by filter list_unified_loan_records
12 Query interest records Return charged-interest history with time/rate list_unified_loan_interest_records

D. Transferability and Risk Config (13-18)

Case User Intent Core Decision Tool Sequence
13 Single-currency transferable Return max transferable amount get_unified_transferable
14 Multi-currency transferable Iterate per currency and aggregate get_unified_transferable(loop)
15 Query leverage setting Return leverage by currency (single/all) get_user_leverage_currency_setting
16 Set leverage setting Update leverage after confirmation set_user_leverage_currency_setting
17 Set collateral currencies Enable/disable collateral list after confirmation set_unified_collateral
18 Query collateral discount tiers Return risk-tier/discount reference list_currency_discount_tiers

Judgment Logic Summary

Condition Action
User asks "how much can I borrow" for one coin Use get_unified_borrowable with that currency
User asks borrowable for several coins Iterate get_unified_borrowable per coin and aggregate
User requests borrow execution Pre-check limit first, then require confirmation before create_unified_loan
User requests repay execution Clarify partial vs full repay and confirm before mutation
User asks "all repay" but currency unclear Ask user to specify currency or propose per-currency execution
User asks transferable for several coins Iterate get_unified_transferable per coin and aggregate
User asks to switch mode Query current mode first, show impact, then confirm and execute
User asks to set leverage Query/validate currency and target leverage, then confirm mutation
User asks to set collateral Confirm enable/disable list and risk note before mutation
User confirmation missing/ambiguous/stale Keep task pending and do not execute mutation
Requested amount exceeds borrowable/transferable Return max available and ask user whether to adjust
Query-only request Never perform mutation calls

Report Template

## Execution Result

| Item | Value |
|------|-----|
| Scenario | {case_name} |
| Scope | {currency_or_mode_scope} |
| Action | {action} |
| Status | {status} |
| Key Metrics | {key_metrics} |

{decision_text}

Example decision_text:

  • ✅ Action completed successfully.
  • 📝 Action draft ready. Reply "Confirm action" to proceed.
  • ⏸️ Not executed: requested amount exceeds current limit.
  • ❌ Not executed: required parameter is missing.

Error Handling

Error Type Typical Cause Handling Strategy
Missing required parameter Currency/amount/mode omitted Ask for the missing field before tool call
Limit exceeded Requested amount > borrowable/transferable Return current max and suggest adjusted amount
Unsupported/hidden batch endpoint Batch method not exposed as tool Iterate single-currency calls and merge result
Mode switch rejected Position/risk constraints prevent switch Return rejection reason and suggest cleanup checks
Invalid leverage setting Out-of-range leverage value Return valid range and ask for revised value
Collateral config risk Enable/disable list changes borrowing power Show risk note and require explicit confirmation
Collateral mutation API error (500) Backend-side failure even with valid payload Return non-user-fault message, keep params for retry, and ask whether to retry later
Missing final confirmation User has not approved draft Keep pending and request explicit confirmation
Stale confirmation Draft no longer matches user intent Invalidate and re-draft for reconfirmation

Cross-Skill Workflows

Workflow A: Unified Borrow Then Spot Buy

  1. Use gate-exchange-unified to borrow quote currency (Case 6)
  2. Use gate-exchange-spot to execute buy order with borrowed funds

Workflow B: Spot Sell Then Unified Repay

  1. Use gate-exchange-spot to liquidate target asset into quote currency
  2. Use gate-exchange-unified to repay outstanding loan (Case 9/10)

Safety Rules

  • Before any mutation, restate target currency/mode/value and key risk.
  • For borrowing, explicitly disclose that interest accrues and rates may vary.
  • For mode or leverage changes, mention potential impact on margin and liquidation risk.
  • For collateral changes, show both enable and disable sets before execution.
  • Without explicit confirmation, stay in read-only mode.
  • Do not reuse stale confirmations; re-confirm if any parameter changes.
  • If constraints are not met, do not force execution; provide alternatives.
Usage Guidance
This skill appears coherent for managing Gate unified-account operations. Before installing: 1) Ensure you provide Gate API keys that have the minimal necessary permissions (ideally create a key with Unified:Read for queries and only grant Unified:Write if you intend to permit borrowing/repayment or mode changes). 2) Confirm you have a trusted local Gate MCP/session configured (the skill expects a local MCP session and will rely on it rather than pasting secrets into chat). 3) Understand the skill will ask for explicit confirmation before any write/mutation — treat those confirmations carefully. 4) Because this bundle is instruction-only, it won’t install software, but verify the skill source (homepage points to github.com/gate/gate-skills) and confirm the repository is legitimate if you need higher assurance. 5) Minor doc inconsistency: README references a bug.xls not present in the package — not a functional risk but worth checking the source repo for completeness. If you are unsure about granting write permissions, use the skill in read-only mode (do not give explicit confirmation to mutation drafts) and rotate/revoke API keys after testing.
Capability Analysis
Type: OpenClaw Skill Name: gate-exchange-unified Version: 1.0.4 The gate-exchange-unified skill bundle is a well-structured tool for managing Gate.io unified accounts. It implements robust safety guardrails, including a mandatory 'Action Draft' and explicit user confirmation flow for all high-risk mutating operations (e.g., borrowing, repayment, and mode switching) as detailed in SKILL.md and references/scenarios.md. The instructions prioritize data integrity by forbidding decimal rounding and emphasize security by requiring the use of pre-configured MCP environment variables (GATE_API_KEY/SECRET) rather than asking users for secrets in chat.
Capability Tags
cryptorequires-walletcan-make-purchases
Capability Assessment
Purpose & Capability
Name and description match required artifacts: the skill declares Gate unified-account operations and only asks for GATE_API_KEY / GATE_API_SECRET which are the expected credentials for Gate API access. Required permissions (Unified:Read, Unified:Write) align with claimed mutating and read capabilities.
Instruction Scope
SKILL.md limits runtime actions to documented MCP tools, enforces pre-checks and explicit confirmation before any mutation, and prohibits asking users to paste secrets into chat. This keeps scope tight. Note: README shows an architecture tree including a 'bug.xls' file which is not present in the bundle manifest — a minor documentation inconsistency to verify but not a functional red flag.
Install Mechanism
Instruction-only skill with no install spec or code files. Nothing will be written or executed on disk by the bundle itself, which minimizes install-time risk.
Credentials
Only two environment variables are required: GATE_API_KEY and GATE_API_SECRET. Those are proportionate and expected for a Gate exchange integration. The declared primary credential is GATE_API_KEY. No unrelated Secrets/Keys are requested.
Persistence & Privilege
Skill does not request always:true and does not modify other skills or system config. It allows model invocation (default), which is normal for skills; MCP session usage is constrained to Gate tools documented in SKILL.md.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install gate-exchange-unified
  3. After installation, invoke the skill by name or use /gate-exchange-unified
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.4
gate-exchange-unified 1.0.4 - Added new reference file: gate-runtime-rules.md, centralizing runtime requirements. - Updated SKILL.md to point to local gate-runtime-rules for runtime compliance. - Added OpenClaw deployment metadata for environment requirements and homepage details. - Revised installation check instructions for clarity and better host IDE guidance. - Minor workflow and formatting corrections for consistency and completeness.
v1.0.3
- Added clear documentation of required credentials, environment variables, and permissions for use (Gate API key/secret, Unified:Read, Unified:Write). - Updated authentication section: now specifies MCP session-sourced credentials only; never request secrets in chat. - Added a reference link for Gate API key management. - No changes to workflow, endpoint mapping, or business logic.
v1.0.2
Version 1.0.2 - Added a reference file: `references/mcp.md` with authoritative execution rules for MCP layer. - Updated SKILL.md: - Referenced the new `references/mcp.md` and clarified that MCP logic should be strictly followed. - Simplified and clarified the description and trigger phrases. - Explicitly separated scenario routing (SKILL.md) and underlying MCP execution (references/mcp.md). - Made workflow and risk confirmation process more concise, referencing the new MCP reference for limit checks, drafts, and post-verification. - No runtime logic changes; structure and integration improved for clarity and maintainability.
v1.0.1
Version 1.0.1 - Clarified that shared runtime rules must be read before any tool selection. - Added explicit instruction to only call tools listed in the skill documentation. - Included MCP server dependency and authentication requirements. - Stated installation prerequisites for supported IDEs. - Minor editorial adjustments for workflow clarity.
v1.0.0
gate-exchange-unified 1.0.0 (2026.3.13-4) – Initial Release - Introduces unified account operations for Gate, supporting equity checks, borrow/repay workflows, mode switches, leverage/collateral config, and risk metrics. - Enforces strict confirmation for all mutating actions (borrow, repay, mode/leverage/collateral changes). - Preserves exact API numeric strings; no rounding or formatting unless user requests. - Requires display of IMR/MMR in all relevant queries; maps unified mode to readable Chinese labels. - Implements workflow for request classification, parameter extraction, pre-checks, and mandatory user confirmation before action execution.
Metadata
Slug gate-exchange-unified
Version 1.0.4
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 5
Frequently Asked Questions

What is Gate Exchange Unified Account?

Gate unified account operations skill. Use when the user asks about unified account equity, margin borrowing, or leverage modes. Triggers on 'unified account... It is an AI Agent Skill for Claude Code / OpenClaw, with 283 downloads so far.

How do I install Gate Exchange Unified Account?

Run "/install gate-exchange-unified" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Gate Exchange Unified Account free?

Yes, Gate Exchange Unified Account is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Gate Exchange Unified Account support?

Gate Exchange Unified Account is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Gate Exchange Unified Account?

It is built and maintained by Gate (@gate-exchange); the current version is v1.0.4.

💬 Comments