Skip to main content
This guide covers integrating Vanna’s lending pools — depositing assets to earn yield, reading pool metrics, and redeeming vTokens.

Overview

Vanna has four lending pools: Depositors receive vTokens (vXLM, vUSDC, etc.) that appreciate in value as interest accrues. Redeem them at any time for the underlying asset.

Prerequisites

Set up the Stellar SDK and server connection — see Getting Started.

Step 1: Read Pool State

Before depositing, read the pool’s current metrics:

Step 2: Get the Borrow APY

Query the Rate Model for the current borrow rate:
The supply APY is approximately borrow_APY × utilization_rate (interest earned by LPs is the fraction of borrow interest from deployed capital).

Step 3: Read a User’s vToken Balance


Step 4: Deposit (Supply Liquidity)

The LendingPool transfers XLM from the caller’s account. Freighter will prompt the user to authorize the native XLM transfer during the signing step — no separate approve() needed for XLM. For USDC pools, the approve() pattern is required.

Step 5: Redeem vTokens (Withdraw)

To withdraw all: fetch the user’s vToken balance and pass it as vtokensToRedeem.

Step 6: Fetch Deposit/Withdrawal History

Use Mercury to fetch historical events:

Full Pool Data Component (React)


Error Handling