/benqi-agent

Bitte Open Agent for CoWSwap

Primary LanguageTypeScript

BENQI AI Agent

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.

Features

  • 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

API Endpoints

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

Local Development

First, install the dependencies:

bun install

Then, run the development server:

bun dev
bun dev-testnet

Open http://localhost:3000 with your browser to see the Swagger UI.

Environment Setup

The application requires the following environment variables:

  • BITTE_KEY: JSON containing the account ID
  • TOKEN_MAP_URL: URL for loading token mappings
  • ZERION_KEY: API key for Zerion for fetching balances

Learn More

To learn more about the technologies used in this project:

Deploy on Vercel

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.