> For the complete documentation index, see [llms.txt](https://etherfi.gitbook.io/etherfi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://etherfi.gitbook.io/etherfi/products/borrow/technical-documentation.md).

# Technical Documentation

High-level overview of how borrowing and lending works

## Overview

All ether.fi users have a non-custodial Safe deployed on their behalf when they create an account. Eligible assets held by this Safe can be supplied to the ether.fi-managed on-chain lending protocol and used as collateral when Borrow is enabled.

When assets are used as collateral, this results in a USD-valued borrowing power. Users are able to borrow select assets directly, or use their card in Borrow Mode which borrows USDC at the time of purchases.

The Lending Protocol is an ether.fi-managed Aave v4 instance on Optimism.

<figure><img src="https://1029745181-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FG3Lk76lfvw9ecPIg0mK8%2Fuploads%2FzQcb4Tp193mPspIDLyAF%2Fimage.png?alt=media&amp;token=284beff2-4957-42b1-9024-67f6ccd22dd1" alt=""><figcaption></figcaption></figure>

## Asset types

There are three types of assets with respect to the Lending Protocol and non-custodial ether.fi accounts:

1. Collateral assets
2. Borrowable assets
3. Non eligible assets

#### Collateral assets

These assets can be used to increase borrowing power. If the account is opted in to Borrow, eligible assets are automatically supplied to the Lending Protocol. Each collateral asset has a Product LTV that limits how much it contributes to borrowing power. The separate collateral factor is used to calculate health factor and determine whether a position can be liquidated. See [Borrowing Power, Health Factor, and Liquidation](/etherfi/products/borrow/borrowing-power-and-liquidation.md).

#### Borrowable assets

A small subset of assets that can be borrowed. This is currently limited to USDC and ETH.

Suppliers of borrowable assets accrue an interest rate, and borrowers of the asset pay an interest rate. Borrowable assets are always collateral assets as well (i.e. users can both deposit USDC to be used as collateral, and borrow USDC).

#### Non eligible assets

Some assets are supported on ether.fi but are neither collateral nor borrowable assets. Primarily these are assets that can be purchased through the Swap feature but are not listed as collateral on the Lending Protocol.

For the documented list of supported assets, see [Lending Market Parameters](/etherfi/products/borrow/lending-market-parameters.md). The app shows the current assets and amounts available to each user.

## Lending protocol structure

The ether.fi-managed Lending Protocol currently consists of a single Liquidity Hub and a single Spoke that interfaces with the Liquidity Hub. The Lending Protocol is permissioned so that only ether.fi Safes can borrow assets, but anyone can supply to the Liquidity Hub.

<figure><img src="https://1029745181-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FG3Lk76lfvw9ecPIg0mK8%2Fuploads%2FvUa4pZcja333muFbsXJX%2Fimage.png?alt=media&amp;token=e9efa0fc-4dc0-4643-9020-932a36d209ec" alt=""><figcaption></figcaption></figure>

Assets used in the Lending Protocol are held in the Liquidity Hub, which is the central source of liquidity for borrows.

Position and balance tracking is managed on-chain through internal accounting. Read more about how the lending market works in the [Aave v4 documentation](https://aave.com/docs/aave-v4).

### User actions

* Supply → tokens flow from the Cash Safe into the Hub; the Spoke credits the user's supplied balance. Hub liquidity grows.
* Borrow → the Hub pays tokens out to the borrower. The debt is recorded as shares against a continuously growing index: amount owed = shares × index.
* Repay → tokens return to the Hub, debt shares are burned, liquidity is restored.
* Withdraw collateral → the Hub pays supplied tokens back out, reducing the user's supplied balance and Hub liquidity.
* Opt out → a user can disable Borrowing functionality in settings. This prevents their assets from being used as collateral (and if assets are supplied they will be withdrawn)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://etherfi.gitbook.io/etherfi/products/borrow/technical-documentation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
