Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crypto Token Assistant Telegram Bot

A Telegram bot to analyze and provide insights on crypto tokens, including price, market cap, safety score, and AI-generated insights. Built with Node.js, TypeScript, Fastify, Prisma, and Langchain.


How to Run Locally

  1. Clone the repository

    git clone https://github.com/Rann-Studio/TokenGuardAI.git
    cd TokenGuardAI
  2. Install dependencies

    npm install
  3. Configure environment variables
    Copy .env.example to .env and fill in your credentials.

  4. Generate Prisma client

    npx prisma generate
  5. Run database migrations

    npx prisma migrate deploy
  6. Build the project

    npm run build
  7. Start the bot and backend

    npm start

    Or for development:

    npm run dev

APIs Used

This project uses the following APIs for various functionalities:


BOT Commands

  • /start - Start the bot and get a welcome message.
  • /help - Get a list of available commands.
  • /ping - Check if the bot is online.

You can ask the bot for information about any crypto token by simply sending its name or symbol or its contract address. The bot will respond with detailed information about the token.

For example, you can send:

  • "Analyze this token 0x2170ed0880ac9a755fd29b2688956bd959f933f8"
  • "What is the price of Bitcoin?"
  • "Give me the market cap of Ethereum."
  • "Tell me about Dogecoin."

Langchain Prompt Structure

The bot uses Langchain with OpenAI models to generate AI responses. Prompt templates are defined in the /src/backend/services/langchain.ts

  • Intent Prompt
    This prompt is used to determine the user's intent based on the input text. It helps in understanding what kind of information the user is looking for.
{
    "intent": "analyze | price | marketcap | ask | unknown",
    "symbol": "string | null",
    "name": "string | null",
    "address": "string | null",
    "query": "string | null"
}
  • Analysis Prompt
    This prompt is used to analyze the token based on the user's intent. It provides detailed information about the token, including its price, market cap, and other relevant data.
{
    "risk" : {
        "score": "number",
        "explanation": "string"
    },
    "insight": "array of strings",
}
  • Chat Prompt
    This prompt is used to generate a AI response based on the user's query. It provides a conversational response to the user's question.
{
    "text": "string"
}

Link to the Bot

You can find the bot on Telegram at @TokenGuardAI_BOT.

Showcase

Please check out the TokenGuardAI Showcase for a demonstration of the bot's features and capabilities.

License

This project is licensed under AGPL-3.0 License. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages