Skip to main content
This page is the single reference for Borrow enums and shared objects. Endpoint pages link here. Values are shown exactly as the Borrow API serializes them. Base URL is https://borrow.yield.xyz; every route except /health needs the x-api-key header.

Integrations

Networks per integration are in Coverage. The live list, with each integration’s networks and actions, comes from List integrations; do not hard-code it. The list is not filtered by project, so it can include integrations that exist only on a test network. Those are not part of mainnet support. IntegrationDto fields: id, providerId, name, networks[], metadata (description, externalLink, logoURI) and actions[]. Each actions[] entry has id (an action type), label and schema, a JSON Schema of the args that action accepts on that integration.

Market models

MarketDto.type is one of two values. MarketDto fields: All rates, LTVs and penalties are decimal strings, not percentages.

Action types

action in Execute an action and the action filter in List actions. Declared in BorrowActionTypes; all seven are accepted by request validation, but each integration supports a subset (see Availability by integration).

Action arguments

args on POST /v1/actions is one flat object (ArgumentsDto). Only marketId is required by the schema; each action validates the rest. R means required, O optional, blank means not used. “Pool” is aave-borrow and sparklend-borrow; “isolated” is morpho-blue-borrow and lista-borrow. Formats: amount, collateralAmount and borrowAmount are decimal strings in human-readable token units ("1.5"); amountRaw and collateralAmountRaw are integer strings in raw token units ("1500000"); targetLtv is a decimal string ("0.1" is 10%); addresses are 0x plus 40 hex characters. Amounts are limited to 50 characters and must be greater than zero.

Validation rules

All failures return 400.

Collateral bundling

Bundling is optional and applies only to borrow and repay. It adds a collateral leg to the same action instead of requiring a separate supply or withdraw call. The extra transactions come back in the same transactions[], in signing order.
  • Pool markets (aave-borrow, sparklend-borrow): collateralTokenAddress is required whenever a collateral amount is sent. The amount is converted using that token’s decimals.
  • Isolated markets (morpho-blue-borrow, lista-borrow): the collateral token is the market’s single collateral asset, so collateralTokenAddress is not needed. If you send it, it must match that token.
  • withdraw, supply, enableCollateral and disableCollateral do not use the collateral fields. Use supplyAndBorrow for a supply-and-borrow bundle.
  • borrow and repay with a collateral amount are not the same as supplyAndBorrow. supplyAndBorrow is a separate action that is only listed for a project when it is configured.

Supply by target LTV

Instead of a collateral amount, supply accepts borrowAmount (in loan-token units) with targetLtv. The API derives the collateral needed to borrow that amount at that LTV and supplies it. targetLtv must not exceed the market’s max LTV, otherwise the call returns 400. The derived collateral is returned in metadata.effectiveCollateralAmount. This is a preview aid: it does not borrow anything.

supplyAndBorrow gating

supplyAndBorrow is implemented only by morpho-blue-borrow. It appears in that integration’s actions[] only when the requesting project has the bundled supply-and-borrow fee configuration, which yield.xyz sets up per project. Calling it anyway returns 400: amount or amountRaw is the net amount you receive. Where a fee applies, the debt recorded on chain is higher; the difference is reported in action metadata.

Availability by integration

The matrix below is derived from each integration’s action list and action builder. GET /v1/integrations remains authoritative for a given project. Calling an unsupported action returns 400. Lista also enforces minLoan: a borrow that would leave debt below it, or a partial repay that would leave debt above zero but below it, returns 400. Use repayAll to close a Lista position.

Action metadata

ActionDto.metadata previews the position after the action. All values are strings unless noted. metadata is optional on the object, so handle its absence. ActionDto.rawArguments echoes the args you sent.

Action statuses

ActionDto.status and the status and statuses filters on List actions. statuses accepts up to 7 values as a CSV or repeated parameter; when it is set, status is ignored. Poll Get an action after submission. A partly signed action returns to CREATED when its submitted transactions confirm and others remain.

Transaction types

TransactionDto.type, in signing order within transactions[]. Sign every returned transaction, in order, including ones you did not request. signingFormat is EVM_TRANSACTION for Borrow; the enum also declares EIP712_TYPED_DATA, SOLANA_TRANSACTION and COSMOS_TRANSACTION, which Borrow does not emit. For an EVM transaction signablePayload is a JSON string with from, to, data, gasLimit and value. Sign it as returned. hasNextStep, currentStep and totalSteps are on ActionDto. Every current integration returns hasNextStep: false and totalSteps: 1. See Step an action.

Transaction statuses

TransactionDto.status and SubmitTransactionResponseDto.status. The enum is shared with the other APIs; the Borrow API uses these values: The enum also declares NOT_FOUND, BLOCKED, WAITING_FOR_SIGNATURE, SIGNED, PENDING and SKIPPED. A Borrow transaction moves through the four values above; SKIPPED counts as done when deciding an action’s SUCCESS.

Position fields and nullability

PositionDto from Get positions. Amounts are strings. Read the account-level fields for aave-borrow and sparklend-borrow, and positionState on each supply balance for morpho-blue-borrow and lista-borrow. pendingActions[] entries are { type, label, args }; type is an action type and args is pre-filled input for POST /v1/actions.

Liquidations

LiquidationDto from Get liquidations. Available for morpho-blue-borrow only. amountUsd values are priced at the liquidation block and are null when no historical price exists.