The Borrowing API is a unified layer for interacting with on-chain lending/borrowing protocols. It provides:Documentation Index
Fetch the complete documentation index at: https://yieldxyz.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
- Normalized market data — rates, liquidity, and collateral parameters across venues
- A consistent action model — supply, borrow, repay, withdraw, collateral toggles
- Unified account state — positions, debt, health factor, and borrow power
- Transaction construction — unsigned payloads ready for wallet signing
- Step-based execution — multi-transaction flows (e.g., ERC-20 approval → supply/repay)
What you can build
Wallets & Super Apps
Embed borrowing flows directly into wallet UX — let users leverage their assets in one tap.
Exchanges & Trading Platforms
Offer margin-like borrowing powered by DeFi lending protocols with full self-custody.
Neobanks & Fintechs
Provide crypto-collateralized credit lines backed by on-chain lending markets.
Treasury & Corporate
Optimize capital efficiency by borrowing against idle collateral across protocols.
Core capabilities
- Discoverability & capability introspection — List supported integrations (protocol + product type), see which networks each supports, and inspect available actions with argument schemas.
- Market discovery (normalized MarketDto) — Browse markets across protocols and chains with a consistent shape. Compare rates, liquidity, and utilization using stable fields across venues.
- Portfolio & risk state (positions) — Read supplied collateral, borrowed debt, and aggregated portfolio metrics:
healthFactor,currentLtv,availableToBorrowUsd, liquidation thresholds, net APY, and accrued interest. - Transaction building (intent → signable payloads) — Convert an intent like “borrow 2.5 WETH from market X” into one or more unsigned on-chain transactions (approvals + protocol calls) ready for client-side signing.
- Execution orchestration (step-based actions) — Actions that require multiple transactions follow a consistent state machine: create action → sign/submit → poll → step → repeat → success/failure.
Supported protocols
- Aave
- Morpho
| Field | Value |
|---|---|
| Integration ID | aave-borrow |
| Name | Aave V3 Borrow |
| Market type | Pool — shared liquidity across assets; collateral types and debts live under the same pool context |
| Networks | Ethereum, Optimism, Arbitrum, Polygon, Avalanche, Base, BNB Chain, Gnosis, Sonic, Linea, Plasma |
Market types: Pool vs Isolated
- Pool markets (Aave): shared liquidity across assets inside a pool; collateral types and debts live under the same pool context.
- Isolated markets (Morpho Blue): each collateral–loan pair is a standalone market with isolated risk and liquidity.
Integration at a glance
Discover markets
Use
GET /v1/markets to browse and filter available lending/borrowing markets across protocols and chains.Fetch current account state (optional)
Use
GET /v1/positions to show balances, risk metrics, and available actions for a user’s portfolio.Create an action
Use
POST /v1/actions with { integrationId, action, address, args } to get unsigned transaction(s).Sign & submit transactions
For each returned
TransactionDto, sign it with your wallet/custody infrastructure, then POST /v1/transactions/:transactionId/submit.Advance multi-step actions
Poll
GET /v1/actions/:id until WAITING_FOR_NEXT, then call POST /v1/actions/:id/step for the next transaction(s). Repeat until hasNextStep=false and status=SUCCESS.Integration options
Option A — Drop-in Widget (React)
The Yield.xyz Borrowing Widget is a drop-in lending/borrowing frontend module built with React. It handles market discovery, live rates, portfolio state, action construction, and transaction signing — all out of the box.Best for: wallets, exchanges, and fintech apps that want a turnkey UI.
Option B — Direct API Integration
Integrate natively while keeping full UI control. Build your own market browser and position UI, use the API for normalized data and transaction construction, and use your own signing/broadcast pipeline.Best for: custom UX or product-specific abstractions.
Key concepts (risk & rates)
Health factor
| Value | Meaning |
|---|---|
> 1 | Safe |
= 1 | At liquidation threshold |
< 1 | Eligible for liquidation |
healthFactor on positions and predictedHealthFactor in action metadata (preview before signing).
LTV and liquidation threshold
- Max LTV — how much can be borrowed against collateral.
- Liquidation threshold — the point where liquidation can occur (typically higher than max LTV, providing a buffer).
- Liquidation penalty — bonus paid to liquidators from collateral during liquidation.
Rates
- Supply APY accrues on supplied assets.
- Borrow APR accrues on borrowed assets.
- Rates are typically utilization-driven — higher utilization → higher borrow rates and supply yields.
API reference
Integrations
List integrations
GET /v1/integrations
Returns all available lending/borrowing integrations with supported actions and argument schemas.
Get integration by ID
GET /v1/integrations/:integrationId
Returns a single integration by ID.
Markets
List markets (paginated)
GET /v1/markets
| Parameter | Type | Required | Description |
|---|---|---|---|
integrationId | string | No | Filter by integration |
network | string | No | Filter by network |
offset | number | No | Pagination offset (default 0) |
limit | number | No | Page size (default 25, max 100) |
Get market by ID
GET /v1/markets/:marketId
Returns a single market by ID.
Positions
Get user positions
GET /v1/positions
Returns the user’s full supply + borrow state for a given integration + network.
| Parameter | Type | Required | Description |
|---|---|---|---|
integrationId | string | Yes | Integration identifier |
network | string | Yes | Network identifier |
address | string | Yes | User wallet address |
Actions
Create an action
POST /v1/actions
Creates a lending/borrowing action and returns unsigned transaction(s) for signing.
Request body — ActionRequestDto
| Field | Type | Required | Description |
|---|---|---|---|
integrationId | string | Yes | Integration identifier |
action | string | Yes | Action type (see Action types) |
address | string | Yes | User wallet address |
args | object | Yes | Action arguments |
| Field | Type | Required | Notes |
|---|---|---|---|
marketId | string | Yes | Target market identifier |
amount | string | No* | Human amount (e.g. "1.5") |
amountRaw | string | No* | Base units (e.g. "1500000") |
tokenAddress | string | No | Used when market needs explicit token selection |
collateralTokenAddress | string | No | For markets where collateral must be specified |
collateralAmount | string | No | Human collateral amount |
collateralAmountRaw | string | No | Base units collateral amount |
Provide either
amount or amountRaw, not both.Get action
GET /v1/actions/:id
Returns the current state of an action (use for polling).
List actions (paginated)
GET /v1/actions
| Parameter | Type | Required | Description |
|---|---|---|---|
address | string | No | Filter by wallet |
integrationId | string | No | Filter by integration |
action | string | No | Filter by action type |
status | string | No | Filter by action status |
offset | number | No | Default 0 |
limit | number | No | Default 25, max 100 |
Advance to next step
POST /v1/actions/:id/step
For multi-step actions, call after the current step confirms. Returns the next transaction(s) to sign.
Transactions
Submit a signed transaction
POST /v1/transactions/:transactionId/submit
Submit either a signedPayload (API broadcasts) or a transactionHash (client already broadcast).
Request body — SubmitTransactionDto
| Field | Type | Description |
|---|---|---|
signedPayload | string | Signed transaction payload (max 1 MB) |
transactionHash | string | 0x + 64 hex chars |
Reference tables
Action types
| Action | Description |
|---|---|
supply | Deposit assets into a lending pool as collateral / to earn interest |
borrow | Borrow assets against supplied collateral |
repay | Repay borrowed debt (partial or full) |
withdraw | Withdraw supplied assets |
enableCollateral | Enable a supplied asset as collateral |
disableCollateral | Disable a supplied asset as collateral |
Transaction types
| Type | Description |
|---|---|
APPROVAL | ERC-20 approval (before supply/repay) |
SUPPLY | Deposit into the protocol |
BORROW | Borrow from the protocol |
REPAY | Repay debt |
WITHDRAW | Withdraw supplied assets |
ENABLE_COLLATERAL | Enable collateral usage |
DISABLE_COLLATERAL | Disable collateral usage |
Transaction statuses
| Status | Meaning |
|---|---|
CREATED | Ready for signing |
BLOCKED | Waiting on prior transaction |
WAITING_FOR_SIGNATURE | Sent to signer |
SIGNED | Signed by user |
BROADCASTED | Broadcast submitted |
PENDING | Awaiting confirmations |
CONFIRMED | Confirmed on-chain |
FAILED | Failed on-chain |
SKIPPED | Not needed (e.g., allowance already sufficient) |
End-to-end examples
Supply → Borrow (step-based)
Repay → Withdraw
Multi-step action lifecycle
Some actions require multiple on-chain transactions (e.g., ERC-20 approval before supply/repay):POST /v1/actions→ returns step 1 transaction(s)- Submit step 1 → poll action
- When action is
WAITING_FOR_NEXT→POST /v1/actions/:id/step - Repeat until
hasNextStep=falseandstatus=SUCCESS
Where to go next
Quickstart
Make your first borrowing request
StakeKit
Explore staking infrastructure
DeFiKit
Explore DeFi yield infrastructure
Contact Us
Get in touch for integration support

