Skip to main content

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:

  1. Call /rpc-call to get prepared RPC calls and a rpcCallId
  2. Execute the RPC calls against your own node
  3. Send rpcCallId + rawResponses to 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

FieldTypeRequiredDescription
rpcCallIdstringyesThe rpcCallId returned by /rpc-call.
rawResponsesobject[]yesRaw 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[].resultstringnoHex-encoded result data

Response 200

FieldTypeDescription
successTrue
dataobjectUser lending positions as a flat array with portfolio summary and per-chain breakdowns.
data.itemsobject[]Flat array of lender entries sorted by net worth (descending). Each entry fuses position data with aggregated summary metrics.
data.items[].lenderstringLender identifier
data.items[].chainIdstringChain ID
data.items[].accountstringUser account address
data.items[].dataobject[]Sub-account position data
data.items[].data[].accountIdstringSub-account identifier (e.g., "0" for default, NFT ID for Init)
data.items[].data[].healthnumberHealth factor (null if no debt). Values > 1 are healthy, < 1 at risk of liquidation.
data.items[].data[].borrowCapacityUSDnumberTotal USD borrowable while maintaining health >= 1
data.items[].data[].balanceDataobjectAggregated balance data for a sub-account.
data.items[].data[].aprDataobjectAPR breakdown for a sub-account.
data.items[].data[].positionsobject[]Individual asset positions in this sub-account
data.items[].data[].userConfigobjectUser configuration for a sub-account.
data.items[].balanceDataobjectSummary-level balance data (without discounted/adjusted fields).
data.items[].balanceData.depositsnumberTotal deposits in USD
data.items[].balanceData.debtnumberTotal debt in USD
data.items[].balanceData.collateralnumberCollateral value in USD
data.items[].balanceData.collateralAllActivenumberCollateral if all assets were enabled
data.items[].balanceData.navnumberNet asset value (deposits - debt)
data.items[].balanceData.deposits24hnumberDeposits 24h ago
data.items[].balanceData.debt24hnumberDebt 24h ago
data.items[].balanceData.nav24hnumberNAV 24h ago
data.items[].balanceData.rewardsobject[]Pending reward token claims. Each entry represents a single reward program.
data.items[].aprDataobjectSummary-level APR breakdown.
data.items[].aprData.aprnumberNet APR (deposit - borrow)
data.items[].aprData.depositAprnumberWeighted deposit APR
data.items[].aprData.borrowAprnumberWeighted borrow APR
data.items[].aprData.rewardAprnumberTotal reward APR
data.items[].aprData.rewardDepositAprnumberReward APR on deposits
data.items[].aprData.rewardBorrowAprnumberReward APR on borrows
data.items[].aprData.intrinsicAprnumberIntrinsic yield APR (e.g., stETH staking)
data.items[].aprData.intrinsicDepositAprnumberIntrinsic yield APR portion from deposits
data.items[].aprData.intrinsicBorrowAprnumberIntrinsic yield APR portion from borrows
data.items[].aprData.rewardsobjectPer-reward-token APR breakdown. Keys are reward token addresses.
data.items[].leveragenumberLeverage ratio (deposits / nav)
data.summaryobjectPortfolio-wide totals with per-chain breakdowns. Per-lender summaries are fused into each LenderDataEntry in the items array.
data.summary.balanceDataobjectSummary-level balance data (without discounted/adjusted fields).
data.summary.balanceData.depositsnumberTotal deposits in USD
data.summary.balanceData.debtnumberTotal debt in USD

Request

Responses

Parsed user position data with portfolio summary