← 返回 Skills 市场
pcriadoperez

ccxt

作者 Pablo Criado-Perez · GitHub ↗ · v1.0.0
cross-platform ✓ 安全检测通过
1188
总下载
1
收藏
4
当前安装
1
版本数
在 OpenClaw 中安装
/install ccxt
功能描述
Interact with 100+ cryptocurrency exchanges — fetch markets, order books, tickers, place orders, check balances, and more using the CCXT CLI.
使用说明 (SKILL.md)

CCXT — Cryptocurrency Exchange Trading

You have access to the ccxt CLI tool which lets you interact with 100+ cryptocurrency exchanges (Binance, Bybit, OKX, Kraken, Coinbase, and many more). You can fetch market data, place orders, check balances, and stream live data.

Core Syntax

ccxt \x3Cexchange_id> \x3CmethodName> [args...] [options]

Before Calling Any Method

If you're unsure about the required arguments for a method, run:

ccxt explain \x3CmethodName>

This will show you the required and optional arguments with descriptions.

Available Options

Flag Purpose
--verbose Show raw request/response data
--sandbox Use testnet/sandbox environment
--raw Output clean JSON without formatting
--swap Target swap/perpetuals account
--future Target futures account
--spot Target spot account
--option Target options account
--param key=value Pass extra exchange-specific params (repeatable)
--no-keys Skip API key loading

Common Operations

Market Data (Public — No API Keys Required)

Fetch markets (list all trading pairs on an exchange):

ccxt \x3Cexchange> fetchMarkets --raw

Fetch a single ticker:

ccxt \x3Cexchange> fetchTicker "BTC/USDT" --raw

Fetch multiple tickers:

ccxt \x3Cexchange> fetchTickers --raw

Fetch order book:

ccxt \x3Cexchange> fetchOrderBook "BTC/USDT" --raw

Fetch OHLCV candles:

ccxt \x3Cexchange> fetchOHLCV "BTC/USDT" 1h undefined 10 --raw

Fetch recent trades:

ccxt \x3Cexchange> fetchTrades "BTC/USDT" --raw

Fetch exchange status:

ccxt \x3Cexchange> fetchStatus --raw

Fetch currencies:

ccxt \x3Cexchange> fetchCurrencies --raw

Trading (Private — Requires API Keys)

Create an order:

ccxt \x3Cexchange> createOrder "BTC/USDT" limit buy 0.001 50000 --raw
ccxt \x3Cexchange> createOrder "BTC/USDT" market buy 0.001 --raw

Create order with extra params:

ccxt \x3Cexchange> createOrder "BTC/USDT" limit buy 0.001 50000 --param stopPrice=49000 --raw

Cancel an order:

ccxt \x3Cexchange> cancelOrder "\x3Corder_id>" "BTC/USDT" --raw

Fetch open orders:

ccxt \x3Cexchange> fetchOpenOrders "BTC/USDT" --raw

Fetch closed orders:

ccxt \x3Cexchange> fetchClosedOrders "BTC/USDT" --raw

Fetch a specific order:

ccxt \x3Cexchange> fetchOrder "\x3Corder_id>" "BTC/USDT" --raw

Account (Private — Requires API Keys)

Fetch balance:

ccxt \x3Cexchange> fetchBalance --raw

Fetch balance for derivatives:

ccxt \x3Cexchange> fetchBalance --swap --raw

Fetch my trades:

ccxt \x3Cexchange> fetchMyTrades "BTC/USDT" --raw

Fetch positions (derivatives):

ccxt \x3Cexchange> fetchPositions --swap --raw

Fetch deposit address:

ccxt \x3Cexchange> fetchDepositAddress "BTC" --raw

Derivatives

Fetch funding rate:

ccxt \x3Cexchange> fetchFundingRate "BTC/USDT:USDT" --raw

Fetch funding rate history:

ccxt \x3Cexchange> fetchFundingRateHistory "BTC/USDT:USDT" --raw

Fetch mark price / index price:

ccxt \x3Cexchange> fetchMarkOHLCV "BTC/USDT:USDT" 1h --raw
ccxt \x3Cexchange> fetchIndexOHLCV "BTC/USDT:USDT" 1h --raw

Important Rules

  1. Always quote symbols that contain / or : — e.g., "BTC/USDT", "BTC/USDT:USDT".
  2. Use undefined as a positional placeholder to skip optional arguments while providing later ones. For example: ccxt binance fetchOHLCV "BTC/USDT" 1h undefined 10 skips since but provides limit.
  3. Use --raw when you need to parse the output programmatically or when the user needs clean JSON.
  4. Use --sandbox for testing with testnet environments. Always recommend sandbox mode when the user is experimenting with orders.
  5. ISO8601 datetimes (e.g., "2025-01-01T00:00:00Z") are auto-converted to milliseconds.
  6. API keys must be configured via environment variables (e.g., BINANCE_APIKEY, BINANCE_SECRET) or the config file. If a private method fails due to missing credentials, instruct the user to set them up.
  7. Derivatives symbols use the format "BASE/QUOTE:SETTLE" — e.g., "BTC/USDT:USDT" for USDT-margined perpetuals.
  8. Be careful with order methods — always confirm amounts and prices with the user before executing createOrder. The CLI executes immediately with no confirmation prompt.
  9. When the output is large (e.g., fetchMarkets returns hundreds of entries), consider piping through | head or filtering, or suggest the user narrows their query.
  10. For the list of supported exchanges, you can check: ccxt exchanges or refer to https://docs.ccxt.com.

Authentication Setup

Tell users to configure credentials in one of two ways:

Option 1 — Environment variables:

export BINANCE_APIKEY=your_api_key
export BINANCE_SECRET=your_secret

Option 2 — Config file (path shown in ccxt --help):

{
  "binance": {
    "apiKey": "your_api_key",
    "secret": "your_secret"
  }
}

Error Handling

  • If you get an AuthenticationError, the API keys are missing or invalid.
  • If you get an ExchangeNotAvailable or NetworkError, the exchange may be down or rate-limiting.
  • If you get an BadSymbol, the trading pair doesn't exist on that exchange — use fetchMarkets to check available pairs.
  • If you get an InsufficientFunds, the account doesn't have enough balance for the operation.
安全使用建议
This skill appears coherent for using the ccxt CLI. Before installing or using it: (1) verify the npm package (ccxt-cli) publisher and review the package page/source if possible; (2) avoid storing high-privilege API keys in plain env variables or config files — create API keys with least privilege (e.g., trading but no withdrawals) and prefer testnet keys for experimentation; (3) prefer using --sandbox when testing and always confirm amounts/prices before createOrder; (4) consider installing the ccxt-cli yourself rather than allowing automated installs, and inspect the installed package if you have security concerns.
功能分析
Type: OpenClaw Skill Name: ccxt Version: 1.0.0 The skill bundle provides an interface to the legitimate `ccxt` CLI tool for cryptocurrency exchange interactions. It transparently describes the necessity of API keys for private operations and instructs the AI agent to guide users on configuring them via environment variables or a config file. The `SKILL.md` includes explicit safety instructions for the agent, such as confirming order details with the user before executing trades. There is no evidence of intentional data exfiltration, malicious command execution, persistence mechanisms, or prompt injection designed to subvert the agent or steal data. The inherent risks are associated with using a financial trading tool, not with malicious design within the skill bundle itself.
能力评估
Purpose & Capability
Name/description match the declared binary and install (node package ccxt-cli that provides a ccxt CLI). No unrelated binaries, env vars, or config paths are requested.
Instruction Scope
SKILL.md stays on-topic: it documents ccxt CLI usage for public and private endpoints, how to provide API keys (env vars or config file), and cautions about confirming orders. It does not instruct reading unrelated system files or exfiltrating data. Note: private methods will perform real account actions if API keys with trading/withdrawal permissions are set; the instructions appropriately recommend sandbox/testing and manual confirmation before createOrder, but users should still be cautious.
Install Mechanism
Install uses the npm package ccxt-cli (creates the 'ccxt' binary). This is a common/expected mechanism for a CLI, but npm packages are third-party artifacts — install writes files to disk and runs code from the package registry. Verify package provenance (publisher, npm page, checksums) if you plan to install automatically.
Credentials
The skill declares no required env vars. The documentation explains how to supply exchange API keys (per-exchange APIKEY/SECRET or a config file), which is proportionate and expected for trading operations. No unrelated secrets are requested.
Persistence & Privilege
always is false and model-invocation is allowed (platform default). The skill does not request system-wide persistence, nor does it modify other skills' configs. Autonomous invocation is normal but remember the skill can execute commands that may place trades if given keys.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install ccxt
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /ccxt 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
First version using ccxt-cli
元数据
Slug ccxt
版本 1.0.0
许可证
累计安装 4
当前安装数 4
历史版本数 1
常见问题

ccxt 是什么?

Interact with 100+ cryptocurrency exchanges — fetch markets, order books, tickers, place orders, check balances, and more using the CCXT CLI. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1188 次。

如何安装 ccxt?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install ccxt」即可一键安装,无需额外配置。

ccxt 是免费的吗?

是的,ccxt 完全免费(开源免费),可自由下载、安装和使用。

ccxt 支持哪些平台?

ccxt 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 ccxt?

由 Pablo Criado-Perez(@pcriadoperez)开发并维护,当前版本 v1.0.0。

💬 留言讨论