Parse user positions
POST/v1/data/lending/user-positions/parse
Accepts the raw multicall RPC responses obtained by executing the calls from /rpc-call and decodes them into structured user position data.
Workflow:
- Call
/rpc-callto get prepared RPC calls and arpcCallId - Execute the RPC calls against your own node
- Send
rpcCallId+rawResponsesto this endpoint for parsing
The rpcCallId ties the responses back to the cached preparation context (valid for 5 minutes).
After successful parsing the cached context is deleted.
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.
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)
Plain-text reference — POST /v1/data/lending/user-positions/parse
Request body
| Field | Type | Required | Description |
|---|---|---|---|
rpcCallId | string | yes | The rpcCallId returned by /rpc-call. |
rawResponses | object[] | yes | Raw JSON-RPC response results in the same order as the rpcCalls array. Each entry is the hex-encoded result of the corresponding multicall3 aggregate3 call. |
rawResponses[].result | string | no | Hex-encoded result data |
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
- 404
- 429
- 500
- 502
Parsed user position data with portfolio summary
Validation error
RPC call context not found or expired (older than 5 minutes). Call /rpc-call again.
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.