Secure DeFi yields with instant cross-chain insurance coverage powered by LayerZero, Chainlink, and Circle.
YieldGuard revolutionizes DeFi risk management by providing seamless cross-chain insurance coverage for protocol participants. Users can either secure their investments with comprehensive insurance protection or earn premium income by providing coverage to others.
- Deposit into high-yield DeFi protocols with 100% insurance coverage
- Automatic claim processing when protocols experience issues
- Cross-chain protection across Ethereum, Arbitrum, and Base
- Provide insurance coverage and earn premium income
- Stack multiple protocol coverage for exponential yield potential
- Diversified risk exposure with transparent payout obligations
- Instant cross-chain insurance claims via LayerZero messaging
- Real-time protocol health monitoring with Chainlink price feeds
- Seamless USDC transfers using Circle's Cross-Chain Transfer Protocol (CCTP)
π LayerZero
- OApp (Omnichain Application) contracts for cross-chain messaging
- Instant insurance claim processing across multiple chains
- Unified liquidity pools accessible from any supported network
π Chainlink
- Real-time price feed monitoring for hack detection
- Cross-Chain Interoperability Protocol (CCIP) for state synchronization
- Automated protocol health assessments
π Circle
- USDC as the primary insurance currency
- Cross-Chain Transfer Protocol (CCTP) for instant settlements
- Multi-chain liquidity management
- Smart Contracts: Solidity ^0.8.20
- Frontend: Vanilla JavaScript with Web3 integration
- Networks: Ethereum, Arbitrum, Base (Sepolia testnets)
- Development: Hardhat, OpenZeppelin
- Node.js v16+
- MetaMask wallet
- Testnet ETH for gas fees
- Testnet USDC from Circle Faucet
# Clone the repository
git clone https://github.com/yourusername/yieldguard
cd yieldguard
# Install dependencies
npm install
# Compile contracts
npm run compile
# Deploy to all testnets
npm run deploy:allDeploy to individual networks:
npm run deploy:ethereum # Ethereum Sepolia
npm run deploy:arbitrum # Arbitrum Sepolia
npm run deploy:base # Base Sepolia-
Open the Demo
# Serve the demo locally npx serve . # Or simply open index.html in your browser
-
Connect Your Wallet
- Install MetaMask and connect to Sepolia testnet
- Ensure you have testnet ETH for gas fees
-
Get Testnet USDC
- Visit Circle's Testnet Faucet
- Request USDC for your wallet address
- Setup: Connect wallet β Load contracts β Check USDC balance
- Approve: Click "Approve USDC Spending" (one-time setup)
- Purchase Insurance: Select protocol, coverage amount, and premium
- Test Claims: Trigger cross-chain emergency claim simulation
- Connect: Wallet connection β Auto-load contracts
- Verify: Check pool statistics (proves contract integration)
- Test: Trigger cross-chain claim (demonstrates LayerZero)
- β Pool Statistics: Shows live contract data from all chains
- β USDC Integration: Balance checks and approval workflow
- β Insurance Purchase: Real transactions with Circle USDC
- β Cross-Chain Claims: LayerZero messaging (may show access control messages)
Note: The demo uses proper access control patterns. Some functions may return "Only PriceMonitor can initiate claims" - this is expected behavior demonstrating security implementation.
contracts/
βββ SimplePriceMonitor.sol # Chainlink price feed integration
βββ USDCManager.sol # Circle CCTP & insurance logic
βββ SimpleCrossChainInsurance.sol # LayerZero OApp messaging
- Protocol Monitoring: Chainlink price feeds detect protocol issues
- Claim Initiation: PriceMonitor triggers cross-chain claims
- Message Relay: LayerZero handles cross-chain communication
- Settlement: Circle CCTP processes instant USDC payouts
| Network | Chain ID | LayerZero ID | Status |
|---|---|---|---|
| Ethereum Sepolia | 11155111 | 40161 | β Deployed |
| Arbitrum Sepolia | 421614 | 40231 | β Deployed |
| Base Sepolia | 84532 | 40245 | β Deployed |
First-of-its-kind cross-chain insurance primitive enabling users to insure DeFi positions across any supported network while maintaining unified liquidity pools.
Chainlink price feeds provide continuous protocol health monitoring, enabling instant claim processing when issues are detected.
Circle's CCTP ensures insurance payouts are processed instantly across chains without traditional bridging delays or additional fees.
# Test individual contracts
npm run test:priceMonitor
npm run test:usdcManager
npm run test:crossChain
# Full integration test
npm run test:integration# Check deployment status
ls deployments/
# Verify contracts on testnet
npm run verify:allpurchaseInsurance(protocolId, coverageAmount, premiumAmount)- Buy insurance coveragedepositUSDC(amount, destinationDomain)- Deposit with optional cross-chain transfergetPoolStats()- Retrieve live pool statistics
initiateCrossChainClaim(user, protocolId, amount, destChain)- Trigger cross-chain claimscheckProtocolHealthCrossChain(protocolId)- Monitor protocol status
checkProtocolHealth(protocolId)- Assess protocol risk levelsaddProtocol(protocolId, aggregator)- Register new protocols
We welcome contributions! Please see our Contributing Guidelines for details.
# Install dev dependencies
npm install
# Run local blockchain
npx hardhat node
# Deploy to local network
npm run deploy:local- Demo: Live Demo
- LayerZero: Omnichain Applications
- Chainlink: Cross-Chain Infrastructure
- Circle: USDC & CCTP