Skip to main content

Hyperliquid trading and query CLI (HIP-3 supported)

Project description

1m-trade

Hyperliquid trading and query CLI (HIP-3 supported).

Install

pip install 1m-trade

Usage

The CLI command is hl1m.

It loads environment variables from the OpenClaw state .env:

  1. OPENCLAW_STATE_DIR (if set)
  2. otherwise: ~/.openclaw/.1m-trade/.env

Quick start

# trade wallet (shared state .env)
hl1m exchange wallet --pri_key 0x...

# copytrade wallet (optional; if not set, copytrade falls back to trade wallet)
hl1m copy wallet --addr 0x... --pri_key 0x...

# start copytrade
hl1m copy start --leader 0xLeader --target 123

# stop copytrade
hl1m copy stop --target 123

Modules

  • trade: top-level commands like query ..., exchange ...
  • copytrade: hl1m copy ... subcommands (start/stop/config/wallet)
  • monitor: hl1m monitor run ... / hl1m monitor stop ...
  • analyze: hl1m analyze address ...
  • news: hl1m news ...

Commands (quick reference)

# start copy-trading
hl1m copy start --leader 0x... --target 123 [--scale 1.0] [--slippage 0.05] [--coins "BTC,HYPE"]

# stop copy-trading
hl1m copy stop --target 123

# update running parameters
hl1m copy config --target 123 [--scale 1.2] [--max-notional-usd 200] [--max-leverage 10] [--coins "BTC,HYPE"|off]

# monitor addresses
hl1m monitor run --target 123 --user 0x... [--min-notional-usd 0] [--language zh|en]
hl1m monitor stop --target 123 --user 0x...
hl1m monitor stop --target 123 --user all

# analyze one address
hl1m analyze address --addr 0x... [--days 30] [--out report.md] [--out-json report.json]

news commands (quick reference)

hl1m news ... uses BlockBeats Pro API and stores the key in the shared state .env as BLOCKBEATS_API_KEY.

# set api key
hl1m news set <api_key>

# scenarios
hl1m news snapshot --lang cn
hl1m news fund-flow --network solana
hl1m news macro --timeframe 1M
hl1m news derivatives --data-type 1D --exchanges-size 10

# single endpoints
hl1m news newsflash --type important --size 5 --lang cn
hl1m news article --type important --size 10 --lang cn
hl1m news search --keyword "bitcoin" --size 10 --lang en
hl1m news data --name us10y --type 1M

State .env variables

All variables live in the same state file (~/.openclaw/.1m-trade/.env by default).

trade wallet keys (used by trade; also used as fallback by copytrade)

  • HYPERLIQUID_WALLET_ADDRESS: the account address used for queries / user fields
  • HYPERLIQUID_PRIVATE_KEY_ENC: encrypted private key payload (v1)
  • HYPERLIQUID_PK_ENC_PASSWORD: password used to decrypt HYPERLIQUID_PRIVATE_KEY_ENC

copytrade wallet keys (optional; override trade keys for copytrade only)

If these are present, copytrade will use them. If not, copytrade falls back to trade wallet keys above.

  • 1M_TRADE_COPY_WALLET_ADDRESS
  • 1M_TRADE_COPY_PRIVATE_KEY_ENC
  • 1M_TRADE_COPY_PK_ENC_PASSWORD

news keys

  • BLOCKBEATS_API_KEY: BlockBeats Pro API key (set via hl1m news set <api_key>)

Query examples

hl1m query user-state
hl1m query open-orders
hl1m query meta
hl1m query kline --coin BTC --period 1m --start 1700000000000 --end 1700003600000

Trading examples

需要先初始化 trade 钱包(写入加密私钥到 state .env)。

hl1m exchange place --coin BTC --is-buy true --qty 0.01 --limit-px 60000 --tif Gtc
hl1m exchange market --coin BTC --is-buy true --qty 0.01 --slippage 0.02
hl1m exchange cancel --coin BTC
hl1m exchange leverage --coin BTC --leverage 5 --is-cross true
hl1m exchange close --coin BTC --qty 0.01 --slippage 0.02

Wallet examples

hl1m exchange wallet --pri_key 0xYourPrivateKey
hl1m exchange wallet --address 0xYourPublicAddress --pri_key 0xYourPrivateKey

# copytrade wallet (optional; separate keys)
hl1m copy wallet --pri_key 0xYourPrivateKey
hl1m copy wallet --addr 0xYourPublicAddress --pri_key 0xYourPrivateKey

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

1m_trade-0.7.0.tar.gz (51.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

1m_trade-0.7.0-py3-none-any.whl (63.6 kB view details)

Uploaded Python 3

File details

Details for the file 1m_trade-0.7.0.tar.gz.

File metadata

  • Download URL: 1m_trade-0.7.0.tar.gz
  • Upload date:
  • Size: 51.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for 1m_trade-0.7.0.tar.gz
Algorithm Hash digest
SHA256 96804ba3835c9873ca58dba3a8b2e227bbcc62c0e14f66230e312b510ae187cf
MD5 3b692f658b70bee99a840d0ad0f9de66
BLAKE2b-256 0bf049bc0a0adc6a62f1dfea21287d0fac93f3abdb88a4991c7f9997afa66cd6

See more details on using hashes here.

File details

Details for the file 1m_trade-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: 1m_trade-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 63.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for 1m_trade-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 78b25a786455e39bcbf4891b1838e81ee3cdf1ed2eb865e206c5862efeaddc50
MD5 322eaaefe77d0c3958033b0636aba780
BLAKE2b-256 b3fa954b2eae639388155580003b4c29c61d61499524e3ac935e3fe00e75617f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page