# 1inch

> 1inch DEX aggregator. Find the best swap rates across 400+ liquidity sources on 12+ blockchains.

- **Type:** Skill
- **Install:** `agentstack add skill-demerzels-lab-elsamultiskillagent-1inch`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [Demerzels-lab](https://agentstack.voostack.com/s/demerzels-lab)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [Demerzels-lab](https://github.com/Demerzels-lab)
- **Source:** https://github.com/Demerzels-lab/elsamultiskillagent/tree/main/public/skills/0xterrybit/1inch
- **Website:** https://www.elsamultiskillagent.site/

## Install

```sh
agentstack add skill-demerzels-lab-elsamultiskillagent-1inch
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 1inch DEX Aggregator 🦄

The most popular DEX aggregator. Best rates across 400+ liquidity sources on 12+ blockchains.

## Environment Variables

| Variable | Description | Required |
|----------|-------------|----------|
| `ONEINCH_API_KEY` | 1inch API Key | Yes |

## 💎 Referral Fee Configuration

This skill includes a referral fee (0.3%) to support development. The fee is transparently disclosed to users.

| Variable | Value | Description |
|----------|-------|-------------|
| `REFERRER_ADDRESS` | `0x890CACd9dEC1E1409C6598Da18DC3d634e600b45` | EVM wallet to receive fees |
| `FEE_PERCENT` | 0.3 | 0.3% referral fee |

> 💡 For high-volume integrations ($10M+), contact 1inch for custom revenue share agreements.

## Features

- 🔄 **400+ Liquidity Sources** - Uniswap, SushiSwap, Curve, Balancer, etc.
- ⛓️ **12+ Chains** - Ethereum, BSC, Polygon, Arbitrum, Optimism, etc.
- 🛡️ **Fusion Mode** - Gasless swaps with MEV protection
- 📊 **Pathfinder Algorithm** - Optimal routing across DEXs
- 💰 **Limit Orders** - Set price targets

## API Base URL

```
https://api.1inch.dev
```

## Get Swap Quote

```bash
API_KEY="${ONEINCH_API_KEY}"
CHAIN_ID="1"  # Ethereum

# Token addresses
SRC_TOKEN="0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"  # ETH (native)
DST_TOKEN="0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"  # USDC
AMOUNT="1000000000000000000"  # 1 ETH in wei
FROM_ADDRESS=""

# Referral configuration
REFERRER="0x890CACd9dEC1E1409C6598Da18DC3d634e600b45"
FEE="0.3"  # 0.3%

curl -s "https://api.1inch.dev/swap/v6.0/${CHAIN_ID}/swap" \
  -H "Authorization: Bearer ${API_KEY}" \
  -G \
  --data-urlencode "src=${SRC_TOKEN}" \
  --data-urlencode "dst=${DST_TOKEN}" \
  --data-urlencode "amount=${AMOUNT}" \
  --data-urlencode "from=${FROM_ADDRESS}" \
  --data-urlencode "slippage=1" \
  --data-urlencode "referrer=${REFERRER}" \
  --data-urlencode "fee=${FEE}" | jq '{
    dstAmount: .dstAmount,
    srcAmount: .srcAmount,
    protocols: .protocols,
    tx: .tx
  }'
```

## Get Quote Only (No Transaction)

```bash
curl -s "https://api.1inch.dev/swap/v6.0/${CHAIN_ID}/quote" \
  -H "Authorization: Bearer ${API_KEY}" \
  -G \
  --data-urlencode "src=${SRC_TOKEN}" \
  --data-urlencode "dst=${DST_TOKEN}" \
  --data-urlencode "amount=${AMOUNT}" \
  --data-urlencode "fee=${FEE}" | jq '{
    dstAmount: .dstAmount,
    srcAmount: .srcAmount,
    protocols: .protocols,
    gas: .gas
  }'
```

## Fusion Mode (Gasless Swap)

```bash
# Get Fusion quote
curl -s "https://api.1inch.dev/fusion/quoter/v2.0/${CHAIN_ID}/quote/receive" \
  -H "Authorization: Bearer ${API_KEY}" \
  -G \
  --data-urlencode "srcChain=${CHAIN_ID}" \
  --data-urlencode "dstChain=${CHAIN_ID}" \
  --data-urlencode "srcTokenAddress=${SRC_TOKEN}" \
  --data-urlencode "dstTokenAddress=${DST_TOKEN}" \
  --data-urlencode "amount=${AMOUNT}" \
  --data-urlencode "walletAddress=${FROM_ADDRESS}" | jq '.'
```

## Get Token List

```bash
curl -s "https://api.1inch.dev/swap/v6.0/${CHAIN_ID}/tokens" \
  -H "Authorization: Bearer ${API_KEY}" | jq '.tokens | to_entries[:10] | .[] | {symbol: .value.symbol, address: .key, decimals: .value.decimals}'
```

## Check Allowance

```bash
TOKEN_ADDRESS="0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"  # USDC
WALLET_ADDRESS=""

curl -s "https://api.1inch.dev/swap/v6.0/${CHAIN_ID}/approve/allowance" \
  -H "Authorization: Bearer ${API_KEY}" \
  -G \
  --data-urlencode "tokenAddress=${TOKEN_ADDRESS}" \
  --data-urlencode "walletAddress=${WALLET_ADDRESS}" | jq '.allowance'
```

## Get Approval Transaction

```bash
curl -s "https://api.1inch.dev/swap/v6.0/${CHAIN_ID}/approve/transaction" \
  -H "Authorization: Bearer ${API_KEY}" \
  -G \
  --data-urlencode "tokenAddress=${TOKEN_ADDRESS}" \
  --data-urlencode "amount=${AMOUNT}" | jq '{to: .to, data: .data, value: .value}'
```

## Supported Chains

| Chain | ID | Native Token |
|-------|-----|--------------|
| Ethereum | 1 | ETH |
| BSC | 56 | BNB |
| Polygon | 137 | MATIC |
| Arbitrum | 42161 | ETH |
| Optimism | 10 | ETH |
| Avalanche | 43114 | AVAX |
| Gnosis | 100 | xDAI |
| Fantom | 250 | FTM |
| zkSync Era | 324 | ETH |
| Base | 8453 | ETH |
| Aurora | 1313161554 | ETH |
| Klaytn | 8217 | KLAY |

## Common Token Addresses

| Token | Ethereum | Polygon |
|-------|----------|---------|
| Native | 0xEeee...EEeE | 0xEeee...EEeE |
| USDC | 0xA0b8...1d0F | 0x2791...1ec7 |
| USDT | 0xdAC1...1ec7 | 0xc2132...1ec7 |
| WETH | 0xC02a...6Cc2 | 0x7ceB...6Cc2 |

## Limit Orders

```bash
# Create limit order
curl -s -X POST "https://api.1inch.dev/orderbook/v4.0/${CHAIN_ID}/order" \
  -H "Authorization: Bearer ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "orderHash": "",
    "signature": "",
    "data": {
      "makerAsset": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "takerAsset": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
      "makingAmount": "1000000000",
      "takingAmount": "500000000000000000",
      "maker": ""
    }
  }'
```

## Safety Rules

1. **ALWAYS** display swap details before execution
2. **WARN** if price impact > 1%
3. **CHECK** token allowance before swap
4. **VERIFY** slippage settings
5. **NEVER** execute without user confirmation

## Error Handling

| Error | Cause | Solution |
|-------|-------|----------|
| `insufficient funds` | Low balance | Check wallet balance |
| `cannot estimate` | Route not found | Try different amount |
| `allowance` | Token not approved | Approve token first |

## Links

- [1inch Docs](https://docs.1inch.io/)
- [API Portal](https://portal.1inch.dev/)
- [Developer Hub](https://1inch.io/page-api/)

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [Demerzels-lab](https://github.com/Demerzels-lab)
- **Source:** [Demerzels-lab/elsamultiskillagent](https://github.com/Demerzels-lab/elsamultiskillagent)
- **License:** MIT
- **Homepage:** https://www.elsamultiskillagent.site/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-demerzels-lab-elsamultiskillagent-1inch
- Seller: https://agentstack.voostack.com/s/demerzels-lab
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
