1inch/1inch-ai

1inch-swap

- Quote and execute token swaps via the 1inch MCP swap tool: Classic (DEX aggregation), Fusion (gasless intent), and Fusion+/cross-chain.

소스 보기

사용 방법

  1. 설치 명령을 복사하고 자신의 에이전트 환경에 설치하기 전에 소스 패키지를 확인하세요.
  2. 필요한 도구, 인증 정보, 지원 환경은 원본 문서에서 확인하세요.
  3. 입력과 원하는 산출물을 설명하고 출처와 결과를 대조하세요.
npx skills add https://github.com/1inch/1inch-ai --skill 1inch-swap

시작 전 확인

  • 설치에는 모델 구독, API 한도, 파일 접근 권한이 포함되지 않습니다.
  • 별점 수와 설치 수는 활동 지표이며 독립적인 품질·보안 검증이 아닙니다.
원본 Skill 문서

원본 저장소의 제목, 예시, 코드, 표, 링크, 이미지를 유지해 표시합니다.

1inch Swap

Use the authenticated MCP tool `swap`. Call `authenticate` first if you are not already a real user (initialize 200 is still anonymous). Do not hand-build calldata for normal flows.

Recommended: connect the user's wallet first (WalletConnect)

Unless the user explicitly wants to sign with their own tooling (private key, cast, viem), offer WalletConnect before executing: pair via the walletconnect tool (see the 1inch-walletconnect skill), then call swap. With an active session, execute defaults to true — the tool handles approve txs, EIP-712 signing, submission, and native escrow sends through the connected wallet, and the user simply approves each prompt in their wallet app. No key handling, no manual signing steps.

  • Set execute: false only when the user wants unsigned calldata / typed data to sign elsewhere.
  • Set execute: true explicitly to require a wallet session (errors if not connected).

Modes

  • Classic — on-chain via aggregation router; user pays gas. preferredType: "classic".
  • Fusion — gasless intent; resolvers fill. preferredType: "fusion".
  • Cross-chain — set dstChain; preferredType: "crosschain".

Approaches

  1. Wallet-first (recommended): connect via walletconnect, then call swap with src, dst, amount, chain, from (the connected wallet address). The user approves in their wallet.
  2. Shortcut: call swap directly. Omit preferredType to let the server recommend, or set it explicitly.
  3. Full flow: quoteOnly: true → compare quotes / recommended → execute with chosen preferredType.
  4. Manual Fusion/cross-chain submit (no wallet session): after signing typed data locally, call again with signedOrder + orderHash.

Flow guides (bundled references)

Load the reference for your flow before signing or broadcasting:

FlowReferenceMCP resource fallback
Quotereferences/QUOTE.mdfile://1inch-mcp/guides/swap/quote
Classicreferences/CLASSIC.mdfile://1inch-mcp/guides/swap/classic
Fusionreferences/FUSION.mdfile://1inch-mcp/guides/swap/fusion
Cross-chainreferences/CROSSCHAIN.mdfile://1inch-mcp/guides/swap/crosschain

The references are the primary source (they work in every client). The MCP resource URIs serve the same content live for clients that read resources.

The manual signing snippets in the references (cast / Python / viem) are only needed without a WalletConnect session — with one, the tool executes through the connected wallet automatically.

Example prompts

  • "Quote swapping 100 USDC to ETH on Base"
  • "Swap 0.5 ETH to USDT on Arbitrum with Fusion"
  • "Swap 100 USDC from Ethereum to Polygon"

관련 작업

같은 저장소의 Skills

더 많은 Skills

모든 Skills