Autonomous stablecoin yield optimizer for the Arc Network ecosystem. Scans on-chain vaults, recommends the highest-APY allocation, and rebalances with one signature.
Arc Network is an emerging stablecoin-native chain. As the ecosystem grows, stablecoin holders need tooling to safely move idle USDC across yield strategies without manual vault-by-vault claim/redeposit cycles. arc-yield-agent is a reference implementation of that flow: an off-chain agent that reads on-chain vault state, scores APYs, and rebalances on user signature.
The repository is intentionally small and educational, but the contracts and agent logic are designed to compose with real Arc DeFi primitives as they ship.
- One-signature rebalance. Agent recommends the best vault, then withdraws + deposits in a single user-signed transaction batch.
- Three reference vaults on Arc Testnet:
CashVault,LendingVault, andRwaVault, each exposinggetAPY()for transparent scoring. - Streaming yield variant (
StreamingYieldVault) with sponsor-funded reward pools that drip on a per-second schedule, so demos accrue real yield (not just metadata). - Public web demo at arc-yield-agent.vercel.app — connect wallet, mint test USDC, deposit to the best vault.
- Dry-run by default. The agent never sends a transaction unless
EXECUTE=trueis set. Safe to run against mainnet RPC for inspection. - MIT licensed. Use the patterns, the contracts, or the agent loop in your own Arc-ecosystem projects.
Deployer / agent wallet
0x86563098801D6Fc60a4250911d2037CEc2172067
Contracts
MockUSDC 0xfd483B685d9f291606b9f70511E13436c091274E
CashVault 0xC2776af10e1721655747508941475C058Eb12556 APY 4.3%
LendingVault 0x36E5d19996df30A8c3E31c7Adaa069dDC522276D APY 7.2%
RwaVault 0x2e02C3C3F00A10F0f1CF2E511a97F7670365002b APY 9.6%
┌────────────────────────────────────────────┐
│ User wallet (EOA) │
└──────────┬─────────────────────────┬───────┘
│ approve / sign │ inspect
▼ ▼
┌────────────────────┐ ┌────────────────┐
│ Yield Agent │◀─────▶│ scripts/ │
│ (scripts/ │ │ status.js │
│ agent.js) │ │ │
└──────────┬─────────┘ └────────────────┘
│ getAPY()
▼
┌────────────────────────────────────────────┐
│ Vaults (CashVault | LendingVault | │
│ RwaVault | StreamingYieldVault) │
└────────────────────┬───────────────────────┘
│ ERC-20
▼
MockUSDC
| Path | Purpose |
|---|---|
contracts/MockUSDC.sol |
ERC-20 mock USDC, 6 decimals, public mint for the testnet faucet flow. |
contracts/YieldVault.sol |
Reference vault: deposits mUSDC, mints 1:1 shares, exposes getAPY(). |
contracts/StreamingYieldVault.sol |
Same surface plus a sponsor-funded reward pool that drips per-second. |
scripts/agent.js |
Agent runner. Default dry-run. Set EXECUTE=true to rebalance. |
scripts/status.js |
Read-only on-chain status: native gas, idle MockUSDC, vault APYs, shares. |
scripts/demo-local.js |
Full local demo: deploy, mint, scan APYs, rebalance. |
scripts/deploy-streaming.js |
Deploy StreamingYieldVault with a funded reward pool. |
ignition/modules/YieldAgentDemo.js |
Hardhat Ignition module for Arc Testnet deploys. |
web/ |
Static frontend: wallet connect, MockUSDC mint, deposit to best vault. |
test/YieldVault.test.js |
Unit tests: deposit, withdraw, APY update, rebalance flow. |
git clone https://github.com/0xdungki/arc-yield-agent
cd arc-yield-agent
npm installnpm run demoExpected flow:
- Deploy MockUSDC and three vaults on a local Hardhat chain.
- Mint 1000 mUSDC to the agent wallet.
- Scan APYs across the three vaults.
- Pick the best vault by APY.
- Deposit 500 mUSDC to the best vault.
- Print pre/post balances.
npm testcp .env.example .env # set PRIVATE_KEY for the agent wallet
npm run statusnpm run agentREBALANCE_AMOUNT=500 EXECUTE=true npm run agent- Read
VAULTS(the deployed vault list). - For each vault, query
getAPY()and current wallet shares. - Sort vaults by APY descending.
- Recommend the top vault.
- If
EXECUTE=true, withdraw any shares the wallet holds in non-best vaults and deposit idle MockUSDC into the best vault. Single signed transaction batch.
- Reference vaults + agent loop on Arc Testnet
- Streaming yield variant with sponsor-funded rewards
- Public web demo
- Slippage / TVL guardrails on rebalance
- Multi-asset support (USDe, sUSDS, USDS)
- Real Arc DeFi vault adapters as ecosystem ships
- Agent strategies beyond APY (risk-weighted, smoothed, time-locked)
- Telegram / Discord notifier when a rebalance is recommended
Issues, PRs, and design notes are welcome. See CONTRIBUTING.md.
This is testnet and reference code. Do not deposit real funds. Report security issues per SECURITY.md.
MIT © 2026 0xdungki