Core Interactions
Technical reference for all Lotus core interactions including supply, withdraw, borrow, repay, collateral management, and the shouldAccrueInterest tradeoff.
┌─────────────────────────────────────────────────────────────────────┐
│ User Flows Across Tranches │
└─────────────────────────────────────────────────────────────────────┘
LENDER FLOW:
════════════
Lender Lotus Market (USDC/WETH)
────── ────────────────────────
Tranche 0 (LLTV 80%) ← Senior
Tranche 1 (LLTV 85%)
Tranche 2 (LLTV 90%) ← Junior
│
│ supply(market, tranche=2, 1000 USDC)
├─────────────────────────────────────────►
│ │
│ │ Accrue interest (0→2)
│ │ Mint supply shares
│ │ Update tranche 2 supply
│ │
│ Receive shares │
│◄──────────────────┤
│ │
│ ▼ Interest cascade:
│ ┌────────────────────┐
│ │ T0 borrows → T0,T1,T2 suppliers
│ │ T1 borrows → T1,T2 suppliers
│ │ T2 borrows → T2 suppliers only
│ └────────────────────┘
│
│ withdraw(market, tranche=2, shares)
├─────────────────────────────────────────►
│ │
│ │ Accrue interest (0→2) [if enabled]
│ │ Check [free supply](../../reference/glossary.md#free-supply)
│ │ Burn shares, transfer assets
│ │
│ Receive USDC │
│◄──────────────────┤
BORROWER FLOW:
══════════════
Borrower Lotus Market (USDC/WETH)
──────── ────────────────────────
Tranche 1 (LLTV 85%, collateral: WETH)
│
│ supplyCollateral(market, tranche=1, 10 WETH)
├─────────────────────────────────────────►
│ │
│ │ Update collateral balance
│ │
│ │
│ borrow(market, tranche=1, 15,000 USDC)
├─────────────────────────────────────────►
│ │
│ │ Accrue interest (tranche 1)
│ │ Check free supply ≥ 15,000
│ │ Check health (WETH value vs LLTV)
│ │ Mint borrow shares
│ │
│ Receive USDC │
│◄──────────────────┤
│ │
│ ▼ Position active:
│ ┌────────────────────┐
│ │ 10 WETH collateral │
│ │ 15,000 USDC debt │
│ │ Health: 1.42x │
│ └────────────────────┘
│
│ repay(market, tranche=1, 15,000 USDC + interest)
├─────────────────────────────────────────►
│ │
│ │ Accrue interest (tranche 1)
│ │ Burn borrow shares
│ │
│ │
│ withdrawCollateral(market, tranche=1, 10 WETH)
├─────────────────────────────────────────►
│ │
│ │ Accrue interest (tranche 1)
│ │ Check health (must remain healthy)
│ │ Transfer collateral
│ │
│ Receive WETH │
│◄──────────────────┤Lending
Supply
Withdraw
Borrowing
Borrow
Repay
Collateral Management
Supply Collateral
Withdraw Collateral
The shouldAccrueInterest Tradeoff
shouldAccrueInterest TradeoffLast updated

