Completed
LendX

LendX

A decentralized Aave-style lending protocol featuring ETH collateralized borrowing, real-time health factor tracking, and an automated liquidation engine.

Overview

LendX is a full-stack DeFi protocol built from the ground up to demonstrate the mechanics of over-collateralized lending. By combining Solidity smart contracts with a NestJS event-indexing backend, the platform provides a seamless Web2-like experience for complex Web3 financial operations, ensuring users have real-time visibility into their liquidation risks and protocol health.

What Users Can Do

  • Deposit ETH as collateral to enable borrowing power.
  • Borrow USDC against deposited collateral within LTV (Loan-to-Value) limits.
  • Monitor a real-time Health Factor to assess liquidation risk.
  • Repay USDC debt to reclaim collateral and improve account health.
  • Participate as a liquidator to seize under-collateralized positions for a bonus.
  • View a complete, indexed audit trail of all on-chain transactions.
  • Access a Liquidation Intelligence API for pre-computed eligibility and bonuses.

Why I built this

  • To master the mathematical foundations of DeFi: LTV ratios, health factors, and liquidation thresholds.
  • To build a robust, idempotent event indexer that mirrors on-chain state into a relational database.
  • To solve the UX friction of ERC20 approvals and real-time state invalidation after transactions.
  • To practice 'protocol thinking'—understanding how every state transition impacts systemic risk.
  • To advance my '6 Projects in 60 Days' challenge by tackling complex financial logic.

Tech Stack

Solidity
Next.js
Nest.js
TypeScript
PostgreSQL
Prisma
Viem
Wagmi
Turborepo

After launch & Impact

  • Developed a high-performance indexing engine using NestJS and Viem to eliminate stale data.
  • Implemented an automated risk calculation system that scales with live price feeds.
  • Streamlined the Web3 UX using React Query for instant cache invalidation post-confirmation.
  • Successfully deployed a modular monorepo architecture separating contracts, API, and UI.
  • Gained deep insights into handling blockchain reorgs and duplicate event processing.

Future Plans

  • Implement an automated liquidation bot to maintain protocol solvency in real-time.
  • Introduce dynamic interest rate curves based on pool utilization percentages.
  • Add support for multi-asset collateral and cross-margining features.
  • Integrate The Graph/Subgraphs for decentralized data indexing.
  • Build a comprehensive risk dashboard for protocol-wide TVL and utilization analytics.