> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vanna.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrate Lending

> Supply and redeem from the four configured testnet lending markets.

## Supply

Resolve the exact asset's pool with `lendingPoolAddress(assetType)`. The app-local `ContractService.deposit(walletAddress, amount, assetType)` accepts a human-unit number, constructs WAD arguments, prepares/signs/submits, and returns a success result or error. For precise external integrations, build amounts from strings/bigint directly.

At the contract boundary call `deposit(lender, amount_wad)`. The lender authorizes the call and underlying transfer. This is a wallet-to-pool flow; no SmartAccount is required.

## Redeem

Read the receipt balance and its own decimals. Convert the desired receipt quantity to WAD and call `redeem_vtokens(lender, tokens_to_redeem_wad)`. The app-local `ContractService.withdraw` passes receipt quantities, despite the generic parameter name `amount`.

Redemption can partially fill because the pool limits a single payout to 50% of total assets and available cash. Read `withdraw_event.asset_amount`, `vtoken_amount`, and the refreshed balance. Do not show the requested quantity as the completed payout.

## Pool data

Use `get_total_liquidity_in_pool`, `get_borrows`, `total_assets`, and conversion getters to distinguish available cash from outstanding debt and receipt value. Read the current rate model and fee. Borrowers are subject to the pool's 95% utilization cap.

See [Lending Pools](https://docs.vanna.finance/stellar/developers/contracts/lending-pools.md) for signatures and [Math Reference](https://docs.vanna.finance/stellar/developers/math-reference.md) for scaling.

## Source reference

* `Vanna_Finance_Backend/apps/stellar/lib/stellar-utils.ts`
* `Vanna_Finance_Backend/apps/stellar/hooks/use-earn.ts`
* `Protocol_V1_Soroban_testnet/contracts/lending-pool/src/pool.rs`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.