Intelligent USDC rebalancing and risk management agent for on-chain treasury automation on Arc Blockchain.
- ๐ก Overview
- ๐ Treasury Dashboard
- ๐จ Problem Statement
- ๐ Solution
- โ๏ธ Core Features
- ๐งฉ System Architecture
- ๐งฑ Architecture
- ๐ง Tech Stack
- ๐ Workflow
- ๐ฆ Deliverables
- ๐ฆ Use Cases
- ๐ฎ Future Enhancements
- ๐ Summary
- ๐งฐ Quick Start (Development)
- ๐งญ Deployment Summary
- ๐ช Credits
Arcwise Treasury AI is an autonomous treasury management system built on the Arc Blockchain.
It uses AI-driven decision logic to monitor wallet balances, dynamically rebalance liquidity between main and reserve accounts, and automatically execute USDC transactions on-chain with deterministic settlement.
This project demonstrates how intelligent agents can handle decentralized treasury operations through real-time analytics, rule-based automation, and stablecoin-native financial logic.
The dashboard visualizes the evolution of balances between the Main and Reserve wallets.
Each time the agent executes, new data are appended to data/rebalance_log_compatible.csv and analyzed via the notebook notebooks/treasury_dashboard.ipynb.
Last updated automatically from analysis notebook outputs.
| Metric | Description |
|---|---|
| Main Balance (USDC) | Current balance of the primary operational wallet |
| Reserve Balance (USDC) | Current balance of the reserve wallet |
| Total (USDC) | Combined holdings of both wallets |
| Main Ratio | Share of main balance in total holdings |
| 3h Change | Net movement of both wallets over the last 3 hours |
| Volatility Approx. | Rolling 5-sample standard deviation of total balance |
Managing liquidity across multiple blockchain accounts remains a complex process for funds, DAOs, and decentralized organizations.
Manual monitoring and fund transfers are inefficient and prone to human bias and latency.
Challenges include:
- Balancing multiple wallets or liquidity pools in real time
- Forecasting short-term liquidity requirements
- Reducing idle capital and transaction costs
- Ensuring safety, auditability, and transparency
Arcwise Treasury AI introduces an intelligent on-chain agent that:
- Continuously monitors wallet balances and historical activity using Arc APIs.
- Applies AI-based decision logic to determine optimal fund distribution.
- Automatically executes USDC transfers on the Arc Testnet via deterministic smart contracts.
- Logs each event with full transparency for compliance and audit purposes.
By leveraging Arcโs USDC-native design and sub-second deterministic finality, the system provides institutional-grade automation for digital treasury management.
| Category | Description |
|---|---|
| AI Decision Engine | Predict liquidity needs with time-series balance data and simple predictive rules. |
| Autonomous Execution | Automatically transfer funds when ratio thresholds are breached. |
| Risk Controls | Apply transaction limits, minimum reserves, and safety checks. |
| Transparent Dashboard | Interactive Streamlit dashboard for real-time visualization. |
| Comprehensive Logging | All actions logged in JSONL format for auditability. |
+-----------------------------+
| AI Decision Engine |
| (Rules + Predictive Model) |
+-------------+---------------+
|
v
+-----------------------------+
| Arcwise Agent (Python) |
| - Web3 Integration |
| - Smart Contract Calls |
| - Event Logging |
+-------------+---------------+
|
v
+-----------------------------+
| Arc Blockchain Layer |
| - Arc Testnet (USDC Gas) |
| - Settlement Contracts |
+-------------+---------------+
|
v
+-----------------------------+
| Streamlit Dashboard |
| - Visualization & KPIs |
| - Analysis Notebook |
+-----------------------------+
| Component | Tools / Frameworks |
|---|---|
| Language | Python 3.11 |
| Blockchain SDK | Web3.py |
| Smart Contracts | Solidity (EVM-Compatible) |
| Blockchain Network | Arc Testnet + USDC as native gas |
| AI & Analytics | Scikit-learn, Pandas, NumPy |
| Frontend / Visualization | Streamlit, Matplotlib |
| Database / Logging | JSONL + CSV |
| Environment Management | virtualenv + dotenv |
- Balance Fetching: Retrieve real-time balances from both main and reserve wallets.
- Decision Engine:
- If main wallet < lower bound โ transfer from reserve.
- If main wallet > upper bound โ send excess back to reserve.
- Execution: Signed transactions broadcast to Arc blockchain.
- Logging: Results stored locally for audit tracking.
- Dashboard Analysis: Data visualized via Jupyter Notebook and Streamlit UI.
โ Fully working on Arc Testnet
โ AI logic + on-chain execution pipeline
โ Streamlit monitoring dashboard
โ Analysis notebook with balance visualizations
โ Comprehensive documentation and modular structure
- Quantitative Funds: Continuous intra-day portfolio rebalancing
- DAO Treasuries: Self-governing liquidity agents
- DeFi Vaults: Autonomous stablecoin management
- Enterprise Treasury: Stablecoin-based working capital allocation
- Reinforcement Learning for adaptive liquidity management
- Multi-asset support (EURC, USYC, and other stablecoins)
- NLP-driven command interface (โRebalance reserve wallet to 40%โ)
- Integration with Circle APIs for off-chain synchronization
Arcwise Treasury AI merges AI automation with stablecoin-native blockchain infrastructure. It illustrates a real-world application of data science, quantitative strategy, and on-chain execution, delivering a scalable and transparent treasury automation framework.
# Clone the repository
git clone https://github.com/yourusername/arcwise-treasury-ai.git
cd arcwise-treasury-ai
# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Create .env file
echo "ARC_RPC_URL=https://rpc.testnet.arc.network" >> .env
echo "PRIVATE_KEY_TEST=your_private_key" >> .env
echo "ACCOUNT_ADDRESS=your_wallet_address" >> .env
echo "RESERVE_ADDRESS=your_reserve_wallet_address" >> .env
# Run the treasury agent
python -m agent.main
# Generate dashboard visualization
jupyter nbconvert --to notebook --execute notebooks/treasury_dashboard.ipynb --output notebooks/treasury_dashboard.ipynbContract Address (Arc Testnet)
0x5b75e285eacafae2a260ed2387ec4440ac7fde76
Deployed via Arc Testnet Sandbox
Explorer Example Transaction
0x010724d591fba63de7a0e09968644147b839bc5923e5d2ce142dddb8828ecb83
Rebalance operation triggered by AI agent
AI Agent Logs:
The agent autonomously triggered a rebalance when the main wallet ratio exceeded 65%.
Example decision output
Developed by Xirui Chen Data Science & FinTech Enthusiast | Quantitative Research | Blockchain AI
Project originally inspired by the โAI Agents on Arc with USDCโ Hackathon, now evolved into a production-ready autonomous treasury analytics framework.

