Skip to content

LIT-Protocol/WarrenBuffbit

 
 

Repository files navigation

Vincent Starter App

A monorepo that powers the Vincent DCA demo application.

This project demonstrates how to schedule and execute recurring DCA (Dollar-Cost Averaging) swaps on behalf of end-users using a Vincent App and delegated agent wallets.

Prerequisites

  • Node ^22.16.0
  • pnpm ^10.7.0
  • Docker or a local MongoDB instance
  • A Vincent App with ERC20 approval and Uniswap swap abilities

Monorepo Structure

This codebase is composed of three main parts:

  • Frontend: React app where users can create, edit, and delete DCA tasks.
  • Database: MongoDB to persist DCA tasks.
  • Backend (Node.js):
    • Express.js API server used by the frontend
    • Agenda-based job scheduler that runs DCA jobs
    • Integration with a Vincent App to execute swaps on behalf of users
      • Vincent ERC20 Approval ability: authorizes Uniswap to spend user tokens
      • Vincent Uniswap Swap ability: executes the actual token swaps

Packages

Package Purpose
dca-frontend Frontend for end-users to define DCA tasks to be run on a schedule
dca-backend Backend REST API and worker instance using NodeJS; deployed to Heroku currently.

Vincent App

To execute operations on behalf of your users (delegators), you need a Vincent App to which they can delegate their agent wallet.

A demo Vincent App already exists: wBTC DCA in the Vincent Dashboard.

You can access the demo app frontend at: https://dca.heyvincent.ai/

Create your own Vincent App

To run this code and sign on behalf of your delegators, create your own Vincent App:

  1. Go to the Vincent Dashboard and log in as a builder.
  2. Create a new app similar to wBTC DCA.
  3. Add the ERC20 Approval ability.
  4. Add the Uniswap Swap ability.
  5. Publish the app.
  6. Once users can connect to it, configure the backend with your App ID and the delegatee private key via environment variables. You can use the Deploy on Railway button below to deploy the entire app.
  7. Once deployed, you'll need to update the App User URL and Redirect URIs to the URL deployed from Railway.

Deploy on Railway

Quick Start

Install dependencies and build the packages (works for both local and production setups):

pnpm install && pnpm build

Note: remember to enable Corepack: corepack enable

Local Development

Local development uses dotenvx to load environment variables from .env files. You should have a .env at the repository root and one for each package that needs it.

Each project includes a .env.example with placeholders and defaults you can copy and fill in.

Start a local MongoDB

A Dockerfile is provided to run MongoDB locally:

pnpm -r mongo:build

Run all services

After setting environment variables and starting the database, run:

pnpm dev

Production

Production does not use dotenvx. Inject environment variables via your platform’s secret manager or environment configuration—do not write them to the runtime filesystem.

Then start the services with:

pnpm start

Notes and Gotchas

  • You will most likely not run API and Worker instances on the same server.
  • The abilities you execute MUST match the exact versions connected in each user’s agent wallet.
    • If you update an ability, users must reconnect; you cannot use a newer version they haven’t approved.
    • If you support multiple versions of the same Vincent App, your server may need to run multiple versions of abilities side-by-side.
    • Install specific versions of abilities in your app to avoid version conflicts.
  • Users can revoke or update their connection at any time; handle revocations and version changes gracefully.
  • Always call prepare and precheck functions for abilities to avoid preventable errors.
  • Users’ agent wallets send their own transactions. Ensure they have sufficient funds for gas, unless you plan to sponsor it.

Disclaimers

  • This is a demo application and is not intended for production use without considerable modifications.
  • The software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. We make no guarantees about its stability or suitability for production use. It is provided for demo and educational purposes.
  • It's your responsibility to comply with all applicable laws and regulations for your jurisdiction with respect to the use of this software.

About

Vincent Starter App

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 93.2%
  • CSS 3.2%
  • JavaScript 3.2%
  • Other 0.4%