Skip to content

Loan Management

Managing active loans — viewing details, health monitoring, collateral top-up, repayment, and loan extension.

Available Actions by Loan Stage


1. My Loans List

Route/my-loan
  • Card view of all current and historical loans
  • Filter tabs: All, Active, Completed, Cancelled
  • Each card shows: loan amount, asset type, health status, due date
  • Quick action buttons based on current stage (top-up, repay, extend)

Active stages: loan_active, collateral_deposited, close_to_matured, loan_matured, payment, late_payment, extension_requested

History stages: loan_cancel, loan_closed, liquidated, extended


2. Loan Detail

Route/my-loan/:id

Comprehensive single-loan view:

  • Loan Summary — amount, LTV, interest breakdown
  • Collateral Card — asset type, volume, current value
  • Health Gauge — visual meter with risk level colors
  • Repayment Info — due dates, amounts
  • Transaction History — loan-specific transactions
  • Liquidation Warning — appears when health drops below thresholds

3. Top-up Collateral

Route/top-up/:id

When loan health degrades (due to crypto price drops), the user can add more collateral to improve health and prevent liquidation.

Top-up Asset Options

The user can choose between two top-up types:

TypeDescriptionNetwork
Same AssetTop-up with the same cryptocurrency as the loan collateral (e.g., BTC loan → add more BTC)Auto-locked to original loan network
USDTTop-up with USDT as alternative collateral regardless of original loan assetUser selects network (ERC20, TRC20, BEP20)

Bidirectional Calculator

Like the loan calculator, top-up supports two input directions:

DirectionInputOutput
Volume → AmountEnter crypto volumeCalculates THB value
Amount → VolumeEnter THB amountCalculates crypto volume needed
  • Uses live price feed for the selected asset
  • USDT price feed used separately for USDT top-ups
  • Decimal places match the asset type configuration

Health Preview

Before confirming, the user sees:

MetricDescription
Current HealthCurrent loan health % and risk level
Suggested AmountSystem calculates the amount needed to restore health to 100%
After Top-up HealthProjected health % after adding the specified collateral
After Top-up Risk LevelProjected risk level (Healthy, Risk LV.1–3)

Deposit Address & Confirmation

Top-up TypeAddress Source
Same AssetUses existing Kryptodian wallet address from the loan
USDTGenerates a new USDT deposit address via Kryptodian API

After confirmation:

  1. Deposit address + QR code displayed in a dialog
  2. User sends crypto to the address from external wallet
  3. Deposit confirmed via Kryptodian webhook
  4. Collateral value updated on the loan
  5. Health recalculated

Top-up Locking

  • Once a USDT top-up is initiated (address generated), the USDT network is locked for that loan
  • Subsequent top-ups to the same loan will use the same USDT network
  • Same-asset top-ups always use the original loan network (no selection needed)

Top-up Protection

A loan with an active top-up (topup_active_time is not null) is temporarily protected from both price-drop and late-payment liquidation. This gives the user time to complete the deposit.


4. Repayment

Route/repayment/:id

Two-step repayment process:

Step 1 — Repay Loan

  • Loan detail display with repayment amount
  • Early payment fee shown if applicable (calculated by backend)
  • Agreement acceptance required when early payment fee > 0 (scroll-to-end enforcement)
  • Bank account details with copy buttons
  • PromptPay QR code for easy payment

Step 2 — Upload Slip

  • Drag-and-drop or file browser upload
  • Supported formats: JPG, PNG, PDF
  • File preview before submission
  • Submit for admin verification

Payment Eligibility (14-Day Rule)

  • Active loans: Must wait 14 days from loan_start before payment is available
  • Matured loans: Immediate payment access (stages: close_to_matured, loan_matured, payment, late_payment)

5. Extend Loan

Route/loan-extend/:id

Extend the loan term when approaching maturity:

  1. Select extension duration
  2. View current vs. new terms side-by-side
  3. Extension fee calculation (processing fee + interest + late payment fee if applicable)
  4. Discount code support
  5. Submit extension request

Extension Eligibility: Available for close_to_matured, loan_matured, payment, late_payment stages (no 14-day restriction).


6. Extension Payment

Route/loan-extension-payment/:id
  • Extension fee breakdown display
  • Bank transfer instructions with PromptPay QR
  • Payment slip upload
  • Status tracking

7. Extension Contract Signing

Route/loan-extension-sign-contract/:id
  • View extension contract document
  • Term comparison (old vs. new)
  • Digital signature pad
  • OTP verification
  • On success → extension activated, new loan dates applied

Next: Profile & Settings →

Confidential — For internal and authorized partner use only.