> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zprotocol.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Z Lend

Z Lend is a private lending market where users can supply assets to earn yield and borrow against shielded collateral. Positions, balances, and individual transaction histories are private to the user.

This page describes how supply and borrow work, the liquidation mechanics, and the privacy properties of the market.

## How it works

A standard Z Lend interaction follows the RelayAdapter pattern, the same way Z Trade does:

* **Supply.** A user supplies an asset from a shielded balance into Z Lend. The adapter unshields the supplied amount, calls the lending market contract to record the supply position, and the market issues an interest-bearing position back into the ShieldedPool as a new note. The user's supply earns yield as the market accrues interest.
* **Borrow.** A user with a supplied position can borrow against it. The borrow operation is similarly mediated by the RelayAdapter: the borrowed asset is unshielded into the user's destination (typically reshielded back into a different note) and a debt position is recorded against the user's collateral.
* **Repay and withdraw.** Reversing the operations: repayment closes a debt position; withdrawal frees up supplied collateral.

All operations are atomic and revert as a whole on failure. The user's identity is hidden from the lending market contract; the market sees the adapter.

## Revenue model

Z Lend earns revenue from the interest spread between borrowers and suppliers, the standard lending-market economics. A portion of the spread accrues to suppliers as yield; a portion is retained by the protocol.

Liquidations (described below) also produce a small fee that goes to the liquidator and the protocol.

## Health factor and liquidation

A position's health factor is the ratio of the collateral's risk-adjusted value to the outstanding debt. The market maintains liquidation thresholds per asset; if a position's health factor falls below 1.0, the position becomes eligible for liquidation.

Liquidation is performed by external actors (liquidators) who repay a portion of the debt in exchange for a discount on the collateral. The privacy property is preserved through the same RelayAdapter mechanics. A liquidator does not learn the identity of the liquidated borrower; they see the liquidatable position as opaque collateral.

## Sample use case

An agent operating a treasury wants to earn yield on idle USDC without revealing the treasury's positions to competitors. The agent:

1. Holds USDC inside the ShieldedPool.
2. Supplies USDC to Z Lend via the RelayAdapter. The supply earns yield.
3. Borrows against the position when liquidity is needed, again through the RelayAdapter, into a separate shielded position.
4. Repays and withdraws as the treasury's needs shift.

At no point does the agent's position, the amounts, or the treasury identity become visible to outside observers.

## Asset support

Z Lend supports the asset set of the ShieldedPool. Supply and borrow markets are available for USDC and other bridged ERC-20 assets on the host EVM chain. The exact supported-asset list, supply and borrow limits, and interest-rate models are maintained on the Z Lend dashboard.
