agentCLAWHUBUnverified

Okx Dex Swap

NOTE (gating): route to okx-dapp-discovery (NOT this skill) when prompt names a specific DApp as the swap venue: Polymarket, Aave V3, Hyperliquid, PancakeSwa...

OpenClaw

Rank

62

Safety

84

Downloads

2.0k

Updated

Oct 9, 2026

Version

3.1.3

Source

CLAWHUB

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 2K downloads reported by the source. Last updated 10/9/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Public facts

Every fact links back to the source it came from.

Vendor
Clawhubvendor · observed Oct 9, 2026
Protocol compatibility
OpenClawcompatibility · observed Oct 9, 2026
Adoption signal
2K downloadsadoption · observed Oct 9, 2026
Latest release
3.1.3release · observed May 9, 2026
Handshake status
UNKNOWNsecurity

Install and run

Setup complexity: low.

clawhub skill install s1757epwxjymcnx07m517yj80584g6p9:okx-dex-swap
  1. Install using `clawhub skill install s1757epwxjymcnx07m517yj80584g6p9:okx-dex-swap` in an isolated environment before connecting it to live workloads.
  2. No published capability contract is available yet, so validate auth and request/response behavior manually.
  3. Review the upstream CLAWHUB listing at https://clawhub.ai/ok-james-01/okx-dex-swap before using production credentials.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-ok-james-01-okx-dex-swap/snapshot"

Documentation

CLAWHUB

147,197 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: okx-dex-swap
description: "NOTE (gating): route to okx-dapp-discovery (NOT this skill) when prompt names a specific DApp as the swap venue: Polymarket, Aave V3, Hyperliquid, PancakeSwap, Morpho, Raydium, Curve, Compound V3, Pendle, Lido, ether.fi, GMX V2, Kamino, Orca, Meteora, Clanker, pump.fun, Uniswap. Examples that go to okx-dapp-discovery: 'swap on PancakeSwap', 'swap SOL for USDC on Raydium', 'use Hyperliquid to long ETH', '在 Curve 上换 USDT', 'swap on Uniswap'. okx-dapp-discovery installs the DApp's plugin and uses its native interface; this skill is for OKX-aggregated swaps without a named venue. Use this skill to 'swap tokens', 'trade OKB for USDC', 'buy tokens', 'sell tokens', 'exchange crypto', 'convert tokens', 'swap SOL for USDC', 'get a swap quote', 'execute a trade', 'find the best swap route', 'cheapest way to swap', 'optimal swap', 'compare swap rates', 'get swap calldata', 'build unsigned tx', or mentions swapping/trading/buying/selling/exchanging tokens across XLayer, Solana, Ethereum, Base, BSC, Arbitrum, Polygon, or any 20+ supported chains. Aggregates 500+ DEX sources for optimal routing/price. Supports slippage control, price impact protection, and cross-DEX route optimization."
license: MIT
metadata:
  author: okx
  version: "3.1.3"
  homepage: "https://web3.okx.com"
---

# Onchain OS DEX Swap

6 commands for multi-chain swap aggregation — quote, approve, one-shot execute, and calldata-only swap.

## Step 0 — DApp Re-Route Check (run before every other step)

Before running any `onchainos swap` command, scan the **original user prompt** for a named DApp/protocol. If any of the names below appear (English or Chinese), STOP this skill and invoke `okx-dapp-discovery` with the user's original prompt instead — the DApp's own plugin is the correct executor.

Trigger names: **Polymarket · Aave · Hyperliquid · PancakeSwap · Pancake · PCS · Morpho · Raydium · Curve · Compound · Pendle · Lido · ether.fi · GMX · Kamino · Orca · Meteora · Clanker · Uniswap · pump.fun**.

Trigger protocol-native tokens (route to `okx-dapp-discovery` even without DApp name): **HYPE, HLP, CAKE, veCAKE, CRV, crvUSD, 3pool, COMP, Comet, RAY, Whirlpool, ETHFI, eETH, weETH, LDO, stETH, wstETH, GLP, esGMX, GHO, kToken, PT-* / YT-* / `PT <token>`, vePENDLE, $CLANKER**.

Examples that MUST re-route (do not run `swap quote` / `swap execute` here):
- "swap on PancakeSwap", "swap SOL for USDC on Raydium", "swap on Uniswap", "在 Curve 上把 USDC 换成 USDT", "在 Orca 上把 SOL 换成 USDC", "swap on PancakeSwap V2 with classic LP".

Stay in this skill ONLY when the venue is **unspecified or aggregated**: "swap 1 ETH for USDC", "best route from SOL to USDC", "trade USDC for OKB", "convert tokens", "buy 0.5 ETH with my USDC".

If you have already started running commands and only then realise the user named a DApp, halt mid-flow and invoke `okx-dapp-discovery` — do not finish the aggregated swap.

## Pre-flight Checks

> Read `../okx-agentic-wallet/_shared/preflight.md`. If

_meta.json

{
  "ownerId": "kn78y61n2w8yxhz17m6kyf9t558268ba",
  "slug": "okx-dex-swap",
  "version": "3.1.3",
  "publishedAt": 1778311496936
}

references/cli-reference.md

# Onchain OS DEX Swap — CLI Command Reference

Detailed parameter tables, return field schemas, and usage examples for all 6 swap commands.

## 1. onchainos swap chains

Get supported chains for DEX aggregator. No parameters required.

```bash
onchainos swap chains
```

**Return fields**:

| Field | Type | Description |
|---|---|---|
| `chainIndex` | String | Chain identifier (e.g., `"1"`, `"501"`) |
| `chainName` | String | Human-readable chain name |
| `dexTokenApproveAddress` | String | DEX router address for token approvals on this chain |

## 2. onchainos swap liquidity

Get available liquidity sources on a chain.

```bash
onchainos swap liquidity --chain <chain>
```

| Param | Required | Default | Description |
|---|---|---|---|
| `--chain` | Yes | - | Chain name (e.g., `ethereum`, `solana`, `xlayer`) |

**Return fields**:

| Field | Type | Description |
|---|---|---|
| `id` | String | Liquidity source ID |
| `name` | String | Liquidity source name (e.g., `"Uniswap V3"`, `"CurveNG"`) |
| `logo` | String | Liquidity source logo URL |

## 3. onchainos swap approve

Get ERC-20 approval transaction data.

```bash
onchainos swap approve --token <address> --amount <amount> --chain <chain>
```

| Param | Required | Default | Description |
|---|---|---|---|
| `--token` | Yes | - | Token contract address to approve |
| `--amount` | Yes | - | Amount in minimal units |
| `--chain` | Yes | - | Chain name |

**Return fields**:

| Field | Type | Description |
|---|---|---|
| `data` | String | Approval calldata (hex) — use as tx `data` field |
| `dexContractAddress` | String | Spender address (already encoded in `data`). **NOT** the tx `to` — send tx to the token contract |
| `gasLimit` | String | Estimated gas limit for the approval tx |
| `gasPrice` | String | Recommended gas price |

## 4. onchainos swap quote

Get swap quote (read-only price estimate).

```bash
onchainos swap quote --from <address> --to <address> --readable-amount <amount> --chain <chain> [--swap-mode <mode>]
```

| Param | Required | Default | Description |
|---|---|---|---|
| `--from` | Yes | - | Source token contract address |
| `--to` | Yes | - | Destination token contract address |
| `--readable-amount` | One of | - | Human-readable sell amount (e.g. `"1.5"` for 1.5 USDC). CLI fetches token decimals and converts automatically. |
| `--amount` | One of | - | Amount in minimal units — use only when raw units are explicitly known. Mutually exclusive with `--readable-amount`. |
| `--chain` | Yes | - | Chain name |
| `--swap-mode` | No | `exactIn` | `exactIn` or `exactOut` |

**Return fields**:

| Field | Type | Description |
|---|---|---|
| `toTokenAmount` | String | Expected output amount in minimal units |
| `fromTokenAmount` | String | Input amount in minimal units |
| `estimateGasFee` | String | Estimated gas fee (native token units) |
| `tradeFee` | String | Trade fee estimate in USD |
| `priceImpactPercent` | String | Price impact as percentage (e.g., `"0.05"`) |
| `router` | St

references/troubleshooting.md

# Swap Troubleshooting

> Load this file when a swap fails or an edge case is encountered.

### Failure Diagnostics

When a swap transaction fails (broadcast error, on-chain revert, or timeout), generate a **diagnostic summary** before reporting to the user:

```
Diagnostic Summary:
  txHash:        <hash or "simulation failed">
  chain:         <chain name (chainIndex)>
  errorCode:     <API or on-chain error code>
  errorMessage:  <human-readable error>
  tokenPair:     <fromToken symbol> → <toToken symbol>
  amount:        <amount in UI units>
  slippage:      <value used, or "auto">
  mevProtection: <on|off>
  walletAddress: <address>
  timestamp:     <ISO 8601>
  cliVersion:    <onchainos --version>
```

This helps debug issues without requiring the user to gather info manually.


## Edge Cases

> Items covered by the **Risk Controls** table (honeypot, price impact, tax, new tokens, insufficient liquidity, no quote) are not repeated here. Refer to Risk Controls for action levels.

- **Insufficient balance**: check balance first, show current balance, suggest adjusting amount
- **Network error**: retry once, then generate diagnostic summary and prompt user
- **Region restriction (error code 50125 or 80001)**: do NOT show raw error code. Display: `⚠️ Service is not available in your region. Please switch to a supported region and try again.`

_shared/chain-support.md

# Shared Chain Name Support

> This file is shared across all onchainos skills.

The CLI accepts human-readable chain names and resolves them automatically.

The following 6 chains support **wallet address creation** (i.e., you can generate a wallet address on these chains):

| Chain | Name | chainIndex |
|---|---|---|
| XLayer | `xlayer` | `196` |
| Solana | `solana` | `501` |
| Ethereum | `ethereum` | `1` |
| Base | `base` | `8453` |
| BSC | `bsc` | `56` |
| Arbitrum | `arbitrum` | `42161` |

> **Note**: The wallet supports interacting with 17+ chains beyond this list (e.g., Polygon, Avalanche, Optimism).
> Run `onchainos wallet chains` for the full list of supported chains.
Github ReposUpdated 3h agoRank 70

AionUi

Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!

MCPOPENCLAW
Github ReposUpdated 6mo agoRank 70

activepieces

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

OPENCLAW
Github ReposUpdated 6mo agoRank 70

cherry-studio

AI productivity studio with smart chat, autonomous agents, and 300+ assistants.

MCPOPENCLAW
Github ReposUpdated 7mo agoRank 70

CopilotKit

The Frontend for Agents & Generative UI. React + Angular

OPENCLAW

Machine-readable data

The same record, as JSON, for agents and crawlers.

{
  "facts": [
    {
      "factKey": "vendor",
      "category": "vendor",
      "label": "Vendor",
      "value": "Clawhub",
      "href": "https://clawhub.ai/ok-james-01/skills/okx-dex-swap",
      "sourceUrl": "https://clawhub.ai/ok-james-01/skills/okx-dex-swap",
      "sourceType": "profile",
      "confidence": "medium",
      "observedAt": "2026-10-09T21:09:12.825Z",
      "isPublic": true
    },
    {
      "factKey": "protocols",
      "category": "compatibility",
      "label": "Protocol compatibility",
      "value": "OpenClaw",
      "href": "https://www.xpersona.co/api/v1/agents/clawhub-ok-james-01-okx-dex-swap/contract",
      "sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-ok-james-01-okx-dex-swap/contract",
      "sourceType": "contract",
      "confidence": "medium",
      "observedAt": "2026-10-09T21:09:12.825Z",
      "isPublic": true
    },
    {
      "factKey": "traction",
      "category": "adoption",
      "label": "Adoption signal",
      "value": "2K downloads",
      "href": "https://clawhub.ai/ok-james-01/okx-dex-swap",
      "sourceUrl": "https://clawhub.ai/ok-james-01/okx-dex-swap",
      "sourceType": "profile",
      "confidence": "medium",
      "observedAt": "2026-10-09T21:09:12.825Z",
      "isPublic": true
    },
    {
      "factKey": "latest_release",
      "category": "release",
      "label": "Latest release",
      "value": "3.1.3",
      "href": "https://clawhub.ai/ok-james-01/okx-dex-swap",
      "sourceUrl": "https://clawhub.ai/ok-james-01/okx-dex-swap",
      "sourceType": "release",
      "confidence": "medium",
      "observedAt": "2026-05-09T07:24:56.936Z",
      "isPublic": true
    },
    {
      "factKey": "handshake_status",
      "category": "security",
      "label": "Handshake status",
      "value": "UNKNOWN",
      "href": "https://www.xpersona.co/api/v1/agents/clawhub-ok-james-01-okx-dex-swap/trust",
      "sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-ok-james-01-okx-dex-swap/trust",
      "sourceType": "trust",
      "confidence": "medium",
      "observedAt": null,
      "isPublic": true
    }
  ],
  "events": [
    {
      "eventType": "release",
      "title": "Release 3.1.3",
      "description": "okx-dex-swap v3.1.3 - Updated skill version to 3.1.3 in metadata. - No functional, logic, or documentation changes detected otherwise (no file changes).",
      "href": "https://clawhub.ai/ok-james-01/okx-dex-swap",
      "sourceUrl": "https://clawhub.ai/ok-james-01/okx-dex-swap",
      "sourceType": "release",
      "confidence": "medium",
      "observedAt": "2026-05-09T07:24:56.936Z",
      "isPublic": true
    }
  ]
}

Record generated Oct 9, 2026.

Sponsored

Ads related to Okx Dex Swap and adjacent AI workflows.