Common frontend flows
Lending and borrowing flows with health monitoring.
Lending flow
Read available markets or pools using
getMorphoMarketor Aave pool data.Use
previewDeposit-style reads or balance checks to show the user how much they can supply.For Morpho, call
buildSupplyand execute the returnedrequirementsfollowed bybundlerTx. For Aave, send an approval transaction first, then execute the tx frombuildAaveSupplyTx.
Borrow flow with health monitoring
After supplying collateral, read the user's account health via
getAaveUserAccountData(for Aave) orgetMorphoPosition(for Morpho).Display available borrow power and health factor in the UI so the user can choose a safe borrow amount.
Call the relevant build method and execute.
After borrowing, re-read account health and update the UI.
Recommended data split
For the best frontend experience, combine data sources the same way you would with vaults:
Use CityLendingClient read methods for live onchain state like positions, health factors, and market utilization. Pair this with CityPortfolioClient subgraph queries if you need historical lending activity or indexed transaction logs.
Last updated