gate-exchange-crossex
Gate CrossEx cross-exchange skill. Use when the user asks to trade or query positions across Gate, Binance, OKX, and Bybit simultaneously. Triggers on 'cross exchange', 'Binance order', 'OKX position'.
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 CrossEx Trading Suite
This skill is the unified entry point for Gate CrossEx cross-exchange trading. It supports lots of **core operations**:
order management, position query, and history query. User intents are routed to corresponding workflows.
## 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 cross-ex account get`
- `gate-cli cex cross-ex market fee`
- `gate-cli cex cross-ex market interest-rate`
- `gate-cli cex cross-ex position margin-leverage`
- `gate-cli cex cross-ex order get`
- `gate-cli cex cross-ex position leverage`
- `gate-cli cex cross-ex account book`
- `gate-cli cex cross-ex position adl-rank`
- `gate-cli cex cross-ex market discount-rate`
- `gate-cli cex cross-ex position margin-interests`
- `gate-cli cex cross-ex position margin-history`
- `gate-cli cex cross-ex order history`
- `gate-cli cex cross-ex position history`
- `gate-cli cex cross-ex order trades`
- `gate-cli cex cross-ex position margin-list`
- `gate-cli cex cross-ex order list`
- `gate-cli cex cross-ex position list`
- `gate-cli cex cross-ex market risk-limits`
- `gate-cli cex cross-ex market symbols`
- `gate-cli cex cross-ex market transfer-coins`
- `gate-cli cex cross-ex transfer list`
**Execution Operations (Write)**
- `gate-cli cex cross-ex order cancel`
- `gate-cli cex cross-ex position close`
- `gate-cli cex cross-ex convert create`
- `gate-cli cex cross-ex convert quote`
- `gate-cli cex cross-ex order create`
- `gate-cli cex cross-ex transfer create`
- `gate-cli cex cross-ex account update`
- `gate-cli cex cross-ex position set-margin-leverage`
- `gate-cli cex cross-ex order update`
- `gate-cli cex cross-ex position set-leverage`
### 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:** Crx:Write
- **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 this skill's CrossEx workflow.
- `SKILL.md` keeps route dispatch and feature boundaries.
- `references/gate-cli.md` is the authoritative `gate-cli` execution contract for query/mutation sequencing, confirmation gates, and risk-aware updates.
## Module Overview
| Module | Description | Trigger Keywords |
|---------------|-------------------------------------------------------------------------|-------------------------------------------------------------------------------|
| **Spot** | Limit/market buy/sell, cross-exchange arbitrage | `spot buy`, `spot sell`, `buy spot`, `sell spot` |
| **Margin** | Long/short trading, margin management, auto-borrowing | `margin long`, `margin short`, `long margin`, `short margin` |
| **Futures** | USDT perpetual contracts, dual-direction positions, leverage adjustment | `futures long`, `futures short`, `open long`, `open short` |
| **Transfer** | Cross-exchange fund transfer | `fund transfer`, `cross-exchange transfer`, `transfer`, `move funds` |
| **Convert** | Flash convert and conversion quote workflow | `convert trading`, `flash convert`, `convert`, `quote convert` |
| **Orders** | Query, cancel, amend orders, order history | `query orders`, `cancel order`, `amend order`, `order history`, `list orders` |
| **Positions** | Query all position types, history records | `query positions`, `check positions`, `position history`, `positions` |
| **History** | Query order/position/trade/interest history | `history query`, `trade history`, `interest history`, `history` |
## Routing Rules
| Intent | Example Phrases | Route To |
|-----------------------------|----------------------------------------------------------------------------------------------|---------------------------------------------|
| **Spot Trading** | "Buy 100 USDT worth of BTC", "Sell 0.5 BTC", "Market buy ETH spot" | Read `references/spot-trading.md` |
| **Margin Trading** | "Long 50 USDT worth of XRP on margin", "Short BTC on margin", "10x leverage long" | Read `references/margin-trading.md` |
| **Futures Trading** | "Open 1 BTC futures long position", "Market short ETH", "Adjust leverage to 20x" | Read `references/futures-trading.md` |
| **Cross-Exchange Transfer** | "Transfer 100 USDT from Gate to Binance", "Move ETH from OKX to Gate" | Read `references/transfer.md` |
| **Convert Trading** | "Flash convert 10 USDT to BTC", "Convert 50 USDT to ETH on Gate" | Read `references/convert-trading.md` |
| **Order Management** | "Query all open orders", "Cancel that buy order", "Amend order price", "Query order history" | Read `references/order-management.md` |
| **Position Query** | "Query all my positions", "Show futures positions", "Position history" | Read `references/position-query.md` |
| **History Query** | "Query trade history", "Position history", "Margin interest history", "Account ledger" | Read `references/history-query.md` |
| **Unclear** | "Show account" , "Help me" , "Please Check my account" | **Clarify**: Query account, then guide user |
## gate-cli command index
This skill uses the **CrossEx MCP toolset** with the cex_crx prefix as its only core tool family.
**Scope rule**: Only execute operations explicitly documented in this skill. Only call tools listed in the tables below
or in `references/*.md`. Tools or operations not mentioned here must not be called.
### Tool Naming Convention
- List operations in the cex_crx family query symbols, orders, positions, transfers, or history
- Get Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.