Skip to content

Repository files navigation

Arc Yield Agent

Autonomous stablecoin yield optimizer for the Arc Network ecosystem. Scans on-chain vaults, recommends the highest-APY allocation, and rebalances with one signature.

License: MIT Solidity Hardhat Arc Testnet PRs Welcome

Why this exists

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.

Highlights

  • 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, and RwaVault, each exposing getAPY() 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=true is 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.

Live deployment (Arc Testnet)

Deployer / agent wallet
0x86563098801D6Fc60a4250911d2037CEc2172067

Contracts
MockUSDC      0xfd483B685d9f291606b9f70511E13436c091274E
CashVault     0xC2776af10e1721655747508941475C058Eb12556  APY 4.3%
LendingVault  0x36E5d19996df30A8c3E31c7Adaa069dDC522276D  APY 7.2%
RwaVault      0x2e02C3C3F00A10F0f1CF2E511a97F7670365002b  APY 9.6%

Architecture

       ┌────────────────────────────────────────────┐
       │             User wallet (EOA)              │
       └──────────┬─────────────────────────┬───────┘
                  │ approve / sign          │ inspect
                  ▼                         ▼
       ┌────────────────────┐       ┌────────────────┐
       │   Yield Agent      │◀─────▶│  scripts/      │
       │   (scripts/        │       │  status.js     │
       │   agent.js)        │       │                │
       └──────────┬─────────┘       └────────────────┘
                  │ getAPY()
                  ▼
       ┌────────────────────────────────────────────┐
       │  Vaults (CashVault | LendingVault |        │
       │  RwaVault | StreamingYieldVault)           │
       └────────────────────┬───────────────────────┘
                            │ ERC-20
                            ▼
                       MockUSDC

Repository layout

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.

Quick start

git clone https://github.com/0xdungki/arc-yield-agent
cd arc-yield-agent
npm install

Run the local demo

npm run demo

Expected flow:

  1. Deploy MockUSDC and three vaults on a local Hardhat chain.
  2. Mint 1000 mUSDC to the agent wallet.
  3. Scan APYs across the three vaults.
  4. Pick the best vault by APY.
  5. Deposit 500 mUSDC to the best vault.
  6. Print pre/post balances.

Run the test suite

npm test

Read live Arc Testnet state

cp .env.example .env   # set PRIVATE_KEY for the agent wallet
npm run status

Dry-run agent (no transactions sent)

npm run agent

Execute a real rebalance

REBALANCE_AMOUNT=500 EXECUTE=true npm run agent

Agent decision logic

  1. Read VAULTS (the deployed vault list).
  2. For each vault, query getAPY() and current wallet shares.
  3. Sort vaults by APY descending.
  4. Recommend the top vault.
  5. 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.

Roadmap

  • 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.

Security

This is testnet and reference code. Do not deposit real funds. Report security issues per SECURITY.md.

License

MIT © 2026 0xdungki

About

Autonomous stablecoin yield optimizer for Arc Network. Scans on-chain vaults, recommends best APY, rebalances with one signature.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages