Skip to main content

UserSubAccount

Position data for a single sub-account within a lender.

accountIdstringrequired

Sub-account identifier (e.g., "0" for default, NFT ID for Init)

Example: 0
healthnumbernullable

Health factor (null if no debt). Values > 1 are healthy, < 1 at risk of liquidation.

Example: 1.85
borrowCapacityUSDnumber

Total USD borrowable while maintaining health >= 1

Example: 3000
balanceData objectrequired

Aggregated balance data for a sub-account.

depositsnumber

Total deposits in USD

Example: 10000.5
debtnumber

Total debt in USD

Example: 5000.25
adjustedDebtnumber

Debt adjusted for borrow factors

Example: 5500
collateralnumber

Collateral value in USD

Example: 9000
collateralAllActivenumber

Collateral if all assets were enabled

Example: 10000.5
borrowDiscountedCollateralnumber

Collateral discounted by borrow factors

Example: 8000
borrowDiscountedCollateralAllActivenumber

Discounted collateral if all enabled

Example: 9000
navnumber

Net asset value (deposits - debt)

Example: 5000.25
deposits24hnumber

Deposits 24h ago (for change calculation)

Example: 9800
debt24hnumber

Debt 24h ago

Example: 4900
nav24hnumber

NAV 24h ago

Example: 4900
rewards object

Pending rewards by token

property name*any

Pending rewards by token

aprData objectrequired

APR breakdown for a sub-account.

aprnumber

Net APR (deposit - borrow)

Example: 2.5
depositAprnumber

Weighted deposit APR

Example: 3.5
borrowAprnumber

Weighted borrow APR

Example: 5.2
rewardAprnumber

Total reward APR

Example: 1.2
rewardDepositAprnumber

Reward APR on deposits

Example: 0.8
rewardBorrowAprnumber

Reward APR on borrows

Example: 0.4
intrinsicAprnumber

Intrinsic yield APR (e.g., stETH staking)

Example: 0
intrinsicDepositAprnumber

Intrinsic yield APR portion from deposits

Example: 0
intrinsicBorrowAprnumber

Intrinsic yield APR portion from borrows

Example: 0
rewards object

Reward token details

property name*any

Reward token details

positions object[]required

Individual asset positions in this sub-account

  • Array [
  • marketUidstring

    Unique market identifier (format: {lender}:{chainId}:{address})

    Example: AAVE_V3:1:0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
    depositsstring

    Deposit amount in token units (wei)

    Example: 1000000000000000000
    debtstring

    Variable debt in token units

    Example: 0
    debtStablestring

    Stable debt in token units

    Example: 0
    depositsUSDnumber

    Deposits in USD

    Example: 2500
    debtUSDnumber

    Variable debt in USD

    Example: 0
    debtStableUSDnumber

    Stable debt in USD

    Example: 0
    collateralEnabledboolean

    Whether this asset is enabled as collateral

    Example: true
    claimableRewardsnumber

    Claimable rewards in USD

    Example: 0.5
    withdrawablestring

    Max tokens withdrawable while maintaining health >= 1. Equals full deposit balance if collateral is not enabled.

    Example: 0.5
    borrowablestring

    Max tokens borrowable against remaining credit line. Zero if borrowing is disabled, reserve is frozen, or debt is disabled for the active mode.

    Example: 100
  • ]
  • userConfig objectrequired

    User configuration for a sub-account.

    selectedModeinteger

    E-Mode category (0 = none)

    Example: 0
    idstring

    Config identifier

    Example: 0
    isWhitelistedboolean

    Whether user is whitelisted (for permissioned markets)

    UserSubAccount
    {
    "accountId": "0",
    "health": 1.85,
    "borrowCapacityUSD": 3000,
    "balanceData": {
    "deposits": 10000.5,
    "debt": 5000.25,
    "adjustedDebt": 5500,
    "collateral": 9000,
    "collateralAllActive": 10000.5,
    "borrowDiscountedCollateral": 8000,
    "borrowDiscountedCollateralAllActive": 9000,
    "nav": 5000.25,
    "deposits24h": 9800,
    "debt24h": 4900,
    "nav24h": 4900,
    "rewards": {}
    },
    "aprData": {
    "apr": 2.5,
    "depositApr": 3.5,
    "borrowApr": 5.2,
    "rewardApr": 1.2,
    "rewardDepositApr": 0.8,
    "rewardBorrowApr": 0.4,
    "intrinsicApr": 0,
    "intrinsicDepositApr": 0,
    "intrinsicBorrowApr": 0,
    "rewards": {}
    },
    "positions": [
    {
    "marketUid": "AAVE_V3:1:0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
    "deposits": "1000000000000000000",
    "debt": "0",
    "debtStable": "0",
    "depositsUSD": 2500,
    "debtUSD": 0,
    "debtStableUSD": 0,
    "collateralEnabled": true,
    "claimableRewards": 0.5,
    "withdrawable": "0.5",
    "borrowable": "100"
    }
    ],
    "userConfig": {
    "selectedMode": 0,
    "id": "0",
    "isWhitelisted": true
    }
    }