Skip to content

Commit b2f69cd

Browse files
committed
Deployments: Arbitrum sepolia and base sepolia
1 parent bf3b81b commit b2f69cd

8 files changed

Lines changed: 334 additions & 82 deletions

File tree

README.md

Lines changed: 92 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -30,97 +30,119 @@
3030

3131
---
3232

33+
## 📦 Deployments
34+
35+
### Base Sepolia : [VaultFactory](https://base-sepolia.blockscout.com/address/0x99A3E04423dec42407dFed6A3d984d9A6200511d?tab=contract)
36+
37+
### Arbitrum Sepolia : [VaultFactory](https://arbitrum-sepolia.blockscout.com/address/0x1C4cCc2c917EDF45aD1C3C9675cF130b47Db8c11?tab=contract)
38+
39+
---
40+
3341
## 🏗️ Architecture Overview
3442

3543
CentoAI is built on a modular architecture, with the following key components:
3644

3745
### 1. **Smart Contracts**
38-
- **LiquidityManager.sol**: Manages liquidity across **Aave**, **Compound**, and **Uniswap V3**.
39-
- **Arbitrage.sol**: Executes flash loan arbitrage strategies using **Balancer V2**.
40-
- **Vault.sol**: Manages user balances and strategy execution.
41-
- **VaultFactory.sol**: Deploys personalized vaults for users.
46+
47+
- **LiquidityManager.sol**: Manages liquidity across **Aave**, **Compound**, and **Uniswap V3**.
48+
- **Arbitrage.sol**: Executes flash loan arbitrage strategies using **Balancer V2**.
49+
- **Vault.sol**: Manages user balances and strategy execution.
50+
- **VaultFactory.sol**: Deploys personalized vaults for users.
4251

4352
### 2. **Frontend**
44-
- Built with **Next.js** and **OnchainKit** for seamless wallet integration and portfolio visualization.
45-
- Provides a user-friendly dashboard for monitoring portfolio performance and strategy execution.
46-
- Integrates **Privy** for embedded wallets and social logins, enabling users to onboard with email or existing wallets.
53+
54+
- Built with **Next.js** and **OnchainKit** for seamless wallet integration and portfolio visualization.
55+
- Provides a user-friendly dashboard for monitoring portfolio performance and strategy execution.
56+
- Integrates **Privy** for embedded wallets and social logins, enabling users to onboard with email or existing wallets.
4757

4858
### 3. **Backend**
49-
- **Node.js** backend for handling off-chain computations and API integrations.
50-
- Fetches real-time APY data from DeFi protocols and provides it to the AI agent.
59+
60+
- **Node.js** backend for handling off-chain computations and API integrations.
61+
- Fetches real-time APY data from DeFi protocols and provides it to the AI agent.
5162

5263
### 4. **AI Agent**
53-
- Analyzes yield opportunities and arbitrage strategies using machine learning models.
54-
- Executes strategies securely using **Coinbase AgentKit**.
64+
65+
- Analyzes yield opportunities and arbitrage strategies using machine learning models.
66+
- Executes strategies securely using **Coinbase AgentKit**.
5567

5668
---
5769

5870
## 🔧 Workflows
5971

6072
### 1. **User Onboarding**
61-
- Users connect their wallets or sign in with email/social login using **Privy**.
62-
- A personalized vault is deployed for the user using **VaultFactory.sol**.
63-
- Users deposit ERC20 tokens (e.g., USDC, ETH) into their vault.
73+
74+
- Users connect their wallets or sign in with email/social login using **Privy**.
75+
- A personalized vault is deployed for the user using **VaultFactory.sol**.
76+
- Users deposit ERC20 tokens (e.g., USDC, ETH) into their vault.
6477

6578
### 2. **AI-Driven Strategy Execution**
66-
- The AI agent fetches real-time APY data from **Aave**, **Compound**, and **Uniswap V3**.
67-
- It analyzes yield opportunities and identifies arbitrage opportunities using **Balancer V2** flash loans.
68-
- The AI agent executes strategies such as:
69-
- **Yield Farming**: Moves funds between protocols to maximize APY.
70-
- **Flash Loan Arbitrage**: Executes risk-free arbitrage between DEXes.
79+
80+
- The AI agent fetches real-time APY data from **Aave**, **Compound**, and **Uniswap V3**.
81+
- It analyzes yield opportunities and identifies arbitrage opportunities using **Balancer V2** flash loans.
82+
- The AI agent executes strategies such as:
83+
- **Yield Farming**: Moves funds between protocols to maximize APY.
84+
- **Flash Loan Arbitrage**: Executes risk-free arbitrage between DEXes.
7185

7286
### 3. **Portfolio Management**
73-
- Users can monitor their portfolio performance, strategy execution, and transaction history through the dashboard.
74-
- The dashboard provides insights into:
75-
- Current APY across protocols.
76-
- Profit/loss from arbitrage strategies.
77-
- Historical performance of the portfolio.
87+
88+
- Users can monitor their portfolio performance, strategy execution, and transaction history through the dashboard.
89+
- The dashboard provides insights into:
90+
- Current APY across protocols.
91+
- Profit/loss from arbitrage strategies.
92+
- Historical performance of the portfolio.
7893

7994
---
8095

8196
## 🧩 Smart Contracts
8297

8398
### 1. **LiquidityManager.sol**
84-
- Manages liquidity across **Aave**, **Compound**, and **Uniswap V3**.
85-
- Key Functions:
86-
- `supplyLiquidityOnAave`: Supplies liquidity to Aave.
87-
- `withdrawLiquidityFromCompound`: Withdraws liquidity from Compound.
88-
- `swapOnUniswap`: Executes token swaps on Uniswap V3.
99+
100+
- Manages liquidity across **Aave**, **Compound**, and **Uniswap V3**.
101+
- Key Functions:
102+
- `supplyLiquidityOnAave`: Supplies liquidity to Aave.
103+
- `withdrawLiquidityFromCompound`: Withdraws liquidity from Compound.
104+
- `swapOnUniswap`: Executes token swaps on Uniswap V3.
89105

90106
### 2. **Arbitrage.sol**
91-
- Executes flash loan arbitrage strategies using **Balancer V2**.
92-
- Key Functions:
93-
- `executeTrade`: Initiates a flash loan and executes arbitrage.
94-
- `receiveFlashLoan`: Callback function for flash loan execution.
107+
108+
- Executes flash loan arbitrage strategies using **Balancer V2**.
109+
- Key Functions:
110+
- `executeTrade`: Initiates a flash loan and executes arbitrage.
111+
- `receiveFlashLoan`: Callback function for flash loan execution.
95112

96113
### 3. **Vault.sol**
97-
- Manages user balances and strategy execution.
98-
- Key Functions:
99-
- `depositERC20`: Deposits ERC20 tokens into the vault.
100-
- `withdrawERC20`: Withdraws ERC20 tokens from the vault.
101-
- `lendTokens`: Lends tokens to **Aave** or **Compound**.
114+
115+
- Manages user balances and strategy execution.
116+
- Key Functions:
117+
- `depositERC20`: Deposits ERC20 tokens into the vault.
118+
- `withdrawERC20`: Withdraws ERC20 tokens from the vault.
119+
- `lendTokens`: Lends tokens to **Aave** or **Compound**.
102120

103121
### 4. **VaultFactory.sol**
104-
- Deploys personalized vaults for users.
105-
- Key Functions:
106-
- `createVault`: Deploys a new vault for a user.
107-
- `getVaultAddress`: Retrieves the vault address for a user.
122+
123+
- Deploys personalized vaults for users.
124+
- Key Functions:
125+
- `createVault`: Deploys a new vault for a user.
126+
- `getVaultAddress`: Retrieves the vault address for a user.
108127

109128
---
110129

111130
## 🛠️ Integration Details
112131

113132
### 1. **Coinbase AgentKit**
114-
- Used for secure, programmatic wallet interactions.
115-
- Enables the AI agent to execute on-chain actions (e.g., deposits, withdrawals, swaps).
133+
134+
- Used for secure, programmatic wallet interactions.
135+
- Enables the AI agent to execute on-chain actions (e.g., deposits, withdrawals, swaps).
116136

117137
### 2. **Privy**
118-
- Provides embedded wallets and social logins, making it easy for users to onboard and interact with DeFi.
119-
- Supports both web3-native users (with existing wallets) and newcomers (with email/social login).
138+
139+
- Provides embedded wallets and social logins, making it easy for users to onboard and interact with DeFi.
140+
- Supports both web3-native users (with existing wallets) and newcomers (with email/social login).
120141

121142
### 3. **Base and Arbitrum**
122-
- CentoAI is deployed on **Base** and **Arbitrum** for low-cost, high-speed transactions.
123-
- Supports yield farming and arbitrage strategies on both networks.
143+
144+
- CentoAI is deployed on **Base** and **Arbitrum** for low-cost, high-speed transactions.
145+
- Supports yield farming and arbitrage strategies on both networks.
124146

125147
---
126148

@@ -129,23 +151,28 @@ CentoAI is built on a modular architecture, with the following key components:
129151
CentoAI is designed to compete in the following **ETHGlobal Agentic Ethereum** tracks:
130152

131153
### **Coinbase Developer Platform**
154+
132155
- **Most Innovative Use of AgentKit**: CentoAI uses AgentKit to automate complex DeFi strategies, abstracting away the complexity for users.
133156
- **Best Combination of AgentKit + OnchainKit**: The frontend integrates **OnchainKit** for seamless wallet interactions and portfolio visualization.
134157
- **Viral Consumer App Award**: CentoAI’s user-friendly interface and AI-driven strategies make it accessible to both DeFi experts and beginners.
135158
- **AgentKit Pool Prize**: CentoAI is built with AgentKit in a meaningful way for users to interact with the DeFi ecosystem.
136159

137160
### **Base**
161+
138162
- **Build an AI-Powered App on Base**: CentoAI is deployed on **Base**, leveraging its low-cost, high-speed infrastructure for seamless DeFi operations.
139163

140164
### **Privy**
165+
141166
- **Best Consumer Experience Built with Server Wallets**: CentoAI uses **Privy** to provide a seamless onboarding experience, enabling users to sign in with email, social login, or existing wallets. This makes CentoAI accessible to all users, regardless of their web3 experience.
142167

143168
### **Arbitrum**
169+
144170
- **Most Innovative AI Agent Applications**: CentoAI combines yield farming and flash loan arbitrage to push the boundaries of DeFi automation.
145171

146172
---
147173

148174
## 📂 Repository Structure
175+
149176
```
150177
contracts/
151178
├── lib/ # Dependencies
@@ -170,41 +197,46 @@ contracts/
170197
### Installation
171198

172199
1. Clone the repository:
200+
173201
```bash
174202
git clone https://github.com/Cento-AI/contracts
175203
cd cento-ai
176204
```
177205

178206
2. Install dependencies:
179-
```bash
180-
forge install
181-
```
207+
208+
```bash
209+
forge install
210+
```
182211

183212
3. Compile the smart contract:
184-
```bash
185-
forge build
186-
```
213+
214+
```bash
215+
forge build
216+
```
187217

188218
4. Deploy the contract to the Base Sepolia Testnet:
219+
189220
```bash
190221
forge script script/DeployVaultFactory.sol:DeployVaultFactory <BASE_SEPOLIA_RPC_URL> --private-key <PRIVATE_KEY> --broadcast --verify --verifier blockscout --verifier-url https://base-sepolia.blockscout.com/api/
191-
```
222+
```
192223

193224
Deploy the contract to the Arbitrum Sepolia Testnet:
225+
194226
```bash
195227
forge script script/DeployVaultFactory.sol:DeployVaultFactory <ARBITRUM_SEPOLIA_RPC_URL> --private-key <PRIVATE_KEY> --broadcast --verify --verifier blockscout --verifier-url https://arbitrum-sepolia.blockscout.com/api/
196-
```
197-
228+
```
198229

199230
## Testing
231+
200232
Foundry is used for testing the Arbitrage contract. To run the tests:
201233

202234
1. Write your tests in the test directory.
203235

204236
2. Run the tests using:
205-
```bash
206-
forge test
207-
```
237+
```bash
238+
forge test
239+
```
208240

209241
---
210242

broadcast/DeployVaultFactory.s.sol/421614/run-1739112295.json

Lines changed: 53 additions & 0 deletions
Large diffs are not rendered by default.

broadcast/DeployVaultFactory.s.sol/421614/run-latest.json

Lines changed: 53 additions & 0 deletions
Large diffs are not rendered by default.

broadcast/DeployVaultFactory.s.sol/84532/run-1739112162.json

Lines changed: 57 additions & 0 deletions
Large diffs are not rendered by default.

broadcast/DeployVaultFactory.s.sol/84532/run-1739112252.json

Lines changed: 57 additions & 0 deletions
Large diffs are not rendered by default.

broadcast/DeployVaultFactory.s.sol/84532/run-latest.json

Lines changed: 19 additions & 19 deletions
Large diffs are not rendered by default.

script/HelperConfig.s.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ contract HelperConfig is Script {
3838
uniswapRouter: 0x94cC0AaC535CCDB3C01d6787D6413C739ae12bc4,
3939
uniswapQouter: 0xC5290058841028F1614F3A6F0F5816cAd0df5E27,
4040
aavePool: 0xbE781D7Bdf469f3d94a62Cdcc407aCe106AEcA74,
41-
agent: address(77)
41+
agent: 0x7e393441Edc1Bb1621318E000cDfC74947f23b26
4242
});
4343
return BaseSepoliaConfig;
4444
}
@@ -57,7 +57,7 @@ contract HelperConfig is Script {
5757
uniswapRouter: 0x101F443B4d1b059569D643917553c771E1b9663E,
5858
uniswapQouter: 0x2779a0CC1c3e0E44D2542EC3e79e3864Ae93Ef0B,
5959
aavePool: 0xBfC91D59fdAA134A4ED45f7B584cAf96D7792Eff,
60-
agent: address(77)
60+
agent: 0x7e393441Edc1Bb1621318E000cDfC74947f23b26
6161
});
6262
return ArbitrumSepoliaConfig;
6363
}

src/VaultFactory.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ contract VaultFactory is HelperConfig {
3434
* Currently hardcoded to Base Sepolia, could be made more flexible in future versions
3535
*/
3636
constructor() {
37-
activeNetworkConfig = getArbitrumSepoliaConfig();
37+
activeNetworkConfig = getBaseSepoliaConfig();
3838
}
3939

4040
/**

0 commit comments

Comments
 (0)