Skip to main content
Vanna is a margin lending protocol on Stellar Soroban. It consists of 14 smart contracts that together let users deposit collateral, borrow assets, deploy leverage into external DeFi protocols (Blend, Aquarius, Soroswap), and earn passive yield as liquidity providers. Every user who opens a margin account gets their own dedicated smart contract — no shared state, no cross-account risk. This documentation is for developers who want to integrate with, extend, or build on top of the Vanna Protocol.

What You Can Build

Lending Integrations

Supply liquidity to XLM or USDC pools. Read pool state (utilization, APY, exchange rate). Integrate vToken minting and redemption into your own interface.

Margin Account Apps

Create margin accounts on behalf of users, deposit collateral, issue borrows, and route capital to external protocols — all from your own frontend.

Liquidation Bots

Monitor health factors on-chain. Call liquidate() when an account drops below 1.1x to earn the protocol fee. No special permissions required.

Yield Aggregators

Compose Vanna’s vTokens with Blend, Aquarius, and Soroswap positions to build automated leveraged yield strategies.

Analytics & Risk Tools

Query position data, oracle prices, borrow rates, and health factors across all accounts. Build dashboards, alerting systems, or stress-testing tools.

Protocol Integrations

Add Vanna’s lending pools as a liquidity source in your own Soroban protocol. The pool interface is minimal: lend_to() and collect_from().

Use Case Quick Reference

What you want to doEntry pointGuide
Supply/withdraw liquidityLendingPool.deposit_xlm() / redeem_vxlm()Integrate Lending
Open a margin accountAccountManager.create_account()Integrate Margin
Deposit collateralAccountManager.deposit_collateral_tokens()Integrate Margin
Borrow from a poolAccountManager.borrow()Integrate Margin
Deploy to Blend / AquariusSmartAccount.execute()Integrate Margin
Build a liquidation botAccountManager.liquidate()Liquidation Bots
Read contract eventsMercury indexer APIEvents & Indexing
Get oracle pricesOracle.get_price_latest()Math Reference
Check health factorRiskEngine.get_current_total_balance()Risk Engine

The Contract Stack

Vanna’s contracts are organized into four layers. You interact with the top layer; the layers below enforce safety and handle accounting.
┌─────────────────────────────────────────────────────────────┐
│                      USER / INTEGRATOR                       │
│         (wallet, frontend, bot, external protocol)           │
└─────────────────────────┬───────────────────────────────────┘

┌─────────────────────────▼───────────────────────────────────┐
│                   ENTRY LAYER                                 │
│   AccountManager — single entry point for all margin ops     │
│   LendingPools (XLM · USDC) — LP deposit/withdraw           │
└──────┬────────────────────────────────────────┬─────────────┘
       │                                        │
┌──────▼──────────────┐              ┌──────────▼──────────────┐
│    RISK LAYER        │              │    STATE LAYER           │
│  RiskEngine          │              │  SmartAccount (per user) │
│  (health checks,     │              │  (collateral balances,   │
│   liquidation gates) │              │   borrow lists,          │
│  RateModel           │              │   external positions)    │
│  (interest rates)    │              │                          │
└──────┬──────────────┘              └──────────┬──────────────┘
       │                                        │
┌──────▼────────────────────────────────────────▼─────────────┐
│                    INFRASTRUCTURE LAYER                       │
│  Registry · Oracle · TrackingTokens · vTokens · Deployer     │
└─────────────────────────────────────────────────────────────┘

Network & Environment

All contracts are currently deployed on Stellar Testnet. Mainnet deployment is planned for a future release.
ParameterValue
NetworkStellar Testnet
Network passphraseTest SDF Network ; September 2015
Soroban RPChttps://soroban-testnet.stellar.org
Horizonhttps://horizon-testnet.stellar.org
Fixed-point precisionWAD — 10¹⁸ (all balances and prices in WAD unless noted)
See Deployed Contracts for all contract addresses.

Documentation Map

Architecture

How the 14 contracts fit together. Call graphs and data flows for deposits, borrows, and liquidations.

Deployed Contracts

All testnet contract addresses, token addresses, and external protocol addresses.

Math Reference

WAD arithmetic, interest accrual, vToken exchange rate, borrow shares, health factor, and rate model formulas.

Contract Reference

Function-level reference for all 8 protocol contracts: parameters, return values, errors, and events.

TypeScript SDK

How to call Soroban contracts from TypeScript using Stellar SDK and Freighter wallet.

Integration Guides

End-to-end guides for lending integrations, margin account management, liquidation bots, and event indexing.