🏦
LendVault collateralized lending from scratch · s0sta.com/lend
—
Supplied—
Borrowed—
Utilization—
Borrow APR10%
Collateral price$2,000 / ETH
⬇️

Supply

Deposit ETH as collateral · withdraw as long as your position stays healthy.

ETH

wallet: —

ETH

your collateral: —

📊

Your position

health factor —
Supplied—
Debt (live interest)—
Borrow limit—
Available to borrow—
Net value—
0LTV 66%
⬆️

Borrow / Repay

Borrow stable against your collateral · repay to lower your health factor.

USDx
USDx

balance: —

⚙️

Market parameters

LTV66%
Liquidation threshold80%
Liquidation bonus10%
Close factor50%
Borrow APR10% fixed
Collateral price$2,000 / ETH (fixed)
Interest rate / s—
📜

Activity

Loading…

📖

How it works

LendVault is a collateralized lending protocol on the Sepolia testnet: you lock ETH, borrow the vault-issued USDx stablecoin against it, and keep your position healthy while interest accrues — or earn a bonus liquidating positions that break down.

🖱

How to use

  1. Connect your wallet — press Connect Wallet (top-right); the chain badge shows Sepolia, the network this dApp is configured for.
  2. Supply collateral — enter an amount in the Supply panel and press Deposit; the vault locks your ETH.
  3. Borrow stablecoins — enter an amount in the Borrow / Repay panel and press Borrow; you receive USDx, capped at 66% of your collateral (LTV).
  4. Stay healthy — watch the health-factor arc in “Your position”; press Repay (USDx) or Withdraw (ETH) to keep health above 1.0.
  5. Earn by liquidating — if a position falls below health 1.0, press Liquidate a position, paste the borrower’s address, set a repay amount and press Seize collateral to claim their ETH at a 10% discount.
⛓

The process — what happens on-chain

  1. LendVault.deposit() — the LendVault contract locks your ETH in its collateral mapping; every ETH/token movement runs under ReentrancyGuard.
  2. LendVault.borrow() — interest is accrued first, then the vault checks the 66% LTV limit before authorizing new USDx against your collateral.
  3. MockStable.mint() — only the vault may mint: MockStable creates USDx via its onlyVault modifier, the same way DAI is born from collateral.
  4. LendVault._accrue() / currentDebt — debt compounds every second at 10% APR (ratePerSecond); as interest grows, healthFactor sinks and the position becomes liquidatable below 1.0 (80% threshold).
  5. LendVault.liquidate() — a liquidator repays up to 50% of the bad debt (close factor); MockStable.burn() destroys the repaid USDx and the liquidator seizes ETH worth 110% of the repayment.
🕸

Flow graph

1 Deposit ETH LendVault.deposit() 2 Borrow USDx LendVault.borrow() 3 Mint USDx MockStable.mint() 4 Accrue interest LendVault._accrue() 5 Repay / Liquidate LendVault · MockStable LTV 66% · liquidation threshold 80% · close factor 50% · liquidation bonus 10% Fixed price $2,000 / ETH · 10% APR per-second interest · Sepolia testnet