A centralized lending dApp built on XRP Ledger where users can deposit XPM tokens as collateral to borrow XRP.
- Collateral Deposit: Deposit XPM tokens as collateral
- Borrow XRP: Borrow XRP against your XPM collateral with adjustable LTV
- Interest Tracking: Real-time interest accrual at 15% APR
- Time Simulation: Fast-forward time to test interest accumulation
- Price Simulation: Change XPM/XRP price to test margin calls
- Margin Calls: Automatic alerts when loans approach liquidation (65% LTV)
- Liquidation: Force liquidation with 10% penalty fee
- Loan Repayment: Partial or full loan repayment
- Liquidation Preview: See potential liquidation impact for at-risk loans
- Install dependencies:
npm install- Start the development server:
npm start- Open http://localhost:3000 in your browser
npm install -g netlify-cli
npm run build
netlify deploy --prod --dir=build- Push your code to GitHub
- Connect your GitHub repository to Netlify
- Netlify will automatically deploy on every push to main
- Run
npm run build - Drag and drop the
buildfolder to Netlify Drop
- Enter the amount of XPM tokens you want to use as collateral
- Adjust the LTV slider (10-50%) to determine how much XRP to borrow
- Click "Create Loan" to borrow XRP
- View Active Loans: See all your loans in the Active Loans table
- Repay Loans: Click "Repay" to pay back part or all of your loan
- Monitor LTV: Watch your LTV ratio - loans liquidate at 65% LTV
- View Liquidation Preview: Expand at-risk loans (>55% LTV) to see liquidation impact
- Time Simulation: Use the Time Simulator to advance time and see interest accumulate
- Price Changes: Adjust the XPM/XRP price to test margin calls and liquidations
- Liquidation: When a loan reaches 65% LTV, you can force liquidate it
- Interest Rate: 15% APR (higher due to altcoin volatility)
- Max Initial LTV: 50% (conservative for altcoins)
- Liquidation Threshold: 65% LTV (lower than BTC/ETH)
- Liquidation Penalty: 10% of total debt
When a loan reaches 65% LTV:
- The loan becomes eligible for liquidation
- A liquidator can trigger the liquidation
- The system calculates:
- Total debt = Principal + Accrued Interest
- Liquidation penalty = Total debt × 10%
- Collateral to liquidate = (Total debt + Penalty) / Current XPM price
- Remaining collateral is returned to the borrower
- React with TypeScript
- Material-UI (MUI) for UI components
- XRP Ledger integration (ready for connection)
- Context API for state management
- Optimized for Netlify deployment
This is an MVP. For production:
- Connect to actual XRP Ledger
- Implement real wallet authentication
- Add proper transaction signing
- Store loan data on-chain or in a database
- Implement automated liquidation bots
- Add price oracles for real-time pricing
- Implement proper security audits