Skip to content

Discord bot for manual and automated trading on hyperliquid.xyz

Notifications You must be signed in to change notification settings

Sakaar-Sen/Hyperliquid-Trading-Bot

Repository files navigation

Hyperliquid Trading Bot

This bot is designed to automate and streamline your trading experience on Hyperliquid(a decentralized perpetuals exchange) offering both manual and automated trading capabilities.

Features

Manual Trading

  • Trade Execution: Execute long and short trades swiftly with precise control over asset selection, trade size, and leverage.
  • Efficient Order Management: Place limit orders, set stop-loss levels, and manage or cancel orders with ease.
  • Enhanced Speed: Faster Experience lower latency and faster order placements compared to manual UI-based trading.

Automated Trading

  • Strategy Automation: Automate a trading strategy with detailed control over parameters like assets, timeframes, leverage, and moving averages. The strategy is based on Hull Suite.
  • Reduced Human Error: Removes the influence of human emotions and the need to constantly monitor charts, leading to more consistent and reliable trading outcomes.
  • Live Alerts: Receive instant notifications via discord webhook whenever a position is opened or closed, keeping you continuously informed about your trading activities.

Commands

Command Usage Description
$long $long <rawAssetName> <usdt_size> <leverage> Execute a long trade with the specified asset, trade size, and leverage.
$short $short <rawAssetName> <usdt_size> <leverage> Execute a short trade with the specified asset, trade size, and leverage.
$limit $limit <rawAssetName> <is_buy : 1/0> <assetAmount> <price> <reduce_only:1/0> Place a limit order for the specified asset with the option to buy/sell, amount, price, and reduce-only setting.
$sl $sl <rawAssetName> <sl_price> Set a stop-loss order for the specified asset with the given stop-loss price.
$cancel $cancel <rawAssetName> <oid> Cancel an existing order for the specified asset using the order ID.
$lev $lev <rawAssetName> <lev> Adjust the leverage for the specified asset to the given level.
$close $close <rawAssetName> Close the position for the specified asset.
$closeall $closeall Close all open positions.
$add $add <rawAssetName> <tf> <sl : 1/0> <hma> <usdt_size> <leverage> <is_long> Add an automated trading strategy for the specified asset with parameters including timeframe, stop-loss, moving average, trade size, leverage, and direction.
$remove $remove <id> Remove an automated trading strategy by its ID.
$hma $hma <id> <length> Adjust the moving average length for the strategy with the specified ID.
$amt $amt <id> <usdt_size> Adjust the trade size for the strategy with the specified ID.
$list $list List all active trading strategies.
$open $open Display all open positions and orders.

Examples

  • To place a $1000 BTC Long on 3x leverage
$long btc 1000 3
  • To start a new long-only strategy on BTC on the 4H timeframe without using stop loss with each order being worth $3000 using 2x leverage
$add btc 4h 0 34 3000 2 1

Getting Started

  1. Clone the Repo
git clone https://github.com/Sakaar-Sen/Hyperliquid-Trading-Bot
  1. Install Dependencies. Preferably use Python3.10.14
pip install -r requirements.txt
  1. Configure the settings in config_example.json. Skip the secret_key key for now.

  2. Run encryptSecretKey.py and input the private key of your wallet and a password. This password will be used to initialize the bot using the command $start <password> when it runs.

  3. Run main.py to start the bot. Use $help to view the list of all commands.

How does it work?

hlBot Diagram

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

About

Discord bot for manual and automated trading on hyperliquid.xyz

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages