Claude
Skills
Sign in
Back

gate-exchange-assets-manager

Included with Lifetime
$97 forever

Gate multi-account asset manager L2 skill. Use when the user asks to check total assets combined with margin/liquidation risk or earnings snapshots. Triggers on 'total assets', 'margin check', 'liquidation risk', 'earn interest', 'staking rewards', 'affiliate commissions', 'borrow USDT', 'add margin', 'set collateral'.

General

What this skill does


### 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`](https://github.com/gate/gate-skills/blob/master/skills/exchange-runtime-rules.md) §4 (or [`gate-runtime-rules.md`](https://github.com/gate/gate-skills/blob/master/skills/gate-runtime-rules.md) §4).


# Gate Account and Asset Manager

This is an L2 composite skill that orchestrates 58 deduplicated MCP tool calls (54 read + 4 write) across 7 L1 skills. It provides a unified entry point for account and asset overview, margin and liquidation risk assessment, SimpleEarn and staking earnings snapshots, affiliate commission queries, and unified-account write operations (borrowing, collateral, leverage settings).
This skill is intended for users aged 18 or above with full civil capacity.

## 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 [gate-runtime-rules.md](https://github.com/gate/gate-skills/blob/master/skills/gate-runtime-rules.md)
- **Only use the `gate-cli` commands 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 alpha account balances`
- `gate-cli cex alpha market currencies`
- `gate-cli cex alpha market tickers`
- `gate-cli cex alpha market tokens`
- `gate-cli cex earn staking assets`
- `gate-cli cex earn staking awards`
- `gate-cli cex earn staking find`
- `gate-cli cex earn uni currency`
- `gate-cli cex earn uni interest`
- `gate-cli cex earn dual balance`
- `gate-cli cex earn dual orders`
- cex_earn_list_structured_orders
- `gate-cli cex earn uni currencies`
- `gate-cli cex earn uni rate`
- `gate-cli cex earn uni lends`
- `gate-cli cex earn staking orders`
- `gate-cli cex futures account get`
- `gate-cli cex futures market candlesticks`
- `gate-cli cex futures market contract`
- `gate-cli cex futures market funding-rate`
- `gate-cli cex futures market orderbook`
- `gate-cli cex futures market premium`
- `gate-cli cex futures market tickers`
- `gate-cli cex futures market trades`
- `gate-cli cex futures market liquidations`
- `gate-cli cex futures position list`
- `gate-cli cex margin account list`
- `gate-cli cex options account get`
- `gate-cli cex rebate broker commissions`
- `gate-cli cex rebate broker transactions`
- `gate-cli cex rebate partner commissions`
- `gate-cli cex rebate partner sub-list`
- `gate-cli cex rebate partner transactions`
- `gate-cli cex rebate user-info`
- `gate-cli cex rebate sub-relation`
- `gate-cli cex spot account get`
- `gate-cli cex spot market candlesticks`
- `gate-cli cex spot market orderbook`
- `gate-cli cex spot market tickers`
- `gate-cli cex spot market trades`
- `gate-cli cex spot account book`
- `gate-cli cex tradfi account assets`
- `gate-cli cex unified account get`
- `gate-cli cex unified query borrowable`
- `gate-cli cex unified query estimate-rate`
- `gate-cli cex unified mode get`
- `gate-cli cex unified query transferable`
- `gate-cli cex unified config leverage-get`
- `gate-cli cex unified config discount-tiers`
- `gate-cli cex unified account currencies`
- `gate-cli cex unified loan interest`
- `gate-cli cex unified loan records`
- `gate-cli cex wallet balance total`

**Execution Operations (Write)**

- `gate-cli cex unified loan create`
- `gate-cli cex unified config collateral`
- `gate-cli cex unified mode set`
- `gate-cli cex unified config leverage-set`

### Authentication
- **Interactive file setup:** when **`GATE_API_KEY`** and **`GATE_API_SECRET`** are **not** both set on the host, run **`gate-cli config init`** to complete the wizard for API key, secret, profiles, and defaults (see [gate-cli](https://github.com/gate/gate-cli)).
- **Env / flags:** **`gate-cli config init`** is **not** required when credentials are already supplied — e.g. **both** **`GATE_API_KEY`** and **`GATE_API_SECRET`** set on the host, or **`--api-key`** / **`--api-secret`** where supported — never ask the user to paste secrets into chat.
- **Permissions:** Alpha:Read, Earn:Read, Fx:Read, Margin:Read, Options:Read, Rebate:Read, Spot:Read, Tradfi:Read, Unified:Write, Wallet:Read
- **Portal:** create or rotate keys outside the chat: https://www.gate.com/myaccount/profile/api-key/manage

### Installation Check
- **Required:** `gate-cli` (run `sh ./setup.sh` from this skill directory if missing; optional `GATE_CLI_SETUP_MODE=release`).
- Add `$HOME/.openclaw/skills/bin` to **`PATH`** if you invoke `gate-cli` by name (or the directory where [`setup.sh`](./setup.sh) installs it).
- **Credentials:** When **`GATE_API_KEY`** and **`GATE_API_SECRET`** are both set (non-empty) for the host, **do not** require **`gate-cli config init`** — that is equivalent valid config for `gate-cli`. When **both** are unset or empty, **remind** the operator to run **`gate-cli config init`** **or** to configure **`GATE_API_KEY`** / **`GATE_API_SECRET`** in 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 --version`** or a read-only **`gate-cli cex ...`** command from this skill); confirm credentials resolve before mutating operations.

## Execution mode

**Read and strictly follow** [`references/gate-cli.md`](./references/gate-cli.md), then execute module routing in this skill.

- `SKILL.md` keeps orchestration/routing logic across account domains.
- `references/gate-cli.md` is the authoritative `gate-cli` execution contract for module aggregation, partial degradation strategy, and unified mutation safeguards.

## Sub-Modules

| Module | L1 Source | Tool Count | Read/Write | Purpose |
|--------|-----------|------------|------------|---------|
| S1 Assets / Overview | gate-exchange-assets, gate-exchange-alpha | 10+ | Read only | Multi-account balance panorama |
| S2 Risk / Margin | gate-exchange-unified, gate-exchange-marketanalysis | 6+ | Read only | Margin ratio, liquidation price, unrealised PnL |
| S3 Earn / Yield | gate-exchange-simpleearn, gate-exchange-staking | 4 | Read only | Current SimpleEarn and staking position/interest snapshots |
| S4 Affiliate / Rebate | gate-exchange-affiliate | 7 | Read only | Rebate user info (may be empty), partner commissions history, sub-relations |
| S5 Borrow / Transfer (Write) | gate-exchange-unified | 6 | 2 Read + 4 Write | Borrow, set collateral, set leverage, switch mode |

Note: TradFi tools (from gate-exchange-tradfi, 10 read tools) are all read-only and used for asset inventory queries. They are included in the deduplicated 58-tool count but not listed as a separate L1 module in the sub-module table above.

## Routing Rules

### Design Principle

User queries often span multiple dimensions (e.g. "check my earn interest and will I get liquidated" covers S3 and S2). Instead of forcing single-intent classification, this skill uses **signal overlay**: each of 5 signal dimensions is independently detected from the query, and the activated dimensions contribute their respective tool sets. The final tool set is the union of all activated signals, deduplicated before execution.

### Signal Dimension Definitions

| Signal | Dimension | Trigger Condition | Trigger Keywords | Tool Subset |
|--------|-----------|-------------------|------------------|-------------|
| S1 | Assets / Overview | User asks about overall assets, multi-account balances, asset inventory; also covers read-only borrowable/rate inquiry (no execution intent) and transferable limit snapshots | assets, balance, account, how m

Related in General