Skip to content

ry-animal/valkyriefinance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Valkyrie Finance πŸš€

AI-Powered DeFi Yield Optimization Platform

Development Status Build Status TypeScript Ask DeepWiki License

Valkyrie Finance combines cutting-edge AI technology with DeFi protocols to deliver automated, intelligent yield optimization. Now featuring live Web3 integration and production-ready AI engine.

✨ Latest Updates - Production Ready!

πŸŽ‰ Just Completed: Full Web3 integration with multi-chain wallet support πŸ€– Live: AI engine with sub-20ms portfolio optimization πŸš€ Deployed: Production-ready Vercel deployment with pnpm workspaces πŸ“Š Working: Real-time market data and AI recommendations πŸ” Secure: Full wallet integration with 300+ wallet support via Reown AppKit

πŸš€ Quick Start

# Clone and setup (one-time)
git clone <repository-url>
cd valkyriefinance
pnpm install

# Start all services (development)
pnpm dev

# Start AI engine (separate terminal)
cd apps/ai-engine && go run main.go

# Access applications
# Web App:    http://localhost:3001  βœ… Web3 + AI Integrated
# Server API: http://localhost:3000  βœ… tRPC + Database
# AI Engine:  http://localhost:8080  βœ… Go + Real Market Data
# Storybook:  http://localhost:6006  βœ… Component Library

Everything works! Full stack with Web3, AI, and production deployment ready.

πŸ† Production Features

βœ… Live & Working

  • πŸ”— Web3 Integration: Multi-chain wallet connection (Ethereum, Arbitrum, Optimism)
  • πŸ€– AI Engine: Live portfolio optimization with real market data
  • πŸ’° Smart Contracts: ERC-20 token and ERC-4626 vault deployed on Sepolia
  • 🎨 Component System: 20+ components with comprehensive Storybook
  • πŸ” Authentication: Wallet-based auth with Better Auth
  • πŸ“Š Real-time Data: Live market indicators and AI recommendations
  • ☁️ Cloud Ready: Vercel deployment with pnpm workspace support

πŸš€ Ready for Production

  • Database: PostgreSQL with Drizzle ORM and migrations
  • API: tRPC with end-to-end type safety
  • Testing: Comprehensive test suites (unit, integration, E2E)
  • Security: Full audit-ready smart contracts
  • Performance: Sub-20ms AI responses, optimized bundles

πŸ—οΈ Architecture

Monorepo Structure

valkyriefinance/
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ web/              # Next.js frontend (port 3001) βœ… Web3 + AI
β”‚   β”œβ”€β”€ server/           # tRPC API server (port 3000) βœ… Database + Auth
β”‚   β”œβ”€β”€ ai-engine/        # Go AI service (port 8080) βœ… Live Market Data
β”‚   └── storybook-host/   # Component docs (port 6006) βœ… 50+ Stories
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ ui/               # Component library βœ… 20+ Components
β”‚   β”œβ”€β”€ common/           # Shared utilities βœ… Types + Schemas
β”‚   β”œβ”€β”€ config/           # Configuration βœ… Multi-chain Support
β”‚   └── contracts/        # Smart contracts βœ… Deployed on Sepolia

Technology Stack

  • Frontend: Next.js 15, React 19, TypeScript, Tailwind CSS
  • Web3: Wagmi v2, Viem, Reown AppKit, ConnectKit (300+ wallets)
  • AI: Go-based engine with Modern Portfolio Theory
  • Backend: tRPC, Drizzle ORM, PostgreSQL, Better Auth
  • Contracts: Solidity, Foundry, OpenZeppelin, ERC-4626
  • Development: Storybook, Turbo, pnpm workspaces, Biome

🎯 Current Features

βœ… Web3 Features

  • Multi-chain Support: Ethereum, Arbitrum, Optimism, Sepolia
  • Wallet Integration: 300+ wallets via Reown AppKit
  • Smart Contracts: Live ERC-20 token and ERC-4626 vault
  • Real-time Balances: Live token balances and vault data
  • Transaction Management: Comprehensive transaction handling

βœ… AI Features

  • Portfolio Optimization: Sub-20ms AI-powered optimization
  • Market Analysis: Real-time Fear & Greed Index, volatility metrics
  • Risk Assessment: Advanced risk scoring and confidence metrics
  • Strategy Recommendations: AI-driven yield optimization

βœ… Platform Features

  • Dashboard: Real-time portfolio and AI analytics
  • Vault Management: ERC-4626 vault operations
  • User Authentication: Wallet-based authentication
  • Responsive Design: Mobile-first with dark/light themes

πŸ› οΈ Development Commands

# Development
pnpm dev                 # Start all services
pnpm dev:web            # Frontend only
pnpm dev:server         # Backend only
pnpm dev:storybook      # Storybook only

# AI Engine (Go)
cd apps/ai-engine
go run main.go          # Start AI service

# Building
pnpm build              # Build all packages
pnpm build:web          # Build frontend
pnpm build:server       # Build backend

# Testing
pnpm test               # Run all tests
pnpm test:watch         # Tests in watch mode
pnpm type-check         # TypeScript checking

# Smart Contracts
cd packages/contracts/foundry
forge build             # Compile contracts
forge test              # Run tests
forge script script/Deploy.s.sol --rpc-url sepolia # Deploy

πŸš€ Deployment

Vercel Deployment

The project is configured for seamless Vercel deployment with pnpm workspace support:

# Automatic deployment on push to main
git push origin main

# Manual deployment
vercel deploy --prod

Deployment URL: https://valkyrie-finance.vercel.app

AI Engine Deployment

# Docker deployment
docker build -t valkyrie-ai ./apps/ai-engine
docker run -p 8080:8080 valkyrie-ai

# Cloud deployment ready for AWS/GCP/Azure

πŸ“Š Performance Metrics

Feature Status Performance
Web3 Integration βœ… Live Instant wallet connection
AI Portfolio Optimization βœ… Live ~15ms response time
Smart Contract Calls βœ… Live Gas optimized
tRPC API βœ… Live Type-safe, fast
Component Library βœ… Complete 50+ documented stories
Build Pipeline βœ… Working 7/7 packages building

πŸ” Security & Best Practices

Smart Contract Security

  • Multiple security audits planned
  • OpenZeppelin battle-tested contracts
  • Comprehensive test coverage
  • Gas optimization (200 runs)

Web3 Security

  • Secure wallet integration
  • Multi-chain configuration
  • Safe transaction handling
  • Input validation on all Web3 calls

Application Security

  • TypeScript strict mode (100% coverage)
  • Input validation with Zod
  • SQL injection protection
  • Rate limiting and CORS

πŸ“š Documentation

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes with tests
  4. Commit changes (git commit -m 'Add amazing feature')
  5. Push to branch (git push origin feature/amazing-feature)
  6. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • OpenZeppelin for battle-tested smart contracts
  • Shadcn/UI for beautiful component primitives
  • Wagmi & Viem for excellent Web3 developer experience
  • tRPC for end-to-end type safety
  • Next.js for the amazing React framework

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published