okx-dex-swap

Aggregate token swap routes and generate executable transaction data across EVM and non-EVM chains.

318|65|Updated Feb 28, 2026
One-click install
npx skills add https://github.com/okx/onchainos-skills --skill okx-dex-swap
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: okx-dex-swap
Source: https://github.com/okx/onchainos-skills/tree/main/skills/okx-dex-swap
Command: npx skills add https://github.com/okx/onchainos-skills --skill okx-dex-swap

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill removes the complexity of finding the best swap route and building executable transaction data across many blockchains by aggregating liquidity, estimating costs, and preparing approval and swap calldata so users can safely execute trades.

Core Features & Use Cases

  • DEX aggregation: Combines liquidity from 500+ sources to find optimal routes and split execution across multiple DEXes for better prices.
  • End-to-end swap flow: Provides quote, ERC-20 approval calldata, and swap transaction data (including gas estimates, price impact, and route breakdown) for EVM and non-EVM chains.
  • Safety & validation: Checks for honeypot flags, tax rates, high price impact, and insufficient balance scenarios; recommends slippage and split-trade strategies.
  • Use Case: A user who wants to swap 100 USDC for OKB on XLayer can get a detailed quote, obtain approval calldata if needed, and receive the signed-ready swap transaction payload to broadcast via the gateway.

Quick Start

Request a quote to sell 100 USDC for OKB on XLayer, review price impact and route, then approve and execute the swap with 1% slippage.

Frequently Asked Questions about okx-dex-swap

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find the best token swap route across multiple blockchains?

A DEX aggregator finds the best token swap route by combining liquidity from 500+ sources across EVM and non-EVM chains, splitting execution to deliver optimal prices. It evaluates available pools to minimize slippage and maximize return.

How do I execute a multi-chain token swap from quote to signed transaction?

To execute a multi-chain token swap, request a quote, review the route and price impact, obtain ERC-20 approval calldata if needed, and sign the returned swap transaction payload. The aggregator provides executable transaction data ready for broadcast.

Does DEX aggregation support both exactIn and exactOut swap modes?

Yes, DEX aggregation supports both exactIn and exactOut swap modes. This allows you to specify either the exact input amount you are paying or the exact output amount you wish to receive when routing across multiple liquidity sources.

Can I check for honeypot tokens and high price impact before executing a swap?

Yes, you can check for honeypot flags, token tax rates, and high price impact before executing a swap. The aggregation process includes safety validation to warn against malicious tokens and recommend slippage or split-trade strategies.

What is included in the swap transaction data provided by a DEX aggregator?

Swap transaction data includes route breakdown, gas estimates, price impact, and approval calldata. It returns minimal-unit amounts and executable transaction payloads ready for user confirmation and signing via a gateway.

Why do I need ERC-20 approval calldata before swapping tokens?

ERC-20 approval calldata is required to authorize the DEX smart contract to spend your tokens before executing a swap. The aggregator detects insufficient approvals and generates the necessary approval transaction data for user signing.