sections object that reports indexing status and freshness for each product, and one array for each product section. Each position is returned already valued, with its own value and price included.
Parameters
| Parameter | In | Required | Description |
|---|---|---|---|
pubkey | path | Yes | Wallet address (base58). |
programId | query | No | KLend program ID to scope results. |
Response object
| Field | Type | Description |
|---|---|---|
timestamp | string | ISO timestamp of the response. |
sections | object | Indexing status and freshness per product. See Section state. |
lending multiply leverage | array | Borrow-side obligations (see the Position fields tabs). |
liquidity earn privateCredit staking | array | The remaining product positions. |
Position fields by product
- Lending, Multiply & Leverage
- Liquidity
- Earn & Private Credit
- Staking
One entry per obligation. The
tag field distinguishes the kind (Vanilla, Multiply, and so on). Multiply and leverage entries add depositMint and borrowMint.| Field | Type | Description |
|---|---|---|
obligation | string | Obligation pubkey. |
market | string | Lending market pubkey. |
tag | string | Obligation kind (Vanilla, Multiply, …). |
netValue | string | USD net value (deposits minus borrows). |
totalDepositValue | string | USD value of all deposits. |
totalBorrowValue | string | USD value of all borrows. |
ltv | string | Current loan-to-value (for example "0.38"). |
maxLtv | string | Maximum borrowing LTV. |
liquidationLtv | string | LTV at which liquidation triggers. |
leverage | string | Position leverage (for example "1.56"). |
deposits | array | Deposited assets (Token object). |
borrows | array | Borrowed assets (Token object). |
depositMint | string | Multiply and leverage only: collateral mint. |
borrowMint | string | Multiply and leverage only: debt mint. |
Shared building blocks
Token object (deposits, borrows, tokenA, tokenB)
Token object (deposits, borrows, tokenA, tokenB)
Entries in
deposits, borrows, and the liquidity tokenA / tokenB share a common shape, with a few context-specific extras.| Field | Type | Description |
|---|---|---|
mint | string | Token mint. |
symbol | string | Token symbol. |
amount | string | Token amount. |
value | string | USD value. |
price | string | Token price. |
reserve | string | Reserve pubkey (deposits and borrows). |
maxLtv | string | Deposits only: collateral max LTV. |
liquidationLtv | string | Deposits only: collateral liquidation LTV. |
borrowFactor | string | Borrows only: borrow factor. |
Section state (sections object)
Section state (sections object)
Each product key in
sections reports whether the wallet has data and how fresh it is. A section with indexed: false has no data for this wallet.| Field | Type | Description |
|---|---|---|
indexed | boolean | false means no data for this wallet and product. |
positionsRefreshedOn | string | null | ISO timestamp positions were last refreshed. |
pricesRefreshedOn | string | null | ISO timestamp prices were last refreshed. |
errors | array | Errors encountered while loading this section. |
Pending rewards
GET /portfolio/{pubkey}/rewards returns pending farm rewards across products: a timestamp and a farms array. Each farm entry lists its pending rewards.
| Field | Type | Description |
|---|---|---|
farm | string | Farm pubkey. |
userState | string | User state pubkey. |
delegatee | string | Wallet pubkey. |
positionType | string | Human-readable source (for example Borrow Markets). |
activeStakeAmount | string | Active staked amount. |
tokenMints | array | Associated token mints. |
rewards | array | Pending rewards (see below). |
Reward entry fields
Reward entry fields
| Field | Type | Description |
|---|---|---|
mint | string | Reward token mint. |
amount | string | Pending amount. |
index | number | Reward index. |
type | number | Reward type. |
tokenProgram | string | Token program of the reward mint. |
Examples
Calculate LTV and liquidation headroom for each lending position
Compareltv against liquidationLtv to measure how close a position is to liquidation.lendingPositions
List earn vault positions with shares and USD value
earnPositions
Check which product sections are stale or failed to load
Usesections to decide whether positions are stale or a product failed to load.sectionFreshness
List pending farm rewards across all products
pendingRewards
Sum total portfolio value and break it down per product
SumnetValue from each section (and value for staking) for a portfolio total, then break it down per product.totalValue
Calculate portfolio totals
The API returns valued positions but no portfolio-wide rollups, so you compose them:- Net worth: sum
netValueacross every section, except staking, which exposesvalueinstead. Multiply and leveragenetValueis already deposits minus borrows, so totals reflect real equity. - USD conversion: positions carry
valueandprice, but for any raw amounts you price yourself, use the Oracle prices endpoint.