okx-cex-earn

okx/agent-skills

Управление Simple Earn, Flash Earn, On-chain Earn и Dual Investment на OKX через CLI.

Звёзды201
Форки29
Авторokx
Обновлённоя 13 2026

Установка

SKILL.md

OKX CEX Earn CLI

Preflight

Before running any command, follow ../_shared/preflight.md. Use metadata.version from this file's frontmatter as the reference for Step 2.

Prerequisites

  1. Install okx CLI:<!-- -->
    npm install -g @okx_ai/okx-trade-cli
    
  2. Configure credentials:<!-- -->
    okx config init   # select site -> follow browser OAuth flow
    
  3. Verify: okx earn savings balance

Security: NEVER accept credentials in chat. Guide users to okx config init for setup.


Credential & Profile Check

Run both commands before any authenticated command — the apiKey field from okx auth status --json is the auth-binary's internal state and is always false regardless of whether ~/.okx/config.toml has an API-key profile. okx config show --json is the only authoritative source for API-key presence. The auth method is detected during preflight Step 2 and remembered for the session.

okx config show --json      # reveals API-key profiles (TOML config)
okx auth status --json      # reveals OAuth session state (auth-binary state)

Apply in this order — first match wins:

  • config show --json has any profile with a non-empty api_key field → API Key mode. Proceed.
  • No API-key profile AND auth status --json returns "status":"logged_in" → OAuth mode. Proceed.
  • No API-key profile AND "status":"pending" — login is in progress, wait for it to complete.
  • No API-key profile AND "status":"not_logged_in" — stop, load okx-cex-auth skill and follow login steps, wait for completion.

OKX Earn does not support demo mode. Always use live mode silently — don't mention it unless there's an error.

  • API Key users: use --profile <live-profile> (the profile without demo=true).
  • OAuth users: no flag needed (live is the default).

On authentication errors (401 / "Session expired" / "Run okx auth login first"): stop immediately, load okx-cex-auth skill and follow re-authentication steps, then retry.


Skill Routing

User intentRoute to skill
Market prices, tickers, candlesokx-cex-market
Spot / swap / futures / options ordersokx-cex-trade
Account balance, positions, transfersokx-cex-portfolio
Grid / DCA trading botsokx-cex-bot
Simple Earn, Flash Earn, On-chain Earn, Dual Investment (双币赢), or AutoEarn (自动赚币)This skill

Command Index

earn savings — Simple Earn (10 commands)

CommandTypeAuthDescription
earn savings balance [ccy]READRequiredSavings balance (all or specific currency). Also fetch fixed-term orders for a complete picture.
earn savings purchase --ccy --amt [--rate]WRITERequiredSubscribe funds to Simple Earn (活期)
earn savings redeem --ccy --amtWRITERequiredRedeem funds from Simple Earn (活期)
earn savings set-rate --ccy --rateWRITERequiredSet minimum lending rate
earn savings lending-historyREADRequiredUser's personal lending records with earnings detail
earn savings rate-historyREADRequiredSimple Earn lending rates and fixed-term offers (require auth)
earn savings fixed-products [--ccy]READRequiredBrowse available fixed-term (定期) products with APR, term, remaining quota, and sold-out status
earn savings fixed-orders [--ccy] [--state]READRequiredQuery fixed-term (定期) orders. States: pending/earning/expired/settled/cancelled
earn savings fixed-purchase --ccy --amt --term [--confirm]WRITERequiredSubscribe to Simple Earn Fixed (定期). Without --confirm: preview only
earn savings fixed-redeem --reqId <reqId>WRITERequiredRedeem a fixed-term order (full amount). Only pending state orders can be redeemed early

For full command syntax, rate field semantics, and confirmation templates, read {baseDir}/references/savings-commands.md.

earn dcd — Dual Investment / 双币赢 (6 commands)

CommandTypeAuthDescription
earn dcd pairsREADRequiredAvailable DCD currency pairs
earn dcd productsREADRequiredActive products with filters
earn dcd quote-and-buy --productId --sz --notionalCcyWRITERequiredAtomic subscribe: quote + execute in one step
earn dcd order --ordIdREADRequiredQuick state check for a single order
earn dcd ordersREADRequiredFull order list / history
earn dcd redeem-execute --ordIdWRITERequiredTwo-step early redemption: preview then execute

DCD does not support demo/simulated trading mode. Always use live mode (API Key: --profile <live-profile>; OAuth: no flag needed).

For full command syntax, product concepts, and error codes, read {baseDir}/references/dcd-commands.md.

earn onchain — On-chain Earn (6 commands)

CommandTypeAuthDescription
earn onchain offersREADRequiredAvailable staking/DeFi products
earn onchain purchase --productId --ccy --amtWRITERequiredSubscribe to on-chain product
earn onchain redeem --ordId --protocolTypeWRITERequiredRedeem on-chain investment
earn onchain cancel --ordId --protocolTypeWRITERequiredCancel pending on-chain order
earn onchain ordersREADRequiredActive on-chain orders
earn onchain historyREADRequiredHistorical on-chain orders

For full command syntax and parameters, read {baseDir}/references/onchain-commands.md.

earn auto-earn — AutoEarn / 自动赚币 (3 commands)

CommandTypeAuthDescription
earn auto-earn status [CCY]READRequiredQuery currencies supporting auto-earn and their status
earn auto-earn on <CCY>WRITERequiredEnable auto-earn for a currency
earn auto-earn off <CCY>WRITERequiredDisable auto-earn for a currency

24h restriction: Cannot disable within 24 hours of enabling (API hard limit). Always warn user before enabling.

For full command syntax, earnType inference rules, and MCP tool reference, read {baseDir}/references/autoearn-commands.md.

earn flash-earn — Flash Earn / 闪赚 (1 command)

CommandTypeAuthDescription
earn flash-earn projects [--status <0|100|0,100>]READRequiredBrowse Flash Earn projects by status. 0=upcoming, 100=in-progress, default is both

Operation Flow

Step 0 — Credential & Profile Check

Before any authenticated command: see Credential & Profile Check. Always use live mode silently.

Step 1 — Identify earn intent

Simple Earn Flexible (活期):

  • Query balance / history / rates → READ command, proceed directly.
  • Subscribe / redeem / set-rate → WRITE command, go to Step 2.

Simple Earn Fixed (定期):

  • Browse available products / check quota → earn savings fixed-products [--ccy]. This is the dedicated tool for querying the fixed-term product pool — use it whenever the user asks about available fixed earn products, remaining quota, or APR.
  • Query user's existing orders → earn savings fixed-orders [--ccy] [--state].
  • Subscribe (two-step: preview then confirm) / redeem (pending state only) → WRITE command, go to Step 2. Read {baseDir}/references/savings-commands.md for pre-execution checklists and confirmation templates.
  • For multi-step workflows (subscribe with preview, early redemption), read {baseDir}/references/workflows.md.

On-chain Earn:

  • Query offers / orders / history → READ command, proceed directly.
  • Purchase / redeem / cancel → WRITE command, go to Step 2.

AutoEarn (自动赚币):

  • Query auto-earn status → READ, proceed directly.
  • Enable / disable auto-earn → WRITE, go to Step 2. Read {baseDir}/references/autoearn-commands.md for confirmation templates and earnType inference.

Flash Earn (闪赚):

  • Browse projects → READ, proceed directly.
  • Use --status 0 for upcoming projects, --status 100 for in-progress projects, or omit the flag to view both.

When user asks to view "earn positions" or "赚币持仓" (regardless of whether they mention DCD explicitly), query all position-bearing sub-modules simultaneously (Flash Earn is query-only, no positions):

okx earn savings balance --json        # Simple Earn Flexible (活期)
okx earn savings fixed-orders --json   # Simple Earn Fixed (定期)
okx earn onchain orders --json         # On-chain Earn
okx 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 / 双币赢):

  • Browse products / pairs → READ; when user specifies a currency, read {baseDir}/references/workflows.md (DCD browse flow) for the mandatory parallel pre-fetch before rendering the product table
  • Subscribe (quote-and-buy) → WRITE → see {baseDir}/references/workflows.md (DCD subscribe flow)
  • Early redeem → WRITE → see {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.

Step 2 — Confirm write operation

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.

Step 3 — Execute and verify

After any purchase, verify based on product type:

  • DCD quote-and-buy succeeded → run earn dcd orders --json, show only the matching order.
  • On-chain purchase (response contains ordId) → run earn onchain orders --json, show only the matching order.
  • Simple Earn Flexible purchase (no ordId in response) → run earn savings balance --ccy <ccy> --json.
  • Simple Earn Fixed purchase → run earn savings fixed-orders --ccy <ccy> --state pending --json, show the new order.

Simple Earn Flexible 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 Flexible redeem: Run earn savings balance --ccy <ccy> to confirm updated balance. Inform user funds returned to funding account.

Simple Earn Fixed purchase: Run earn savings fixed-orders --ccy <ccy> --state pending --json to confirm the order was created. Show order details including APR, term, and expected expiry date.

Simple Earn Fixed redeem: Run earn savings fixed-orders --json to confirm the order state changed to cancelled. Inform user full principal returned to funding account — no interest earned for early cancellation.

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:

  • Order gone from list → inform user: cancellation complete, funds returned to funding account.
  • state: 3 (cancelling) → inform user: cancellation in progress, funds will return to funding account shortly.

Global Notes

  • Security: Never ask users to paste API keys or secrets into chat.
  • Output: Always pass --json to list/query commands and render results as a Markdown table — never paste raw terminal output.
  • Network errors: If commands fail with a connection error, prompt user to check VPN: curl -I https://www.okx.com
  • Language: Always respond in the user's language.

For number/time formatting and response structure conventions, read {baseDir}/references/templates.md.

Вставить в README

Ссылка на карточку для вашего README — без картинок и счётчиков.

[DarkPlay: okx-cex-earn](https://darkplay.ru/ai/skills/okx-agent-skills-okx-cex-earn)

Похожие скиллы и другие разделы каталога

Популярное в разделе «Скиллы»

Самые востребованные скиллов раздела по установкам и звёздам.

find-skillsvercel-labs · Помогает находить и устанавливать навыки агентов по запросам вроде «как сделать X»…
4 400 000 устан.
grill-memattpocock · Настойчивое интервью для доработки плана или дизайна.
1 600 000 устан.
hyperframesheygen-com · Обязательная точка входа для любых задач по видео, анимации и motion-графике в…
1 600 000 устан.
hyperframes-cliheygen-com · Цикл разработки HyperFrames CLI: init, add, render, preview, publish и другие команды.
1 600 000 устан.
agent-browservercel-labs · CLI для автоматизации браузера для ИИ-агентов: навигация по страницам, заполнение форм…
1 600 000 устан.
media-useheygen-com · Agent Media OS: единый навык для медиа в HyperFrames — BGM, SFX, изображения, голос, LUT.
1 500 000 устан.
hyperframes-registryheygen-com · Установка и подключение блоков реестра в композиции HyperFrames через add и catalog.
1 400 000 устан.
grill-with-docsmattpocock · Настойчивое интервью для доработки плана или дизайна, попутно создающее документацию (ADR…
1 300 000 устан.
improve-codebase-architecturemattpocock · Поиск в кодовой базе возможностей для углубления, визуальный HTML-отчёт о них и детальный…
1 300 000 устан.
tddmattpocock · Разработка через тестирование (TDD): red-green-refactor и интеграционные тесты.
1 300 000 устан.
Похожее в других разделах каталога

Соседние разделы каталога: возможно, нужный инструмент живёт там.

Instinct Statusaffaan-m · Показывает изученные инстинкты (проектные и глобальные) с уровнем уверенности.
225 587 ★
Mle Revieweraffaan-m · Ревьюер ML-инженерии: данные, признаки, обучение, оценка, сервинг и мониторинг.
225 587 ★
hookifyanthropics · Позволяет легко создавать пользовательские хуки для предотвращения нежелательного…
34 комп.
learning-output-styleanthropics · Интерактивный режим обучения, который запрашивает содержательные правки кода в ключевых…
34 комп.
ruflo-aidefenceruvnet · Сканирование безопасности ИИ, обнаружение PII, защита от prompt injection и адаптивное…
240 комп.
ruflo-autopilotruvnet · Автономное выполнение задач на основе /loop с обучением, прогнозированием и отслеживанием…
240 комп.
ruflo-intelligenceruvnet · Самообучающийся нейроинтеллект с паттернами SONA, обучением на траекториях и…
240 комп.
ruflo-neural-traderruvnet · Нейросетевые торговые стратегии: самообучающиеся модели LSTM/Transformer/N-BEATS с…
240 комп.
ruflo-ruvectorruvnet · Самообучающаяся векторная база данных: HNSW, FlashAttention-3, Graph RAG, гибридный…
240 комп.
marketing-skillscoreyhaines31 · 47 навыков маркетинга для технических маркетологов и основателей: CRO, копирайтинг…
47 комп.

Лучшие ИИ-инструменты для генерации видео

Генерация видео

Подборка нейросетей для генерации и монтажа видео. Инструменты, которые превращают текст в готовые ролики, экономят часы на съемках и постпродакшне. Подходит для SMM-специалистов,

VEED.IOVeed
По запросу
5.0
MootionMootion
По запросу
5.0
FlyviFlyvi
Есть бесплатный тариф
4.9
Google Veo 3.1Google
Платно
4.9
Sora (OpenAI)OpenAI
Платно
4.9
PikaPika
Платно
4.9
captions space
Есть бесплатный тариф
4.8
Клайп
Есть бесплатный тариф
4.8
viralpulse.appViralpulse
По запросу
4.8
Viral Maker AIViral-maker
Есть бесплатный тариф
4.8

Лучшие ИИ-инструменты для генерации текста и копирайтинга

Генерация текста и копирайтинг

Подборка нейросетей для генерации текстов и копирайтинга. Сервисы, которые помогают создавать статьи, посты и рекламные объявления с нуля или по черновику, экономя часы рутинной ра

NeuroscribeNeuroscribe
Есть бесплатный тариф
5.0
GoGPTGogpt
По запросу
5.0
ChatsonicChatsonic
По запросу
4.9
НейроТекстерNeuro-texter
По запросу
4.9
ChatGPTOpenAI
По подписке
4.9
Редактум
Есть бесплатный тариф
4.8
ChadGPTChadgpt
По запросу
4.8
Cosmo ScribeCosmoscribe
Есть бесплатный тариф
4.8
Memo HelperCopilot33
По запросу
4.8
LibraChatLibrachat
Есть бесплатный тариф
4.8

Лучшие ИИ-инструменты для генерации изображений

Генерация изображений

Подборка нейросетей для генерации изображений от фотореализма до концепт-арта. Сервисы, которые экономят часы ручной работы, создавая визуал для блогов, рекламы и дизайна за минуты

MagviMagvi
По запросу
5.0
DALL-E 3OpenAI
По подписке
5.0
SupaLabSupalab
По запросу
5.0
Freestyling.aiFreestyling
Есть бесплатный тариф
4.9
ArtGeneration.meArtgeneration
Есть бесплатный тариф
4.9
BigjpgBigjpg
По запросу
4.9
Художник от VKVK
Бесплатно
4.9
Wonderink — ИИ-книги
Есть бесплатный тариф
4.8
Avato AI12ai
По запросу
4.8
Virton AIVirton
По запросу
4.8