
NovaDapp
Cross Chain Lending and Borrowing
Demo
About
The problem it solves # 🌉 Cross-Chain Bridge (Avalanche Fuji ↔ Sepolia) A powerful, CCIP-based bridge to wrap and move assets across Avalanche Fuji and Ethereum Sepolia testnets. ## 🔁 Supported Bridge Flow ### 1. Avalanche Fuji → Sepolia - 🌐 Send **Native AVAX** from Fuji. - 🎯 Receive **WAVAX** (Wrapped AVAX) on Sepolia. - 🔄 **Conversion ratio**: `1:1` (testnet parity). - 🧱 WAVAX can now be used for testing or DeFi interactions on Sepolia. ### 2. Sepolia → Avalanche Fuji - 📨 Send **WAVAX** from Sepolia. - 💸 Receive **Native AVAX** on Fuji. - 🪄 Smoothly unwraps the token and returns native AVAX. > ✅ Facilitates using wrapped tokens on Sepolia for testnet experimentation. --- # 💰 Cross-Chain Lending & Borrowing Cross-chain mUSDC protocol for testing decentralized credit on multi-chain environments. ## 🌱 Lend on Avalanche Fuji - 🪙 Users can mint mUSDC on Fuji. - 📥 Deposit into the lending protocol as **collateral**. ## 💸 Borrow on Sepolia - 🧾 Borrow mUSDC on Sepolia. - 🔐 Borrowing power depends on user's supplied amount on Fuji. ### ⚖️ Borrowing Limit - 🔢 Borrow up to **70%** of the supplied mUSDC (for testing). --- 🛠️ Powered by [Chainlink CCIP](https://chain.link/ccip) for seamless and secure cross-chain communication.
How it's made
Challenges we ran into ## 🧩 Challenges I Ran Into While building the cross-chain lending and borrowing system, I encountered a few notable hurdles: ### 1. 🧮 Interest Rate Logic Misalignment Initially, I implemented an interest accrual system based on a fixed APY (Annual Percentage Yield). The idea was to simulate real-world borrowing costs, but due to precision mismatches, rounding errors, and inconsistencies across chains, the calculations led to bugs and unpredictable behavior. After multiple attempts at adjusting the math and managing time deltas properly, I decided to remove the interest logic entirely — at least for this testnet version. > 🔧 **Resolution:** Reverted to a static 1:1 lending/borrowing ratio with a fixed borrow limit (70% LTV), ensuring consistency and simplicity for testing. --- ### 2. 💱 Real-Time Price Feed Complexity I intended to fetch the real-world price of USDC (e.g., via Chainlink oracles) to calculate more accurate collateral values. However, integrating price feeds across chains introduced latency and sync issues. Additionally, when testing on Sepolia and Fuji, price feed contracts were either unavailable or unreliable for test tokens like mUSDC. --- ### 3. 🔁 Cross-Chain Message Ordering One subtle issue I faced was the timing between user actions (like withdrawals) and their corresponding CCIP messages. For example, users could withdraw tokens before their cross-chain message was confirmed, creating sync issues between chains. --- ### 🤔 Lessons Learned - Sometimes, **simplicity is more robust** — especially in multi-chain environments. - Cross-chain development introduces **synchronization and finality delays** you don’t face in single-chain systems. - Testnet limitations (like missing price feeds or liquidity) require **pragmatic workarounds** that still simulate real-world logic. These challenges helped shape a more stable, testable system — and gave me better insight into designing for eventual mainnet deployment.