
1inch
1inch DEX aggregator: same-chain EVM swaps, SOL↔EVM cross-chain, limit orders. Use when swapping tokens with best routing or placing limit orders (e.g. ETH→USDC on Base, SOL→ETH cross-chain, limit buy ARB at 0.80).
- Installs
- 352
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/starchild-ai-agent/official-skills --skill 1inch- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads 1inch automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
1inch (Script-First, Install-and-Use)
This skill is designed for your architecture: do not rely on platform-injected tools.
- ✅ Uses only skill-local scripts under
skills/1inch/scripts/ - ✅ Agent executes scripts via
bash(python3 ...) - ✅ No
oneinch_*tool calls required
Why this version fixes “tool not found”
Old design depended on runtime tool registration (oneinch_quote, oneinch_swap, ...).
If tool injection fails, agent is blocked.
New design uses deterministic local scripts:
- call 1inch HTTP API directly
- call wallet service directly (OIDC via
/.fly/api) - print JSON result
So after install, the agent always has a runnable path.
Files
scripts/_oneinch_lib.py— shared client + wallet/OIDC helpersscripts/tokens.py— token search/listscripts/quote.py— quote onlyscripts/check_allowance.py— allowance checkscripts/approve.py— approve tx broadcastscripts/swap.py— swap execution (optional auto-approve)scripts/run_swap_flow.py— one-command flow (quote + optional approve + swap + post-trade balance verification)
Environment
Required:
ONEINCH_API_KEYWALLET_SERVICE_URL(default fallback exists)- sc-proxy connectivity for 1inch API (mandatory)
Assumptions:
- Running on Fly Machine with
/.fly/apiunix socket for OIDC token minting.
sc-proxy requirement (critical)
This skill enforces 1inch calls through sc-proxy.
- It reads proxy from
HTTP_PROXY/HTTPS_PROXYfirst, else falls back toPROXY_HOST+PROXY_PORT. - If no proxy env is found, scripts fail fast with a clear error instead of silently direct-connecting.
Supported chains
ethereum, arbitrum, base, optimism, polygon, bsc, avalanche, gnosis
Agent execution rules (IMPORTANT)
When user asks for 1inch actions, follow this exact pattern:
- Never call
oneinch_*tools - Run local scripts with
bash+python3 skills/1inch/scripts/<script>.py ... - Parse JSON output and respond with concise summary
- For write actions, always do post-check using wallet balance tools (if available) or rerun script-based checks
Canonical mapping
- “查 token 地址 / 列 token” →
tokens.py - “先报价 / 看能换多少” →
quote.py - “检查授权” →
check_allowance.py - “授权” →
approve.py - “执行兑换” →
swap.py
Command examples
1) Search token
python3 skills/1inch/scripts/tokens.py --chain polygon --search POL --limit 10
2) Quote: 1 USDC -> POL
python3 skills/1inch/scripts/quote.py --chain polygon --from USDC --to POL --amount 1
3) Check allowance (USDC)
python3 skills/1inch/scripts/check_allowance.py --chain polygon --token USDC
4) Approve USDC (unlimited)
python3 skills/1inch/scripts/approve.py --chain polygon --token USDC
5) Swap: 1 USDC -> POL (auto-approve if needed)
python3 skills/1inch/scripts/swap.py --chain polygon --from USDC --to POL --amount 1 --slippage 1.0 --auto-approve
6) One-command full flow (recommended)
python3 skills/1inch/scripts/run_swap_flow.py --chain polygon --from USDC --to POL --amount 1 --slippage 1.0 --auto-approve
Tune retries when needed:
python3 skills/1inch/scripts/run_swap_flow.py --chain polygon --from USDC --to POL --amount 1 --slippage 1.0 --auto-approve --swap-retries 3 --swap-retry-backoff 2
Default workflow for “买 X USDC 的 POL”
Preferred deterministic sequence:
run_swap_flow.py --auto-approve- Read JSON result and report quote, tx submission result, and verification deltas
Fallback manual sequence (if user asks step-by-step):
quote.py(confirm expected output)swap.py --auto-approve- Verify with fresh balances (before/after)
If swap returns wallet policy rejection:
- load
wallet-policyskill - propose wildcard baseline (
DENY exportPrivateKey,ALLOW *) - after user confirms, rerun swap command
Error handling
Unknown chain→ ask user to choose supported chain1inch API 4xx/5xx→ show raw error;run_swap_flow.pyautomatically retries transient/swap5xx (default: 2 retries with exponential backoff)Not enough <token> balancefrom 1inch → likely symbol mapped to a different token variant (e.g. USDC.e vs USDC); rerun with explicit token address fromtokens.pyWallet API 4xx/5xx→ show raw error, do not fabricate tx hashinsufficient allowance(without auto-approve) → rerun with--auto-approveor runapprove.pypolicyrejection → propose policy update then retry
Notes
- Amount input is human units (e.g.
--amount 1= 1 USDC), script handles decimal conversion. - Token symbol resolution comes from 1inch
/tokenson the selected chain. - If a symbol has multiple variants on a chain (e.g.,
USDC/USDC.e), prefer passing token contract address explicitly to avoid ambiguity. - For native token input, use
native/ETH.
Quick smoke test
python3 skills/1inch/scripts/quote.py --chain polygon --from USDC --to POL --amount 1
If this works, the skill is operational in script mode.
Script Reference (CLI args)
This skill exposes scripts (not Python functions). Run them via bash +
python3 skills/1inch/scripts/<name>.py <args>. All scripts emit JSON on
stdout — parse with json.loads(...) or just print the output.
Common arguments
| Arg | Required | Notes |
|---|---|---|
--chain | yes | One of ethereum, arbitrum, base, optimism, polygon, bsc, avalanche, gnosis |
--from, --to | yes (swap/quote) | Token symbol (USDC, POL, etc.) or contract address. Use native / ETH for native gas token. |
--amount | yes (swap/quote) | Human units (e.g. 1 = 1 USDC, decimal conversion handled internally) |
--slippage | optional | Percent (default 1.0) |
--token | yes (allowance/approve) | Token symbol or address |
--auto-approve | optional flag | swap/run_swap_flow only — auto-broadcasts approve if allowance insufficient |
--swap-retries | optional | run_swap_flow only — retries on /swap 5xx (default 2) |
--swap-retry-backoff | optional | run_swap_flow only — backoff seconds (default 1) |
Scripts
| Script | Purpose | Required args |
|---|---|---|
tokens.py | List or search tokens on a chain | --chain + --search SYM and/or --limit N |
quote.py | Get quote (no broadcast) | --chain --from --to --amount |
check_allowance.py | Check ERC-20 allowance to 1inch router | --chain --token |
approve.py | Broadcast approve tx (unlimited) | --chain --token |
swap.py | Execute swap | --chain --from --to --amount (+ optional --slippage, --auto-approve) |
run_swap_flow.py | One-command quote + (auto-approve) + swap + post-trade balance check | Same as swap.py (+ optional retry args) |
Recommended flow
For ANY user "swap X for Y" request, default to run_swap_flow.py --auto-approve. It handles the full chain end-to-end and verifies via
wallet balance read after broadcast.
If user asks "just quote, don't execute" → quote.py only.
Output schema (run_swap_flow.py)
JSON with these top-level keys:
quote—{fromToken, toToken, fromAmount, toAmount, estimatedGas, ...}approve—{required, txHash, success}(only if--auto-approve)swap—{txHash, success, error?}verification—{from_balance_before, from_balance_after, to_balance_before, to_balance_after, delta_in, delta_out}
If wallet returns a policy rejection, swap.success = false and
swap.error will mention policy. Load the wallet-policy skill,
propose a wildcard baseline, then rerun.
FAQ
What does the 1inch skill do?
1inch DEX aggregator: same-chain EVM swaps, SOL↔EVM cross-chain, limit orders. Use when swapping tokens with best routing or placing limit orders (e.g. ETH→USDC on Base, SOL→ETH cross-chain, limit buy ARB at 0.80).
How do I install 1inch?
Run npx skills add https://github.com/starchild-ai-agent/official-skills --skill 1inch in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/1inch/ (personal) or .claude/skills/1inch/ (project).
Which AI agents can use 1inch?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is 1inch safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains 1inch?
It is published by starchild-ai-agent in starchild-ai-agent/official-skills. It has 352 recorded installs.
More from starchild-ai-agent/official-skills
coinglass
starchild-ai-agent/official-skills
Crypto derivatives data: funding rates, open interest, liquidations, long/short ratios. Use when researching perp markets or comparing ETF flows (e.g. BTC funding, ETH OI). NOTE: platform API key is Startup tier — liquidation heatmap, coins-markets detail, liquidation order book and Hyperliquid positions require higher plans (see Plan Tiers).
wallet
starchild-ai-agent/official-skills
Multi-chain wallet: EVM and Solana balances, transfers, signing, and policy. Use when checking balances, sending tokens, signing typed data, or proposing a wallet policy (e.g. send 10 USDC on Base, sign EIP-712, Solana balance).
hyperliquid
starchild-ai-agent/official-skills
Trade perp futures, spot, and RWA on Hyperliquid DEX with up to asset max leverage. Use when placing perp or spot orders, setting TP/SL, or moving funds on Hyperliquid (e.g. long BTC 5x, sell ETH, deposit USDC, set stop).
coingecko
starchild-ai-agent/official-skills
Crypto spot prices, OHLC charts, market discovery, and global stats. Use when looking up coin prices, market caps, trending coins, sector rankings, or comparing tokens (e.g. BTC price, ETH chart, top gainers).
starchild-ai-agent/official-skills
Twitter/X data: fetch tweets, search, user profiles, followers, replies, trends. Use for any x.com or twitter.com URL or lookup (e.g. summarize this tweet, recent posts by @vitalikbuterin, search $SOL minfaves:50).
skill-creator
starchild-ai-agent/official-skills
Scaffold new skills with valid frontmatter, directory layout, and a starter SKILL.md. Use when building a new reusable workflow or wrapping a new API (e.g. create a kalshi skill, scaffold an API helper, start a charting skill).
Popular ai & agents skills
google-agents-cli-publish
google/agents-cli
This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini", "publish to Gemini" (formerly Gemini Enterprise), or needs guidance on the agents-cli publish gemini command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).
google-agents-cli-eval
google/agents-cli
This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Gemini platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding (use google-agents-cli-scaffold).
skill-creator
anthropics/skills
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
codex-pet
prime-skills/runcomfy-agent-skills
Codex Pet generator on RunComfy. Build a Codex-compatible Codex Pet spritesheet.webp + pet.json from a single reference image, drop it into ${CODEXHOME:-$HOME/.codex}/pets/ / and Codex picks it up as a custom Codex Pet next to the 8 built-ins. This skill produces the exact Codex Pet atlas Codex expects (1536x1872 PNG/WebP, 8 cols x 9 rows, 192x208 cells, 9 animation states — idle, running-right, running-left, waving, jumping, failed, waiting, running, review). Calls OpenAI GPT Image 2 edit ONCE via the local RunComfy CLI as runcomfy run openai/gpt-image-2/edit to produce a canonical Codex Pet pose, then assembles all 9 animation rows programmatically with ImageMagick micro-transforms — no Codex Pro, no $imagegen, no OPENAIAPIKEY required, only RUNCOMFYTOKEN. Triggers on "codex pet", "create codex pet", "make codex pet", "hatch codex pet", "/hatch image", "desktop pet codex", "codex pets", "spritesheet.webp", or any explicit ask to build a custom pet for OpenAI Codex.
full-output-enforcement
leonxlnx/taste-skill
Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.
executing-plans
obra/superpowers
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available