Skill: zed-venus/venus-agent-skills (version 1.0.0)

--- name: venus-protocol-ops description: Analyze Venus Protocol lending/borrowing positions on BNB Chain with risk-first guidance. Use when users ask about Venus markets, collateral/borrow decisions, health factor, liquidation risk, APY/utilization comparison, isolated pools, or "can I borrow X safely" style what-if checks. --- # Venus Protocol Ops ## Overview Use this skill to provide **read-only**, risk-aware analysis for Venus Protocol. Prioritize liquidation safety, clarity, and explicit uncertainty over aggressive yield-chasing. ## Workflow ### 1) Classify user intent Map request into one of these modes: - **Market scan**: compare assets/pools (supply APY, borrow APY, utilization, caps) - **Position check**: assess a wallet's current collateral/borrow health - **What-if simulation**: estimate risk after a proposed borrow/supply/repay - **Execution planning**: prepare step-by-step actions without broadcasting tx If user asks for onchain execution, pause and request explicit confirmation + exact parameters. Use simulation first, then broadcast only after user confirms. ### 2) Collect data Use scripts first: - `scripts/fetch_markets.py` for market snapshot (official API base: `https://api.venus.io`, default scope: Core Pool only via `references/pool-filter.json`) - `scripts/wallet_onchain_exposure.py` for real wallet onchain exposure - `scripts/check_wallet_exposure.py` for manual/API fallback wallet summary - `scripts/simulate_borrow.py` for hypothetical borrow impact - `scripts/venus_deposit.js` for deposit preview/broadcast flow (approve + mint) - `scripts/venus_withdraw.js` for withdraw preview/broadcast flow (redeem / redeemUnderlying) with post-withdraw HF prediction and safety line checks (default 1.2, user customizable) - `scripts/venus_borrow.js` for borrow preview/broadcast flow - `scripts/venus_repay.js` for repay preview/broadcast flow (approve + repayBorrow) - `scripts/venus_collateral.js` for collateral enable/disable (enterMarkets / exitMarket) - `scripts/hf_monitor.py` for threshold-based HF monitoring and advisory actions (includes ACCOUNT_UNHEALTHY alert when HF < safety line, default 1.2) Example market query: - `python scripts/fetch_markets.py --chain-id 56 --limit 200` (Core Pool default) - `python scripts/fetch_markets.py --chain-id 56 --limit 200 --pool-scope all` (all pools) If API is unavailable, continue with transparent assumptions and mark output as estimate. ### 3) Run risk rules Apply rules from `references/risk-rules.md`: - Compute health and safety buffer - Flag borrow-cap / liquidity constraints - Detect concentration risk (single volatile collateral) - Classify risk: Low / Medium / High ### 4) Produce actionable output Always include: 1. **Current state** (key numbers) 2. **Risk status** (Low/Medium/High + why) 3. **Safe range** (max suggested extra borrow or required extra collateral) 4. **Next best actions** (2-4 concrete steps) Prefer concise bullets and exact numbers. ## Output format Use this structure: - **Summary**: one-line verdict - **Metrics**: collateral, debt, health, utilization, APYs - **Risk findings**: top 2-4 risks - **Recommended plan**: concrete steps and limits - **Assumptions**: data freshness, missing fields, estimate flags ## Guardrails - Never claim guaranteed safety or returns. - Never hide data gaps; explicitly note stale/missing data. - Default to conservative thresholds when uncertain. - Treat this as educational/risk tooling, not financial advice. - For real transactions: run simulate mode first; require explicit confirmation for broadcast. - For withdrawals: always predict post-withdraw HF; warn/block when predicted HF falls below safety line (default 1.2 unless user customizes). ## Quick usage - One-command market check: `python scripts/venus_check.py --symbol vUSDT` - Market + auto wallet risk check: `python scripts/venus_check.py --symbol vUSDT --wallet 0x...` - What-if borrow (auto wallet): `python scripts/venus_check.py --symbol vUSDT --wallet 0x... --extra-borrow 120` - Manual fallback: `python scripts/venus_check.py --symbol vUSDT --wallet 0x... --weighted-collateral 1500 --debt 1000` - English brief mode: `python scripts/venus_check.py --symbol vUSDT --wallet 0x... --output brief --lang en` ## Protocol separation - Venus Core scripts: `scripts/` root (e.g. `venus_*.js`, `fetch_markets.py`, `wallet_onchain_exposure.py`). - Flux (Power by Fluid) scripts: `scripts/flux/`. - Choose protocol-specific scripts directly so other agents can route quickly without mixing workflows. ## References - Protocol overview: `references/protocol-overview.md` - Risk thresholds and formulas: `references/risk-rules.md` - Contract/address notes: `references/bnbchain-contracts.md` - Terminology: `references/glossary.md` - Venus CLI cookbook: `references/quick-commands.md` - Flux CLI cookbook: `references/flux-quick-commands.md` - Flux BNB addresses: `references/flux-bnb-addresses.json`

path: assets/report-template.md
content: # Venus Position Risk Report

## Summary
- Verdict:
- Risk level:

## Current metrics
- Collateral (USD):
- Weighted collateral (USD):
- Debt (USD):
- Health:
- Buffer (%):

## Market observations
- Supply APY:
- Borrow APY:
- Utilization:
- Borrow cap headroom:

## What-if simulation
- Proposed action:
- Post-action health:
- Risk delta:

## Recommended plan
1.
2.
3.

## Assumptions & caveats
- Data timestamp:
- Missing fields:
- Estimate notes:


path: references/bnbchain-contracts.md
content: # BNB Chain Contract Notes

Store or update verified contract addresses and API endpoints here.

## Suggested fields to maintain
- Comptroller / Pool lens / Oracle contracts
- vToken addresses by market
- Subgraph / API endpoints (with date verified)
- RPC endpoints used for reads

## Verified API endpoints
- Base URL (mainnet): `https://api.venus.io` (verified: 2026-02-22)
- Markets list: `GET /markets?chainId=56` (verified: 2026-02-22)
- Pools list: `GET /pools?chainId=56` (verified: 2026-02-22)

## Verification practice
- Prefer official Venus docs + verified explorers.
- Record `verified_at` date for each endpoint/address.
- If uncertain, mark as unverified and avoid hard claims.


path: references/flux-bnb-addresses.json
content: {
  "chainId": 56,
  "protocol": "flux",
  "network": "bnb",
  "source": "https://github.com/Instadapp/fluid-contracts-public/tree/main/deployments/bnb",
  "lendingResolver": [REDACTED_SECRET],
  "lendingFactory": [REDACTED_SECRET],
  "fTokens": [
    {"symbol": "fU", "address": [REDACTED_SECRET]},
    {"symbol": "fUSDC", "address": [REDACTED_SECRET]},
    {"symbol": "fUSDT", "address": [REDACTED_SECRET]},
    {"symbol": "fWBNB", "address": [REDACTED_SECRET]}
  ]
}


path: references/flux-quick-commands.md
content: # Flux (Power by Fluid) Quick Commands

Protocol-specific scripts are under `scripts/flux/` (separate from Venus Core scripts).

## 1) List all Flux lending markets + APY details

```bash
node scripts/flux/fetch_markets.js
```

APY math used:
- `supplyRateBps`: already bps (`1% = 100`)
- `rewardsRateRaw`: Fluid rewards precision (`1% = 1e12`)
- `rewardsRateBps = rewardsRateRaw / 1e10`
- `totalApr = (supplyRateBps + rewardsRateBps) / 100`

## 2) Check wallet Flux positions

```bash
node scripts/flux/position.js --wallet 0xYourWallet
```

## 3) Simulate lend

```bash
node scripts/flux/lend.js --asset fUSDC --amount 10 --wallet 0xYourWallet --mode simulate
```

## 4) Broadcast lend

```bash
node scripts/flux/lend.js --asset fUSDC --amount 10 --wallet 0xYourWallet --mode broadcast --private-key 0x... --confirm YES
```

## 5) Simulate withdraw

```bash
node scripts/flux/withdraw.js --asset fUSDC --amount 5 --wallet 0xYourWallet --mode simulate
```

## 6) Broadcast withdraw

```bash
node scripts/flux/withdraw.js --asset fUSDC --amount 5 --wallet 0xYourWallet --mode broadcast --private-key 0x... --confirm YES
```

## Addresses source
- `references/flux-bnb-addresses.json`
- derived from Instadapp `fluid-contracts-public/deployments/bnb`


path: references/glossary.md
content: # Glossary

- **APY**: annualized yield.
- **Supply APY**: yield suppliers earn.
- **Borrow APY**: cost borrowers pay.
- **Utilization**: share of supplied liquidity currently borrowed.
- **Health**: collateral safety ratio; near 1 means liquidation risk.
- **Liquidation**: forced close when debt safety falls below threshold.
- **Borrow cap**: max debt allowed for a market.
- **Isolated pool**: separate risk bucket with custom parameters.


path: references/pool-filter.json
content: {
  "defaultScope": "core",
  "coreComptrollersByChain": {
    "56": [
      "0xfd36e2c2a6789db23113685031d7f16329158384"
    ]
  }
}


path: references/protocol-overview.md
content: # Venus Protocol Overview (BNB Chain)

Venus is a money market protocol on BNB Chain. Users supply assets to earn yield and borrow against posted collateral.

## Concepts
- **vToken**: interest-bearing market token representing supplied assets.
- **Collateral factor / liquidation threshold**: determines borrowable value from collateral.
- **Health**: collateral safety against liquidation.
- **Utilization**: borrowed / supplied in a market; strongly affects rates.
- **Isolated pools**: pool-specific risk params and asset sets.

## Practical analysis checklist
1. Confirm pool/market parameters (CF/LT, caps, liquidity).
2. Compute current health and liquidation buffer.
3. Stress test proposed borrow.
4. Recommend conservative limit and fallback action (repay/add collateral).


path: scripts/calc_health.py
content: #!/usr/bin/env python3
import argparse


def main():
    p = argparse.ArgumentParser(description="Calculate health and buffer from collateral/debt")
    p.add_argument("--weighted-collateral", type=float, required=True, help="Weighted collateral USD")
    p.add_argument("--debt", type=float, required=True, help="Debt USD")
    args = p.parse_args()

    if args.debt <= 0:
        print("health=inf buffer_pct=inf")
        return

    health = args.weighted_collateral / args.debt
    buffer_pct = (health - 1.0) * 100
    print(f"health={health:.4f} buffer_pct={buffer_pct:.2f}")


if __name__ == "__main__":
    main()


Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (CRITICAL)