1
Derive accounts
asset_config, reserve, share_mint, the reserve’s liquidity vault, the user’s underlying ATA, and the user’s share ATA (classic SPL Token).2
Wrap SOL
If the mint is wSOL, wrap native SOL first. The program only sees wSOL.
3
Refresh and quote
Read the
Reserve. If last_update_timestamp is old, include public_refresh_reserve or project accrual off-chain so the quote matches.4
Supply
Call
lender_supply(assets, min_shares_out) with min_shares_out from the quoted rate minus slippage.5
Redeem
Call
lender_redeem(shares, min_assets_out). Payouts are limited to accounted_liquidity_assets − accrued_protocol_fees, so check available cash first.supply_cap, the operating mode, and the reserve status.
vTokens are not margin collateral. To use supplied funds as collateral, redeem first and deposit the underlying.
App reference: lib/solana/lend.ts (supply, redeem, previewSupplyShares).
