This project retrieves and tracks the vault details from Hyperliquid's API and sends updates about vault changes (TVL and asset positions) to Telegram.
The script fetches information about the vaults with the highest Total Value Locked (TVL) from the Hyperliquid stats API, filters out vaults based on a minimum TVL threshold, and retrieves detailed asset position data for each vault. If any changes are detected in the asset positions or vault TVL, the script sends these updates to a specified Telegram chat.
- Fetches the top vaults by TVL.
- Tracks changes in asset positions, including leverage, direction (LONG/SHORT), and unrealized PnL.
- Sends vault updates to a Telegram group or user.
- Retries failed requests a specified number of times.
- Stores tracked vault data in a local JSON file for reference.
- Supports customization through configuration parameters (e.g., minimum TVL, excluded vault addresses).
Before running the script, ensure you have the following installed:
- Python 3.7 or higher
- Required Python libraries (listed in
requirements.txt
)
pip install -r requirements.txt
The script requires a few configuration settings in the config.py
file:
- MIN_VAULT_TVL: Minimum TVL value for vaults to be tracked.
- EXCLUDED_VAULT_ADDRESSES: List of vault addresses to exclude from tracking.
- MAX_RETRIES: Maximum number of retries for failed API requests.
- RETRY_AFTER: Number of seconds to wait between retries.
- USER_ID: Telegram user ID to send messages to (if
chat
is set toUSER
). - TEST_TG_CHAT_ID: Telegram chat ID to send messages to (if
chat
is set toGROUP
). - TELEGRAM_BOT_TOKEN: Token for the Telegram bot used to send messages.
- Rename the
private_temp.ini
file toprivate.ini
. - Fill in the following details in the
private.ini
file under the[telegram]
section:
[telegram]
TELEGRAM_BOT_TOKEN = <your telegram bot token>
TEST_TG_CHAT_ID = <your telegram group chat id>
USER_ID = <your telegram user id>
To run the script, execute the following command:
python vault_updates_tracker.py
You can also specify the target chat for the updates (either GROUP
or USER
):
python vault_updates_tracker.py -c GROUP
GROUP
: Send updates to a Telegram group using theTEST_TG_CHAT_ID
.USER
: Send updates to a Telegram group using theUSER_ID
.
- The script saves vault data in the
saved_data/tracked_top_tvl_vaults/tracked_top_tvl_vaults.json
file. - Vaults and their positions are tracked, and updates are compared to previous data to identify changes.
- The script retries failed requests up to
MAX_RETRIES
times. - If an error occurs during API interaction, a retry will be attempted after
RETRY_AFTER
seconds.