okx-dex-strategy

द्वारा okx

Limit-order strategy trading on OKX Agentic Wallet. Use this skill when the user wants to place a price-triggered limit order (buy a dip, take profit, stop loss, chase a high), cancel one or more pending orders, list active or historical orders, or resume orders that have been suspended by SA TEE upgrades. Distinct from okx-dex-swap (market orders, immediate execution at the best available aggregated price). Strategy orders are stored on the Agentic Wallet TEE and execute automatically when...

npx skills add https://github.com/okx/onchainos-skills --skill okx-dex-strategy

Onchain OS DEX Strategy

4 subcommands that wrap the Agentic Wallet limit-order surface — create-limit, cancel, list, resume. SA activation (Trader Mode upgrade / re-upgrade) is performed transparently by the CLI when the BE returns UPGRADE_REQUIRED; the skill does not need to expose that detail.

Pre-flight Checks

Read ../okx-agentic-wallet/_shared/preflight.md. If that file does not exist, fall back to _shared/preflight.md. Strategy endpoints require an authenticated Agentic Wallet session — confirm login before running any subcommand.

Display labels & output language (single source of truth)

This section is the canonical rule for user-facing strings. Every other section in this skill defers to it.

Canonical Display labels — the only strings the agent may surface to the user. The CLI returns these directly (statusLabel) for status; for strategyType the agent looks them up from the §strategyType and §status tables below.

SurfaceCanonical EN Display labels
strategyType (4 values)Buy Dip / Take Profit / Stop Loss / Buy Above
status (9 values)Expired / Cancelling / Cancelled / Failed / Trading / Completed / Creating / Active / Suspended

Translation rule — match the user's conversation language. Display labels above are canonical English. When the user converses in another language, the agent translates the label at output time to match the conversation language.

Never (these rules apply everywhere in this skill):

  • mix two languages in one label (pick one — never render the English label and a translation side by side),
  • expose the underlying enum name (BUY_DIP, CHASE_HIGH, COMPLETED, …) to the user,
  • expose the underlying CLI flag value (buy_dip, chase_high, completed, cancelled, …) to the user,
  • pass through the CLI's raw statusLabel verbatim when the user is conversing in a non-English language — translate it.

Notes:

  • CHASE_HIGH renders as Buy Above in English (not "Chase High").
  • SPEEDING_UP (-4) is not a valid filter or display value.

Boundary vs okx-dex-swap

User intentSkill
"Swap X for Y now" / "Buy 0.5 ETH with USDC"okx-dex-swap (market order, immediate execution)
"Buy ETH if it dips to $2000" / "Sell when ETH hits $5000" / "Take profit at X" / "Stop loss at Y"this skill (price-triggered limit order)
"Cancel my pending order"this skill
"What limit orders do I have?"this skill

If the venue is named explicitly (Uniswap, PancakeSwap, Raydium, Curve, ...) → re-route to okx-dapp-discovery. This skill is for OKX-aggregated limit orders only.

Command Index

1. onchainos strategy create-limit

Place a single price-triggered limit order.

onchainos strategy create-limit \
  --chain-id <id|alias> \
  --from-token <address> \
  --to-token <address> \
  --amount <decimal-string> \
  --direction <buy|sell> \
  --trigger-price <usd> \
  [--current-price <usd>] \
  [--slippage <value>] \
  [--mev-protection <on|off|default>] \
  [--expires-in <secs>]
FlagRequiredNotes
--chain-idYChain id or alias: 1, solana, bsc, arbitrum, base, xlayer
--from-tokenYSell-side token contract address
--to-tokenYBuy-side token contract address
--amountYAmount of from_token to sell (string, no precision loss)
--directionYbuy or sell (case-insensitive). Strategy type is derived from --direction + --trigger-price + the current market price; the agent does not pass a strategy type explicitly.
--trigger-priceYUSD trigger price. Required for strategy type derivation.
--current-priceNCurrent USD price of the comparison token (to-token for buy, from-token for sell). When omitted the CLI fetches it via market price. Pass it to skip the extra HTTP round-trip when the agent already retrieved the price for the confirmation page.
--slippageNSlippage in percent. Default 15. Pass the percent as a plain number (slippage 20%--slippage 20). Note 0.05 = 0.05%, NOT 5% — for 5% pass --slippage 5.
--mev-protectionNTri-state on / off / default (default = default; default = BE picks).
--expires-inNOrder TTL in seconds. Default 604800 (7 days) — see §Default order expiry.

Output (JSON, always — the CLI has no human-format mode):

{
  "ok": true,
  "data": {
    "orderId": "<id>",
    "status": <int>,
    "statusLabel": "<label>",
    "estimatedWaitTime": <int|null>,
    "eventCursor": "<string|null>"
  }
}

Solana orders return estimatedWaitTime=0 — the order is queryable immediately; for all other chains the agent follows §Async wait pattern (fixed 3-second sleep before re-querying).

Default order expiry

BE default = 7 days (604800 seconds). All other "7 days" mentions in this skill derive from here.

Supported chains

Strategy orders are only supported on these 6 chains. Any other chain MUST be rejected upfront by the agent — do not call create-limit and do not even open the Step 1 confirmation.

chainIndexName--chain-id aliases
1Ethereumethereum, eth, 1
56BSCbsc, 56
196X Layerxlayer, 196
501Solanasolana, sol, 501
8453Basebase, 8453
42161Arbitrumarbitrum, arb, 42161

Pre-flight rule (agent): when the user mentions a chain, resolve it to its chainIndex and check this list. If the chain is not in the table (e.g. Polygon 137, Optimism 10, Avalanche 43114, Linea 59144, Sui 784, Tron 195, ...), respond directly with:

Strategy orders are only supported on Ethereum / BSC / X Layer / Solana / Base / Arbitrum right now. <requested chain> is not supported — pick one of these to continue.

Do NOT proceed to Step 1 confirmation. Do NOT call the CLI. The CLI also defends against this (validates against the same 6-chain whitelist before BE), but the agent catching it earlier saves a round trip and gives a clearer message tied to the user's exact phrasing.

strategyType enum + derivation

strategyType is fully derived inside the CLI from (--direction, --trigger-price, current market price) — there is no --type flag and the agent never passes or computes the integer. This single table covers both uses: deriving the Display label for the Step 1 confirmation page, and mapping the strategyType integer in list responses back to a Display label. The Display label is the only user-facing string (see §Display labels & output language).

strategyType (int)Enum nameDirectiontrigger vs currentDisplay labelSemantics
2BUY_DIPbuytrigger < currentBuy DipBuy when price falls to trigger
5CHASE_HIGHbuytrigger ≥ currentBuy AboveBuy when price rises above trigger
3TAKE_PROFITselltrigger > currentTake ProfitSell when price rises to trigger
4STOP_LOSSselltrigger ≤ currentStop LossSell when price falls to trigger

Equality folds into the aggressive side (CHASE_HIGH / STOP_LOSS), matching the CLI.

Agent flow:

  1. Parse direction (buy / sell) from user intent ("buy" / "ape in" / "snap up" → buy; "sell" / "take profit" / "stop loss" / "exit" → sell). Passed verbatim as --direction <buy|sell>.
  2. Fetch current price — call onchainos market price --chain <chain> --address <token>, read data[0].price. For BUY direction query the to-token's current price; for SELL direction query the from-token's current price. The agent needs this for (a) Step 0 USD-value pre-flight, (b) the Step 1 confirmation page "Trigger Price vs current", and (c) computing the Display label per the table above.
  3. Pass --current-price <usd> to the CLI so it does not re-fetch. (If the agent omits it, the CLI fetches the same value itself — correct but one extra round-trip.)

Two-step confirmation flow (Agent must follow)

create-limit is a write operation. The agent MUST present a confirmation summary to the user first and only call the CLI after the user explicitly confirms. The CLI itself does not gate (it calls BE directly); this contract is enforced at the skill layer.

Step 0 — Minimum order value pre-flight (must run before Step 1):

BE enforces a minimum order value of $1 USD (returns error 100010 ORDER_AMOUNT_TOO_SMALL otherwise). To avoid wasting a round-trip and a confirmation page on an amount that BE will reject, the agent MUST verify the from-side USD value first.

  1. Fetch the from-token price (USD):
    • If from-token is a well-known stablecoin (USDT / USDC / USDG / USDe / DAI / FDUSD / ...): assume from_price ≈ 1.0 without an HTTP call.
    • Otherwise: call onchainos market price --chain <chain> --address <from_token>, read data[0].price as from_price.
  2. Compute USD value: usd_value = from_amount × from_price.
  3. If usd_value < 1.0:
    • Compute min_from_amount = ceil(1.0 ÷ from_price) rounded up to a reasonable display precision for the token (e.g. whole units when from_price ≥ 0.1; 2-4 significant digits otherwise).

    • Surface exactly this single canonical line to the user, with no extra prose — no USD-value math, no $1 threshold mention, no echo of the user's original amount, no follow-up sentence, no apology:

      Minimum order amount: <min_from_amount> <from_symbol>

      Translate the prefix at output time per §Display labels & output language (e.g. for a Chinese user the agent renders the same fact in Chinese). The structure stays single-line: <localised prefix> <min_from_amount> <from_symbol>.

    • STOP. Do NOT render Step 1. Do NOT call the CLI. Wait for the user to provide a larger --amount, then re-run Step 0 from the top.

  4. If usd_value ≥ 1.0: carry from_price forward (Step 1's "Value" column reuses it; no need to re-fetch) and proceed to Step 1.

Example (user wants to spend 1 OKB on a chain where OKB ≈ $0.10):

  • from_price = 0.10, usd_value = 1 × 0.10 = 0.10 < 1.0 → fail
  • min_from_amount = ceil(1.0 / 0.10) = 10
  • Output: Minimum order amount: 10 OKB
  • Stop. No Step 1, no extra prose.

Step 1 — Show the order summary for the user to confirm. Five top-level categories with sub-items; the agent may freely organise prose at runtime, but no category may be dropped:

#CategorySub-itemsSource
1ChainHuman-readable chain name resolved from --chain-id (Arbitrum / BSC / Solana / ...)
2Order TypeDisplay label per the §strategyType table (Buy Dip / Take Profit / Stop Loss / Buy Above) — translate per §Display labels & output languageDerived per "Strategy type derivation" above
3From tokenSymbol (e.g. USDC); Amount (e.g. 10)Symbol from token metadata; Amount is raw --amount value
4To tokenSymbol (e.g. ARB); Trigger Price (e.g. $0.10, USD-denominated); Estimated Amount (predicted to-token amount); Value (estimated USD value)Symbol/Trigger Price direct; Estimated Amount and Value computed by the agent — see formulas below
5SlippageEither Default 15% (user did not mention slippage) or User-specified X% (user explicitly said "slippage X%")See Slippage display rules below

Estimated Amount / Value formulas:

  • Buy direction (BUY_DIP / CHASE_HIGH):
    • Estimated Amount = from_amount ÷ trigger_price (in units of to-token)
    • Value = from_amount × from_token_USD_price (if from is a stablecoin, ≈ from_amount)
  • Sell direction (TAKE_PROFIT / STOP_LOSS):
    • Estimated Amount = from_amount × trigger_price (in units of to-token, usually a stablecoin)
    • Value = from_amount × trigger_price (if to is a stablecoin, equals Estimated Amount)

Slippage display rules:

  • User did NOT mention slippage in the conversation → display Slippage: Default 15%, and omit --slippage on the CLI call (the CLI default is 15).
  • User explicitly said "slippage X%" / "use X% slippage" / similar → display Slippage: User-specified X%, and pass --slippage X on the CLI call.

Structural example (display labels come from the §strategyType / §status tables; see §Display labels & output language for the cross-cutting rule):

1. Chain: Arbitrum
2. Order Type: Buy Dip
3. From: USDC 10
4. To:
   - Symbol: ARB
   - Trigger Price: $0.10
   - Estimated Amount: 100 ARB
   - Value: $10
5. Slippage: 15% (default)

If the trigger condition is not met within 7 days, this order auto-expires.

Reply confirm / change / cancel.

Expiry note (mandatory): After the 5 categories and before the reply prompt, the agent must surface that the limit order auto-expires 7 days after creation if the trigger never fires. Default phrasing: If the trigger condition is not met within 7 days, this order auto-expires.

Step 2 — Handle the user's reply:

  • User says "confirm" / "yes" / "submit" → call onchainos strategy create-limit ....
  • User says "change amount = 5" / "set trigger to 0.08" / similar → update the corresponding field and re-render Step 1 for another confirmation.
  • User says "cancel" / "abort" → do NOT call the CLI; acknowledge that the order was discarded.

Hard constraints:

  1. Never call strategy create-limit until the user has explicitly confirmed.
  2. Estimated Amount / Value are agent-side estimates derived from trigger_price, not BE quotes. The realised fill amount is decided at BE execution time by slippage and aggregator routing; the agent must not present these estimates as "actual fill amounts".
  3. --trigger-price is a USD price. The agent must make this clear to the user to avoid confusion with "exchange rate = X from-token per 1 to-token".
  4. Never render Step 1 when Step 0's USD-value check fails. Output the single-line minimum-amount warning instead and stop — the user must restart with a larger --amount.

2. onchainos strategy cancel

Cancel a single, batch, or all active orders. Pass exactly one of the three flags:

onchainos strategy cancel --order-id <id>
onchainos strategy cancel --order-ids id1,id2,...
onchainos strategy cancel --all

Output (JSON): {ok:true,data:{updateNum:N,estimatedWaitTime:null|n}}. updateNum is the count BE accepted, not the count that reached terminal state — re-query with list after the wait.

3. onchainos strategy list

onchainos strategy list \
  [--order-id <id>] \
  [--status active,suspended,...] \
  [--chain-id 1,501] \
  [--token <address>] \
  [--limit <int>] \
  [--cursor <string>] \
  [--strategy-mode 7]

Two modes:

  • Single order: pass --order-id <id> → GET openOrderDetail (returns full order shape).
  • Page query: omit --order-id → POST getOpenOrder. The active wallet's addresses are auto-supplied; pass --limit (max 100, default 100) and --cursor from the previous response's nextCursor for pagination.

Flag CSV support--status and --chain-id accept comma-separated lists; --token accepts a single address only. For multi-token queries, call list once per token and merge the results.

Full getOpenOrder request-body schema (auto-injected fields, flag mapping): see references/backend-schema.md.

status enum

Full 10-state mapping — agent reads data.list[].status integer and looks up the display label here:

Int valueEnum nameCLI --status valueDisplay labelTerminal?
-7EXPIREDexpiredExpiredYes
-3CANCELLINGcancellingCancellingNo (transient)
-2CANCELLEDcancelledCancelledYes
-1FAILEDfailedFailedYes
0TRADINGprocessing or tradingTradingNo
1COMPLETEDcompletedCompletedYes
2CREATINGcreatingCreatingNo
3ACTIVEactiveActiveNo
4SUSPENDEDsuspendedSuspendedNo

SPEEDING_UP (-4) is not a valid filter option. CLI's statusLabel already returns the display label (the only user-facing string); translate per §Display labels & output language.

Non-terminal set (5): {-3, 0, 2, 3, 4} = CANCELLING / TRADING / CREATING / ACTIVE / SUSPENDED Terminal set (4): {-7, -2, -1, 1} = EXPIRED / CANCELLED / FAILED / COMPLETED

Default status filter (when --status is omitted): the CLI sends the 5 non-terminal states [-3, 0, 2, 3, 4] (CANCELLING / TRADING / CREATING / ACTIVE / SUSPENDED); terminal orders (Cancelled / Completed / Failed / Expired) are excluded by default — "show my orders" almost always means live ones.

To see terminal orders the agent must pass --status explicitly:

User intent--status value to pass
"show my completed orders"completed (orderStatusList=[1])
"show my cancelled orders"cancelled (orderStatusList=[-2])
"show failed orders"failed (orderStatusList=[-1])
"show expired orders"expired (orderStatusList=[-7])
"show all orders including terminal"active,suspended,creating,trading,cancelling,completed,cancelled,failed,expired (full 9)
"show my live orders" / no qualifier(omit --status — uses non-terminal default)

--status accepts comma-separated values; each entry is either an integer (e.g. 4) or a string label (active, suspended, processing, creating, cancelling, cancelled, completed, failed, expired).

Agent rendering rules (when the user asks for orders without naming a specific status)

User prompts that match this rule include: "show my strategy orders" / "list orders" / "show my limit orders" / "what orders do I have" — i.e. any general "show me my orders" intent without a status qualifier.

Steps the agent must follow:

  1. Run onchainos strategy list --limit 10 (no --status) — the CLI puts orderStatusList=[-3, 0, 2, 3, 4] (non-terminal set) into the request body; BE applies the filter server-side and returns only matching orders. Always pass --limit 10 for general "show my orders" queries; full pagination is opt-in via "next page" follow-up.

  2. Render the response data.list as a Markdown table with exactly these 8 columns (locked):

    Order idOrder StatusOrder TypeEstimated AmountTo Token addrValueTrigger priceExpire after

    Per-row mapping (order matters, no extra columns):

    ColumnSourceNotes
    Order iddata.list[i].orderId
    Order Statusdata.list[i].statusLabel (Display label per the §status table)Translate per §Display labels & output language
    Order TypeDisplay label per the §strategyType table, derived from data.list[i].strategyType integer (2 → Buy Dip / 3 → Take Profit / 4 → Stop Loss / 5 → Buy Above)Translate per §Display labels & output language
    Estimated Amountdata.list[i].toToken.tokenAmount + + data.list[i].toToken.tokenSymbole.g. 0.2 SOL
    To Token addrdata.list[i].toToken.tokenContractAddress, truncated to first-6 + last-4EVM: 0x1234...cdef (0x + 4 chars + ... + 4 chars); Solana base58: first 6 + ... + last 4
    Valuedata.list[i].toToken.tokenUsd, formatted as <n> USDe.g. 16 USD (round or 2-decimal, follow BE precision)
    Trigger pricedata.list[i].triggerInfo.triggerPrice, prefixed with $e.g. $80; if empty (trigger-rate path, not currently used) display data.list[i].triggerInfo.triggerRate
    Expire afterdata.list[i].expireTime (13-digit ms UTC), converted to the user's current timezone, formatted MM/DD/YYYY HH:MM:SSe.g. 05/15/2026 17:50:49 (semantically = createTime + 7 days by default)

    Sample row (Solana SOL→USDC take_profit):

    | 17262791359882688 | Active | Take Profit | 0.2 SOL | 9xQeWv...vEjz | 16 USD | $80 | 05/15/2026 17:50:49 |
    

    Address shortening rules:

    • EVM (0x prefix): first 6 chars (0x + 4) + ... + last 4 chars
    • Solana / other non-prefixed base58: first 6 + ... + last 4
    • Strings shorter than 10 chars: do not truncate; display verbatim

    Expire timezone conversion:

    • expireTime from BE is a UTC millisecond timestamp
    • The agent must convert to the user's current local timezone at render time (e.g. JS Intl.DateTimeFormat, Rust chrono::Local, or equivalent)
    • Fixed format: MM/DD/YYYY HH:MM:SS, 24-hour clock
  3. After the table, append a single combined reminder covering pagination + status filter. Include the pagination line only when nextCursor is non-empty.

    Canonical EN; the agent translates per §Display labels & output language:

    Showing live orders by default (10 per page).

    • Reply "next page" to load more.
    • To filter by a specific state, ask for orders by their Display label — e.g. Completed, Cancelled, Failed, Expired. Example: "show my completed orders" → I'll re-query with that filter.

    If nextCursor is empty (no more pages), drop the "next page" bullet and keep only the status-filter bullet.

  4. If the user replies "next page" / similar, re-run with --limit 10 --cursor <nextCursor> carrying the previous response's nextCursor. Render with the same table format.

  5. If the user names a specific status (any of the 9 Display labels), re-run as list --limit 10 --status <label> (single value) and render the same table. Drop the status-filter bullet from the reminder; keep the pagination bullet if nextCursor is non-empty.

4. onchainos strategy resume

onchainos strategy resume                          # auto-discover all SUSPENDED + canResume=true on active wallet
onchainos strategy resume --order-ids id1,id2      # explicit

When ids are omitted, the CLI runs list filtered to status=4 and keeps only orders whose canResume flag is true; the discovered ids are then submitted to reactivate. After resume, the agent should advise the user that orders whose trigger condition was already met may execute immediately — re-query with list to confirm.

Error code → Agent action

The CLI surfaces the BE error code in human-readable form. Map each code to a recommended next step:

CodeNameWhat the agent should do
100REQUEST_PARAM_ERRORSurface the BE message; ask the user to fix the offending flag
10019INSUFFICIENT_NATIVE_GAS_BALANCEWallet's native token balance is below the BE-required minimum (the response msg includes minAmount = <N>, e.g. 0.001 BNB on BSC). Tell the user their native gas balance is insufficient to pay this chain's gas fees and prompt them to top up — deposit from an exchange, transfer from another account, or swap a stablecoin to native via onchainos swap execute. Do NOT auto-retry.
10026JWT_TOKEN_VERIFY_FAILEDSuggest onchainos wallet login then retry
10106CHAIN_NOT_SUPPORT_ERRORTell the user the chain is not supported; suggest a supported alternative
60002NO_ORDER_FOUNDCancel/resume target id is wrong or already terminal — suggest list
60003LIMIT_ORDER_NO_AUTHORITYTrader Mode may not be activated yet; the next CLI call will trigger SD-A automatically — retry once
60006LIMIT_ORDER_OUT_LIMIT_FAILPending order count is at the per-account limit (max 100); ask the user to cancel some pending orders (cancel --all or cancel --order-id) and retry
60009LIMIT_ORDER_ILLIQUIDITY_ERRORNo liquidity for the pair at the trigger; suggest a different pair or wider trigger
60014LIMIT_ORDER_EXPIRED_CANNOT_OPERATEOrder already expired
60015LIMIT_ORDER_PENDING_CANNOT_OPERATEOrder is mid-lifecycle; wait for terminal state
60017LIMIT_ORDER_SUCCESS_CANNOT_OPERATEOrder already completed
60018LIMIT_ORDER_TEE_SA_VERSION_UPGRADE_REQUIREDTransparent — CLI handles via SD-A retry; the agent should NOT see this code in normal flow. If it leaks, just retry the same command
60030QUOTA_EXCEEDEDAccount-level quota reached
100005WALLET_ADDRESS_BLACKLISTEDWallet address flagged by risk control; ask the user to contact support — do not retry
100007TEE_SIGN_FAILURETransient TEE issue — retry once
100010ORDER_AMOUNT_TOO_SMALLOrder value is below the BE-enforced minimum of $1 USD. Ask the user to increase --amount so the order value clears $1, then retry
100008TEE_SERVICE_UNAVAILABLETEE service is temporarily unavailable; ask the user to retry later
100012LIMIT_ORDER_INSUFFICIENT_BALANCEInsufficient balance; suggest checking with onchainos wallet balance

Match by integer code, not msg string. The msg text is for humans and may change.

Execution event codes (executionHistoryList[].code)

Emitted by the TEE swap-trade engine while it executes an active order. Read the latest entry first; older entries are historical context. For each recognised code the CLI injects three fields next to the raw code:

FieldUse
nameInternal label; do NOT surface to the user
messageSurface verbatim to the user (translate per §Display labels & output language)
terminaltrue ⇒ engine will not retry; stop polling and surface. false ⇒ engine retries; safe to wait

Unrecognised codes pass through with name / message / terminal absent — surface the raw BE msg if present, else "event code <N>".

Reading patterns

  • Latest entry wins. Render the most recent executionHistoryList[] item; older entries are historical context only.
  • Repeated same code. When the same code recurs every ~10s without a txHash appearing, the engine is in a soft retry loop. Surface the latest message, mention the repeat count ("this is the 5th No quote due to low liquidity event"), and ask the user whether to wait, cancel, or adjust parameters.
  • terminal=true codes. Stop polling immediately and surface to the user; engine will not retry.
  • terminal=false codes that repeat 3+ times. Treat as user-actionable: suggest changing slippage / amount / pair / chain, or cancelling.
  • Code 0 with txHash. Trade succeeded; surface txHash and explorer link.

Action hints by hot code

The message field is the user-facing string. The agent additionally chooses one of these action hints based on code:

codewhat the agent should do
0report success; surface txHash + explorer link
3013suggest topping up the from-token or recreating with smaller amount
3014tell user to fund the chain's native fee token (SOL / ETH / BNB / ...)
3015suggest widening --slippage
3016non-transient — suggest different pair, smaller amount, wider trigger, or different chain
3017engine retries; if recurring 3+ times, treat like 3016
3019terminal — destination token is blocklisted; order will not execute
3020terminal — wallet address is flagged; surface explicitly
3023recreate with longer --expires-in

Codes outside this table: read terminal from the CLI output. terminal=true ⇒ surface and stop. terminal=false ⇒ surface and wait one more cycle.

Async wait pattern

create-limit, cancel, and resume return after the request has been accepted, not after the order reached a terminal state. The CLI surfaces estimatedWaitTime (seconds, BE-supplied — typically 0 for Solana, ~3 for BSC, ~12 for ETH-class chains).

Agent recipe (locked):

  1. Run the subcommand.
  2. Sleep 3 seconds. A single fixed 3-second wait is enough across all supported chains. Do not sleep by the response's estimatedWaitTime; the BE-supplied number is conservative and inflates the wait unnecessarily.
  3. Re-query with onchainos strategy list --order-id <orderId> to read the final state.
  4. If still pending after the first re-query, surface the partial state to the user; do not loop indefinitely.

Do not run a long polling loop. The CLI is not designed for that; the BE backs the order finalisation off-chain and one targeted re-query is sufficient in normal conditions.

SA activation transparency

Trader Mode upgrade / re-upgrade is performed transparently by the CLI:

  • On create-limit or resume, if the BE returns code 60018 (UPGRADE_REQUIRED), the CLI activates Trader Mode transparently and retries the original op once. On success the user sees Trader Mode activated. followed by the normal command output.
  • The agent should not ask the user to "activate Trader Mode" first — the CLI does it on demand.
  • If activation fails, the original command aborts and the activation error is surfaced. Suggest onchainos wallet status to inspect the session.

Output format conventions

All strategy subcommands always emit the standard onchainos JSON envelope {ok: true, data: { ... }} on stdout. There is no --format flag — strategy CLI is agent-facing, so structured JSON is the only output and the agent renders any user-visible tables (e.g. the §list 8-column Markdown table) from that JSON.

Limitations

Symbol→address resolution is out of scope — pass --from-token / --to-token as contract addresses directly.

Full current-limitations list: see references/backend-schema.md.

okx की और Skills

okx-agent-identity
okx
We need to translate the given text from English to Hindi, preserving the name "okx-agent-identity" if it appears, but it does not appear in the text. The text is a description of an agent skill. We must not add any extra commentary, labels, or formatting. Just translate the text inside <text> to Hindi. The text includes technical terms like ERC-8004, XLayer, agent, ASP, evaluator, etc. We should keep those as is or transliterate if needed. Also includes Chinese characters, which should be preserved as they are? The instruction says preserve product names, protocol names, URLs, numbers, technical terms. Chinese characters are part of the text, likely as alternative terms. We should keep them as is. So we translate the English parts to Hindi, but keep the Chinese characters unchanged. Let's break down the text: "ERC-8004 on-chain Agent identity on XLayer: register / create / update / activate / deactivate / search agents; view ratings; list agent services; set avatar. Roles: user (User
developmentapi
okx-ai-guide
okx
We need to translate the given text from English to Hindi. The text is a description of an agent skill for OKX.AI. We must preserve the product name "okx-ai-guide" as per instruction, but it's not in the text. The text includes "OKX.AI" and various spellings. We need to translate the entire content inside <text> to Hindi, keeping product names, URLs, numbers, technical terms unchanged. Also preserve the examples like "what is OKX.AI" etc. but translate the surrounding words. The instruction says "Do not include the name unless it appears in the source text." The name "okx-ai-guide" does not appear in the source text, so we don't include it. We just translate the text. Let's translate paragraph by paragraph. Source: "OKX.AI (the Agent economic system) intro & onboarding entry. Use whenever the user asks what OKX.AI is, what it can do, how to use or get started with it, wants an OKX.AI tutorial
researchapidocument
okx-agentic-wallet
okx
OKX Agentic Wallet और इसकी Gas Station सुविधा के लिए प्राधिकृत स्रोत। Gas Station = तीसरे पक्ष के Relayer के माध्यम से Solana पर OKX का स्थिर-मुद्रा-गैस फीचर; केवल Solana, कोई EIP-7702 नहीं। Gas Station प्रश्नों (यह क्या है / यह कैसे काम करता है / समर्थित टोकन / शुल्क / गैस स्टेशन सक्षम या अक्षम करें / डिफ़ॉल्ट गैस टोकन बदलें / Jito Bundler संगतता) और किसी भी वॉलेट कार्रवाई: लॉगिन, OTP सत्यापन, खाता जोड़ें/स्विच करें/स्थिति/लॉगआउट
apiweb-scrapingdevelopment
okx-agent-chat
okx
Routing stub — any a2a-agent-chat envelope / agent-task system message is handled by `okx-agent-task`. For missing or uninitialized OKX A2A communication runtime/plugin, read `skills/okx-agent-chat/ensure-okx-a2a-communication-ready.md`.
developmentapicommunication
okx-agent-task
okx
We need to translate the given text from English to Hindi. The text is a description of conditions for activating an agent skill. It mentions specific patterns and keywords. We must preserve product names, protocol names, URLs, numbers, technical terms. The name "okx-agent-task" appears in the text, so we preserve it. Also preserve terms like "agentId", "message", "source", "event", "jobId", "msgType", "a2a-agent-chat", "sender", "role", "COUNTERPARTY", "SKILL.md", and the Chinese keywords. The translation should be in Hindi script. We need to translate the entire text inside <text> tags. No extra labels. Just the translation. Let's break it down: "MUST ACTIVATE on inbound envelopes: (1) {agentId, message:{source:"system", event, jobId, ...}} — system event; (2) {msgType:"a2a-agent-chat", jobId, sender:{role}, ...} — agent-to-agent task chat (fields
developmentapicommunication
okx-agent-payments-protocol
okx
Use when an agent hits HTTP 402 / payment-required, or the user mentions x402, x402Version, X-PAYMENT, PAYMENT-REQUIRED, PAYMENT-SIGNATURE, WWW-Authenticate: Payment, permit2, upto, metered billing, a payment channel / voucher / session, channelId / channel_id, opening / closing / topping up / settling / refunding a channel, a paymentId or a2a_ link, creating / checking a payment link, A2MCP / an A2MCP endpoint, or sending a request to / calling an Agent's endpoint with a concrete endpoint...
okx-security
okx
इस कौशल का उपयोग सुरक्षा स्कैनिंग के लिए करें: लेन-देन सुरक्षा जांचें, क्या यह लेन-देन सुरक्षित है, निष्पादन-पूर्व जांच, सुरक्षा स्कैन, टोकन जोखिम स्कैनिंग, हनीपॉट पहचान, DApp/URL फ़िशिंग पहचान, संदेश हस्ताक्षर सुरक्षा, दुर्भावनापूर्ण लेन-देन पहचान, अनुमोदन सुरक्षा जांच, टोकन अनुमोदन प्रबंधन। ट्रिगर: 'क्या यह टोकन सुरक्षित है', 'टोकन सुरक्षा जांचें', 'हनीपॉट जांच', 'इस
okx-task-watch
okx
监听任务进展 / 帮我盯着任务 / 任务有动静告诉我 / 历史消息 / 未读消息 / 未决策 / 待决策 / 继续监听 / task watch / user watch / monitor task progress / catch me up on tasks / outstanding decisions — OKX A2A user-session task-notification monitor: live long-poll via `okx-a2a user watch` (also drains backlog of past/missed/unread events on entry) plus un-replied decision_request lister via `okx-a2a user outdated-list`. Not for wallet / gas / task-list / status queries.
developmentapiproductivity