1inch logo

1inch

Organization
Starchild-ai-agent
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).

Overview

PublisherStarchild-ai-agent
Repositoryofficial-skills
Skill name1inch
Stars
32
Forks
13
Bundled files
23
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 23 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by Starchild-ai-agent on GitHub. Read the source before you install it.

Installation

Install the 1inch AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/Starchild-ai-agent/official-skills/tree/main/1inch
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Starchild-ai-agent/official-skills.git /tmp/official-skills
mkdir -p .claude/skills
cp -r /tmp/official-skills/1inch .claude/skills/1inch
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable 1inch in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads 1inch on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so 1inch is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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:

  1. call 1inch HTTP API directly
  2. call wallet service directly (OIDC via /.fly/api)
  3. print JSON result

So after install, the agent always has a runnable path.


Files

  • scripts/_oneinch_lib.py — shared client + wallet/OIDC helpers
  • scripts/tokens.py — token search/list
  • scripts/quote.py — quote only
  • scripts/check_allowance.py — allowance check
  • scripts/approve.py — approve tx broadcast
  • scripts/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_KEY
  • WALLET_SERVICE_URL (default fallback exists)
  • sc-proxy connectivity for 1inch API (mandatory)

Assumptions:

  • Running on Fly Machine with /.fly/api unix socket for OIDC token minting.

sc-proxy requirement (critical)

This skill enforces 1inch calls through sc-proxy.

  • It reads proxy from HTTP_PROXY/HTTPS_PROXY first, else falls back to PROXY_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:

  1. Never call oneinch_* tools
  2. Run local scripts with bash + python3 skills/1inch/scripts/<script>.py ...
  3. Parse JSON output and respond with concise summary
  4. 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

bash
python3 skills/1inch/scripts/tokens.py --chain polygon --search POL --limit 10

2) Quote: 1 USDC -> POL

bash
python3 skills/1inch/scripts/quote.py --chain polygon --from USDC --to POL --amount 1

3) Check allowance (USDC)

bash
python3 skills/1inch/scripts/check_allowance.py --chain polygon --token USDC

4) Approve USDC (unlimited)

bash
python3 skills/1inch/scripts/approve.py --chain polygon --token USDC

5) Swap: 1 USDC -> POL (auto-approve if needed)

bash
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)

bash
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:

bash
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:

  1. run_swap_flow.py --auto-approve
  2. Read JSON result and report quote, tx submission result, and verification deltas

Fallback manual sequence (if user asks step-by-step):

  1. quote.py (confirm expected output)
  2. swap.py --auto-approve
  3. Verify with fresh balances (before/after)

If swap returns wallet policy rejection:

  • load wallet-policy skill
  • propose wildcard baseline (DENY exportPrivateKey, ALLOW *)
  • after user confirms, rerun swap command

Error handling

  • Unknown chain → ask user to choose supported chain
  • 1inch API 4xx/5xx → show raw error; run_swap_flow.py automatically retries transient /swap 5xx (default: 2 retries with exponential backoff)
  • Not enough <token> balance from 1inch → likely symbol mapped to a different token variant (e.g. USDC.e vs USDC); rerun with explicit token address from tokens.py
  • Wallet API 4xx/5xx → show raw error, do not fabricate tx hash
  • insufficient allowance (without auto-approve) → rerun with --auto-approve or run approve.py
  • policy rejection → 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 /tokens on 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

bash
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

ArgRequiredNotes
--chainyesOne of ethereum, arbitrum, base, optimism, polygon, bsc, avalanche, gnosis
--from, --toyes (swap/quote)Token symbol (USDC, POL, etc.) or contract address. Use native / ETH for native gas token.
--amountyes (swap/quote)Human units (e.g. 1 = 1 USDC, decimal conversion handled internally)
--slippageoptionalPercent (default 1.0)
--tokenyes (allowance/approve)Token symbol or address
--auto-approveoptional flagswap/run_swap_flow only — auto-broadcasts approve if allowance insufficient
--swap-retriesoptionalrun_swap_flow only — retries on /swap 5xx (default 2)
--swap-retry-backoffoptionalrun_swap_flow only — backoff seconds (default 1)

Scripts

ScriptPurposeRequired args
tokens.pyList or search tokens on a chain--chain + --search SYM and/or --limit N
quote.pyGet quote (no broadcast)--chain --from --to --amount
check_allowance.pyCheck ERC-20 allowance to 1inch router--chain --token
approve.pyBroadcast approve tx (unlimited)--chain --token
swap.pyExecute swap--chain --from --to --amount (+ optional --slippage, --auto-approve)
run_swap_flow.pyOne-command quote + (auto-approve) + swap + post-trade balance checkSame 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.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the 1inch AI 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).

Why use 1inch on TypingMind?

Because you install it once and use it with any model. 1inch is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install 1inch in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Starchild-ai-agent/official-skills/tree/main/1inch. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use 1inch?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with 1inch?

As many as you like. As long as a model supports skills, you can use 1inch with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the 1inch AI skill free?

It is published on GitHub by Starchild-ai-agent. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇