agentleFS
ahmetenesdurahmetenesdur/starkfi/skills/lending/SKILL.md

lending

Skill2 starsChanged 8 months agoMITView on GitHub

Manage Vesu V2 lending positions on Starknet — supply assets, borrow against collateral, repay debt, withdraw, close positions, monitor health factors, and auto-rebalance risky positions. Use this skill when the user mentions lending, borrowing, supplying collateral, Vesu, earn interest, health factor, liquidation risk, monitoring positions, auto-rebalancing, protecting against liquidation, "my position is risky", "health factor low", or DeFi yield from lending protocols — even if they don't say "lending" explicitly.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. IngAs8/ClaudeSkill★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository13 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. About 0 are common, 0 are distinctive, and 15 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 15

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    BEFORE any lending action, run npx starkfi@latest lend-pools to discover available pools and tokens.

    line 39
  2. Very specific:

    BEFORE borrowing, run npx starkfi@latest lend-status to check existing positions, or with --pool and --collateral-token for Health Factor:

    line 41
  3. Very specific:

    AFTER any transactional operation, verify with tx-status.

    line 46
  4. Very specific:

    When using --use-supplied, the borrow is backed by the user's existing earn positions (supplied positions) rather than transferring from …

    line 47
  5. Very specific:

    When the user asks about health, risk, or liquidation — use lend-monitor first for a comprehensive overview with 4-level risk …

    line 48
  6. Very specific:

    When a position's health factor is low, suggest lend-auto to automatically rebalance.

    line 49
  7. Very specific:

    Run without arguments to auto-scan all pools.

    line 171
  8. Very specific:

    Run without arguments to scan all pools.

    line 183
  9. Very specific:

    Use balance to verify available assets before supplying.

    line 310
  10. Very specific:

    Use trade to swap tokens if the user doesn't have the right asset.

    line 311
  11. Very specific:

    Use portfolio for a full overview including lending positions with USD values.

    line 312
  12. Very specific:

    Use batch to combine supply operations with swaps, staking, or vault deposits.

    line 313
  13. Very specific:

    Use troves for vault-based yield strategies (different from lending).

    line 314
  14. Very specific:

    Use lst for liquid staking yield (xSTRK can also be supplied to lending pools).

    line 315
  15. Very specific:

    Use portfolio-rebalance (within portfolio skill) to optimize overall portfolio allocation.

    line 316

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Lending (Vesu V2)

Manage lending and borrowing positions on Vesu V2 protocol on Starknet. Supply assets to earn yield, borrow against collateral, repay debt, monitor health factors, auto-rebalance risky positions, and close positions.

Prerequisites

  • Active session required.
  • Sufficient token balance for supply/repay operations + gas fees.

Rules

  1. BEFORE any lending action, run npx starkfi@latest lend-pools to discover available pools and tokens. Use lend-pools <name> for detailed pool info including APY rates.
  2. Pool can be specified by name (e.g. Prime, Genesis) or by contract address (0x...).
  3. BEFORE borrowing, run npx starkfi@latest lend-status to check existing positions, or with --pool and --collateral-token for Health Factor:
    • Health Factor > 2.0 → Safe to borrow.
    • Health Factor 1.5 – 2.0 → WARN the user about increasing risk.
    • Health Factor < 1.5 → STRONGLY advise against borrowing. Suggest repaying instead.
    • Health Factor < 1.1 → DO NOT proceed without explicit double-confirmation from the user.
  4. AFTER any transactional operation, verify with tx-status.
  5. When using --use-supplied, the borrow is backed by the user's existing earn positions (supplied positions) rather than transferring from wallet.
  6. When the user asks about health, risk, or liquidation — use lend-monitor first for a comprehensive overview with 4-level risk classification (SAFE/WARNING/DANGER/CRITICAL).
  7. When a position's health factor is low, suggest lend-auto to automatically rebalance. Always use --simulate first to preview the action before executing.

Commands

Discovery

# List all pools (overview table)
npx starkfi@latest lend-pools [--json]

# Detailed pool info with APY rates
npx starkfi@latest lend-pools <name> [--json]

# View all lending positions (auto-scan)
npx starkfi@latest lend-status

# View specific position status
npx starkfi@latest lend-status --pool <name|address> --collateral-token <symbol> [--borrow-token <symbol>]

Supply & Withdraw

# Supply (deposit assets to earn yield)
npx starkfi@latest lend-supply <amount> --pool <name|address> --token <symbol> [--simulate]

# Withdraw (remove supplied assets)
npx starkfi@latest lend-withdraw <amount> --pool <name|address> --token <symbol> [--simulate]

Borrow & Repay

# Borrow (provide collateral and take loan)
npx starkfi@latest lend-borrow \
  --pool <name|address> \
  --collateral-amount <n> --collateral-token <symbol> \
  --borrow-amount <n> --borrow-token <symbol> \
  [--use-supplied] [--simulate]

# Repay (pay back borrowed amount)
npx starkfi@latest lend-repay <amount> --pool <name|address> --token <symbol> --collateral-token <symbol> [--simulate]

Close Position

# Atomically repay all debt and withdraw all collateral
npx starkfi@latest lend-close --pool <name|address> --collateral-token <symbol> --borrow-token <symbol> [--simulate]

Health Monitoring

# Scan all positions across all pools
npx starkfi@latest lend-monitor [--json]

# Monitor specific position
npx starkfi@latest lend-monitor --pool <name|address> --collateral-token <symbol> --borrow-token <symbol>

# Custom warning threshold
npx starkfi@latest lend-monitor --warning-threshold 1.5

Auto-Rebalance

# Auto-rebalance (picks best strategy — repay or add collateral)
npx starkfi@latest lend-auto --pool <name|address> --collateral-token <symbol> --borrow-token <symbol>

# With specific strategy
npx starkfi@latest lend-auto --pool <name|address> --collateral-token <symbol> --borrow-token <symbol> --strategy repay
npx starkfi@latest lend-auto --pool <name|address> --collateral-token <symbol> --borrow-token <symbol> --strategy add-collateral

# Simulate first (always recommended)
npx starkfi@latest lend-auto --pool <name|address> --collateral-token <symbol> --borrow-token <symbol> --simulate

Parameters

lend-supply / lend-withdraw

ParameterTypeDescriptionRequired
amountnumberAmount (positional)Yes
--poolstringPool name or addressYes
--tokenstringToken symbol (USDC, ETH, STRK, etc.)Yes
--simulateflagEstimate fees and validate without executingNo

lend-borrow

ParameterTypeDescriptionRequired
--poolstringPool name or addressYes
--collateral-amountnumberCollateral amount to supplyYes
--collateral-tokenstringCollateral token (e.g. ETH, STRK)Yes
--borrow-amountnumberAmount to borrowYes
--borrow-tokenstringToken to borrow (e.g. USDC, USDT)Yes
--use-suppliedflagUse existing earn positions as collateralNo
--simulateflagEstimate fees and validate without executingNo

lend-repay

ParameterTypeDescriptionRequired
amountnumberAmount to repay (positional)Yes
--poolstringPool name or addressYes
--tokenstringToken to repay (e.g. USDC)Yes
--collateral-tokenstringCollateral token of the positionYes
--simulateflagEstimate fees and validate without executingNo

lend-close

ParameterTypeDescriptionRequired
--poolstringPool name or addressYes
--collateral-tokenstringCollateral token symbolYes
--borrow-tokenstringBorrow token symbolYes
--simulateflagEstimate fees and validate without executingNo

lend-status

Run without arguments to auto-scan all pools. Or specify --pool + --collateral-token for a detailed position view.

ParameterTypeDescriptionRequired
--poolstringPool name or addressNo (auto-scan if omitted)
--collateral-tokenstringToken supplied/used as collateralNo*
--borrow-tokenstringBorrow token (needed to see debt + HF)No

* Required when --pool is specified.

lend-monitor

Run without arguments to scan all pools. Or specify --pool + --collateral-token + --borrow-token for a single position.

ParameterTypeDescriptionRequired
--poolstringPool name or addressNo (scans all if omitted)
--collateral-tokenstringCollateral token symbolNo*
--borrow-tokenstringDebt token symbolNo*
--warning-thresholdnumberCustom warning threshold (default: 1.3)No

* Required when --pool is specified.

Risk Levels:

LevelHealth FactorMeaning
SAFE> 1.3No action needed
WARNING1.1 – 1.3Monitor closely
DANGER1.05 – 1.1Repay debt or add collateral
CRITICAL≤ 1.05Imminent liquidation risk

lend-auto

ParameterTypeDescriptionRequired
--poolstringPool name or addressYes
--collateral-tokenstringCollateral token symbolYes
--borrow-tokenstringDebt token symbolYes
--strategystringrepay, add-collateral, or auto (default)No
--target-hfnumberTarget health factor (default: 1.3)No
--simulateflagEstimate fees and validate without executingNo

Examples

User: "What lending pools are available?"

npx starkfi@latest lend-pools

User: "Show me details for the Prime pool"

npx starkfi@latest lend-pools Prime

User: "Supply 500 USDC to Prime"

npx starkfi@latest status
npx starkfi@latest balance --token USDC
npx starkfi@latest lend-supply 500 --pool Prime --token USDC --simulate  # Preview first
npx starkfi@latest lend-supply 500 --pool Prime --token USDC             # Execute
npx starkfi@latest tx-status <hash>

User: "Borrow 100 USDC with ETH collateral from Prime"

npx starkfi@latest lend-status
# Check Health Factor before proceeding
npx starkfi@latest lend-borrow \
  --pool Prime \
  --collateral-amount 0.1 --collateral-token ETH \
  --borrow-amount 100 --borrow-token USDC
npx starkfi@latest tx-status <hash>

User: "Repay my 100 USDC loan from Prime"

npx starkfi@latest lend-repay 100 --pool Prime --token USDC --collateral-token ETH
npx starkfi@latest tx-status <hash>

User: "Close my ETH/USDC position in Prime"

npx starkfi@latest lend-close --pool Prime --collateral-token ETH --borrow-token USDC
npx starkfi@latest tx-status <hash>

User: "How healthy is my position?"

# Comprehensive health monitoring with risk levels
npx starkfi@latest lend-monitor

# Detailed health factor for specific position
npx starkfi@latest lend-monitor --pool Prime --collateral-token ETH --borrow-token USDC

User: "My position is at risk, fix it"

# First, check current state
npx starkfi@latest lend-monitor --pool Prime --collateral-token ETH --borrow-token USDC

# Simulate the auto-rebalance action
npx starkfi@latest lend-auto --pool Prime --collateral-token ETH --borrow-token USDC --simulate

# Execute after user confirms
npx starkfi@latest lend-auto --pool Prime --collateral-token ETH --borrow-token USDC
npx starkfi@latest tx-status <hash>

User: "Protect my ETH/USDC position from liquidation"

# Choose a specific strategy — repay debt
npx starkfi@latest lend-auto --pool Prime --collateral-token ETH --borrow-token USDC --strategy repay --simulate

Error Handling

ErrorAction
Pool not foundRun lend-pools to list valid pool names.
Health Factor too lowWarn of liquidation risk. Suggest repaying or supplying more.
Insufficient collateralCannot borrow without supplying first.
Dust limitBorrow amount is below the pool's minimum dollar value (~$10). Increase it.
Insufficient balanceCheck balance — user may need to swap for the token.
Not authenticatedRun authenticate-wallet skill first.
Monitor failedCheck pool/token params and retry.
Rebalance failedCheck balances, health factor, and retry.

Related Skills

  • Use balance to verify available assets before supplying.
  • Use trade to swap tokens if the user doesn't have the right asset.
  • Use portfolio for a full overview including lending positions with USD values.
  • Use batch to combine supply operations with swaps, staking, or vault deposits.
  • Use troves for vault-based yield strategies (different from lending).
  • Use lst for liquid staking yield (xSTRK can also be supplied to lending pools).
  • Use portfolio-rebalance (within portfolio skill) to optimize overall portfolio allocation.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.