Rechercher

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 installations selon la source☆ 0 Étoiles du dépôtv1.0.0

Installation

Suivez les instructions du dépôt pour votre agent. Consultez les fichiers et dépendances avant l’installation.

SkillHub CLI

skillhub install aaronllee/dex-quote

Examinez la source et la compatibilité, puis suivez les étapes d’installation.

Donnez le lien à votre agent et demandez-lui d’examiner instructions et dépendances avant d’expliquer les étapes.

Voir la source ↗Guides

Instructions

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...

Informations sur la source

Source
github
Repository
openclaw/skills
Path
skills/aaronllee/dex-quote
Version
1.0.0
Commit
f3b04bc504fbd9e9019fe39b85aa1d9b144d030b
Source de classification
rules
Statut
active
Visibilité
public

Ces informations proviennent de l’analyse indexée et peuvent être anciennes. Vérifiez les fichiers actuels.

Contenu extrait

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...

Skills associés

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...