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

# Borrow

> Let users borrow against their crypto across Aave V3, SparkLend, Morpho Blue and Lista, with positions on their own address, and charge your own fee on Morpho Blue.

The Borrow API gives your users one way to borrow against their crypto across Aave V3, SparkLend, Morpho Blue and Lista, with Compound V3 being added. That is roughly 960 pooled and isolated markets behind one schema. Users supply collateral to a market and borrow against it, and the position always stays on their own address. The API is served at `https://borrow.yield.xyz/v1` and uses the same project API key as the Earn API, in the `x-api-key` header.

Request and response shapes are the same on every protocol and network: whether the market is Aave on Ethereum or Morpho on Base, your integration code does not change.

<Note>
  Borrow and [Earn's Lending](/documentation/earn/defi/lending/index) are separate products. Lending supplies an asset to earn yield through the [Earn API](/documentation/earn/index). Borrow supplies collateral and borrows against it through the Borrow API. A Borrow `supply` action and a lending yield are different positions, even on the same protocol.
</Note>

## What the Borrow API does

<CardGroup cols={2}>
  <Card title="Market discovery" icon="magnifying-glass">
    Every market comes back in the same shape, with loan and collateral tokens, borrow and supply rates, liquidity and utilization, plus the max LTV and liquidation threshold for each collateral.
  </Card>

  <Card title="Positions and risk" icon="heart-pulse">
    For each user, the API returns collateral, debt, health factor (how close the position is to liquidation), how much more they can borrow, and liquidation history.
  </Card>

  <Card title="Transaction building" icon="hammer">
    `supply`, `borrow`, `repay` and `withdraw` each return every transaction they need, including ERC-20 approvals, unsigned, with the health factor and LTV the position will have afterwards.
  </Card>

  <Card title="Monetization" icon="coins">
    On Morpho Blue, you can charge your own fee on the collateral, on the amount borrowed, or both.
  </Card>
</CardGroup>

The intent model is the same as Earn's. Yield.xyz never holds funds or keys.

## How it works

1. Discover markets with `GET /v1/markets`, project-scoped by default (`scope=enabled`).
2. Read a market's collateral and rate data, and the user's current state with `GET /v1/positions`.
3. Request an action with `POST /v1/actions`, such as `supply`, `borrow`, `repay` or `withdraw`. The response previews the health factor and LTV after the action.
4. Sign each returned transaction in order, submitting the next one only after the previous one confirms.
5. Poll the action until it settles, then track the position with `GET /v1/positions`.

Walk through this flow with requests in [Quickstart](/documentation/get-started/quickstart#borrow-api) and the [Borrow guide](/guides/borrow/index). The model behind it is in [Core concepts](/documentation/borrow/core-concepts/index), and every field is in [Borrow objects](/api-reference/borrow/objects).

## Next steps

<Columns cols={3}>
  <Card title="Core concepts" icon="shapes" href="/documentation/borrow/core-concepts/index">
    Markets, positions, actions and the action lifecycle.
  </Card>

  <Card title="Coverage" icon="table" href="/documentation/borrow/coverage">
    The protocols, market types and networks integrated today.
  </Card>

  <Card title="Monetization" icon="percent" href="/documentation/borrow/monetization">
    Fees on collateral and on borrowed capital, and how they reach you.
  </Card>
</Columns>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.