
Ref Finance Agent is a template for creating a Bitte.ai Plugin for facilitating DeFi swaps using Ref Finance. Built using Next.js 14 + Elysia.
Tooling:
Ref Finance Agent facilitates the development of AI-powered DeFi swap agents. The template supports creating, managing, and deploying DeFi swap functionalities. Build your own agent
https://ref-finance-agent.vercel.app
-
Token Metadata
GET
/api/token/{token}
-
Swap Transactions
GET
/api/swap/{tokenIn}/{tokenOut}/{quantity}
Make LLM requests to the endpoints above. Refer to the full API documentation for detailed parameter and response information.
Copy .env.example
to .env
and set the required environment variables.
cp .env.example .env
Get BITTE_API_KEY at key.bitte.ai.
Install dependencies and start development.
# install dependencies
pnpm i
# start the development server
pnpm dev
# test the agent using make-agent
pnpm make-agent dev
# host the agent on a https url i.e. https://ref-finance-agent.vercel.app
# Add to Bitte Registry using make-agent deploy
pnpm make-agent deploy -u <your-agent-url>
# test the agent using the Bitte Playground (agent-id is url without http or https i.e. ref-finance-agent.vercel.app)
https://wallet.bitte.ai/smart-actions?mode=debug&agentId=<agent-id>
- Run dev server
pnpm run dev
- Activate tunneling service (ngrok, localtunnel, serveo, pinggy, etc.)
- Deploy a temporary agent
pnpm make-agent deploy -u <tunnel-url>
(agents with tunnel urls are only temporary) - Test the agent using the Bitte Playground https://wallet.bitte.ai/smart-actions?mode=debug&agentId=
# Run dev server
pnpm run dev
# Activate tunneling service
ngrok http 3000
# Deploy a temporary agent
pnpm make-agent deploy -u https://example-agent.ngrok.app
# Test the agent on the Bitte Wallet Playground
https://wallet.bitte.ai/smart-actions?mode=debug&agentId=example-agent.ngrok.app
DeFi.Swaps.AI.Ref.NEAR.Bitte.mp4
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.