# QIELend (/docs/qie/qielend)

Borrow the bill in QUSDC against QIE on QIELend, guided step by step, so holders pay bills without selling.

QIELend is QIE's lending market (a Compound V2 fork). Todoku uses it so someone who won't sell QIE can still pay: supply QIE as collateral, borrow the bill's QUSDC, pay. The person signs each step; Todoku never holds the loan. The full walk-through is in [Borrow, don't sell](/docs/guide/borrow).

| Step | Contract call |
| --- | --- |
| Wrap | `WQIE.deposit` |
| Allow | `WQIE.approve(qWQIE, amount)` |
| Supply | `qWQIE.mint(amount)`, simulated first; its return code must be 0 |
| Collateral | `Comptroller.enterMarkets([qWQIE])` |
| Borrow | `qQUSDC.borrow(amount)` |

## What Todoku reads [#what-todoku-reads]

From QIELend's comptroller and markets: the oracle's price for WQIE, the collateral factor, the cash available, the borrow rate per block, and whether minting or borrowing is paused. It plans a loan that lands at a health of 2 (refusing under 1.5), and shows the age of QIE Oracle's QIE/USDT feed, warning after an hour.

A borrow is attached to the order only after Todoku reads it on chain: it must call qQUSDC, emit `Borrow` for the payer, and land within 2 hours before the price.

<Callout type="warn">
Mainnet only, and walked on a fork of QIE mainnet so far.
</Callout>