Making DeFi Easy, Accessible, and Intelligent for Everyone
DeFies is a revolutionary AI-powered DeFi platform built specifically for the Sei blockchain ecosystem. We combine artificial intelligence, advanced analytics, and seamless DEX integration to guide users through their DeFi journey with unprecedented ease and intelligence.
"Making the world easier for blockchainies"
We believe DeFi should be accessible to everyone, not just crypto experts. DeFies bridges the gap between complex DeFi protocols and everyday users through AI-powered guidance, intelligent automation, and a unified platform experience.
DeFies is an all-in-one DeFi platform that offers:
- π€ AI-Powered Chatbot: Intelligent assistant that understands DeFi and guides users
- π Advanced Analytics: Real-time insights and personalized recommendations
- π DEX Integration: Direct interaction with multiple DEXes without leaving our platform
- π° Smart Liquidity Management: AI-suggested concentrated liquidity positions
- π Portfolio Tracking: Comprehensive balance monitoring
- π οΈ Developer Tools: Open-source tools for the Sei ecosystem
DeFies is built with a modern, scalable architecture designed for reliability and performance:
Next.js 14 + TypeScript + Tailwind CSS
Modern, responsive web interface with advanced DeFi functionality:
frontend/
βββ app/ # Next.js App Router
β βββ globals.css # Global styles
β βββ layout.tsx # Root layout
β βββ page.tsx # Home page
β βββ liquidity/ # Liquidity management pages
βββ components/ # React components
β βββ ui/ # Base UI components
β βββ liquidity/ # Liquidity-specific components
β βββ home-page.tsx # Main landing page
β βββ liquidity-provider.tsx # Liquidity interface
β βββ chat-interface.tsx # AI chatbot component
β βββ pools-page.tsx # Pool browsing
βββ hooks/ # Custom React hooks
β βββ useCurrentPrice.ts # Real-time price data
β βββ useLiquidityManager.ts # Liquidity operations
β βββ usePool.ts # Pool data management
β βββ usePools.ts # Multiple pools handling
βββ adapters/ # External service adapters
β βββ contracts/ # Smart contract interactions
β βββ apis/ # API communication
β βββ liquidity/ # Liquidity calculations
β βββ wallet/ # Wallet integrations
βββ services/ # Business logic services
βββ contexts/ # React contexts (wallet, theme)
βββ constants/ # Configuration (networks, DEXes, tokens)
βββ types/ # TypeScript definitions
Key Features:
- Beautiful, responsive UI with dark theme and gradients
- Real-time price charts and analytics
- Advanced liquidity position management
- Wallet integration (MetaMask, WalletConnect)
- AI chatbot integration
- Multi-DEX support (DragonSwap, Sailor)
Rust + Actix-Web
High-performance API gateway handling all business logic:
rust_backend_api_gateway/
βββ src/
β βββ main.rs # Application entry point
β βββ application/ # Application layer
β β βββ dtos/ # Data transfer objects
β β βββ service/ # Application services
β β βββ use_cases/ # Business use cases
β βββ domain/ # Domain layer
β β βββ repositories/ # Repository interfaces
β β βββ services/ # Domain services
β βββ infrastructure/ # Infrastructure layer
β β βββ data/ # Data providers
β β βββ external_apis/ # External API integrations
β β βββ wallet/ # Wallet services
β β βββ jwt.rs # JWT authentication
β βββ presentation/ # Presentation layer
β β βββ handlers.rs # HTTP handlers
β β βββ routes.rs # Route definitions
β βββ math/ # Mathematical calculations
β βββ config/ # Configuration management
βββ migration/ # Database migrations
βββ docker-compose.yml # Docker configuration
Key Features:
- High-performance Rust backend with Actix-Web
- Clean architecture with layered design
- RESTful API for frontend communication
- Data providers for Binance, DragonSwap, and Sailor
- JWT-based authentication
- Advanced mathematical calculations for DeFi
- External API integrations
- EVM wallet support
Node.js + MCP Protocol
Intelligent AI agent with blockchain tools integration:
mcp-client/
βββ src/
β βββ index.js # Application entry point
β βββ agent/ # AI agent logic
β β βββ seiAgent.js # Sei-specific AI agent
β βββ config/ # Configuration
β β βββ env.js # Environment settings
β βββ infra/ # Infrastructure adapters
β β βββ mcp/ # MCP protocol client
β β βββ rest/ # REST API client
β β βββ sei/ # Sei blockchain client
β βββ llm/ # Language model integration
β β βββ LLM.js # LLM interface
β βββ server/ # HTTP server
β β βββ httpServer.js # Express server setup
β βββ tools/ # Blockchain tools
β β βββ mcpBalanceTool.js # Balance checking
β β βββ mcpTokenBalanceTool.js # Token balance queries
β β βββ poolsDataTool.js # Pool data retrieval
β β βββ tokenPairPriceHistoryTool.js # Price history
β βββ utils/ # Utility functions
β βββ responseProcessor.js # Response processing
β βββ tokenRegistry.js # Token registry
Key Features:
- MCP (Model Context Protocol) integration
- Communication with Sei MCP server
- Integration with external APIs via Rust backend
- Sei blockchain tools and utilities
- Natural language processing for DeFi queries
- Real-time balance tracking
- Smart recommendations engine
- Token and pool data analysis
Solidity + Foundry
Secure, efficient smart contracts for DEX interactions:
contracts/
βββ src/
β βββ LiquidityManager.sol # Main liquidity management contract
β βββ Counter.sol # Example contract
β βββ interfaces/ # Contract interfaces
β β βββ INonfungiblePositionManager.sol
β β βββ IPool.sol
β βββ libraries/ # Mathematical libraries
β βββ FixedPoint96.sol
β βββ FullMath.sol
β βββ LiquidityAmounts.sol
β βββ TickMath.sol
βββ script/ # Deployment scripts
β βββ DeployLiquidityManager.s.sol
β βββ TestMintLiquiidtyDragonUsingNFPM.sol
β βββ TestMintLiquiidtySailorUsingNFPM.sol
β βββ testMintLqiuidity.s.sol
βββ test/ # Contract tests
β βββ LiquidityManager.t.sol
β βββ Counter.t.sol
βββ examples/ # Usage examples
β βββ MintLiquidityExample.sol
β βββ typescript/
βββ lib/ # External libraries
βββ forge-std/
βββ openzeppelin-contracts/
Network: Sei Pacific-1 (EVM)
DeFies LiquidityManager: 0x36BcE29839Db8DC5cbA2dC64200A729558baB8FD
View contract details, transactions, and verification status on SeiTrace explorer.
Key Features:
- Optimized gas usage for Sei blockchain
- Multi-DEX compatibility (DragonSwap, Sailor)
- Advanced liquidity calculations using proven libraries
- Comprehensive test suite with Foundry
- Security-focused design with OpenZeppelin
- Example implementations and TypeScript integration
- Automated deployment scripts
- Node.js 18+ and npm/pnpm
- Rust 1.70+ and Cargo
- Foundry (for smart contracts)
git clone https://github.com/your-org/defies.git
cd defiesCopy the example environment files and configure them:
# Frontend
cp frontend/.env.example frontend/.env
# Rust Backend
cp rust_backend_api_gateway/.env.example rust_backend_api_gateway/.env
# MCP Client
cp mcp-client/.env.example mcp-client/.envStart Rust Backend:
cd rust_backend_api_gateway
cargo runStart MCP Client:
cd mcp-client
npm install
npm startStart Frontend:
cd frontend
pnpm install
pnpm devDeploy Smart Contracts:
cd contracts
forge install
forge build
forge script script/DeployLiquidityManager.s.sol --rpc-url $SEI_RPC_URL --broadcast- Frontend: http://localhost:3000
- Rust Backend: http://localhost:8080
- MCP Client: http://localhost:3001
- Natural language DeFi queries
- Real-time balance and portfolio information
- Smart liquidity position recommendations
- Educational guidance and explanations
- Real-time price charts and market data
- Liquidity distribution analysis
- Historical performance tracking
- Risk assessment and optimization
- Direct integration with DragonSwap and Sailor
- Create liquidity positions without leaving the platform
- Automated transaction handling via smart contracts
- Multi-DEX portfolio management
- AI-suggested optimal price ranges
- Liquidity position creation and management
- Multi-DEX integration (DragonSwap, Sailor)
- Price range configuration tools
Frontend:
cd frontend
pnpm testRust Backend:
cd rust_backend_api_gateway
cargo testSmart Contracts:
cd contracts
forge testRust:
cargo fmt # Format code
cargo clippy # Lint codeFrontend:
pnpm lint # ESLint
pnpm format # PrettierWe welcome contributions! Please see our Contributing Guidelines for details on:
- Code style and standards
- Testing requirements
- Pull request process
- Issue reporting
- Smart contracts audited and tested
- Secure wallet integration
- JWT-based authentication
- Input validation and sanitization
This project is licensed under the MIT License - see the LICENSE file for details.
Making the world easier for blockchainies π
Built with β€οΈ for the Sei ecosystem and the DeFi community