https://github.com/mollybeach/hedgepod
๐ฆ๐ซ HedgePod is a โ๏ธ ๐ ETHGlobal Buenos Aires ๐ฆ๐ท Prize Pool Winner ๐ World Mini App that solves crypto's biggest UX problem: chain fragmentation. Autonomous cross-chain DeFi that makes 23M World App users their own hedge fund. Deposit once. AI agents automatically rebalance across 8+ chains for optimal yield. Gasless. Built for non-crypto use
https://github.com/mollybeach/hedgepod
1inch autonomous-agent cdp cross-chain defi layerzero oft omnichain privy pyth-network rebalancing uniswap-v4 world-mini-app yield-aggregator
Last synced: 14 days ago
JSON representation
๐ฆ๐ซ HedgePod is a โ๏ธ ๐ ETHGlobal Buenos Aires ๐ฆ๐ท Prize Pool Winner ๐ World Mini App that solves crypto's biggest UX problem: chain fragmentation. Autonomous cross-chain DeFi that makes 23M World App users their own hedge fund. Deposit once. AI agents automatically rebalance across 8+ chains for optimal yield. Gasless. Built for non-crypto use
- Host: GitHub
- URL: https://github.com/mollybeach/hedgepod
- Owner: mollybeach
- License: mit
- Created: 2025-11-22T00:40:08.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2025-11-30T04:29:56.000Z (7 months ago)
- Last Synced: 2025-12-02T09:31:29.411Z (7 months ago)
- Topics: 1inch, autonomous-agent, cdp, cross-chain, defi, layerzero, oft, omnichain, privy, pyth-network, rebalancing, uniswap-v4, world-mini-app, yield-aggregator
- Language: TypeScript
- Homepage: https://hedgepod.app
- Size: 45.3 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# ๐ฆ๐ซ HedgePod Agent
> **Build your own AI-powered hedge fund**
> **Autonomous cross-chain DeFi that makes 23M World App users their own hedge fund.**
**TL;DR**: Deposit once. AI agents automatically rebalance across 8+ chains for optimal yield. Gasless. Chain-abstracted. Human-readable. Built for non-crypto users.
[](https://hedgepod.app)
[](https://youtu.be/lSkDzICg0vg)
[](https://opensource.org/licenses/MIT)
[](https://discord.com/invite/5C7yYrsR)
[](https://x.com/hedgepod)
[](https://t.me/hedgepod)
## ๐ Links
- ๐ **Live Demo**: [hedgepod.app](https://hedgepod.app)
- ๐ฌ **Demo Video**: [Watch on YouTube](https://youtu.be/lSkDzICg0vg)
- ๐ฌ **Discord**: [Join our community](https://discord.com/invite/5C7yYrsR)
- ๐ฑ **Telegram**: [t.me/hedgepod](https://t.me/hedgepod)
- ๐ฆ **Twitter/X**: [@hedgepod](https://x.com/hedgepod)
- ๐ธ **Instagram**: [@hedgepod_app](https://www.instagram.com/hedgepod_app/)
- ๐ป **GitHub**: [mollybeach/hedgepod](https://github.com/mollybeach/hedgepod)
## ๐ Table of Contents
- [What Is HedgePod?](#-what-is-hedgepod-agent)
- [Key Integrations](#-key-integrations)
- [Architecture](#๏ธ-architecture)
- [Multi-Language Support](#-multi-language-support) ๐ **19 languages**
- [Quick Start](#-quick-start)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Environment Setup](#environment-setup) โก **Start here!**
- [Deploy Contracts](#deploy-contracts)
- [Run Frontend](#run-frontend)
- [Tech Stack](#-tech-stack)
- [Documentation](#-documentation)
- [Contact](#-contact)
---
## ๐ฏ What Is HedgePod Agent?
HedgePod Agent is a World mini app that solves crypto's biggest UX problem: **chain fragmentation**.
Users deposit USDC/ETH/USDT once, and autonomous AI agents:
- **Monitor yields** across 8+ chains in real-time using Pyth Network price feeds and APR calculations
- **Move funds** via LayerZero omnichain fungible tokens (OFTs) with custom APR-aware routing logic
- **Execute optimal swaps** through 1inch aggregation across 50+ DEXs when profitable
- **Trade on Uniswap v4** with dynamic fee hooks that adjust (0.1%-0.3%) based on real-time Pyth volatility data
- **Access real pool data** from The Graph's Uniswap v3 subgraphs for liquidity and volume information
- **Ensure fair rewards** using Pyth Entropy for verifiable randomness in agent selection
- **Operate 24/7 autonomously** powered by Coinbase CDP server wallets with x402 authorization
- **All gasless** (Privy sponsorship), **all transparent** (ENS names), **all automated**
**Built for the 23M World App users who don't know what an RPC isโand never should.**
โจ HedgePod's consumer-grade UI with Animal Crossing-inspired design
### ๐ก What Makes HedgePod Unique?
- **Real-Time Data**: All prices, volatility, liquidity, and volume from live APIs (Pyth, The Graph, 1inch)โno mock data
- **True Cross-Chain**: LayerZero OFT extended with custom logicโonly moves funds if APR improvement justifies gas
- **Dynamic Pricing**: Uniswap v4 hook adjusts swap fees automatically based on market volatility to protect liquidity providers
- **Autonomous Agents**: Coinbase CDP server wallets execute rebalances 24/7 without user approval (via x402 authorization)
- **Consumer UX**: Animal Crossing-themed UI, ENS names everywhere, gasless transactions, World ID verification
- **Multi-Language**: Available in 19 languages to serve World App's global 23M user base
---
## ๐ Key Integrations
### Cross-Chain Infrastructure
- **LayerZero V2** - Extended OFT contracts with custom APR-aware routing logic. Only transfers funds cross-chain if yield improvement exceeds threshold. Deployed across 8 chains with automated peer configuration.
### DeFi & Swaps
- **Uniswap v4** - Dynamic fee hooks (`VolatilityFeeHook.sol`) that adjust swap fees (0.1%-0.3%) based on real-time Pyth volatility. Protects LPs from impermanent loss during high volatility.
- **1inch Aggregation Protocol** - Swap, Quote, Price, and Liquidity Source APIs for optimal routing across 50+ DEXs. Used by agents for best execution and portfolio valuation.
### Real-Time Data & Oracles
- **Pyth Network** - Pull-based price feeds via Hermes API for ETH/USD, BTC/USD, USDC/USD. Volatility calculations from confidence intervals power dynamic fees.
- **Pyth Entropy** - Verifiable randomness for fair agent selection and weekly lottery rewards. MEV protection through random rebalancing order. **[PR Submitted](https://github.com/pyth-network/pyth-examples/pull/82)**
- **The Graph** - GraphQL queries to Uniswap v3 subgraphs across 5 chains. Real liquidity ($245.8M+ TVL) and 24h volume dataโno mocks.
### UX & Identity
- **World (MiniKit)** - Full SDK integration for 23M user distribution. MiniKitProvider, wallet auth, SIWE, transactions via `sendTransactionViaMiniKit()`.
- **World ID (IDKit)** - Orb-level verification for sybil resistance on agent deployment. Zero-knowledge proofs verify humanity without revealing identity.
- **ENS** - Human-readable addresses everywhere (`jane.eth` not `0x...`). No crypto jargon visible to end users.
- **Privy** - Gas sponsorship for gasless transactions. Users never pay fees, maximizing accessibility.
### Autonomous Operations
- **Coinbase CDP** - Server wallets for 24/7 agent autonomy. x402 authorization pattern allows recurring rebalances without user approval.
- **Supabase** - PostgreSQL database for agent performance tracking, rebalance history, and portfolio analytics.
### Development & Testing
- **Hardhat 3** - Smart contract development, testing (94% coverage), and multi-chain deployment automation.
---
## ๐๏ธ Architecture
```
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ WORLD MINI APP (Next.js + MiniKit SDK) โ
โ โข Privy gas sponsorship (gasless UX) โ
โ โข ENS resolution (jane.eth not 0x...) โ
โ โข Octav widget (portfolio dashboard) โ
โโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโ> Deposit USDC/ETH/USDT (any chain)
โ
โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ HedgePod VAULT (Smart Contracts) โ
โ โข Deployed on: World Chain, Base, Celo, Zircuit, Polygon โ
โ โข Issues AutoYield Tokens (LayerZero OFT) โ
โ โข Grants x402 authorization to agent wallet โ
โ โข Integrated with Uniswap v4 pools (custom hook) โ
โโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโ> Agent monitors & rebalances 24/7
โ
โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ YIELD AGENT (CDP Server Wallet) โ
โ โข Autonomous wallet with x402 authorization โ
โ โข Monitors: Pyth APRs, 1inch liquidity โ
โ โข Rebalances via: LayerZero OFT, 1inch Fusion+, Uniswap v4 โ
โ โข Redundancy: Chainlink CCIP for critical ops โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
```
๐ Real-time portfolio tracking across 8+ chains with autonomous agents
---
## ๐ Multi-Language Support
HedgePod is available in **19 languages** to serve users worldwide (all World Coin supported languages):
| Language | Code | Status |
|----------|------|--------|
| ๐ฌ๐ง **English** | `en` | โ
Complete |
| ๐จ๐ณ **ไธญๆ (็ฎไฝ) (Chinese Simplified)** | `zh` | โ
Complete |
| ๐ช๐ธ **Espaรฑol (Spanish)** | `es` | โ
Complete |
| ๐ธ๐ฆ **ุงูุนุฑุจูุฉ (Arabic)** | `ar` | โ
Complete |
| ๐ง๐ท **Portuguรชs (Portuguese)** | `pt` | โ
Complete |
| ๐ฎ๐ฉ **Bahasa Indonesia (Indonesian)** | `id` | โ
Complete |
| ๐ซ๐ท **Franรงais (French)** | `fr` | โ
Complete |
| ๐ฏ๐ต **ๆฅๆฌ่ช (Japanese)** | `ja` | โ
Complete |
| ๐ท๐บ **ะ ัััะบะธะน (Russian)** | `ru` | โ
Complete |
| ๐ฉ๐ช **Deutsch (German)** | `de` | โ
Complete |
| ๐ฎ๐ณ **เคนเคฟเคจเฅเคฆเฅ (Hindi)** | `hi` | โ
Complete |
| ๐ฐ๐ท **ํ๊ตญ์ด (Korean)** | `ko` | โ
Complete |
| ๐ต๐ฑ **Polski (Polish)** | `pl` | โ
Complete |
| ๐ช๐ธ **Catalร (Catalan)** | `ca` | โ
Complete |
| ๐ฒ๐พ **Bahasa Melayu (Malay)** | `ms` | โ
Complete |
| ๐น๐ญ **เนเธเธข (Thai)** | `th` | โ
Complete |
| ๐น๐ผ **ไธญๆ (็น้ซ) (Chinese Traditional - Taiwan)** | `zh-TW` | โ
Complete |
| ๐ณ๐ฑ **Nederlands (Dutch)** | `nl` | โ
Complete |
| ๐ฒ๐ฝ **Espaรฑol (Amรฉrica Latina) (Spanish - Latin America)** | `es-419` | โ
Complete |
**Language auto-detection**: The app automatically detects your browser's preferred language and displays content accordingly.
**Manual switching**: Use the language selector in the header to switch between languages at any time.
**Access any language directly**:
- English: `https://hedgepod.app/en`
- Spanish: `https://hedgepod.app/es`
- Chinese: `https://hedgepod.app/zh`
- And so on...
---
## ๐ Quick Start
### Prerequisites
```bash
node >= 18.0.0
npm >= 9.0.0
```
### Installation
```bash
# Clone the repository
git clone https://github.com/mollybeach/hedgepod.git
cd hedgepod
# Install dependencies
npm install
```
### Environment Setup
**REQUIRED** - Create your `.env` file:
```bash
# Copy the example file
cp .env.example .env
```
Then edit `.env` with your actual values. **Minimum required** for deployment:
```bash
# 1. Your deployer wallet private key (from MetaMask)
DEPLOYER_PRIVATE_KEY=your_private_key_here
# 2. Alchemy RPC for Base Sepolia (get free at https://www.alchemy.com/)
BASE_SEPOLIA_RPC=https://base-sepolia.g.alchemy.com/v2/YOUR_ALCHEMY_API_KEY
# 3. WalletConnect for frontend (get free at https://cloud.walletconnect.com/)
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_walletconnect_project_id_here
```
**Optional but recommended** for full functionality:
```bash
# Block explorer verification
BASESCAN_API_KEY=your_basescan_api_key_here
# Additional networks
POLYGON_AMOY_RPC=https://rpc-amoy.polygon.technology
CELO_ALFAJORES_RPC=https://alfajores-forno.celo-testnet.org
```
#### ๐ Getting API Keys
| Service | URL | Purpose | Cost |
|---------|-----|---------|------|
| **Alchemy** | https://www.alchemy.com/ | RPC endpoints for all chains | Free tier |
| **WalletConnect** | https://cloud.walletconnect.com/ | Frontend wallet connection | Free |
| **BaseScan** | https://basescan.org/apis | Contract verification | Free |
| **MetaMask** | Your wallet โ Account Details โ Export Private Key | Deployer wallet | Free |
#### ๐ช Getting Testnet Funds
You'll need testnet ETH before deploying:
| Network | Faucet | Amount Needed |
|---------|--------|---------------|
| **Base Sepolia** | https://www.alchemy.com/faucets/base-sepolia | ~0.05 ETH |
| **Polygon Amoy** | https://faucet.polygon.technology/ | ~0.1 MATIC |
| **Celo Alfajores** | https://faucet.celo.org/alfajores | ~0.5 CELO |
| **Multi-chain** | https://faucet.quicknode.com/ | Various |
#### โ ๏ธ Security Notes
- **Never commit** your `.env` file (already in `.gitignore`)
- **Use a separate deployer wallet**, not your main wallet
- **Only fund** what you need for deployment
- See **`docs/ENV_TEMPLATE.md`** for complete documentation
### Run Tests
```bash
# Compile contracts
npx hardhat compile
# Run test suite
npx hardhat test
# Check coverage
npx hardhat coverage
```
### Deploy Contracts
**Before deploying**, make sure:
1. โ
You've created your `.env` file (see Environment Setup above)
2. โ
You have testnet funds in your deployer wallet
3. โ
You've compiled contracts: `npx hardhat compile`
```bash
# Deploy to Base Sepolia (recommended first deployment)
npx hardhat run scripts/deploy/deployer.ts --network baseSepolia
# Or use Makefile shortcuts
make deploy-base-sepolia
# Deploy to all testnets
make deploy-all
```
**After deployment**, verify your contracts:
```bash
# Verify on BaseScan
make verify-base-sepolia
```
๐ **Detailed deployment guide**: `docs/DEPLOYMENT_QUICKSTART.md`
### Run Frontend
**Before starting the frontend**, create `frontend/.env.local`:
```bash
# frontend/.env.local
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_walletconnect_project_id_here
# Supabase (for agent performance tracking - optional for local dev)
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key-here
```
๐ **Database setup**: See [docs/DATABASE_SETUP.md](./docs/DATABASE_SETUP.md) for Supabase configuration (5 min setup)
Then start the development server:
```bash
# Install frontend dependencies (first time only)
cd frontend
npm install
# Start development server
npm run dev
# Open http://localhost:3000/en (or your locale)
```
Your frontend will automatically connect to deployed contracts using data from:
- `frontend/lib/data/contracts_data.json` (auto-generated on deployment)
๐จ **Frontend features**:
- ๐ฆ Animal Crossing-themed UI
- ๐ฐ RainbowKit wallet connection (100+ wallets)
- ๐ Multi-chain support (World, Base, Celo, Polygon, etc.)
- โก Responsive design for mobile and desktop
### Run Agent
```bash
# Start yield monitoring agent
cd backend
npm run agent:start
```
## ๐ Deployment Addresses
### **Local Development (Hardhat)**
| Contract | Address |
|----------|---------|
| **YieldOracle** | `0x5FbDB2315678afecb367f032d93F642f64180aa3` |
| **AutoYieldToken** | `0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512` |
| **HedgePodVault** | `0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9` |
| **VolatilityFeeHook** | `0x0165878A594ca255338adfa4d48449f69242Eb8F` |
### **Testnet Deployments**
**Status**: ๐ง Ready for deployment to Base Sepolia, Polygon Amoy, Celo Alfajores
To deploy to testnets:
```bash
# Deploy to Base Sepolia (recommended first)
make deploy-base-sepolia
# Deploy to all testnets
make deploy-all
```
See **[deployments/](./deployments/)** for full deployment history, ABIs, and verification commands.
๐ **Deployment guide**: [docs/DEPLOYMENT_QUICKSTART.md](./docs/DEPLOYMENT_QUICKSTART.md)
---
## ๐งช Tech Stack
**Smart Contracts**: Solidity 0.8.24, Hardhat 3, OpenZeppelin, LayerZero OFT, Uniswap v4
**Frontend**: Next.js 14, TypeScript, TailwindCSS, World MiniKit, Privy SDK, wagmi, RainbowKit, next-intl (i18n)
**Backend**: Node.js, TypeScript, Coinbase CDP SDK, Pyth Hermes API, 1inch API, Supabase (PostgreSQL)
**Oracle & Data**:
- **Pyth Network** - Real-time price feeds & volatility for dynamic fees
- **The Graph** - Uniswap v3 liquidity & volume data via GraphQL subgraphs
**Infrastructure**: Alchemy, Vercel, Railway, Supabase
**Integrations**: LayerZero, Pyth Network, The Graph, 1inch, Uniswap v4, World, Coinbase CDP, Privy, ENS, Chainlink, Zircuit, Octav
**Languages**: 10 languages supported (English, Chinese, Spanish, Arabic, Portuguese, Indonesian, French, Japanese, Russian, German)
---
## ๐ Documentation
Comprehensive guides and documentation:
| Document | Description |
|----------|-------------|
| **[Partner Prize Submission](docs/PARTNER_PRIZE_SUBMISSION.md)** | ๐ Completed form for LayerZero, World, CDP prizes |
| **[Submission Guide](docs/SUBMISSION.md)** | ETHGlobal submission checklist |
| **[Environment Setup](docs/ENV_TEMPLATE.md)** | Complete guide for all environment variables |
| **[Database Setup](docs/DATABASE_SETUP.md)** | Supabase integration for agent tracking (5 min setup) |
| **[Localisations](docs/LOCALISATIONS.md)** | App content in all 19 languages for World submission |
| **[Deployment Quickstart](docs/DEPLOYMENT_QUICKSTART.md)** | Step-by-step deployment instructions |
| **[Full Deployment Guide](docs/DEPLOYMENT.md)** | Advanced deployment documentation |
| **[Scripts Documentation](scripts/README.md)** | All deployment and utility scripts |
| **[Config Documentation](config/README.md)** | Network and price feed configurations |
### Key Directories
```
hedgepod/
โโโ contracts/ # Solidity smart contracts
โ โโโ HedgePodVault.sol
โ โโโ AutoYieldToken.sol
โ โโโ YieldOracle.sol
โ โโโ VolatilityFeeHook.sol
โโโ frontend/ # Next.js frontend application
โ โโโ app/ # Pages and routes
โ โโโ components/ # Reusable UI components
โ โโโ lib/ # Utilities and contract data
โโโ backend/ # Agent backend (Node.js)
โโโ scripts/ # Deployment and utility scripts
โ โโโ deploy/ # Deployment scripts
โ โโโ verify/ # Contract verification
โโโ config/ # Network and price configurations
โโโ deployments/ # Deployed contract addresses & ABIs
โโโ docs/ # Documentation
```
---
## ๐ Contact & Community
- ๐ **Live Demo**: [hedgepod.app](https://hedgepod.app)
- ๐ง **Email**: [mollybeach@hedgepod.app](mailto:mollybeach@hedgepod.app)
- ๐ป **GitHub**: [mollybeach/hedgepod](https://github.com/mollybeach/hedgepod)
- ๐ฌ **Discord**: [Join our community](https://discord.com/invite/5C7yYrsR)
- ๐ฑ **Telegram**: [t.me/hedgepod](https://t.me/hedgepod)
- ๐ฆ **Twitter/X**: [@hedgepod](https://x.com/hedgepod)
- ๐ธ **Instagram**: [@hedgepod_app](https://www.instagram.com/hedgepod_app/)
---
## ๐ License
MIT License - see [LICENSE](./LICENSE) for details
---
## ๐ Acknowledgments
Built for **ETHGlobal Buenos Aires 2025** with:
- LayerZero for omnichain infrastructure
- World for 23M user distribution
- Coinbase CDP for autonomous agents
- And many other amazing sponsors!
**๐ฆ Making DeFi accessible for everyone!**