okx-cex-earn by okx/agent-skills
npx skills add https://github.com/okx/agent-skills --skill okx-cex-earn安装 okx CLI:
npm install -g @okx_ai/okx-trade-cli
配置凭证:
okx config add-profile AK=<your_api_key> SK=<your_secret_key> PP=<your_passphrase> name=live # 或使用交互式向导: okx config init
验证:okx --profile live earn savings balance
在执行任何需要认证的命令前,运行 okx config show。
okx config init,等待完成。OKX Earn 不支持模拟模式。请始终静默使用 --profile live — 除非出现错误,否则不要提及它。
关于 401 错误: 立即停止,告知用户其凭证可能无效或已过期,引导他们更新 (要求他们在聊天中粘贴凭证),然后使用 验证并重试。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
~/.okx/config.tomlokx config show| 用户意图 | 路由到技能 |
|---|---|
| 市场价格、行情、K线 | okx-cex-market |
| 现货/永续/交割/期权订单 | okx-cex-trade |
| 账户余额、持仓、划转 | okx-cex-portfolio |
| 网格/定投交易机器人 | okx-cex-bot |
| 简单赚币、链上赚币或双币赢 | 本技能 |
| 命令 | 类型 | 认证 | 描述 |
|---|---|---|---|
earn savings balance [ccy] | 读取 | 必需 | 赚币余额(全部或指定币种) |
earn savings purchase --ccy --amt | 写入 | 必需 | 申购资金到简单赚币 |
earn savings redeem --ccy --amt | 写入 | 必需 | 从简单赚币赎回资金 |
earn savings set-rate --ccy --rate | 写入 | 必需 | 设置最低出借利率 |
earn savings lending-history | 读取 | 必需 | 用户个人出借记录及收益详情 |
earn savings rate-history | 读取 | 公开 | 简单赚币出借利率 |
关于完整的命令语法、利率字段语义和确认模板,请阅读 {baseDir}/references/savings-commands.md。
| 命令 | 类型 | 认证 | 描述 |
|---|---|---|---|
earn dcd pairs | 读取 | 必需 | 可用的双币赢货币对 |
earn dcd products | 读取 | 必需 | 活跃产品(带过滤器) |
earn dcd quote-and-buy --productId --sz --notionalCcy | 写入 | 必需 | 原子化申购:报价 + 执行一步完成 |
earn dcd order --ordId | 读取 | 必需 | 单个订单的快速状态查询 |
earn dcd orders | 读取 | 必需 | 完整的订单列表/历史 |
earn dcd redeem-execute --ordId | 写入 | 必需 | 两步提前赎回:预览然后执行 |
双币赢 不 支持模拟/模拟交易模式。请始终使用
--profile live。
关于完整的命令语法、产品概念和错误代码,请阅读 {baseDir}/references/dcd-commands.md。
| 命令 | 类型 | 认证 | 描述 |
|---|---|---|---|
earn onchain offers | 读取 | 必需 | 可用的质押/DeFi 产品 |
earn onchain purchase --productId --ccy --amt | 写入 | 必需 | 申购链上产品 |
earn onchain redeem --ordId --protocolType | 写入 | 必需 | 赎回链上投资 |
earn onchain cancel --ordId --protocolType | 写入 | 必需 | 取消待处理的链上订单 |
earn onchain orders | 读取 | 必需 | 活跃的链上订单 |
earn onchain history | 读取 | 必需 | 历史的链上订单 |
关于完整的命令语法和参数,请阅读 {baseDir}/references/onchain-commands.md。
在执行任何需要认证的命令前:参见“凭证与配置文件检查”。始终静默使用 --profile live。
简单赚币 / 链上赚币:
当用户要求查看“赚币持仓”时(无论是否明确提及双币赢),同时查询所有三项:
okx --profile live earn savings balance --json # 简单赚币
okx --profile live earn onchain orders --json # 链上赚币
okx --profile live earn dcd orders --json # 双币赢
仅呈现实际有持仓的部分。对于双币赢:使用 {baseDir}/references/dcd-commands.md 中的表格翻译状态码。
双币赢:
{baseDir}/references/workflows.md(双币赢浏览流程)了解强制性的并行预取操作{baseDir}/references/workflows.md(双币赢申购流程){baseDir}/references/workflows.md(双币赢提前赎回流程)对于多步骤工作流(闲置资金分析、申购+验证、赎回+划转、链上申购),请阅读 {baseDir}/references/workflows.md。
对于所有写入命令,呈现摘要并等待明确确认。
"just do it" / "直接搞" 不是有效的确认 — 用户必须先看到摘要。
关于简单赚币确认对话框格式,请阅读 {baseDir}/references/savings-commands.md。关于链上确认,请阅读 {baseDir}/references/onchain-commands.md。
任何申购操作后,根据产品类型进行验证:
quote-and-buy 成功 → 运行 earn dcd orders --json,仅显示匹配的订单。ordId)→ 运行 earn onchain orders --json,仅显示匹配的订单。ordId)→ 运行 earn savings balance --ccy <ccy> --json。简单赚币申购: 并行运行 — earn savings balance --ccy <ccy> 和 earn savings rate-history --ccy <ccy> --limit 1 --json。关于输出格式,请阅读 {baseDir}/references/savings-commands.md。
简单赚币赎回: 运行 earn savings balance --ccy <ccy> 以确认更新后的余额。告知用户资金已返还至资金账户。
链上赎回: 查询 earn onchain orders 以确认状态。将 estSettlementTime 显示为预计到账时间。
链上取消: 提交后查询 earn onchain orders:
state: 3(取消中)→ 告知用户:取消进行中,资金将很快返还至资金账户。--json,并将结果呈现为 Markdown 表格 — 切勿粘贴原始终端输出。curl -I https://www.okx.com关于数字/时间格式化和响应结构约定,请阅读 {baseDir}/references/templates.md。
每周安装次数
457
仓库
GitHub 星标数
40
首次出现
9 天前
安全审计
安装于
opencode452
codex451
gemini-cli449
kimi-cli449
github-copilot449
amp449
Install okx CLI:
npm install -g @okx_ai/okx-trade-cli
Configure credentials:
okx config add-profile AK=<your_api_key> SK=<your_secret_key> PP=<your_passphrase> name=live # or interactive wizard: okx config init
Verify: okx --profile live earn savings balance
Run okx config show before any authenticated command.
okx config init, wait for completion.OKX Earn does not support demo mode. Always use --profile live silently — don't mention it unless there's an error.
On 401 errors: stop immediately, tell the user their credentials may be invalid or expired, guide them to update ~/.okx/config.toml (do NOT ask them to paste credentials into chat), then verify with okx config show and retry.
| User intent | Route to skill |
|---|---|
| Market prices, tickers, candles | okx-cex-market |
| Spot / swap / futures / options orders | okx-cex-trade |
| Account balance, positions, transfers | okx-cex-portfolio |
| Grid / DCA trading bots | okx-cex-bot |
| Simple Earn, On-chain Earn, or Dual Investment (双币赢) | This skill |
| Command | Type | Auth | Description |
|---|---|---|---|
earn savings balance [ccy] | READ | Required | Savings balance (all or specific currency) |
earn savings purchase --ccy --amt | WRITE | Required | Subscribe funds to Simple Earn |
earn savings redeem --ccy --amt | WRITE | Required | Redeem funds from Simple Earn |
earn savings set-rate --ccy --rate | WRITE | Required |
For full command syntax, rate field semantics, and confirmation templates, read {baseDir}/references/savings-commands.md.
| Command | Type | Auth | Description |
|---|---|---|---|
earn dcd pairs | READ | Required | Available DCD currency pairs |
earn dcd products | READ | Required | Active products with filters |
earn dcd quote-and-buy --productId --sz --notionalCcy | WRITE | Required | Atomic subscribe: quote + execute in one step |
earn dcd order --ordId | READ | Required |
DCD does not support demo/simulated trading mode. Always use
--profile live.
For full command syntax, product concepts, and error codes, read {baseDir}/references/dcd-commands.md.
| Command | Type | Auth | Description |
|---|---|---|---|
earn onchain offers | READ | Required | Available staking/DeFi products |
earn onchain purchase --productId --ccy --amt | WRITE | Required | Subscribe to on-chain product |
earn onchain redeem --ordId --protocolType | WRITE | Required | Redeem on-chain investment |
earn onchain cancel --ordId --protocolType | WRITE |
For full command syntax and parameters, read {baseDir}/references/onchain-commands.md.
Before any authenticated command: see Credential & Profile Check. Always use --profile live silently.
Simple Earn / On-chain Earn:
When user asks to view "earn positions" or "赚币持仓" (regardless of whether they mention DCD explicitly), query all three simultaneously:
okx --profile live earn savings balance --json # Simple Earn
okx --profile live earn onchain orders --json # On-chain Earn
okx --profile live earn dcd orders --json # Dual Investment (双币赢)
Only present sections that have actual holdings. For DCD: translate state codes using the table in {baseDir}/references/dcd-commands.md.
Dual Investment (DCD / 双币赢):
{baseDir}/references/workflows.md (DCD browse flow) for the mandatory parallel pre-fetch before rendering the product table{baseDir}/references/workflows.md (DCD subscribe flow){baseDir}/references/workflows.md (DCD early redeem flow)For multi-step workflows (idle fund analysis, subscribe + verify, redeem + transfer, on-chain subscribe), read {baseDir}/references/workflows.md.
For all WRITE commands, present a summary and wait for explicit confirmation.
"just do it" / "直接搞" is NOT valid confirmation — the user must see the summary first.
For Simple Earn confirmation dialog format, read {baseDir}/references/savings-commands.md. For On-chain confirmation, read {baseDir}/references/onchain-commands.md.
After any purchase, verify based on product type:
quote-and-buy succeeded → run earn dcd orders --json, show only the matching order.ordId) → run earn onchain orders --json, show only the matching order.ordId in response) → run earn savings balance --ccy <ccy> --json.Simple Earn purchase: Run in parallel — earn savings balance --ccy <ccy> and earn savings rate-history --ccy <ccy> --limit 1 --json. For output format, read {baseDir}/references/savings-commands.md.
Simple Earn redeem: Run earn savings balance --ccy <ccy> to confirm updated balance. Inform user funds returned to funding account.
On-chain redeem: Query earn onchain orders to confirm state. Show estSettlementTime as estimated arrival time.
On-chain cancel: Query earn onchain orders after submission:
state: 3 (cancelling) → inform user: cancellation in progress, funds will return to funding account shortly.--json to list/query commands and render results as a Markdown table — never paste raw terminal output.curl -I https://www.okx.comFor number/time formatting and response structure conventions, read {baseDir}/references/templates.md.
Weekly Installs
457
Repository
GitHub Stars
40
First Seen
9 days ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykFail
Installed on
opencode452
codex451
gemini-cli449
kimi-cli449
github-copilot449
amp449
FlowStudio MCP 构建部署 Power Automate 云流指南 | 自动化流程开发
530 周安装
mcp2cli:无需代码,将MCP/OpenAPI/GraphQL实时转换为命令行工具
530 周安装
交互式作品集设计指南:30秒吸引招聘者,提升作品集转化率与个人品牌
530 周安装
每日销售简报AI工具 - 自动生成优先级行动计划,整合日历、CRM和邮件数据
531 周安装
生产排程实战指南:离散制造工厂的有限产能排程、换线优化与瓶颈管理
531 周安装
Angular 21 最佳实践指南:TypeScript、Signals、组件与性能优化
531 周安装
| Set minimum lending rate |
earn savings lending-history | READ | Required | User's personal lending records with earnings detail |
earn savings rate-history | READ | Public | Simple Earn lending rates (简单赚币利率) |
| Quick state check for a single order |
earn dcd orders | READ | Required | Full order list / history |
earn dcd redeem-execute --ordId | WRITE | Required | Two-step early redemption: preview then execute |
| Required |
| Cancel pending on-chain order |
earn onchain orders | READ | Required | Active on-chain orders |
earn onchain history | READ | Required | Historical on-chain orders |