Skip to content

Latest commit

 

History

History
145 lines (120 loc) · 6.63 KB

README.md

File metadata and controls

145 lines (120 loc) · 6.63 KB

Meteora Discord Bot

Overview

This bot is based on @GeekLad's Meteora DLMM Market Making Opportunities Google Sheet and his Solana DEX Volume to TVL Report on Dune. It provides users with useful data on potential market making opportunities on Meteora DLMMs.

Use on the Meteora Discord Server

The easiest way to use the bot is to simply join the join the 🤖 | dlmm-opps-bot channel on the Meteora Discord Server.

Bot Commands

  • /help: Display this info again
  • /degen minliquidity estimationmode minfdv uptrendonly: Get a list of DLMM opportunities for tokens not on the strict list.
    • Optional minliquidity parameter for the minimum liquidity. Default is 600.
    • Optional estimationmode indicates whether to use the min or max estimated fees. Default is min.
    • Optional minfdv parameter for the minimum fully diluted value. Default is 0.
    • Optional uptrendonly parameter to only display pairs with up trending volume. Default is False (i.e. display all pairs regardless of trend).
  • /strict minliquidity estimationmode minfdv uptrendonly: Get a list of DLMM opportunities for tokens on the strict list.
    • Optional minliquidity parameter for the minimum liquidity. Default is 600.
    • Optional estimationmode indicates whether to use the min or max estimated fees. Default is min.
    • Optional minfdv parameter for the minimum fully diluted value. Default is 0.
    • Optional uptrendonly parameter to only display pairs with up trending volume. Default is False (i.e. display all pairs regardless of trend).
  • /bluechip minliquidity estimationmode minfdv uptrendonly: Get a list of DLMM opportunities for "blue chip" tokens.
    • Optional minliquidity parameter for the minimum liquidity. Default is 600.
    • Optional estimationmode indicates whether to use the min or max estimated fees. Default is min.
    • Optional minfdv parameter for the minimum fully diluted value. Default is 0.
    • Optional uptrendonly parameter to only display pairs with up trending volume. Default is False (i.e. display all pairs regardless of trend).
  • /pair pairname estimationmode: Get a list of DLMM opportunities for a specific pair.
    • Required pairname parameter should be in the format TOKEN1-TOKEN2.
    • Optional estimationmode indicates whether to use the min or max estimated fees. Default is min.
  • /token token estimationmode: Get a list of DLMM opportunities for a specific token.
    • Required token parameter
    • Optional estimationmode indicates whether to use the min or max estimated fees. Default is min.
  • /all type: Get a list of all market making opportunities across all of Solana.
    • Required type parameter must be degen, strict, or bluechip.
  • /profit txid excludefromleaderboard: Get the profit for a Meteora DLMM position.
    • Required txid can be any transaction associated with the position (add, remove, fee claim, etc.).
    • Optional excludefromleaderboard will prevent a profit transaction from being submitted to the position leaderboard.
  • /leaderboard: Display the position leaderboard.

Installing the Bot on Your Own Discord Server

If you want to install the bot on your own Discord server, go to this OAuth URL, and follow the steps to add it to your server:

https://discord.com/oauth2/authorize?client_id=1239340511765074061

Technical Info

The bot is written in TypeScript, and utilizes Bun. Bun removes all friction for creating a TypeScript project. It also allows async calls to be made in the entrypoint script, which is great for lazy people like GeekLad.

Meteora DLMM Opportunties

The bot uses the Meteora API to obtain DLMM markets, as well as the DEX Screener API. For each market it:

  • Obtains the volume for the past 5 minutes, 1 hour, 6 hours, and 24 hours
  • Based on each of those intervals, it projects the 24-hour fees / TVL
  • Determines the minimum 24-hour fees / TVL projection (i.e. the most conservative)
  • Determines if it has an up-trend by looking for increasing projected fees between different time steps
  • Displays the top projected 24-hour fee / TVL results for markets in an up-trend that have at least $1,000 in liquidity

Solana Opportunities

The bot uses the Dune API to obtain data from a Dune query to obtain volume to tvl ratios across all DEXes/AMMs on Solana. Users can filter results down according to their investment preferences.

Running the Bot

  • Install Bun
  • Create a .env with the following environment variables:
    • DISCORD_BOT_TOKEN: Your Discord bot's token
    • DUNE_API_KEY: Your Dune API key
    • DLMM_REFRESH_MINUTES: The number of minutes to wait between refreshes for DLMM opportunities (defaults to 15 minutes)
    • DUNE_REFRESH_MINUTES: The number of minutes to wait between refreshes for all opportunities (defaults to 60 minutes)
    • ENABLE_DUNE_REFRESH: Flag to enable the re-running of the Dune query. This will cost API credits.
    • DEBUG: Flag to disable Dune, to avoid spending credits while testing out other stuff
    • RPC_MAX_TPS: Maximium RPC requests per second (defaults to 10)
    • METEORA_API_MAX_TPS: Maximum Meteora requests per second (defaults to 10)
  • Run the bot with the pm2 launch script: ./pm2-start.sh
  • Stop the bot with the pm2 stop script: ./pm2-stop.sh
  • You can use pm2 commands with npx pm2 (npx pm2 status, npx pm2 log, etc.)

Compiling Google Apps Script for Google Sheets

To compile the app to use in Google Sheets, run ./build-gs.sh. This will output the google-app-script.gs file, which will provide a valid Google App Script that can be used in Google Sheets.

Credits

@MeteoraAG for creating Meteora

@GeekLad for creating the opportunity Google Sheet and this bot

@Foxtrot for looking at Geeklad's Google Apps script, and modifying it to create a Discord bot and inspiring GeekLad to create is own and open sourcing it.

@benchow.sol for suggesting adding the trend indicator