搜索

PythonReactSEOPDF
OpenClaw

okx-dex-quote

Fetch optimal swap quotes from OKX DEX Aggregator API (v6). Use this skill when a user wants to: 1. Get the best price for swapping tokens on any supported EVM/Solana chain 2. Compare DEX routing paths and price impact for token swaps 3. Build applications or scripts that query real-time DEX aggregator pricing Core value: Generates correct, authenticated API calls with proper token decimals, amount formatting, HMAC-SHA256 signing, and comprehensive error handling.

aaronllee0 来源安装数☆ 0 仓库 Starsv1.0.0

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

SkillHub CLI

skillhub install aaronllee/dex-quote

打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。

将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。

查看来源 ↗使用指南

技能说明

OKX DEX Aggregator Quote Skill

Overview

This skill generates production-ready code for fetching optimal swap quotes from the OKX DEX Aggregator API v6. The API finds the best price across multiple DEX protocols (Uniswap, SushiSwap, Curve, etc.) and returns detailed routing information including price impact, gas estimates, and token safety flags.

Key capabilities:

  • Authenticated API requests with HMAC-SHA256 signing
  • Correct handling of token decimals and amount formatting
  • Support for exactIn (fixed input) and exactOut (fixed output) swap modes
  • Multi-chain support (Ethereum, BSC, Arbitrum, Base, Solana, and 20+ chains)
  • Price impact protection and honeypot detection
  • Fee/commission splitting configuration

Prerequisites

Required Credentials

Users must have an OKX Web3 API key set. The skill needs three values:

  • OKX_ACCESS_KEY — API key
  • OKX_SECRET_KEY — Secret key for HMAC signing
  • OKX_PASSPHRASE — Account passphrase
Environment
  • Python: requests, hmac, hashlib, base64, datetime (all stdlib except requests)
  • Node.js: axios or node-fetch, built-in crypto
  • No additional blockchain dependencies required (this is a read-only quote endpoint)
API Endpoint
GET https://web3.okx.com/api/v6/dex/aggregator/quote

Workflow

Step 1: Validate User Input

Before constructing the API call, validate:

  1. Chain ID (chainIndex) — Must be a supported chain. Common values:

    • 1 = Ethereum
    • 56 = BSC
    • 137 = Polygon
    • 42161 = Arbitrum
    • 8453 = Base
    • 130 = Unichain
    • 501 = Solana
  2. Token addresses — Must be valid contract addresses or the native token placeholder:

    • Native tokens (ETH, BNB, etc.): 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
    • Contract tokens: Full 42-character hex address (EVM) or base58 (Solana)
  3. Amount — MUST include token decimals. This is the #1 source of errors:

    • 1 ETH (18 decimals) → `"1000000000000000000...

来源信息

Source
github
Repository
openclaw/skills
Path
skills/aaronllee/dex-quote
Version
1.0.0
Commit
f3b04bc504fbd9e9019fe39b85aa1d9b144d030b
分类来源
rules
状态
active
可见性
public

这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。

来源内容

SKILL.md
# OKX DEX Aggregator Quote Skill

## Overview

This skill generates production-ready code for fetching optimal swap quotes from the **OKX DEX Aggregator API v6**. The API finds the best price across multiple DEX protocols (Uniswap, SushiSwap, Curve, etc.) and returns detailed routing information including price impact, gas estimates, and token safety flags.

**Key capabilities:**
- Authenticated API requests with HMAC-SHA256 signing
- Correct handling of token decimals and amount formatting
- Support for `exactIn` (fixed input) and `exactOut` (fixed output) swap modes
- Multi-chain support (Ethereum, BSC, Arbitrum, Base, Solana, and 20+ chains)
- Price impact protection and honeypot detection
- Fee/commission splitting configuration

## Prerequisites

### Required Credentials
Users must have an OKX Web3 API key set. The skill needs three values:
- `OKX_ACCESS_KEY` — API key
- `OKX_SECRET_KEY` — Secret key for HMAC signing
- `OKX_PASSPHRASE` — Account passphrase

### Environment
- **Python**: `requests`, `hmac`, `hashlib`, `base64`, `datetime` (all stdlib except `requests`)
- **Node.js**: `axios` or `node-fetch`, built-in `crypto`
- No additional blockchain dependencies required (this is a read-only quote endpoint)

### API Endpoint
```
GET https://web3.okx.com/api/v6/dex/aggregator/quote
```

## Workflow

### Step 1: Validate User Input

Before constructing the API call, validate:

1. **Chain ID (`chainIndex`)** — Must be a supported chain. Common values:
   - `1` = Ethereum
   - `56` = BSC
   - `137` = Polygon
   - `42161` = Arbitrum
   - `8453` = Base
   - `130` = Unichain
   - `501` = Solana

2. **Token addresses** — Must be valid contract addresses or the native token placeholder:
   - Native tokens (ETH, BNB, etc.): `0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee`
   - Contract tokens: Full 42-character hex address (EVM) or base58 (Solana)

3. **Amount** — MUST include token decimals. This is the #1 source of errors:
   - 1 ETH (18 decimals) → `"1000000000000000000...

相关技能

OpenClaw

a-stock-trader

bombfuock

A股模拟交易系统 - 数据爬取、存储、策略回测、模拟交易 / A-Share Paper Trading System - Data Fetch, Storage, Backtest, Simulation

OpenClaw

adaptive-skill-factory

505768069-rgb

Discover, install, update, or create the right skill when a workflow gap appears. Use when a task is repetitive, a role lacks a reliable procedure, an existing skill might save time, ClawHub search/install coul...