This is a Next.js project that implements an AI-powered agent for interacting with BENQI protocols on Avalanche. The agent helps users generate and execute transactions for BENQI liquid staking, markets, and other services.
- BENQI Liquid Staking: Stake AVAX for sAVAX
- BENQI Markets: Deposit and borrow assets
- Health Monitoring: Check account health and liquidation risk
- ERC20 token transfers
- Support for Avalanche and Avalanche Fuji Testnet
The agent exposes several endpoints:
/api/tools/benqi/liquid-staking: Stake AVAX for sAVAX and unstake sAVAX to AVAX/api/tools/benqi/markets: Deposit to and borrow from BENQI markets/api/tools/benqi/health: Check account health and liquidation risk/api/tools/erc20: Generate ERC20 transfer transactions/api/tools/balances: Get token balances for a wallet
First, install the dependencies:
bun installThen, run the development server:
bun dev
bun dev-testnetOpen http://localhost:3000 with your browser to see the Swagger UI.
The application requires the following environment variables:
BITTE_KEY: JSON containing the account IDTOKEN_MAP_URL: URL for loading token mappingsZERION_KEY: API key for Zerion for fetching balances
To learn more about the technologies used in this project:
- BENQI Documentation - Learn about BENQI protocols
- Bitte Documentation - Learn about Bitte and building AI agents
- Next.js Documentation - Learn about Next.js features and API
The easiest way to deploy your Next.js app is to use the Vercel Platform.
Check out our Next.js deployment documentation for more details.