StarkFiStarkFi

Vesu V2 Lending

Supply, borrow, and manage lending positions on Vesu pools

Overview

Vesu provides V2 lending pools on Starknet. StarkFi integrates with Vesu through the Starkzap SDK's wallet.lending() API, which handles all on-chain interactions — supply, withdraw, borrow, repay, close, and position monitoring.

Network-aware: All Vesu lending operations work on both Starknet mainnet and Sepolia testnet. Token addresses resolve dynamically based on the configured network.

How StarkFi Uses Vesu

FeatureSDK IntegrationStarkFi Command
Browse Poolswallet.lending().getMarkets()lend-pools
Supplywallet.lending().deposit()lend-supply
Withdrawwallet.lending().withdraw()lend-withdraw
Borrowwallet.lending().borrow()lend-borrow
Repaywallet.lending().repay()lend-repay
Close Positionwallet.tx().lendRepay()lend-close
Check Positionwallet.lending().getPositions()lend-status
Health Checkwallet.lending().getHealth()lend-monitor

Supported Pools

Pools are discovered dynamically via the SDK — no hardcoded list. Run starkfi lend-pools to see all live pools with APY/APR rates.

Tip: Use starkfi lend-pools <name> to filter by name and see detailed asset info.

Health Factor

Health factor is computed from SDK-provided USD values:

healthFactor = collateralValueUSD / debtValueUSD

Risk levels:

Risk LevelHealth FactorMeaning
SAFE> 1.3Position is healthy
WARNING1.1 – 1.3Monitor closely
DANGER1.05 – 1.1At risk of liquidation
CRITICAL≤ 1.05Imminent liquidation risk

Important: Monitor your health factor regularly with starkfi lend-status. If it drops below 1.0, your position can be liquidated.

Technical Details

SettingValue
SDK Modulestarkzapwallet.lending() via VesuLendingProvider
Pool DiscoveryDynamic via getMarkets()
Amount ParsingAmount.parse() / Amount.fromRaw() with token decimals
Dust Limit~$10 minimum for borrow positions (collateral and debt)

Architecture

commands/lending.ts → services/vesu/lending.ts → StarkZap wallet.lending() API
                      services/vesu/pools.ts   → StarkZap wallet.lending().getMarkets()
                      services/vesu/monitor.ts → StarkZap wallet.lending().getPositions()
                      services/vesu/health.ts  → Shared risk classification

The VesuLendingProvider is registered during wallet initialization in services/starkzap/client.ts.

Error Handling

ErrorCauseResolution
LENDING_FAILEDOn-chain operation failedCheck token allowance, balance, and health factor
POOL_NOT_FOUNDInvalid pool name or addressRun lend-pools to see available pools

See Also

Edit on GitHub

Last updated on

On this page