Skip to main content
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.
Borrow and Earn’s Lending are separate products. Lending supplies an asset to earn yield through the Earn API. 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.

What the Borrow API does

Market discovery

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.

Positions and risk

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.

Transaction building

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.

Monetization

On Morpho Blue, you can charge your own fee on the collateral, on the amount borrowed, or both.
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 and the Borrow guide. The model behind it is in Core concepts, and every field is in Borrow objects.

Next steps

Core concepts

Markets, positions, actions and the action lifecycle.

Coverage

The protocols, market types and networks integrated today.

Monetization

Fees on collateral and on borrowed capital, and how they reach you.