1m trade dex

From LeoYeAI/openclaw-master-skills · View interactive version

1m trade dex is an AI agent skill from the GitHub repository LeoYeAI/openclaw-master-skills. Hyperliquid DEX/Perps entrypoint via `hl1m`: market queries, order placement. Wallet creation/management at https://www.1m-trade.com; local `hl1m init-wallet` with address + proxy (API) private key — never the main wallet key. No in-skill private-key messaging.

How to use this skill

Skill file

Setup

1. Install CLI

which hl1m

If hl1m is missing, install the 1m-trade package (requires Python 3.11+ and pipx):

pipx install 1m-trade

2. Verify

hl1m --help

3. Upgrade

pipx upgrade 1m-trade

Basic syntax

hl1m [--testnet] <command> [command_args]

Core flags


Wallet initialization

Official wallet UI (create & manage):

When to trigger: user wants to use their own wallet with this skill (e.g. “init wallet”, “connect my wallet”, “configure Hyperliquid”, first-time setup before trading).

Natural-language binding (one-shot address + proxy key)

Use this when the user asks to configure/bind the trading account and supplies both a wallet address and a proxy (API) private key in the same message (often with explicit field labels).

Recognized intents (examples, non-exhaustive):

Label → flag mapping:

| User wording (meaning) | hl1m flag |

|------------------------|-------------|

| wallet address, address, or any label clearly referring to the public trading / master address shown in the UI | --address |

| proxy private key, API private key, proxy key, or any label clearly referring to the bot/API signing key — not the main EOA key | --pri_key |

Parsing (apply before running init-wallet):

  1. Extract address: first 0x + 40 hexadecimal characters (case-insensitive), typically the value next to a label for the public wallet / address when labels exist.
  2. Extract proxy key: first 0x + 64 hexadecimal characters (typical for this flow). If the user wrote 64 hex digits without 0x, prefix 0x when the CLI requires it (see hl1m --help).
  3. Require both values; if only one is present, do not guess — ask for the missing piece or point to 1M-Trade + show the placeholder command only.
  4. If multiple 0x… strings appear, use labels to pair: the hex labeled as address → --address; the hex labeled as proxy/API key → --pri_key. Do not swap.

Exact command (values come from the user message; run in a trusted local shell):

hl1m init-wallet --address <parsed_address> --pri_key <parsed_proxy_private_key>

Assistant output: confirm bind success or CLI error; run hl1m query-user-state after success. Do not repeat the full private key in chat (mask or omit).

What to use (recommended):

Critical security warning:

Rules:

Command (placeholders — user substitutes on their machine; never paste real keys in chat):

hl1m init-wallet --address 0xYourWalletAddress --pri_key 0xYourProxyPrivateKey

If your CLI supports key-only init, you may use --pri_key alone when the address is derived from the key; follow hl1m --help / reference.md for your version.

After success:


Constraints

Command list

Note: for any asset name (e.g. --coin), you can run query-meta to confirm the exact symbol. For example, user input "gold" often maps to xyz:GOLD. Always pass the canonical symbol.

1) Query commands

| Command | Description | Example |

|------|------|------|

| query-user-state | Query user state (positions + balances). Optional address override; structure follows the API/SDK response. | hl1m query-user-state --address 0x123... |

| query-open-orders | Query open orders | hl1m --testnet query-open-orders |

| query-fills | Query fills / trade history | hl1m query-fills |

| query-meta | Query asset metadata (all symbols) | hl1m query-meta |

| query-mids | Query mid prices (all symbols) | hl1m query-mids |

| query-kline | Query kline/candles for a symbol | hl1m query-kline --coin BTC --period 15m --start 1772511125000 --end 1772597525000 |

Retry rule (query commands only):

Query command arguments

`query-user-state`
`query-kline`
2) Trading commands

| Command | Description | Example |

|------|------|------|

| place-order | Place a limit order (HIP-3 supported) | hl1m place-order --coin BTC --is-buy True --qty 0.01 --limit-px 50000 --tif Gtc |

| market-order | Place a market order (recommended for HIP-3) | hl1m --testnet market-order --coin ETH --is-buy True --qty 0.1 --slippage 0.01 |

| market-close | Close a position with a market order (recommended for HIP-3) | hl1m market-close --coin ETH --qty 0.1 --slippage 0.01 |

| cancel-order | Cancel orders | hl1m cancel-order --oid 123456 --coin HYPE |

| update-leverage | Update leverage | hl1m update-leverage --coin BTC --leverage 10 --is-cross True |

| update-isolated-margin | Transfer isolated margin (HIP-3) | hl1m update-isolated-margin --coin xyz:GOLD --amount 10 |

Trading command arguments

General rules
  1. For --coin, always resolve the canonical symbol (use query-meta if needed).
  2. For --qty, use query-meta results (e.g. szDecimals) to format the quantity precision correctly.
`update-isolated-margin`
`place-order`
`market-order`
`market-close`
`cancel-order`
`update-leverage`

Output

All commands print formatted JSON for easy parsing:

Error handling

Notes

  1. Private keys are sensitive. Do not expose or share them.
  2. Testnet vs mainnet are strictly separated. Confirm --testnet before acting.
  3. Adjust slippage for market orders based on volatility; too small may fail.
  4. Leverage trading is risky. Choose leverage carefully.
  5. For proxy-style setups, follow hl1m help for --address / --pri_key behavior.

Summary

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.