Appearance
Lending
Lending (shown as Crypto Loans) lets users borrow one coin by locking another as collateral, without selling it. They repay the loan to unlock the collateral. If the collateral loses too much value, the loan is liquidated and the collateral is kept.
Enabling it
Lending is an optional module. Turn it on in .env and clear the config cache:
ini
LENDING_ENABLED=truebash
php artisan config:clearThen Earn → Lending appears in the menu (/lending), and the Lending section in the admin panel. Create pools and collateral rules in Admin → Lending. With the module off, every lending page sends visitors to the home page.
Borrowing
Borrow now / Start Borrowing on a pool's page:
- I want to borrow: pick the coin and the Loan Amount, between Minimum loan and Maximum loan.
- Loan type: Flexible (repay any time), 7 Days or 30 Days, each with its own APR. Only the types switched on for the pool are offered.
- Collateral: "Choose a coin you hold as collateral." The page shows the Required collateral, worked out from the coin prices and the Initial LTV.
- Confirm. The collateral is taken from the user's Funding Account, and "The borrowed coins arrive in your wallet instantly", also in the Funding Account.
LTV: how safe the loan is
txt
LTV = value of the loan ÷ value of the collateralThree levels are set per collateral coin in Admin → Lending:
| Level | What happens |
|---|---|
| Initial LTV | The most a user can borrow when opening the loan |
| Margin call | The user is emailed a warning to add collateral or repay |
| Liquidation LTV | The loan is liquidated: closed, the collateral is kept to cover it, and the user is emailed |
The LTV rises when the collateral's price falls, or the borrowed coin's price rises. The scheduler checks every loan every minute (lending:liquidation-watcher).
Add Collateral on an active loan lowers its LTV: "Adding collateral lowers your LTV and the risk of liquidation." The extra collateral comes from the Funding Account.
Interest
Interest is charged hourly (lending:interest-taker) on the remaining debt, at the plan's yearly rate (APR) spread over 365 days × 24 hours. That is the Estimated Hourly Interest the page shows. It is paid from the collateral: the hourly interest is converted into the collateral coin at current USD prices and deducted, so the locked collateral slowly shrinks while the loan is open.
txt
hourly interest = remaining debt × APR ÷ 365 ÷ 24 (then converted to the collateral coin)Each charge appears in the loan's transactions. If either coin has no USD price at that moment, that hour is skipped.
Repaying
Repay on a loan in My Loans:
- Enter the Repayment Amount in the borrowed coin. It's taken from the Funding Account.
- A partial repayment lowers the Remaining Debt.
- When the full debt is repaid ("Repay and unlock"), the loan is Closed and the remaining collateral returns to the Funding Account.
7-day and 30-day loans aren't closed automatically when their term ends. They stay open until they're repaid or liquidated.
My Loans and history
My Loans shows each loan: coin, Borrowed, Collateral, Current LTV, Liquidation LTV, Remaining Debt, Total Debt, and Status (Active, Closed or Liquidated). Repayment History lists every repayment.
Admins see all loans, interest charges and repayments in Reports → Earn → Lending.
Before you launch lending
Borrowed coins are added to the user's balance directly. They aren't taken from another user or a pool balance, so make sure your hot and cold wallets hold enough of each lendable coin to pay out if borrowers withdraw. Start with low initial LTVs, and tell users clearly that liquidation keeps their collateral.
