Install
openclaw skills install gate-exchange-unified-stagingGate unified account operations skill. Use when the user asks about unified account equity, margin borrowing, or leverage modes. Triggers on 'unified account...
openclaw skills install gate-exchange-unified-staging⚠️ 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
| MCP Server | Status |
|---|---|
| Gate (main) | ✅ Required |
GATE_API_KEY, GATE_API_SECRET)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.| 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 |
create_unified_loan with type=repay; full repayment uses repaid_all=true.totalInitialMarginRatetotalMaintenanceMarginRatebalances, include imr and mmr for each reported currency (preserve original API numeric strings).classic -> 经典现货模式single_currency -> 单币种保证金模式multi_currency -> 跨币种保证金模式portfolio -> 组合保证金模式⚠️ 当前账户未开通统一账户功能。Mutating unified actions are treated as high risk:
create_unified_loan (borrow/repay)set_unified_modeset_user_leverage_currency_settingset_unified_collateralFor each of the actions above, always require explicit user confirmation immediately before execution.
When the user asks for any unified account operation, follow this sequence.
Classify the request into one of these six categories:
Extract key fields:
currency or currency listborrow/repay, query vs mutation)amount and repaid_all intentclassic / single_currency / multi_currency / portfolio)Pre-check order:
borrowable / transferable) for requested amountBefore every mutating call, provide an Action Draft first, then wait for explicit confirmation.
Required execution flow:
Required confirmation fields:
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):
Use only the minimal tool set required for the task:
get_unified_accountsget_unified_mode / set_unified_modeget_unified_borrowableget_unified_transferablecreate_unified_loanlist_unified_loan_records, list_unified_loan_interest_recordslist_unified_currencies, get_unified_estimate_rateget_user_leverage_currency_setting, set_user_leverage_currency_settingset_unified_collaterallist_currency_discount_tiersThe response must include:
totalInitialMarginRate / totalMaintenanceMarginRate) and include per-currency imr/mmr when present| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
## 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 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 |
gate-exchange-unified to borrow quote currency (Case 6)gate-exchange-spot to execute buy order with borrowed fundsgate-exchange-spot to liquidate target asset into quote currencygate-exchange-unified to repay outstanding loan (Case 9/10)