QIELend API

QIELend (Compound V2 fork) on QIE Blockchain mainnet, chain id 1990. Machine-readable spec: /openapi.json

Read endpoints return market and account data read live from the chain (market snapshot refreshed every 15 s). Transaction endpoints return unsigned transactions (to, data, value) for a wallet to sign. This service never signs, holds keys or broadcasts. Amounts are decimal strings: QIE/WQIE 18 decimals, QUSDC 6 decimals. Rates are raw protocol figures (per-block mantissa, 1e18 = 100%).

Read

EndpointReturns
GET /healthblock, snapshot age, QIE oracle feed age
GET /protocolcontracts, close factor, liquidation incentive, pause flags
GET /markets, /markets/{id}totals, utilization, rates, collateral factor, oracle price, borrow cap, available to borrow. id = qToken, underlying or symbol (QIE, QUSDC)
GET /accounts/{address}supplied, borrowed, health factor, borrow limit, max borrowable QUSDC, max withdrawable QIE, wallet balances, allowances
GET /quote?supplyQie=&borrowQusdc=&address=max QUSDC borrowable for X QIE, health factor and QIE liquidation price at 25/50/75/100% of max (and at borrowQusdc)

Transactions (unsigned)

EndpointSteps (only those still needed are returned)
GET /tx/supply?address=&amount=WQIE.deposit (wrap, value = amount) → WQIE.approve(qWQIE) → qWQIE.mint
GET /tx/enable-collateral?address=Comptroller.enterMarkets([qWQIE])
GET /tx/borrow?address=&amount=qQUSDC.borrow
GET /tx/repay?address=&amount=|maxQUSDC.approve(qQUSDC) → qQUSDC.repayBorrow
GET /tx/withdraw?address=&amount=|maxqWQIE.redeemUnderlying / redeem → WQIE.withdraw (unwrap)
GET /tx/supply-and-borrow?address=&supplyQie=&borrowQusdc=wrap → approve → mint → enterMarkets → borrow

Options: approval=exact|max (default exact), wrap=false (use existing WQIE), unwrap=false, simulate=false.

Send steps in order and wait for each to be mined before the next. Steps with no unmet dependency are dry-run (eth_call + eth_estimateGas from address); later steps show pending. QIELend returns Compound error codes instead of reverting in some cases, so the dry-run decodes the return value (e.g. TOKEN_INSUFFICIENT_BALANCE). After sending, check the receipt status and the market's Failure event.

Risk model

Health factor = sum(supplied value × collateral factor, enabled markets) / borrowed value. Below 1.0 the account can be liquidated: a liquidator may repay up to the close factor (50%) of a borrow and take collateral worth that amount × the liquidation incentive (1.08). Prices come from the protocol oracle; the QIE feed age is reported in /markets and /health. Interest accrues every block, so debt grows over time.

curl "https://api.qielend.qie.digital/quote?supplyQie=10000"
curl "https://api.qielend.qie.digital/tx/supply-and-borrow?address=0xYOU&supplyQie=10000&borrowQusdc=300"