StarkFiStarkFi

Lending Tools

7 tools for Vesu V2 lending operations — supply, borrow, repay, withdraw, close

Prerequisite: All lending tools require an active authenticated session. Call get_auth_status first to verify.

Supply (earn yield)

1. list_lending_pools    →  Find pools and check APY rates
2. supply_assets         →  Deposit tokens into a pool
3. get_lending_position  →  Verify position

Borrow (leverage)

1. list_lending_pools    →  Find pools and supported pairs
2. borrow_assets         →  Deposit collateral + borrow in one call
3. get_lending_position  →  Monitor Health Factor
4. repay_debt            →  Repay when ready
5. close_position        →  Or close everything atomically

list_lending_pools

List available Vesu V2 lending pools with live APY/APR data, supported assets, and pairs.

ParamTypeRequiredDescription
namestringNoFilter pools by name (partial match). Omit to list all.

This is a read-only tool.


get_lending_position

Get the user's position in a lending pool — collateral value, debt value, Health Factor, and risk level.

ParamTypeRequiredDescription
poolstringYesPool name (e.g., Prime, Re7) or contract address
collateral_tokenstringYesCollateral token symbol (e.g., ETH, STRK)
borrow_tokenstringNoBorrow token symbol (e.g., USDC). Optional for supply-only positions.

This is a read-only tool. Use it to monitor Health Factor before and after operations.

Health Factor Guide:

  • Above 1.5 — Safe
  • 1.1 – 1.5 — Warning (monitor closely)
  • Below 1.1 — Danger (at risk of liquidation)

supply_assets

Supply tokens into a Vesu V2 pool to earn interest. Tokens are deposited into the pool's ERC-4626 vToken vault.

ParamTypeRequiredDescription
poolstringYesPool name (e.g., Prime, Re7) or contract address
amountstringYesAmount to supply (e.g., 100, 0.5)
tokenstringYesToken symbol to supply (e.g., STRK, ETH, USDC)

Note: Supply uses standard ERC-4626 vToken deposit — there is no minimum amount.


withdraw_assets

Withdraw previously supplied tokens from a pool.

ParamTypeRequiredDescription
poolstringYesPool name or contract address
amountstringYesAmount to withdraw
tokenstringYesToken symbol to withdraw

borrow_assets

Borrow tokens by supplying collateral. Atomically deposits collateral and borrows the debt asset in a single transaction.

ParamTypeRequiredDescription
poolstringYesPool name or contract address
collateral_amountstringYesCollateral amount to deposit
collateral_tokenstringYesCollateral token symbol (e.g., ETH, STRK)
borrow_amountstringYesAmount to borrow
borrow_tokenstringYesToken to borrow (e.g., USDC, USDT)
use_suppliedbooleanNoSet true to use previously supplied vTokens as collateral

Important: Monitor your Health Factor after borrowing. Use get_lending_position to check.


repay_debt

Repay borrowed tokens on an existing lending position.

ParamTypeRequiredDescription
poolstringYesPool name or contract address
amountstringYesAmount to repay
tokenstringYesToken to repay (e.g., USDC, USDT)
collateral_tokenstringYesCollateral token of the position — needed to identify which position to repay

close_position

Atomically close an active lending position. Repays all outstanding debt and withdraws all collateral in a single transaction.

ParamTypeRequiredDescription
poolstringYesPool name or contract address
collateral_tokenstringYesCollateral token symbol (e.g., STRK, ETH)
debt_tokenstringYesBorrowed token symbol (e.g., USDC, USDT)

Note: This tool handles the full close flow atomically — repay debt + withdraw collateral in one transaction.

Edit on GitHub

Last updated on

On this page