{
  "axon_version": "1.0.0",
  "protocol": {
    "name": "1inch",
    "slug": "1inch-ethereum",
    "version": "v6",
    "description": "Leading DEX aggregator that sources liquidity across multiple decentralized exchanges to find optimal swap routes. Supports Fusion mode (gasless, MEV-protected swaps via resolvers) and Classic mode (direct on-chain execution).",
    "category": "dex",
    "chain": {
      "id": 1,
      "name": "ethereum",
      "network": "mainnet"
    },
    "contracts": {
      "aggregation_router": {
        "address": "0x111111125421cA6dc452d289314280a0f8842A65",
        "label": "AggregationRouterV6",
        "verified": true
      }
    },
    "links": {
      "website": "https://1inch.io",
      "docs": "https://portal.1inch.dev",
      "github": "https://github.com/1inch"
    },
    "off_chain_api": {
      "description": "1inch API provides off-chain route optimization before on-chain execution. An API key is required.",
      "base_url": "https://api.1inch.dev/swap/v6.0/1",
      "authentication": {
        "type": "bearer_token",
        "header": "Authorization",
        "description": "Requires a 1inch Developer Portal API key passed as Bearer token"
      },
      "endpoints": {
        "quote": {
          "method": "GET",
          "path": "/quote",
          "description": "Get the best swap route and expected output amount without generating transaction data",
          "parameters": {
            "src": "Source token address",
            "dst": "Destination token address",
            "amount": "Amount of source token to swap (in smallest unit / wei)",
            "protocols": "(optional) Comma-separated list of liquidity protocols to use",
            "fee": "(optional) Partner fee percentage (0-3)",
            "includeGas": "(optional) Include gas estimation in response"
          }
        },
        "swap": {
          "method": "GET",
          "path": "/swap",
          "description": "Get swap transaction data for on-chain execution",
          "parameters": {
            "src": "Source token address",
            "dst": "Destination token address",
            "amount": "Amount of source token to swap (in smallest unit / wei)",
            "from": "Address of the sender",
            "slippage": "Maximum acceptable slippage percentage (0.1 - 50)",
            "protocols": "(optional) Comma-separated list of liquidity protocols",
            "fee": "(optional) Partner fee percentage",
            "referrer": "(optional) Referral address for fee sharing",
            "disableEstimate": "(optional) Disable gas estimation for faster response"
          }
        }
      },
      "rate_limits": {
        "requests_per_second": 2,
        "requests_per_minute": 60
      }
    }
  },
  "actions": [
    {
      "id": "get_quote",
      "name": "Get Swap Quote",
      "description": "Fetches the optimal swap route and expected output amount from 1inch's off-chain routing engine. This is an off-chain API call that does not require gas and should be called before executing a swap.",
      "type": "swap",
      "parameters": [
        {
          "name": "src",
          "type": "address",
          "required": true,
          "description": "Contract address of the source (input) token. Use 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for native ETH."
        },
        {
          "name": "dst",
          "type": "address",
          "required": true,
          "description": "Contract address of the destination (output) token"
        },
        {
          "name": "amount",
          "type": "uint256",
          "required": true,
          "description": "Amount of source token to swap, in wei (smallest unit)"
        },
        {
          "name": "protocols",
          "type": "string",
          "required": false,
          "description": "Comma-separated list of liquidity sources to include (e.g. 'UNISWAP_V3,CURVE'). Omit for all sources."
        },
        {
          "name": "fee",
          "type": "string",
          "required": false,
          "description": "Partner fee percentage (0-3). Deducted from the swap return amount."
        },
        {
          "name": "includeGas",
          "type": "bool",
          "required": false,
          "description": "Whether to include gas cost estimate in the response",
          "default": "true"
        }
      ],
      "constraints": {
        "min_amount": "1",
        "max_slippage_bps": 5000,
        "deadline_required": false,
        "supported_tokens": "any_erc20_or_native"
      },
      "approvals": [],
      "transaction_flow": [
        {
          "step": 1,
          "action": "off_chain_quote",
          "description": "Call 1inch Quote API to get the optimal route and expected output. No gas required.",
          "contract": "off_chain",
          "method": "GET /swap/v6.0/1/quote?src={src}&dst={dst}&amount={amount}",
          "conditional": "always",
          "returns": ["dstAmount", "protocols", "gas"]
        }
      ],
      "risk_warnings": [
        "Quote amounts are estimates and may change between quote and execution",
        "Large swaps may experience significant price impact across DEX pools",
        "API rate limits apply — cache quotes where possible"
      ]
    },
    {
      "id": "swap",
      "name": "Execute Swap",
      "description": "Executes a token swap through the 1inch Aggregation Router. First fetches optimized calldata from the 1inch API (off-chain), then submits the transaction on-chain. Requires token approval for the router contract.",
      "type": "swap",
      "parameters": [
        {
          "name": "src",
          "type": "address",
          "required": true,
          "description": "Contract address of the source (input) token. Use 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for native ETH."
        },
        {
          "name": "dst",
          "type": "address",
          "required": true,
          "description": "Contract address of the destination (output) token"
        },
        {
          "name": "amount",
          "type": "uint256",
          "required": true,
          "description": "Exact amount of source token to swap, in wei"
        },
        {
          "name": "from",
          "type": "address",
          "required": true,
          "description": "Address of the wallet executing the swap"
        },
        {
          "name": "slippage",
          "type": "string",
          "required": true,
          "description": "Maximum acceptable slippage as a percentage (e.g. '1' for 1%)",
          "constraints": {
            "min": "0.1",
            "max": "50"
          }
        },
        {
          "name": "receiver",
          "type": "address",
          "required": false,
          "description": "Address that receives the output tokens. Defaults to 'from' address."
        },
        {
          "name": "referrer",
          "type": "address",
          "required": false,
          "description": "Referral address for fee-sharing program"
        }
      ],
      "constraints": {
        "min_amount": "1",
        "max_slippage_bps": 5000,
        "deadline_required": false,
        "supported_tokens": "any_erc20_or_native"
      },
      "approvals": [
        {
          "type": "erc20_approve",
          "token": "src",
          "spender": "aggregation_router",
          "amount": "exact_or_max"
        }
      ],
      "transaction_flow": [
        {
          "step": 1,
          "action": "check_allowance",
          "description": "Check if the 1inch router has sufficient allowance to spend the source token. Skip for native ETH.",
          "contract": "src",
          "method": "allowance(address,address)",
          "conditional": "if_not_native_token"
        },
        {
          "step": 2,
          "action": "approve",
          "description": "Approve the 1inch Aggregation Router to spend source tokens",
          "contract": "src",
          "method": "approve(address,uint256)",
          "conditional": "if_allowance_insufficient"
        },
        {
          "step": 3,
          "action": "off_chain_build_tx",
          "description": "Call 1inch Swap API to get optimized calldata with route, amounts, and gas parameters",
          "contract": "off_chain",
          "method": "GET /swap/v6.0/1/swap?src={src}&dst={dst}&amount={amount}&from={from}&slippage={slippage}",
          "conditional": "always",
          "returns": ["tx.to", "tx.data", "tx.value", "tx.gas"]
        },
        {
          "step": 4,
          "action": "execute",
          "description": "Submit the swap transaction on-chain using the calldata from step 3",
          "contract": "aggregation_router",
          "method": "swap(address,(address,address,address,address,uint256,uint256,uint256),bytes,bytes)",
          "returns": ["returnAmount", "spentAmount"]
        }
      ],
      "risk_warnings": [
        "Always use slippage protection — never set slippage to 50%",
        "Route may differ from quote if market moves between API call and execution",
        "For large swaps (>$100K), consider splitting across multiple transactions",
        "Verify the tx.to address matches the known 1inch router before signing"
      ]
    }
  ],
  "risk": {
    "audit_status": {
      "audited": true,
      "auditors": ["OpenZeppelin", "ChainSecurity", "Decurity", "Pessimistic"],
      "last_audit_date": "2024-11-01",
      "audit_reports": [
        "https://github.com/1inch/1inch-audits"
      ]
    },
    "tvl": {
      "current_usd": 0,
      "source": "defillama",
      "last_updated": "2026-03-07T00:00:00Z"
    },
    "incidents": [
      {
        "date": "2023-03-20",
        "severity": "medium",
        "title": "1inch Resolver vulnerability",
        "description": "A vulnerability in the resolver contract was identified and patched. No user funds were lost.",
        "resolved": true,
        "post_mortem": "https://blog.1inch.io"
      }
    ],
    "risk_score": {
      "overall": "A",
      "smart_contract": "A",
      "centralization": "B+",
      "oracle_dependence": "A+",
      "liquidity": "A+"
    }
  },
  "fees": {
    "model": "per_trade",
    "tiers": [
      {
        "name": "aggregator_fee",
        "fee_bps": 0,
        "description": "0% — 1inch does not charge protocol fees on classic swaps",
        "conditions": "Standard aggregation swaps"
      },
      {
        "name": "positive_slippage",
        "fee_bps": null,
        "description": "Positive slippage (price improvement) may be partially retained by resolvers in Fusion mode",
        "conditions": "Fusion mode swaps"
      },
      {
        "name": "partner_fee",
        "fee_bps": null,
        "description": "Optional partner/integrator fee (0-3%), configurable via API parameter",
        "conditions": "When integrator sets fee parameter"
      }
    ],
    "gas_estimates": {
      "swap_simple": "175000",
      "swap_complex_route": "350000",
      "approve": "46000"
    }
  }
}