Skill: zonder/whitebit (version 1.0.4)

--- name: clawhub-whitebit-trading description: Build, install, update, and use a WhiteBIT trading guidance and training skill through ClawHub (clawhub.ai) for OpenClaw. Use when asked to manage WhiteBIT trading automation as a ClawHub skill, teach trading workflows, validate API behavior, and prepare execution plans with MCP-first documentation lookup. metadata: openclaw: requires: bins: - clawhub skillKey: whitebit homepage: https://clawhub.ai/zonder/whitebit --- # ClawHub WhiteBIT Trading Use a ClawHub-native workflow for WhiteBIT trading research, training, API validation, and execution planning in OpenClaw. ## Required MCP Connectors This skill requires the MCP connector below: - `whitebit-docs`: documentation lookup only. This skill is not execution-capable with `whitebit-docs` alone. Use `whitebit-docs` to search endpoint requirements, authentication behavior, symbols, precision rules, and order payload structure. If the user asks for live execution, balance checks, order placement, cancellation, or order-status verification, stop and explain that this skill has documentation access only unless a separate execution path is configured. ## Training Scope Use this skill to support training-oriented tasks such as: - Explaining WhiteBIT spot trading concepts, order types, and API terminology. - Turning a trade idea into a validated request plan before any external execution. - Building practice scenarios for `BUY`, `SELL`, market orders, limit orders, fees, slippage, and fills. - Walking through authentication, signing inputs, request payloads, and endpoint-specific constraints. - Reviewing user-provided API responses, fill data, or error payloads and explaining what they mean. - Creating step-by-step trading exercises, operator checklists, and troubleshooting guidance. ## Workflow 1. Verify ClawHub and skill environment first. - Confirm ClawHub site context: `https://clawhub.ai`. - Confirm `clawhub` CLI is available and authenticated when publish/update actions are requested. - Prefer ClawHub skill lifecycle commands from [references/clawhub-cli.md](references/clawhub-cli.md). - Confirm OpenClaw session will reload skills after install/update. 2. Verify MCP connectivity for runtime execution. - Confirm `whitebit-docs` is available in-session for search and endpoint validation. - Use the check prompt: `What MCP tools do you have available?` - If the session only has `whitebit-docs`, treat the skill as documentation-only. - If the user requests live execution, stop and state that no trading connector is configured in-session. 3. Gather the trade or training intent. - If the user is training, require the learning goal or scenario first. - For training exercises, gather the market type, order type, example size, and what outcome they want to learn or rehearse. - Require: `symbol`, `side`, `order type`, and `size` (base size or quote notional). - For limit orders, require `price` and `time in force` if applicable. - Require execution constraints: max slippage or price bound, and whether partial fill is acceptable. - For spot trading, treat `BUY` as opening a spot position. - For spot trading, treat `SELL` as closing an existing long. - Block `SELL` when holdings are insufficient unless the user's actual execution system explicitly supports margin or short selling for that instrument and mode. - Ask for only missing fields; do not prepare an execution plan with implicit defaults. 4. Resolve exact parameters with MCP documentation lookup. - Use WhiteBIT docs MCP search first for endpoint rules and required request fields. - Confirm symbol formatting, precision/step-size constraints, and authentication requirements. - Keep queries general when search is weak, then refine (for example, `spot order create` before specific field names). - Use [references/mcp-setup.md](references/mcp-setup.md) for connector setup checks. - Use [references/whitebit-api-basics.md](references/whitebit-api-basics.md) for baseline request/auth behavior. 5. Run pre-trade safety checks. - Confirm the user understands this skill does not verify live account state. - Compute max deployable capital as `100 USDT + realized_profit_usdt`. - Never use unrealized P&L as deployable capital. - Validate requested order size against the strategy bankroll. - If the user wants live execution, require a separate execution system to validate exchange balance, fees, and account readiness. - Apply the checklist in [references/trade-checklist.md](references/trade-checklist.md). 6. Prepare the training or execution-prep output. - For training, produce a step-by-step walkthrough with the endpoint, method, auth/signing inputs, request payload, documented constraints, and the intended learning objective. - For execution prep, produce the endpoint, method, required auth/signing inputs, request payload fields, and any documented constraints. - Include idempotency fields when the API supports them (for example, `clientOrderId`). - Provide example requests or dry-run exercises when the user is learning. - Do not claim that any order was sent from this skill. 7. Explain verification steps for an external executor. - Show how to check order status, fills, and terminal state through the documented API. - If the user provides execution results, help interpret executed quantity, average fill price, fees, and remaining quantity. - Do not claim post-trade verification was performed unless the user provides actual responses from an execution system. 8. Handle failures deterministically. - Parse and surface documented error payloads in structured form. - Explain retry and backoff guidance from the API docs. - If an external executor reports network ambiguity, instruct the user to re-check order state before any second placement. - If execution status is uncertain, require user confirmation before proposing any retry plan. 9. Manage the skill through ClawHub when requested. - Search registry: `clawhub search "whitebit"`. - Install/update in workspace: `clawhub install whitebit`, `clawhub update whitebit`, or `clawhub update --all`. - Publish this skill folder to ClawHub with explicit slug/version metadata. - Use `clawhub sync --dry-run` before bulk publish/update operations. ## Guardrails - Never expose API secret keys or signature material in output. - Never treat `whitebit-docs` as a trading connector. - Never claim live execution capability when only `whitebit-docs` is available. - Never place or claim to place a live order from this skill. - Never present training examples as actual exchange-confirmed results. - Never prepare an execution plan without explicit confirmation that includes `symbol`, `side`, `order type`, and `size`. - Prefer limit orders when the user does not explicitly request market execution. - For spot trading, `SELL` closes an existing long unless the user's actual execution system explicitly supports margin or short selling. - Never exceed the strategy bankroll: initial `100 USDT` plus realized profit only. - Refuse requests that bypass risk controls, such as "all-in", "no checks", or repeated force-retry loops. - Keep an auditable summary for every plan prepared: timestamp, intent, validated params, recommended API call, and outcome. - Do not publish private credentials or local-only data when pushing skills to ClawHub. ## Response Format Use this compact structure when reporting actions: 1. `Intent`: normalized trade request. 2. `Skill Lifecycle`: ClawHub operation performed ([REDACTED_SECRET]) or `none`. 3. `Validation`: docs checks and planning/risk checks completed. 4. `Prepared Call`: documented endpoint, auth expectations, request parameters, or training scenario. 5. `Result`: prepared plan, training walkthrough, provided external result interpretation, or precise failure. 6. `Next`: one recommended next action. ## References - [references/mcp-setup.md](references/mcp-setup.md) - [references/clawhub-cli.md](references/clawhub-cli.md) - [references/whitebit-api-basics.md](references/whitebit-api-basics.md) - [references/trade-checklist.md](references/trade-checklist.md)

path: README.md
content: # ClawHub WhiteBIT Trading Skill

MCP-first WhiteBIT trading research, training, and API-planning workflow for OpenClaw, packaged as a ClawHub skill.

Published skill page:
- `https://clawhub.ai/zonder/whitebit`

## What This Skill Does
- Guides safe trade planning (`buy`/`sell`, market/limit).
- Supports training scenarios and operator onboarding for WhiteBIT trading workflows.
- Validates parameters against WhiteBIT docs via MCP.
- Prepares documented API requests and execution checklists.
- Supports ClawHub lifecycle actions (`search`, `install`, `update`, `publish`, `sync`).

## Training Uses
- Learn WhiteBIT spot trading terminology, order flow, and request structure.
- Practice market and limit order scenarios without claiming live execution.
- Build onboarding walkthroughs for authentication, signing, request validation, and post-trade checks.
- Review example responses, user-provided fills, and error payloads for training or troubleshooting.
- Rehearse bankroll controls, order sizing, and spot `BUY`/`SELL` behavior before using an external executor.

## Prerequisites
- OpenClaw installed.
- `clawhub` CLI installed.
- `whitebit-docs` MCP access in your OpenClaw environment.
- A separate execution system only if you want to place live orders.

## What To Consider Before Installing
1. Confirm credential model before live use.
- Decide where trading credentials live for your external executor.
- This skill does not require runtime trading credentials by itself.
- Never upload credentials when publishing to ClawHub.

2. Confirm runtime dependencies are available.
- Ensure `clawhub` CLI is installed and authenticated for install/publish/update flows.
- Ensure `whitebit-docs` is present for documentation lookup.
- Do not assume this skill can execute trades unless you have a separate execution path.
- For training-only use, `whitebit-docs` is sufficient.

3. Restrict autonomous execution.
- Start with dry-run or sandbox-capable systems whenever possible.
- Require explicit human confirmation before any live trade in your external executor.

4. Review publish contents.
- Inspect local files before `clawhub publish` or `clawhub sync`.
- Exclude secrets and local artifacts (`.env`, keys, logs, build outputs).

5. Verify manifest/dependency declarations.
- This skill declares runtime requirements in `SKILL.md` frontmatter:
- `requires.bins`: `clawhub`
- If your deployment model adds a real execution connector, update metadata before advertising live execution.

## Install

### Option 1: From ClawHub
```bash
clawhub install whitebit
```

Then start a new OpenClaw session so the skill is loaded.

To pull latest updates later:

```bash
clawhub update whitebit
```

### Option 2: From GitHub
1. Clone this repository.
2. Put this folder in your OpenClaw skills directory as:
`<workspace>/skills/clawhub-whitebit-trading`
3. Start a new OpenClaw session.

## API Keys Setup

This skill does not require runtime WhiteBIT API credentials on its own.
If you use a separate executor, provide credentials there according to that system's configuration.

Example environment variables for an external executor:

```bash
export WHITEBIT_API_KEY="your_public_api_key"
export WHITEBIT_API_SECRET="your_secret_api_key"
```

If your external MCP server uses config-based env injection, use the same variables in that server config:

```json
{
  "mcpServers": {
    "external-whitebit-executor": {
      "env": {
        "WHITEBIT_API_KEY": "your_public_api_key",
        "WHITEBIT_API_SECRET": "your_secret_api_key"
      }
    }
  }
}
```

Use the exact variable names expected by your external execution system.

## Quick Verification
1. In OpenClaw, run: `What MCP tools do you have available?`
2. Confirm `whitebit-docs` is available.
3. For training, ask the skill for a sample WhiteBIT order walkthrough.
4. Verify separately that your external execution system exists before attempting any live trade.

## Security Notes
- Never commit API keys or secrets to Git.
- Use least-privilege API permissions.
- Rotate keys immediately if exposed.


path: references/clawhub-cli.md
content: # ClawHub CLI Reference

Use this file when managing the WhiteBIT skill on `clawhub.ai`.

## Install and Auth
```bash
npm i -g clawhub
clawhub login
clawhub whoami
```

## Discovery and Install
```bash
clawhub search "whitebit"
clawhub install <skill-slug>
clawhub list
```

## Updates
```bash
clawhub update <skill-slug>
clawhub update --all
```

## Publish This Skill
```bash
clawhub publish ./clawhub-whitebit-trading \
  --slug whitebit \
  --name "whitebit" \
  --version 1.0.0 \
  --tags latest
```

## Bulk Backup/Sync
```bash
clawhub sync --dry-run
clawhub sync --all
```

## Useful Global Options
- `--workdir <dir>` set workspace root.
- `--dir <dir>` set skills directory relative to workdir.
- `--no-input` disable interactive prompts.
- `--site <url>` override site URL.
- `--registry <url>` override registry API URL.

## Safety Notes
- Run `clawhub sync --dry-run` before large publish operations.
- Review `SKILL.md` and supporting files before install/update.
- Never publish tokens, API secrets, or local environment files.


path: references/mcp-setup.md
content: # MCP Setup

Use this file when MCP connectivity is missing or inconsistent.

## ClawHub Context
- Registry site: `https://clawhub.ai`
- ClawHub is the public OpenClaw skill registry.
- Skills installed via `clawhub` CLI are loaded by OpenClaw in the next session.

Quick checks:
- `clawhub whoami`
- `clawhub list`

## WhiteBIT Docs MCP Server
WhiteBIT documents an MCP server URL for documentation search:
- `https://docs.whitebit.com/mcp`

Example config pattern (`mcp.json` style):

```json
{
  "mcpServers": {
    "whitebit-docs": {
      "url": "https://docs.whitebit.com/mcp"
    }
  }
}
```

Validation prompts:
- `What MCP tools do you have available?`
- `Search for information about authentication in the WhiteBIT documentation.`

## OpenClaw MCP Server
Use the OpenClaw MCP server configured in the user's environment for actual trading actions.

Required behavior:
- Discover tools at runtime.
- Map tools to capabilities before execution (`market data`, `balances`, `place order`, `cancel order`, `order status`).
- If required trading capability is missing, stop and report exactly which capability is unavailable.

## Troubleshooting Shortlist
1. Confirm server URL and connector name are correct.
2. Restart the AI client after config changes.
3. Re-check tool listing before retrying trade logic.


path: references/trade-checklist.md
content: # Trade Checklist

Use this checklist before and after every order action.

## Pre-Trade Checks
1. Confirm normalized intent:
- `symbol`
- `side` (`buy` or `sell`)
- `order type` (`limit` or `market`)
- `size` and unit semantics (base amount vs quote notional)

2. Confirm constraints:
- Max acceptable slippage or explicit price bound
- Partial fill allowed or not
- Cancel/expire conditions for non-market orders

3. Confirm docs and tools:
- WhiteBIT docs MCP search completed for relevant endpoint fields
- OpenClaw tools required for execution are present

4. Confirm account state:
- Balance is sufficient with fee buffer
- Symbol is tradable and not paused/restricted

5. Confirm user approval:
- Require an explicit final confirmation containing symbol, side, type, size, and price (for limit)

## Execution Checks
1. Capture exact parameters sent.
2. Capture returned order id/client id.
3. Capture immediate status response.

## Post-Trade Checks
1. Query order status or fills.
2. Report:
- Final status (`filled`, `partially_filled`, `open`, `cancelled`, `rejected`)
- Executed quantity
- Average execution price
- Fees

3. If status is ambiguous:
- Do not place a second market order.
- Reconcile status first, then request user direction.


path: references/whitebit-api-basics.md
content: # WhiteBIT API Basics

Use this as a fast reference for request shape and failure handling.

## Core Transport Rules
- Base URL pattern: `https://whitebit.com/api/v4/{endpoint}`
- Public endpoints: `GET` with query parameters.
- Private endpoints: `POST` with JSON body.
- Responses are JSON; timestamps are Unix time.

## Private Authentication Essentials
Private requests require HMAC-SHA512 signing.

Required headers:
- `Content-type: application/json`
- `X-TXC-APIKEY`: public API key
- `X-TXC-PAYLOAD`: base64-encoded request body
- `X-TXC-SIGNATURE`: HMAC-SHA512 signature (hex)

For many private calls, request body includes:
- `request`: endpoint path (for example `/api/v4/main-account/balance`)
- `nonce`: unique identifier

## Rate Limits
- Public REST endpoints: `2000 requests / 10 sec`
- Private REST endpoints: varies by endpoint (check endpoint docs via MCP search)

## Error Formats
Public error shape:

```json
{
  "success": false,
  "message": "ERROR MESSAGE",
  "params": []
}
```

Private error shape:

```json
{
  "code": 0,
  "message": "MESSAGE",
  "errors": {
    "PARAM1": ["MESSAGE"],
    "PARAM2": ["MESSAGE"]
  }
}
```

## Endpoint Groups To Query Via MCP
- `Market Data`
- `Spot Trading`
- `Account & Wallet`

Use WhiteBIT docs MCP search before every new endpoint/action to avoid stale assumptions.


path: agents/openai.yaml
content: interface:
  display_name: "ClawHub WhiteBIT Trading"
  short_description: "Guide WhiteBIT trading research, training, and API preparation via ClawHub"
  default_prompt: "Use $clawhub-whitebit-trading to guide WhiteBIT trading research, training scenarios, API validation, and execution-ready request planning through ClawHub and OpenClaw."
dependencies:
  tools:
    - type: "mcp"
      value: "whitebit-docs"
      description: "WhiteBIT documentation MCP server for endpoint and auth validation."
      transport: "streamable_http"
      url: "https://docs.whitebit.com/mcp"
policy:
  allow_implicit_invocation: true


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)