Skip to content

Repository files navigation

LPAgent Discord Bot

Discord bot MVP for LPAgent communities. Users configure a public wallet address, then use slash commands to inspect balances, LP positions, portfolio metrics, pools, and alerts.

Demo

https://youtu.be/f2EeAn8DJls

Stack

  • Node.js 22 + TypeScript
  • discord.js v14
  • PostgreSQL + Prisma
  • node-cron for alert polling
  • zod for env and input validation
  • pino for logging

Setup

  1. Install dependencies:

    yarn install
  2. Copy env values:

    cp .env.example .env
  3. Start local Postgres:

    docker compose up -d
  4. Apply migrations:

    yarn db:migrate
  5. Register Discord slash commands for your dev guild:

    yarn commands
  6. Run the bot:

    yarn dev

Commands

  • /wallet connect <address>
  • /wallet status
  • /wallet currency <USD|Native>
  • /wallet unlink
  • /balance
  • /positions address:<optional>
  • /portfolio address:<optional>
  • /pools search:<token> sort:<optional, defaults to fee_tvl_ratio>
  • /pool info address:<poolAddress>
  • /pool positions address:<poolAddress> owner:<optional> status:<optional>
  • /pool top-lpers address:<poolAddress> sort:<optional>
  • /alert add type:<type> position_id:<optional> threshold:<optional>
  • /alert list
  • /alert remove <id>

Security

The MVP stores public wallet addresses only. Do not collect private keys, seed phrases, or signed transactions in Discord. Keep LPAGENT_API_KEY server-side in .env.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages