swap-build

Fetch optimal KyberSwap routes and generate encoded swap calldata.

6|2|Updated Feb 28, 2026
One-click install
npx skills add https://github.com/KyberNetwork/kyberswap-skills --skill swap-build
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swap-build
Source: https://github.com/KyberNetwork/kyberswap-skills/tree/main/skills/swap-build
Command: npx skills add https://github.com/KyberNetwork/kyberswap-skills --skill swap-build

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Build swap transactions quickly by obtaining the best route and generating encoded calldata ready for on-chain submission, without needing manual scripting or multiple API calls.

Core Features & Use Cases

  • Resolve the optimal route for a token pair and amount
  • Validate inputs, show quote details, and require user confirmation before building
  • Produce encoded calldata, router address, and gas estimates for on-chain submission
  • Supports various chains and handles sender/recipient logic with safety checks

Quick Start

Use the swap-build skill to fetch the best route and generate the encoded calldata for your token pair.

Frequently Asked Questions about swap-build

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

FAQPage Schema
How do I build swap calldata for an Ethereum token pair?

To build swap calldata, resolve the optimal route for your tokenIn, tokenOut, and amount using an aggregator, then confirm the quote to generate the encoded transaction data ready for on-chain submission.

Does the swap-build process handle slippage and input validation automatically?

Yes, the swap-build process applies input parsing, address resolution via a token registry, and safety checks with default slippage handling before presenting a mandatory quote confirmation to the user.

What is the best way to get the optimal DeFi routing and gas estimates for my trade?

The best way to get optimal DeFi routing is to fetch rates via a KyberSwap aggregator GET request, which returns the complete route data, router address, and gas estimates needed for your transaction.

Can I use this approach to build transactions across multiple blockchain networks?

Yes, you can build transactions across various supported chains by specifying the chain in your request, allowing the resolver to convert amounts to wei and handle sender or recipient logic safely.

How do I handle API errors when fetching swap route data?

You handle API errors by following the structured error handling path aligned with the API specification, which catches failures during the route fetch and amount conversion processes to prevent invalid calldata generation.