AgentDEX is a decentralized exchange that combines traditional DEX functionality with an AI agent interface for a more intuitive trading experience. Users can interact with the protocol through both a traditional swap interface and a conversational AI agent that helps manage trades and liquidity positions.
- Token swaps with automatic price calculation
- Liquidity provision and fee collection
- Intelligent forwarding to Uniswap V2 for optimal trade execution
- Support for any ERC20 token pair
- Natural language interaction for trades and liquidity management
- Conversational interface for managing positions
- Trade suggestions based on pool analysis
- Clear explanations of complex DeFi operations
- Smart contract protocol built with Solidity
- Nest.js backend with GraphQL API
- React frontend with both traditional and chat interfaces
- Automated testing suite
- AgentDEX: AI-Powered Decentralized Exchange
- Make sure to set the env variables
- Node.js >= 16
- Docker
- MetaMask or other Web3 wallet
git clone https://github.com/All-Khwarizmi/agent-dex.git
cd agent-dex
yarn install# Let’s start the local node
yarn chain
# Compile contracts
yarn compile
# Deploy contracts
yarn deploy
# Add factory contract address to .env.local in backend package
# You can find the address in packages/protocol/contracts/deployedContracts.ts (after deployment)
# Be careful to select the right chain!
# AND
# on the frontend under /debug
# Setup database
yarn db
# Start backend
# You can either use docker
yarn backend:docker
# or run it locally
yarn backend:start
# Start frontend
yarn start
# Contracts tests
yarn test
# Backend tests
yarn backend:test- Connect your wallet
- Select tokens for swap
- Enter amount
- Confirm transaction
- Factory contract for pool creation and management
- Pool contracts for individual token pairs
- Uniswap V2 integration for trade forwarding
- Pool creation/modification events
- Swap events
- Liquidity addition/removal events
- Built on proven DEX patterns
- Comprehensive testing suite
- Security-first development approach
- Price manipulation prevention
- Front-running protection
- Proper access controls
We welcome contributions! Please see our contributing guidelines.
MIT
- Uniswap V2 team for protocol inspiration
- OpenZeppelin for security patterns