
Okx Dex Strategy
Design and execute OKX DEX strategy workflows with the onchainos CLI after shared pre-flight install and version checks.
Overview
okx-dex-strategy is an agent skill for the Build phase that runs OKX DEX strategy flows via the onchainos CLI with mandatory release pre-flight checks.
Install
npx skills add https://github.com/okx/onchainos-skills --skill okx-dex-strategyWhat is this skill?
- Shares onchainos pre-flight: resolve latest GitHub release tag, install or refresh CLI within 12-hour cache window
- Graceful offline path when API fails but a local onchainos binary already exists
- Windows and macOS/Linux install paths via release install.sh and user profile cache dirs
- Part of OKX onchainos-skills family for DEX strategy operations
- 12-hour local cache window for onchainos update checks
Adoption & trust: 1.1k installs on skills.sh; 284 GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You want agent-assisted DEX strategy steps but do not trust a stale or missing onchainos binary to execute trades or queries safely.
Who is it for?
Builders already working in the OKX onchainos ecosystem who need repeatable agent playbooks for DEX strategy automation.
Skip if: Users who only need static DeFi documentation, regulated institutional execution without self-custody review, or projects with no network/shell permissions.
When should I use this skill?
Before the first onchainos command in a session when working on OKX DEX strategy tasks.
What do I get? / Deliverables
After pre-flight install or update, your agent can invoke onchainos strategy commands with a verified CLI version aligned to the latest GitHub release when network allows.
- Verified onchainos CLI ready for strategy commands
- Agent-executed DEX strategy steps per skill instructions
Recommended Skills
Journey fit
You integrate onchain trading strategy tooling while building agent or automation stacks—not during pure Idea research. Integrations subphase fits CLI-backed OKX onchainos skills that call live DEX/strategy endpoints from your dev environment.
How it compares
CLI-orchestrated OKX onchain skill—not a generic swap widget or a non-custodial wallet product by itself.
Common Questions / FAQ
Who is okx-dex-strategy for?
Indie builders and agent developers integrating OKX onchainos for DEX strategy experimentation and automation.
When should I use okx-dex-strategy?
During Build integrations when you are scripting or agent-driving OKX DEX strategy commands and must refresh onchainos before the first command in a session.
Is okx-dex-strategy safe to install?
It implies downloading binaries and onchain operations with financial risk—review the Security Audits panel on this page, use test environments first, and never expose API secrets in logs.
SKILL.md
READMESKILL.md - Okx Dex Strategy
# Shared Pre-flight Checks > This file is shared across all onchainos skills. Follow these steps before the first `onchainos` command each session. Every time before running any `onchainos` command, always follow these steps in order. Do not echo routine command output to the user; only provide a brief status update when installing, updating, or handling a failure. 1. **Resolve latest stable version**: Fetch the latest stable release tag from the GitHub API: ``` curl -sSL "https://api.github.com/repos/okx/onchainos-skills/releases/latest" ``` Extract the `tag_name` field (e.g., `v1.0.5`) into `LATEST_TAG`. If the API call fails and `onchainos` is already installed locally, skip steps 2-3 and continue with step 4 (the user may be offline or rate-limited; a stale binary is better than blocking). If `onchainos` is **not** installed, **stop** and tell the user to check their network connection or install manually from https://github.com/okx/onchainos-skills. 2. **Install or update**: If `onchainos` is not found, or if the cache at `~/.onchainos/last_check` (`$env:USERPROFILE\.onchainos\last_check` on Windows) is older than 12 hours: - Download the installer and its checksum file from the latest release tag: - **macOS/Linux**: `curl -sSL "https://raw.githubusercontent.com/okx/onchainos-skills/${LATEST_TAG}/install.sh" -o /tmp/onchainos-install.sh` `curl -sSL "https://github.com/okx/onchainos-skills/releases/download/${LATEST_TAG}/installer-checksums.txt" -o /tmp/installer-checksums.txt` - **Windows**: `Invoke-WebRequest -Uri "https://raw.githubusercontent.com/okx/onchainos-skills/${LATEST_TAG}/install.ps1" -OutFile "$env:TEMP\onchainos-install.ps1"` `Invoke-WebRequest -Uri "https://github.com/okx/onchainos-skills/releases/download/${LATEST_TAG}/installer-checksums.txt" -OutFile "$env:TEMP\installer-checksums.txt"` - Verify the installer's SHA256 against `installer-checksums.txt`. On mismatch, **stop** and warn — the installer may have been tampered with. - Execute: `sh /tmp/onchainos-install.sh` (or `& "$env:TEMP\onchainos-install.ps1"` on Windows). The installer handles version comparison internally and only downloads the binary if needed. - On other failures, point to https://github.com/okx/onchainos-skills. 3. **Verify binary integrity** (once per session): Run `onchainos --version` to get the installed version (e.g., `1.0.5` or `2.0.0-beta.0`). Construct the installed tag as `v<version>`. Download `checksums.txt` for the **installed version's tag** (not necessarily LATEST_TAG): `curl -sSL "https://github.com/okx/onchainos-skills/releases/download/v<version>/checksums.txt" -o /tmp/onchainos-checksums.txt` Look up the platform target and compare the installed binary's SHA256 against the checksum. On mismatch, reinstall (step 2) and re-verify. If still mismatched, **stop** and warn. - Platform targets — macOS: `arm64`->`aarch64-apple-darwin`, `x86_64`->`x86_64-apple-darwin`; Linux: `x86_64`->`x86_64-unknown-linux-gnu`, `aarch64`->`aarch64-unknown-linux-gnu`, `i686`->`i686-unknown-linux-gnu`, `armv7l`->`armv7-unknown-linux-gnueabihf`; Windows: `AMD64`->`x86_64-pc-windows-msvc`, `x86`->`i686-pc-windows-msvc`, `ARM64`->`aarch64-pc-windows-msvc` - Hash command — macOS/Linux: `shasum -a 256 ~/.local/bin/onchainos`; Windows: `(Get-FileHash "$env:USERPROFILE\.local\bin\onchainos.exe" -Algorithm SHA256).Hash.ToLower()` 4. **Version drift check** — REQUIRED, run even if steps 1-3 were skipped. - Run `onchainos --version` → CLI version (e.g., `2.2.9`) - Read `version` field from the active skill's YAML frontmatter (e.g., `version: "2.0.0"` at the top of SKILL.md) - If CLI version > skill version → warn the user and offer to refresh skills: **"⚠️ Skill outdated (skill vX.Y.Z < CLI vA.B.C). Run `onchainos upgrade` to refresh both the CLI and any locally cloned skill checkouts (`~/.codex/onchainos-skills`, `~/.openclaw/onc