# No returning of premium if there is no swap to PT

Illuminate Lender.lend() with Swivel leaves underlying premium stranded on contract balance when swap flag e=false, freezing user funds until admin withdraw.

- Payout: Contest reward
- Severity: high
- Program: Illuminate
- Credited: cccz
- Disclosed: 2022-10-15
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2022-10-illuminate-judging/issues/211
- Library page: https://bugbountylibrary.com/r/sherlock%3A2022-10-illuminate%3AH-5
- Tags: domain:web3 impact:funds-loss kind:contest platform:sherlock sev:high tech:solidity technique:source-review vuln:accounting-error vuln:business-logic

**Target:** Lender.lend() Swivel integration
**Root cause:** When e==false, the underlying premium from filled Swivel orders is never returned to the caller nor swapped, remaining on the Lender contract balance.
**Steps:**
1. Call `Lender.lend(p,u,m,a,y,o,s,e=false,premiumSlippage)` with valid Swivel orders.
2. Swivel `initiate(o,a,s)` fills orders, underlying premium accrues to Lender balance.
3. Because `e==false`, `swivelLendPremium` is skipped; premium stays on contract.
4. Only Illuminate PTs minted to caller; premium unrecoverable except via admin `withdraw(u)`.
5. Subsequent lend() calls treat stranded balance as new starting point, compounding loss.
**How found:** Code review of lend() branch handling the optional swap flag; noticed no else-branch returns the premium, and admin withdraw() is the only recovery path.
**Insight:** When a function has an optional swap/convert flag, audit the false branch for funds that were realized but never routed back to the caller; check that every balance delta has a corresponding transfer or mint.
