NEXUS INTENT
Swap crypto using Powered by GPT-4 + 1inch Fusion using natural language.
Problem Statement
The AI Cross-Chain Swap Assistant is an intelligent DeFi interface that lets users initiate cryptocurrency swaps across multiple blockchains using natural language input. Instead of interacting with complex UIs or manually configuring token and network details, users can simply type commands like:“Swap 1 ETH to USDC on Arbitrum” or “Convert 0.1 BTC to ETH”The system uses OpenAI GPT-4 to parse user input into structured transaction parameters such as:Source and destination tokensBlockchain networksAmountsIntent confidenceIt then integrates with the 1inch Fusion+ API to fetch live quotes, build transactions, and simulate or execute swaps. The application supports both same-chain and cross-chain operations, and includes support for native and ERC-20 tokens across Ethereum, Arbitrum, Polygon, and even Bitcoin (simulated).Key Components:FastAPI backend: Handles requests, parsing, and 1inch integration.AI parsing module: Uses GPT-4 to extract structured swap data from free-form text.1inch service module: Interfaces with the 1inch Fusion+ API to quote and prepare transactions.Wallet module: Supports transaction signing, balance checking, and mock execution.Demo + hackathon scripts: Showcase full user flows, system health checks, and innovation highlights.Supported Features:Natural language DeFi swap interfaceCross-chain detection and routingGas and price impact estimation1inch Fusion+ quote and swap integrationModular wallet abstraction with mock supportEnd-to-end working demo and test harnessWhy It Matters: Today’s DeFi tools are powerful but difficult for everyday users to access. This project makes DeFi radically more accessible by replacing dropdowns and arcane token symbols with a conversation, bridging the gap between user-friendly AI and deep protocol-level functionality.
Solution
Draft EIP = https://github.com/ethereum/EIPs/pull/10085AI Swap – Natural Language to DeFi Execution User Input The user types something like: “Swap 10 ETH to USDC on Ethereum”AI Parser (GPT-4) The message is sent to GPT-4 (via OpenAI API), which parses it into a structured JSON intent:{ "from_chain": "ethereum", "to_chain": "arbitrum", "from_token": "ETH", "to_token": "USDC", "amount": "10" } Intent Validation The backend checks:Are the tokens/chains supported?Is the amount valid?Are the tokens available on the selected chains?Quote via 1inch Fusion+ APIA live quote is fetched from 1inch’s /quote endpoint.Includes estimated output, gas costs, execution time.Build TransactionA transaction is built using /swap endpoint from 1inch.Includes parameters like slippage, token addresses, amount in wei.Wallet Execution (or Mock)The transaction is signed and (optionally) broadcast using the SimpleWallet class.For demo use, a mock hash is returned with a simulated explorer link.Secure Intents – Cryptographic Swap Authorisation (Optional Mode) Intent Signing (User or AI Agent) The parsed JSON intent is:HashedSigned using EIP-712 (or standard Ethereum signature)Optionally encrypted for confidentiality (e.g., with X402 or similar)SecureIntent Format A SecureIntent looks like:{ "payload": "ENCRYPTED_SWAP_DETAILS", "ttl": 300, "signature": "0x...", "address": "0xUserWallet" } Verification on BackendSignature is verified against addressttl (time-to-live) prevents replay attacksIf encrypted, payload is decryptedTrusted Execution Once verified:The intent is treated as trusted and executedExecution logs are linked back to signer’s address
Hackathon
ETHGlobal Unite
2025
Contributors
- KBryan
10 contributions