User positions
GET/v1/data/lending/user-positions
Fetches lending and borrowing positions for a given account across one or more chains.
Response Structure:
items: Flat array of lender entries sorted by net worth (descending). Each entry fuses sub-account position data with aggregated summary metrics (deposits, debt, APRs, health, leverage).summary: Portfolio-wide totals (net worth, APRs, leverage, active counts) plus per-chain breakdowns.partial/incompleteLenders: only present when some lender could not be read in full (RPC error or reverted call). A lender whose reads all failed is omitted rather than returned as an empty position, so totals are a lower bound for that request.
Lender Entry includes:
- Per-asset deposits and debt (in USD and token units)
- Sub-account data with health factors and borrow capacity
- Aggregated lender-level metrics (total deposits/debt, weighted APRs, health factor, leverage)
- Collateral status, withdrawable/borrowable amounts per position
Portfolio Summary includes:
- Total deposits, debt, and net worth (current + 24h ago) across all chains
- Weighted average APRs and overall leverage ratio
- Count of active lenders and chains
- Per-chain totals (deposits, debt, net worth, lender count)
The server executes RPC calls internally and returns fully parsed results.
Using with action endpoints (POST simulation):
All action endpoints (/v1/actions/lending/*, /v1/actions/loop/*) accept an optional POST body for post-trade simulation. The data comes directly from this endpoint:
// 1. Fetch positions
GET /v1/data/lending/user-positions?account=0x...&chains=1
// 2. Pick the lender entry + sub-account you're acting on
const sub = response.data.items[i].data[j]
// 3. POST to any action endpoint with the same query params as GET, plus:
POST /v1/actions/lending/deposit?marketUid=AAVE_V3:1:0x...&amount=1000000
{
"balanceData": sub.balanceData,
"aprData": sub.aprData,
"positions": sub.positions,
"modeId": sub.userConfig.selectedMode
}
// 4. Response includes a "simulation" field with pre/post health factor,
// borrow capacity, and projected balanceData/aprData.
See the SimulationBody schema for full details.
Plain-text reference — GET /v1/data/lending/user-positions
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
account | query | string | yes | EVM account address (0x-prefixed, 40 hex chars) |
chains | query | string | yes | Comma-separated chain IDs |
lenders | query | string | no | Comma-separated lender IDs to filter by. If omitted, all supported lenders for each chain are included. See the LenderId schema for the full set of accepted values. |
Response 200
| Field | Type | Description |
|---|---|---|
success | True | |
data | object | User lending positions as a flat array with portfolio summary and per-chain breakdowns. |
data.items | object[] | Flat array of lender entries sorted by net worth (descending). Each entry fuses position data with aggregated summary metrics. |
data.items[].lender | string | Lender identifier |
data.items[].chainId | string | Chain ID |
data.items[].account | string | User account address |
data.items[].data | object[] | Sub-account position data |
data.items[].data[].accountId | string | Sub-account identifier (e.g., "0" for default, NFT ID for Init) |
data.items[].data[].health | number | Health factor (null if no debt). Values > 1 are healthy, < 1 at risk of liquidation. |
data.items[].data[].borrowCapacityUSD | number | Total USD borrowable while maintaining health >= 1 |
data.items[].data[].balanceData | object | Aggregated balance data for a sub-account. |
data.items[].data[].aprData | object | APR breakdown for a sub-account. |
data.items[].data[].positions | object[] | Individual asset positions in this sub-account |
data.items[].data[].userConfig | object | User configuration for a sub-account. |
data.items[].balanceData | object | Summary-level balance data (without discounted/adjusted fields). |
data.items[].balanceData.deposits | number | Total deposits in USD |
data.items[].balanceData.debt | number | Total debt in USD |
data.items[].balanceData.collateral | number | Collateral value in USD |
data.items[].balanceData.collateralAllActive | number | Collateral if all assets were enabled |
data.items[].balanceData.nav | number | Net asset value (deposits - debt) |
data.items[].balanceData.deposits24h | number | Deposits 24h ago |
data.items[].balanceData.debt24h | number | Debt 24h ago |
data.items[].balanceData.nav24h | number | NAV 24h ago |
data.items[].balanceData.rewards | object[] | Pending reward token claims. Each entry represents a single reward program. |
data.items[].aprData | object | Summary-level APR breakdown. |
data.items[].aprData.apr | number | Net APR (deposit - borrow) |
data.items[].aprData.depositApr | number | Weighted deposit APR |
data.items[].aprData.borrowApr | number | Weighted borrow APR |
data.items[].aprData.rewardApr | number | Total reward APR |
data.items[].aprData.rewardDepositApr | number | Reward APR on deposits |
data.items[].aprData.rewardBorrowApr | number | Reward APR on borrows |
data.items[].aprData.intrinsicApr | number | Intrinsic yield APR (e.g., stETH staking) |
data.items[].aprData.intrinsicDepositApr | number | Intrinsic yield APR portion from deposits |
data.items[].aprData.intrinsicBorrowApr | number | Intrinsic yield APR portion from borrows |
data.items[].aprData.rewards | object | Per-reward-token APR breakdown. Keys are reward token addresses. |
data.items[].leverage | number | Leverage ratio (deposits / nav) |
data.summary | object | Portfolio-wide totals with per-chain breakdowns. Per-lender summaries are fused into each LenderDataEntry in the items array. |
data.summary.balanceData | object | Summary-level balance data (without discounted/adjusted fields). |
data.summary.balanceData.deposits | number | Total deposits in USD |
data.summary.balanceData.debt | number | Total debt in USD |
Request
Responses
- 200
- 400
- 429
- 500
- 502
User position data with portfolio summary
Validation error
Rate limited. Unauthenticated callers share a per-IP budget; send an x-api-key header to lift it. Retry with exponential backoff.
Unexpected server error. Safe to retry with backoff.
An upstream data source or protocol origin failed (error.code is ORIGIN_FAILED). error.details carries the per-origin status. This is also what a missing or malformed required parameter currently returns, rather than a 400.