← Back to home

Hanguard

Decentralized crypto index funds on Hedera - get instant diversification across multiple tokens! 🚀

Problem Statement

Hangaurd Index revolutionizes cryptocurrency investing by bringing traditional index fund concepts to the decentralized world, built specifically on Hedera Hashgraph's lightning-fast, eco-friendly blockchain.The Problem We Solve: Most crypto investors struggle with portfolio diversification - they either put all their eggs in one basket or spend countless hours researching and managing multiple token positions. Traditional index funds exist in traditional finance, but crypto lacks accessible, trustworthy index solutions that ordinary investors can use.Our Solution: Hangaurd Index lets anyone create or invest in custom cryptocurrency index funds using just HBAR. Think of it as the "Vanguard of crypto" - but decentralized, transparent, and accessible to everyone.How It Works: For Investors: Simply deposit HBAR into any index fund and receive fund tokens that automatically track a diversified portfolio of cryptocurrencies. No need to research individual tokens or manage complex portfolios. For Fund Creators: Design custom index funds with your preferred token weightings, earn fees from investors, and build a reputation as a fund manager.Why Hedera? We chose Hedera because it offers what other blockchains can't: 3-5 second transaction finality, predictable fees starting at $0.0001, and a carbon-negative footprint. This means your investments are processed instantly without the high gas fees and environmental concerns of other networks. Real-World Impact: Imagine a DeFi enthusiast creating a "DeFi Leaders" fund with 40% ETH, 30% LINK, 20% UNI, and 10% AAVE. Investors can buy into this expertise with a single HBAR transaction, automatically getting exposure to all four tokens without the hassle of individual purchases, wallet management, or rebalancing.What Makes Us Special: Instant Diversification: One transaction, multiple token exposure Expert-Curated Funds: Leverage other investors' research and expertise Dynamic Rebalancing: Fund creators can adjust allocations based on market conditions Transparent Fees: Just 1% platform fee, clearly distributed between creators, treasury, and governance Enterprise-Grade Security: Built on Hedera's proven, enterprise-ready infrastructureThis isn't just another DeFi protocol - it's a complete investment platform that makes sophisticated portfolio management accessible to everyone, from crypto newcomers to seasoned investors looking for passive diversification strategies.

Solution

How We Built Hangaurd Index: Technical Deep Dive 🏗️ Architecture Overview Hangaurd Index is built as a sophisticated multi-layer application that leverages Hedera's unique capabilities while maintaining compatibility with the broader Ethereum ecosystem. 🔗 Blockchain Layer: Hedera EVM Integration The Foundation: Hedera Smart Contract Service (HSCS) We deployed our core contracts on Hedera's EVM-compatible layer, which gives us the best of both worlds - Ethereum's mature tooling ecosystem with Hedera's superior performance characteristics. Our contracts include the HGI Token, FundFactory, individual IndexFund contracts, and PriceOracle integration for real-time pricing data. 💎 The HGI Token: Our Platform Currency Dual-Purpose Design: The HGI (Hangaurd Index) token serves as both a governance token and the platform's native currency. Fund creation requires burning 1000 HGI tokens, creating a deflationary mechanism. The 1% platform fees are partially used for HGI buybacks and burns, while HGI holders get governance rights to vote on platform parameters. 🪙 Index Token Minting: The Magic Behind Portfolio Tokens Dynamic Token Creation: Each index fund creates its own ERC-20 token that represents shares in the underlying portfolio. When investors deposit HBAR, the system calculates fund tokens to mint based on current NAV, executes swaps for each underlying token, and mints fund tokens to the investor. The beauty is that investors receive actual ERC-20 tokens in their wallets that they can view in real-time, transfer, or use as collateral in other DeFi protocols.📊 Pyth Oracle Integration: Accurate Price Feeds Enterprise-Grade Price Data: We integrated Pyth Network's oracle system to fetch real-time, high-frequency price feeds for accurate index token valuation. Pyth provides sub-second price updates from over 95 first-party data providers including major exchanges and market makers. Why Pyth for Index Token Valuation: High-Frequency Updates: Price feeds update multiple times per second, ensuring accurate NAV calculations Institutional Quality: Data sourced directly from exchanges and trading firms, not derived from other oracles Cross-Chain Compatibility: Pyth's pull-based oracle model works seamlessly with Hedera's architecture Comprehensive Coverage: Access to 400+ price feeds covering major cryptocurrencies and traditional assets Index Token Value Calculation: The Pyth oracle feeds are crucial for determining the real-time value of our index tokens. When users want to buy or sell fund tokens, we query Pyth for the latest prices of all underlying assets, calculate the total portfolio value, and determine the precise NAV per index token. This ensures fair pricing and prevents arbitrage opportunities that could harm existing investors.🔄 SaucerSwap Integration: The Liquidity EngineWhy SaucerSwap? SaucerSwap is Hedera's premier DEX, and integrating with it was crucial for our automated rebalancing and token swaps. We built sophisticated swap execution logic that automatically converts HBAR deposits into the underlying tokens based on each fund's allocation weights. Benefits of SaucerSwap Integration: Deep Liquidity: Access to Hedera's largest token pools Low Slippage: Efficient price discovery for large swaps Composability: Our fund tokens can be used in other SaucerSwap pools Real-time Pricing: Accurate NAV calculations using SaucerSwap's price feeds🛠️ Frontend: Next.js 15 with Hedera Wallet Integration HashConnect Integration: We built a sophisticated wallet connection system using HashConnect, Hedera's official wallet connector, enabling seamless integration with HashPack, Blade, and other Hedera wallets. Real-time Portfolio Tracking: Using Hedera's Mirror Node API, we provide real-time updates on fund performance, transaction history, and portfolio valuations.🔧 Particularly Hacky & Notable SolutionsCross-Chain Price Oracle Workaround Since Hedera doesn't have Chainlink oracles yet, we built a hybrid oracle system that falls back to SaucerSwap for price discovery when external price feeds aren't available.Gas-Efficient Rebalancing Algorithm We implemented a smart rebalancing system that calculates which tokens need buying vs selling, then batches all operations into minimal transactions to reduce costs.Hedera Account ID to EVM Address Mapping One of the trickiest parts was handling Hedera's dual addressing system, converting between Hedera Account IDs (0.0.123456 format) and EVM addresses for seamless wallet integration.🚀 Performance Optimizations Batch Operations: We batch multiple fund investments and operations to minimize transaction costs and improve user experience. Lazy Loading with React Query: Frontend performance is optimized with intelligent caching, stale-while-revalidate patterns, and automatic background refetching for real-time data updates.🔐 Security Considerations Multi-signature Fund Management: For high-value funds, we implemented optional multi-sig requirements for rebalancing operations, adding an extra layer of security for institutional investors. This technical architecture gives us the performance of Hedera with the familiarity of Ethereum tooling, creating a robust platform that can scale to handle institutional-level assets while remaining accessible to retail investors.

Hackathon

ETHGlobal New Delhi

2025

Contributors