https://github.com/Mintbase/ref-finance-agent-next
https://github.com/Mintbase/ref-finance-agent-next
Last synced: 25 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/Mintbase/ref-finance-agent-next
- Owner: Mintbase
- Created: 2024-05-07T19:41:16.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-21T18:21:52.000Z (over 1 year ago)
- Last Synced: 2025-02-21T18:30:12.698Z (over 1 year ago)
- Language: TypeScript
- Homepage: https://ref-finance-agent-next.vercel.app
- Size: 406 KB
- Stars: 1
- Watchers: 7
- Forks: 13
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-bitte - Ref.finance Agent
README
# Ref Finance DeFi Swap Agent

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.
[](https://ref-finance-agent-next.vercel.app/)
[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FMintbase%2Fref-finance-agent-next)
**Tooling:**
[](#)
[](#)
## Project Walkthrough
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://docs.bitte.ai/agents)
#### API Base URL
https://ref-finance-agent.vercel.app
#### Endpoints
- Token Metadata `GET` `/api/token/{token}`
- Swap Transactions `GET` `/api/swap/{tokenIn}/{tokenOut}/{quantity}`
#### Usage
Make LLM requests to the endpoints above. Refer to the full API documentation for detailed parameter and response information.
## Getting Started
[Docs to integrate](https://docs.bitte.ai/agents/quick-start)
### Installation
Copy `.env.example` to `.env` and set the required environment variables.
```bash
cp .env.example .env
```
Get BITTE_API_KEY at [key.bitte.ai](https://key.bitte.ai).
Install dependencies and start development.
```bash
# 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
# 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=
```
## Local Development Using Tunneling
1. Run dev server `pnpm run dev`
2. Activate tunneling service (ngrok, localtunnel, serveo, pinggy, etc.)
3. Deploy a temporary agent `pnpm make-agent deploy -u ` (agents with tunnel urls are only temporary)
4. Test the agent using the Bitte Playground https://wallet.bitte.ai/smart-actions?mode=debug&agentId=
### Example
```bash
# 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
```
## Demo
https://github.com/Mintbase/ref-finance-agent-next/assets/838839/3291eaf9-aa79-4c95-8c5f-673a6d72dc96
## Deploy on Vercel
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.