← Back to Skills Marketplace
esojourn

OKX Trader

by esojourn · GitHub ↗ · v1.2.0
cross-platform ✓ Security Clean
2510
Downloads
4
Stars
14
Active Installs
6
Versions
Install in OpenClaw
/install okx-trader
Description
Automated OKX trading skill with dual-grid strategies, auto-rescaling, and risk controls for managing orders and monitoring account performance.
Usage Guidance
This package appears to implement what it claims (an OKX grid trading bot) and asks for the expected OKX API keys. Before enabling or running it: 1) Use a dedicated test account and set OKX_IS_SIMULATION=true to confirm behavior; do not use main funds until you’ve tested. 2) Create API keys with the minimal required permissions (enable Trade only; explicitly disable Withdrawals). 3) Inspect and back up grid_settings.json and config.json: the bot will rewrite grid_settings.json during rescale. 4) Review cronTemplates/schedule: the package includes scheduled tasks (5-min maintenance, hourly report, daily snapshot) — disable or adjust schedules if you do not want automatic runs. 5) Confirm how the platform supplies environment variables (the package metadata and the registry summary disagree about required env vars). 6) Consider running the code in an isolated environment and monitoring API activity / logs; rotate keys after testing. If you are not comfortable reviewing or running code that can place/cancel real orders automatically, do not install this skill or restrict it to simulation-only accounts.
Capability Analysis
Package: okx-trader (mcp) Version: 1.2.0 Description: Professional OKX grid trading system with multi-instrument support, dual-layer strategy, automated trailing logic, and daily account snapshots. The `okx-trader` package implements an automated grid trading system for the OKX exchange. The code correctly utilizes the OKX API for market data, order management, and account information. API keys are handled via environment variables or a local configuration file, and all network communication is directed to the legitimate `www.okx.com` domain. The package includes features such as dynamic grid maintenance, auto-rescaling, daily account snapshots, and trading reports. Crucially, it incorporates risk management features like simulation mode, position limits, and profit protection logic. File system operations are confined to reading its own configuration files and writing logs and snapshots to designated data directories within the expected OpenClaw workspace. The documentation explicitly warns users about trading risks and recommends disabling withdrawal permissions for API keys. No malicious activities such as unauthorized data exfiltration, arbitrary command execution, or interaction with suspicious domains were identified.
Capability Assessment
Purpose & Capability
The skill's name, README, SKILL.md, scripts, and lib/okx-client.js consistently implement an OKX grid trading agent and legitimately require OKX API credentials and local config files. However, the provided registry summary at the top of the package metadata (which listed 'Required env vars: none') conflicts with the included skill.json/README/SKILL.md that declare OKX API env vars and node as a required binary. This appears to be a packaging/metadata mismatch rather than a capability mismatch.
Instruction Scope
The SKILL.md and scripts instruct the agent to read and write local files under /root/.openclaw/workspace/okx_data (config.json, grid_settings.json, logs, snapshots) and to call OKX API endpoints for market data, orders, fills, and balances. These actions are within the stated purpose. Important runtime effects: the bot will perform real trades (unless OKX_IS_SIMULATION=true), can cancel/place orders, and will persist rescaled grid settings to grid_settings.json and append audit/snapshot files. There are no instructions to read unrelated system config or exfiltrate data to third-party endpoints.
Install Mechanism
No external install/download step is present; the package is delivered as code files. There are no external URLs, archive extracts, or third-party installers in the manifest. This is lower-risk from an install mechanics perspective.
Credentials
The skill requires OKX API key, secret, passphrase and an OKX_IS_SIMULATION flag (declared in skill.json and used as fallbacks in code). Those credentials are necessary and proportionate for a trading bot. The code reads creds from config.json or environment variables, which matches the declared envs. The only proportionality concern is the earlier metadata mismatch that omitted these required env vars — verify what the platform will actually request or provide when enabling the skill.
Persistence & Privilege
The skill does not request always:true and does not modify other skills. It persists state under /root/.openclaw/workspace/okx_data by updating grid_settings.json, writing audit logs, and saving daily snapshots. The manifest also includes cronTemplates for scheduled autonomous runs (every 5 minutes and hourly/daily tasks). Combined with normal autonomous invocation, this means the skill can place/cancel orders on a schedule — a normal behavior for a trading bot but operationally impactful if run against live funds.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install okx-trader
  3. After installation, invoke the skill by name or use /okx-trader
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.2.0
Multi-instrument support (e.g. ETH-USDT), daily account snapshot tool, dynamic report generation from grid_settings.json
v1.1.2
Security & Metadata optimization: Removed unused binary dependencies (curl, jq, openssl). Restructured documentation to place English content above Chinese for better review compatibility. Simplified metadata to match actual code requirements.
v1.1.1
Metadata alignment: Fixed inconsistent env/bin declarations. Documentation: Added comprehensive English/Chinese bilingual README and SKILL.md. Detailed trading logic explanation.
v1.1.0
Performance optimization: Batch API requests, path normalization, and folder structure cleanup.
v1.0.1
- Removed obsolete files: _meta.json and balance.sh. - No changes to features or functionality. - Internal metadata and balance script cleanup for improved maintainability.
v1.0.0
# OKX-Trader Skill for OpenClaw A professional-grade automated trading skill for OpenClaw, specifically optimized for the OKX exchange. It provides a robust, dual-strategy grid trading system with built-in risk management and high-efficiency reporting. ## 🌟 Core Concepts: The Dual-Grid Strategy This skill is designed with a **Macro + Micro** dual-layer approach to maximize market coverage: 1. **Macro Grid (0.0020 BTC Base):** * **Purpose:** Long-term accumulation and capital growth. * **Logic:** Larger position sizes designed to capture significant market moves and maintain a core position during bullish trends. 2. **Micro Grid (0.0003 BTC Scalper):** * **Purpose:** High-frequency cash flow and activity. * **Logic:** Small, agile positions that scalp minor price fluctuations (0.1% - 0.5%) to generate consistent small profits even in sideways markets. ## 🛠 Trading Logic & Protections * **Auto-Trailing (Rescale):** The system monitors the price 24/7. If the market moves beyond the active grid range, it automatically cancels old orders and "re-centers" the grid around the new price. * **Cost Protection:** Built-in logic prevents the bot from selling below your average cost basis plus a minimum profit margin, avoiding "selling at a loss" during dips. * **Overload Protection:** You can define a `maxPosition` limit. Once reached, the bot will stop buying and wait for recovery to protect your account balance. * **Efficiency:** Formatted output is optimized for AI agents, using minimal tokens for reporting and status checks. ## 🚀 Getting Started ### 1. Installation ```bash openclaw skill install okx-trader ``` ### 2. Configuration Add your API credentials to your `openclaw.json`. Ensure your API key has **Trade** and **Read** permissions enabled. ```json "skills": { "entries": { "okx": { "apiKey": "YOUR_API_KEY", "secretKey": "YOUR_SECRET_KEY", "passphrase": "YOUR_PASSPHRASE", "isSimulation": false } } } ``` ### 3. Automated Tasks (Cron) We recommend setting up two Cron jobs: - `okx_grid_maintain`: Every 5 minutes (Silent mode). - `okx_report`: Every hour (Announce mode). --- # OKX-Trader 交易技能 (OpenClaw) 这是一个为 OpenClaw 设计的专业级自动化交易技能,专门针对 OKX 交易所进行了优化。它提供了一套稳健的“双层网格”交易系统,内置风险控制和高效率的报表功能。 ## 🌟 核心理念:双重网格策略 本技能采用 **大网格 (Macro) + 小网格 (Micro)** 的双层架构,旨在全方位捕捉市场机会: 1. **大网格 (0.0020 BTC 底仓):** * **设计目的**:长期积累与资产增值。 * **交易逻辑**:较大的单笔仓位,旨在捕捉市场的主流波段,在趋势行情中维持核心底仓并获取大额利润。 2. **小网格 (0.0003 BTC 高频):** * **设计目的**:维持现金流与账户活跃度。 * **交易逻辑**:极小的单笔仓位,灵活捕捉 0.1% - 0.5% 的细微波动。即使在横盘震荡行情中,也能通过频繁成交贡献持续的小额收益。 ## 🛠 交易逻辑与保护机制 * **自动追踪 (Rescale)**:系统 24/7 监控价格。一旦价格偏离当前网格有效范围,脚本会自动撤销旧单并在新价格中心重新铺设网格,确保策略永不踏空。 * **成本保护**:内置成本校验逻辑。当价格处于成本价以下时,系统将拒绝执行任何导致亏损的卖出操作,确保每一笔配对成交都是盈利的。 * **过载保护**:可配置 `maxPosition` 最大持仓限制。达到上限后系统将自动停止买入补仓,保护账户资金安全。 * **AI 友好**:报表输出经过极简化设计,在保证信息完整的条件下,将 Token 消耗降至最低。 ## 🚀 快速开始 ### 1. 安装 ```bash openclaw skill install okx-trader ``` ### 2. 配置 在您的 `openclaw.json` 中添加 API 信息(建议仅开启“交易”与“读取”权限): ```json "skills": { "entries": { "okx": { "apiKey": "你的APIKEY", "secretKey": "你的SECRET", "passphrase": "你的口令", "isSimulation": false } } } ``` ### 3. 自动化任务建议 建议在 OpenClaw 中配置以下 Cron: - `okx_grid_maintain`: 每 5 分钟执行一次,用于维护挂单。 - `okx_report`: 每小时执行一次,用于推送收益报表。 ## 📄 License MIT
Metadata
Slug okx-trader
Version 1.2.0
License
All-time Installs 14
Active Installs 14
Total Versions 6
Frequently Asked Questions

What is OKX Trader?

Automated OKX trading skill with dual-grid strategies, auto-rescaling, and risk controls for managing orders and monitoring account performance. It is an AI Agent Skill for Claude Code / OpenClaw, with 2510 downloads so far.

How do I install OKX Trader?

Run "/install okx-trader" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is OKX Trader free?

Yes, OKX Trader is completely free (open-source). You can download, install and use it at no cost.

Which platforms does OKX Trader support?

OKX Trader is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created OKX Trader?

It is built and maintained by esojourn (@esojourn); the current version is v1.2.0.

💬 Comments