Overview
MetaVault AI requires configuration across three packages. Each package has its own.env file with specific settings.
Contracts Configuration
The contracts package requires minimal configuration for deployment.1
Create Environment File
2
Configure Variables
Edit
packages/contracts/.env:Configuration Reference
string
required
Private key of the wallet that will deploy contracts.For local development, use one of Hardhat’s test account private keys.
string
Your Infura API key for connecting to Ethereum networks.Only required for testnet or mainnet deployments. Get one at infura.io.
AI Agents Configuration
The agents package requires the most configuration, including API keys and contract addresses.1
Create Environment File
2
Configure Core Settings
3
Configure Blockchain Connection
Add blockchain settings:
4
Configure Contract Addresses
Add the contract addresses from your deployment:
5
Configure Telegram (Optional)
For Telegram notifications:
Configuration Reference
string
default:"false"
Enable debug logging for the ADK framework.Set to
"true" to see detailed framework logs.string
required
Your OpenRouter API key for AI model access.The agents use OpenRouter to access LLM models like Claude.
string
default:"anthropic/claude-3.5-sonnet"
The LLM model to use for AI agents.See OpenRouter models for available options.
number
default:"3001"
Port for the main agent server.
number
default:"3002"
Port for the chat agent server.
string
required
Ethereum RPC endpoint URL.Use
http://127.0.0.1:8545 for local Hardhat node.string
required
Private key for the agent’s wallet to sign transactions.
string
required
Address of the deployed MetaVault contract.
string
required
Address of the deployed Router contract.
string
required
Address of the Aave Leverage Strategy contract.
string
required
Address of the Aave V3 Strategy contract.
string
required
Address of the LINK token (or mock LINK for testing).
string
required
Address of the mock Aave pool contract.
string
Token for your Telegram bot.Optional. Used for sending strategy alerts and notifications.
string
Telegram channel or chat ID for notifications.Optional. Where the bot will send messages.
Frontend Configuration
The frontend requires contract addresses to interact with the blockchain.1
Create Environment File
2
Configure Contract Addresses
Edit
packages/frontend/.env.local:Configuration Reference
string
Ethereum RPC endpoint (not exposed to browser).
string
Private key for server-side operations (not exposed to browser).
string
URL of the AI agent server API.Should match the PORT configured in the agents package.
string
required
Address of the MetaVault contract (exposed to browser).
string
required
Address of the Router contract (exposed to browser).
string
required
Address of the Aave Leverage Strategy contract (exposed to browser).
string
required
Address of the Aave V3 Strategy contract (exposed to browser).
string
required
Address of the LINK token contract (exposed to browser).
Environment-Specific Configuration
- Local Development
- Testnet
- Mainnet
Use Hardhat’s local network:Use Hardhat’s first test account:
Validation
After configuration, verify your setup:Troubleshooting
Invalid RPC URL
Invalid RPC URL
Ensure your Hardhat node is running:
Contract Address Not Found
Contract Address Not Found
Make sure you’ve deployed the contracts:Copy the addresses from the deployment output to your
.env files.OpenRouter API Error
OpenRouter API Error
Verify your OpenRouter API key is correct and has credits.Check your account at openrouter.ai.
Port Already in Use
Port Already in Use
Change the PORT variables in your configuration:
Next Steps
Architecture
Understand how MetaVault AI components work together
AI Agents
Learn about the AI agents managing your vault