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
| Feature | SDK Integration | StarkFi Command |
|---|---|---|
| Browse Pools | wallet.lending().getMarkets() | lend-pools |
| Supply | wallet.lending().deposit() | lend-supply |
| Withdraw | wallet.lending().withdraw() | lend-withdraw |
| Borrow | wallet.lending().borrow() | lend-borrow |
| Repay | wallet.lending().repay() | lend-repay |
| Close Position | wallet.tx().lendRepay() | lend-close |
| Check Position | wallet.lending().getPositions() | lend-status |
| Health Check | wallet.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 / debtValueUSDRisk levels:
| Risk Level | Health Factor | Meaning |
|---|---|---|
| SAFE | > 1.3 | Position is healthy |
| WARNING | 1.1 – 1.3 | Monitor closely |
| DANGER | 1.05 – 1.1 | At risk of liquidation |
| CRITICAL | ≤ 1.05 | Imminent 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
| Setting | Value |
|---|---|
| SDK Module | starkzap — wallet.lending() via VesuLendingProvider |
| Pool Discovery | Dynamic via getMarkets() |
| Amount Parsing | Amount.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 classificationThe VesuLendingProvider is registered during wallet initialization in services/starkzap/client.ts.
Error Handling
| Error | Cause | Resolution |
|---|---|---|
LENDING_FAILED | On-chain operation failed | Check token allowance, balance, and health factor |
POOL_NOT_FOUND | Invalid pool name or address | Run lend-pools to see available pools |
See Also
- Lending Commands — Full CLI reference for all lending operations
- Lending Tools — MCP tool equivalents for AI agents
- Error Handling — Full error code reference
Last updated on