For the complete documentation index, see llms.txt. This page is also available as Markdown.

Read methods

Account health, market data and user positions.

Aave V3: account health

Returns the full account summary for a user on an Aave V3 pool. This is useful for displaying health factors, available borrow power, and liquidation thresholds in your UI.

const accountData = await lendingClient.getAaveUserAccountData({
  pool: "0xYourAavePoolAddress",
  user: "0xYourWalletAddress",
});

The returned object includes fields like totalCollateralBase, totalDebtBase, availableBorrowsBase, currentLiquidationThreshold, ltv, and healthFactor. All base values are denominated in the pool's base currency, USD with 8 decimals on Aave V3.

Morpho Blue: market data

Reads the current state of a Morpho Blue market, including total supply, total borrow, and utilization.

const market = await lendingClient.getMorphoMarket({
  marketId: "0xYourMorphoMarketId",
});

Morpho Blue: user position

Reads a user's current position in a specific Morpho market, including supplied assets, borrowed assets, and collateral.

const position = await lendingClient.getMorphoPosition({
  marketId: "0xYourMorphoMarketId",
  user: "0xYourWalletAddress",
});

Last updated