TopRank Skills

Home / Claw Skills / Data Analysis / Okx Trader
Official OpenClaw rules 36%

Okx Trader

OKX Trader Skill

Stars

0

Installs

0

Status

ACTIVE

Visibility

PUBLIC

安装方式

直接复制以下提示词,发送给你的 AI 助手即可完成安装。

请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 Okx Trader 技能。 若已安装,则直接安装 Okx Trader 技能。

Overview

Skill Key
esojourn/okx-trader
Author
esojourn
Source Repo
openclaw/skills
Version
-
Source Path
skills/esojourn/okx-trader
Latest Commit SHA
d51665dfbdf477b7273415231f3442942d193913

Extracted Content

SKILL.md excerpt

# OKX Trader Skill

A professional-grade automated trading agent skill for OKX. This skill enables the AI agent to manage grid trading strategies, monitor account performance, and handle market execution with built-in safety protocols.

## System Capabilities

### 1. Dual-Grid Execution
The agent operates two concurrent strategies:
- **Macro Grid (Main):** Heavy positions for capturing major trend movements.
- **Micro Grid:** High-frequency scalp positions for extracting profit from minor volatility.

Supports multiple instruments (e.g., BTC-USDT, ETH-USDT) via named configurations in `grid_settings.json`.

### 2. Auto-Trailing (Rescale) Logic
The skill automatically detects when the market price drifts outside the active grid range. It performs a "Rescale" operation:
- Cancels all legacy orders associated with the bot.
- Recalculates and re-centers the grid layout based on the current market ticker.
- Persists new range settings to `grid_settings.json`.

### 3. Risk Management & Protection
- **Cost Basis Guard:** Prevents the agent from placing sell orders below the average entry price (including a minimum profit buffer).
- **Inventory Control:** Respects `maxPosition` limits to prevent over-leveraging during extended downtrends.
- **Order Throttling:** Built-in delays and batch execution to prevent rate-limiting and improve efficiency.

## Available Tools

### `okx_report`
Generates a highly condensed PnL and status report. Automatically detects all configured instruments from `grid_settings.json` and reports per-grid statistics.

### `okx_grid_maintain`
The core execution tool that maintains the grid structure. Supports any number of grid configurations (e.g., `main`, `micro`, `eth_micro`).

### `okx_snapshot`
Records a daily account snapshot including balances, prices, 24h trading summary, and day-over-day equity comparison. Data is saved to `okx_data/snapshots/YYYY-MM-DD.json`.

## Internal Dependencies
Requires the following local files in `/root/.openclaw/wor...

README excerpt

# OKX Trader Skill

[![ClawHub](https://img.shields.io/badge/ClawHub-okx--trader-blue)](https://clawhub.ai/esojourn/okx-trader)

Professional automated grid trading system for OKX, designed for OpenClaw.

## Trading Logic

The bot implements a **Dynamic Symmetric Grid** strategy:

1.  **Maintenance:** Every 5 minutes, the bot compares current market price against planned grid levels. If a level is missing an order, it places a new limit order.
2.  **Rescale:** If the price moves beyond the `trailingPercent` threshold of the current range, the bot cancels all orders and re-centers the grid around the new price.
3.  **Profit Taking:** Sell orders are only placed if they meet the `minProfitGap` requirement relative to the average position cost (for Micro grid).

## Account Snapshots

`scripts/snapshot.js` records daily account state (balances, prices, 24h trading summary) and compares equity changes against the previous day. Data is saved to `okx_data/snapshots/YYYY-MM-DD.json`.

## Configuration

Files should be placed in `/root/.openclaw/workspace/okx_data/`:

### `config.json`
```json
{
  "apiKey": "YOUR_API_KEY",
  "secretKey": "YOUR_SECRET_KEY",
  "passphrase": "YOUR_PASSPHRASE",
  "isSimulation": true
}
```

### `grid_settings.json`
Supports multiple named configurations (e.g., `main`, `micro`, `eth_micro`) for different instruments and strategies.

## Environment Variables

- `OKX_API_KEY`
- `OKX_SECRET_KEY`
- `OKX_PASSPHRASE`
- `OKX_IS_SIMULATION` (default: false)

## Disclaimer

This software is for educational purposes only. Do not trade money you cannot afford to lose.

---

# OKX Trader Skill (中文说明)

专为 OpenClaw 设计的 OKX 专业自动化网格交易系统。

## 交易逻辑

机器人执行**动态对称网格**策略:

1.  **定期维护:** 每5分钟,机器人对比当前市价与计划网格水位。如果某个水位缺失订单,则下达新的限价单。
2.  **自动移动:** 如果价格超出当前区间设定的偏移阈值,机器人将取消所有订单,并以新价格为中心重置网格。
3.  **止盈保护:** (针对小网格)卖单仅在满足相对于持仓均...

Related Claw Skills