← 返回
开发者工具 中文

YieldVault Agent

Autonomous yield farming agent for BNB Chain with deterministic execution, smart contract integration, and automated decision-making.
用于 BNB Chain 的自主收益农业代理,具备确定性执行、智能合约集成和自动化决策功能。
alannetwork
开发者工具 clawhub v1.0.0 1 版本 99901.9 Key: 无需
★ 0
Stars
📥 1,018
下载
💾 6
安装
1
版本
#latest

概述

YieldVault Agent

Autonomous yield farming agent for BNB Chain with deterministic execution, smart contract integration, and automated decision-making.

Features

  • Deterministic Decision Engine - Same input always produces same output (auditable)
  • Smart Contract Integration - Interact with YieldVault contracts on BNB testnet/mainnet
  • Autonomous Scheduler - Run farming decisions hourly without manual intervention
  • Transaction Executor - Automatic DEPOSIT, WITHDRAW, HARVEST, COMPOUND, REBALANCE actions
  • Telegram Alerts - Real-time notifications for executions, APR changes, and errors
  • Risk Management - Conservative risk filtering (only vaults with risk_score ≤ 0.5)
  • Yield Optimization - Net APR calculation (apr - fees - risk_penalty)

Installation

clawhub install yieldvault-agent

Quick Start

1. Configure

cp config.deployed.json .env.local
# Edit with your contract addresses and RPC endpoint

2. Deploy Contracts (if needed)

cd contracts
npm install
npm run deploy:testnet

3. Run Tests

npm test                    # Unit tests
node test.live.mock.js      # Integration tests (offline)
node test.live.js           # Live testnet tests

4. Start Scheduler

node scheduler.js
# Runs decision cycle every hour against testnet

5. Monitor Alerts

Telegram notifications sent automatically for:

  • Execution started (vault_id, action, amount)
  • APR changes (>1% delta)
  • Errors (with severity level)
  • Cycle completion (stats summary)

Architecture

Smart Contracts (BNB Testnet/Mainnet)
    ↓
BlockchainReader (live vault data)
    ↓
YieldFarmingAgent (deterministic decisions)
    ↓
TransactionExecutor (sign & broadcast)
    ↓
Scheduler (hourly automation)
    ↓
Notifications (Telegram alerts)

Configuration

Edit config.scheduler.json:

{
  "chainId": 97,
  "interval_minutes": 60,
  "harvest_threshold_usd": 25,
  "rebalance_apr_delta": 0.02,
  "max_allocation_percent": 0.35,
  "risk_score_threshold": 0.5
}

Decision Logic

  1. Read current vault state (APR, TVL, user balance)
  2. Calculate Net APR = apr - fees - (risk_score × 0.10)
  3. Filter vaults with risk_score ≤ 0.5
  4. Select vault with highest Net APR
  5. Decide action:
    • HARVEST if pending_rewards ≥ $25 USD
    • COMPOUND if net_apr ≥ 2% delta
    • REBALANCE if another vault beats current by ≥ 2%
    • NOOP if already optimized
  1. Execute transaction (with retry logic)
  2. Log execution record (SHA256 auditable)

Supported Networks

  • Testnet: BNB Chain Testnet (chainId: 97)
  • Mainnet: BNB Chain Mainnet (chainId: 56)

Security

  • ✅ Deterministic execution (reproducible, auditable)
  • ✅ SHA256 audit trail for every decision
  • ✅ Risk filtering (conservative)
  • ✅ Constraint enforcement (max 35% per vault)
  • ✅ Retry logic with exponential backoff
  • ✅ No hardcoded private keys (use environment variables)

Production Readiness

For mainnet deployment, add:

  1. Chainlink Oracle - Live APR feeds
  2. Hardware Wallet Support - Ledger/Trezor signing
  3. Smart Contract Audit - Professional security review
  4. Emergency Pause - Multi-sig pause mechanism

See FINAL_CHECKLIST.md for complete production requirements.

Documentation

  • README.md - Full user guide
  • SKILL.md - This file
  • FINAL_CHECKLIST.md - Production requirements
  • INTEGRATION_GUIDE.md - Smart contract integration
  • EXAMPLES.md - Usage examples
  • RESPUESTAS_PREGUNTAS.md - FAQ & architecture

Support

Issues & PRs welcome: https://github.com/open-web-academy/yieldvault-agent-bnb

License

MIT

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 08:00 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

Clawtrade Bnb

alannetwork
适用于 BNB 链的自主 DeFi 交易代理,具备多策略引擎、网络切换与强化学习功能。
★ 0 📥 1,090
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 68 📥 180,467
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,924