3.1k★by ya7ya
open-broker – OpenClaw Skill
open-broker is an OpenClaw Skills integration for coding workflows. Hyperliquid trading toolkit. Execute market orders, limit orders, check positions, view funding rates, and analyze markets. Use for any Hyperliquid perp trading task.
Skill Snapshot
| name | open-broker |
| description | Hyperliquid trading toolkit. Execute market orders, limit orders, check positions, view funding rates, and analyze markets. Use for any Hyperliquid perp trading task. OpenClaw Skills integration. |
| owner | ya7ya |
| repository | ya7ya/openbroker |
| language | Markdown |
| license | MIT |
| topics | |
| security | L1 |
| install | openclaw add @ya7ya/openbroker |
| last updated | Feb 7, 2026 |
Maintainer

name: open-broker description: Hyperliquid trading toolkit. Execute market orders, limit orders, check positions, view funding rates, and analyze markets. Use for any Hyperliquid perp trading task. license: MIT compatibility: Requires Node.js 22+, network access to api.hyperliquid.xyz metadata: author: monemetrics version: "1.0.0" allowed-tools: Bash(npx:) Bash(tsx:) Bash(npm:*) Read
Open Broker - Hyperliquid Trading Skill
Execute trading operations on Hyperliquid DEX with builder fee support.
Quick Start (Automated Onboarding)
Run these two commands to get started:
npm install
npx tsx scripts/setup/onboard.ts
This will automatically:
- Generate a new trading wallet
- Create
.envwith your private key - Approve the builder fee (free, no funds needed)
- Display your wallet address to fund
After onboarding, fund your wallet:
- Send USDC to your wallet address on Arbitrum
- Deposit to Hyperliquid at https://app.hyperliquid.xyz/
- Start trading!
Manual Setup (Alternative)
If you prefer manual setup or have an existing wallet:
- Install dependencies:
npm install - Copy and configure environment:
cp config/example.env .env # Edit .env with your private key - Approve builder fee:
npx tsx scripts/setup/approve-builder.ts
Builder Fee
Open Broker charges a 1 bps (0.01%) builder fee on trades to fund development. The onboarding script handles this automatically. To check or manage manually:
# Check if approved
npx tsx scripts/setup/approve-builder.ts --check
# Approve (must use main wallet, not API wallet)
npx tsx scripts/setup/approve-builder.ts
Quick Reference
Get Account Info
npx tsx scripts/info/account.ts
npx tsx scripts/info/account.ts --orders # include open orders
Get Positions
npx tsx scripts/info/positions.ts
npx tsx scripts/info/positions.ts --coin ETH
Check Funding Rates
npx tsx scripts/info/funding.ts --top 20
npx tsx scripts/info/funding.ts --coin ETH
View Markets
npx tsx scripts/info/markets.ts --top 30
npx tsx scripts/info/markets.ts --coin BTC
Market Order
npx tsx scripts/operations/market-order.ts --coin ETH --side buy --size 0.1
npx tsx scripts/operations/market-order.ts --coin BTC --side sell --size 0.01 --slippage 100
Limit Order
npx tsx scripts/operations/limit-order.ts --coin ETH --side buy --size 1 --price 3000
npx tsx scripts/operations/limit-order.ts --coin SOL --side sell --size 10 --price 200 --tif ALO
Cancel Orders
npx tsx scripts/operations/cancel.ts --all # cancel all
npx tsx scripts/operations/cancel.ts --coin ETH # cancel ETH orders
npx tsx scripts/operations/cancel.ts --oid 123456 # cancel specific order
TWAP (Time-Weighted Average Price)
# Execute 1 ETH buy over 1 hour (auto-calculates slices)
npx tsx scripts/operations/twap.ts --coin ETH --side buy --size 1 --duration 3600
# Custom intervals with randomization
npx tsx scripts/operations/twap.ts --coin BTC --side sell --size 0.5 --duration 1800 --intervals 6 --randomize 20
Scale In/Out (Grid Orders)
# Place 5 buy orders ranging 2% below current price
npx tsx scripts/operations/scale.ts --coin ETH --side buy --size 1 --levels 5 --range 2
# Scale out with exponential distribution
npx tsx scripts/operations/scale.ts --coin BTC --side sell --size 0.5 --levels 4 --range 3 --distribution exponential --reduce
Bracket Order (Entry + TP + SL)
# Long ETH with 3% take profit and 1.5% stop loss
npx tsx scripts/operations/bracket.ts --coin ETH --side buy --size 0.5 --tp 3 --sl 1.5
# Short with limit entry
npx tsx scripts/operations/bracket.ts --coin BTC --side sell --size 0.1 --entry limit --price 100000 --tp 5 --sl 2
Chase Order (Follow Price)
# Chase buy with ALO orders until filled
npx tsx scripts/operations/chase.ts --coin ETH --side buy --size 0.5 --timeout 300
# Aggressive chase with tight offset
npx tsx scripts/operations/chase.ts --coin SOL --side buy --size 10 --offset 2 --timeout 60
Trading Strategies
Funding Arbitrage
# Collect funding on ETH if rate > 25% annualized
npx tsx scripts/strategies/funding-arb.ts --coin ETH --size 5000 --min-funding 25
# Run for 24 hours, check every 30 minutes
npx tsx scripts/strategies/funding-arb.ts --coin BTC --size 10000 --duration 24 --check 30 --dry
Grid Trading
# ETH grid from $3000-$4000 with 10 levels, 0.1 ETH per level
npx tsx scripts/strategies/grid.ts --coin ETH --lower 3000 --upper 4000 --grids 10 --size 0.1
# Accumulation grid (buys only)
npx tsx scripts/strategies/grid.ts --coin BTC --lower 90000 --upper 100000 --grids 5 --size 0.01 --mode long
DCA (Dollar Cost Averaging)
# Buy $100 of ETH every hour for 24 hours
npx tsx scripts/strategies/dca.ts --coin ETH --amount 100 --interval 1h --count 24
# Invest $5000 in BTC over 30 days with daily purchases
npx tsx scripts/strategies/dca.ts --coin BTC --total 5000 --interval 1d --count 30
Market Making Spread
# Market make ETH with 0.1 size, 10bps spread
npx tsx scripts/strategies/mm-spread.ts --coin ETH --size 0.1 --spread 10
# Tighter spread with position limit
npx tsx scripts/strategies/mm-spread.ts --coin BTC --size 0.01 --spread 5 --max-position 0.1
Maker-Only MM (ALO orders)
# Market make using ALO (post-only) orders - guarantees maker rebates
npx tsx scripts/strategies/mm-maker.ts --coin HYPE --size 1 --offset 1
# Wider offset for volatile assets
npx tsx scripts/strategies/mm-maker.ts --coin ETH --size 0.1 --offset 2 --max-position 0.5
Script Arguments
All scripts support --dry for dry run (preview without executing).
Common Arguments
--coin- Asset symbol (ETH, BTC, SOL, etc.)--dry- Dry run mode
Order Arguments
--side- buy or sell--size- Order size in base asset--price- Limit price (for limit orders)--slippage- Slippage tolerance in bps (for market orders)--tif- Time in force: GTC, IOC, ALO--reduce- Reduce-only order
References
See references/OPERATIONS.md for detailed operation documentation.
See references/STRATEGIES.md for detailed strategy documentation.
Risk Warning
- Always use
--dryfirst to preview orders - Start with small sizes on testnet
- Monitor positions and liquidation prices
- Use reduce-only for closing positions
Open Broker
Hyperliquid trading toolkit for AI agents. Execute orders, manage positions, and run trading strategies on Hyperliquid DEX.
Quick Start (Automated)
# 1. Install and onboard (creates wallet, configures everything)
npm install
npx tsx scripts/setup/onboard.ts
This will automatically:
- Generate a new trading wallet
- Create
.envwith your private key - Approve the builder fee (free, no funds needed)
- Display your wallet address to fund
Next step: Send USDC to your wallet on Arbitrum, then deposit to Hyperliquid at https://app.hyperliquid.xyz/
Manual Setup (Existing Wallet)
If you already have a wallet:
# 1. Install dependencies
npm install
# 2. Configure environment
cp config/example.env .env
# Edit .env with your private key
# 3. Approve builder fee (one-time)
npx tsx scripts/setup/approve-builder.ts
Builder Fee
Open Broker charges 1 bps (0.01%) per trade to fund development.
# Check approval status
npx tsx scripts/setup/approve-builder.ts --check
# Approve (uses main wallet, not API wallet)
npx tsx scripts/setup/approve-builder.ts
Note: Must be signed by main wallet, not API wallet or sub-account.
Available Commands
Account Info
# View account balance, equity, and positions
npx tsx scripts/info/account.ts
# View detailed positions with PnL
npx tsx scripts/info/positions.ts
# Check funding rates (sorted by annualized rate)
npx tsx scripts/info/funding.ts --top 20
# View market data
npx tsx scripts/info/markets.ts --coin ETH
Trading Operations
# Market order
npx tsx scripts/operations/market-order.ts --coin ETH --side buy --size 0.1
# Limit order
npx tsx scripts/operations/limit-order.ts --coin ETH --side buy --size 0.1 --price 3000
# Cancel orders
npx tsx scripts/operations/cancel.ts --coin ETH # Cancel all ETH orders
npx tsx scripts/operations/cancel.ts --all # Cancel all orders
npx tsx scripts/operations/cancel.ts --oid 123456 # Cancel specific order
Advanced Execution
# TWAP - split large order over time
npx tsx scripts/operations/twap.ts --coin ETH --side buy --size 1 --duration 3600
# Scale - grid of limit orders
npx tsx scripts/operations/scale.ts --coin ETH --side buy --size 1 --levels 5 --range 2
# Bracket - entry with TP and SL
npx tsx scripts/operations/bracket.ts --coin ETH --side buy --size 0.5 --tp 3 --sl 1.5
# Chase - follow price with limit orders
npx tsx scripts/operations/chase.ts --coin ETH --side buy --size 0.5 --timeout 300
Trading Strategies
# Funding arbitrage - collect funding payments
npx tsx scripts/strategies/funding-arb.ts --coin ETH --size 5000 --min-funding 25
# Grid trading - profit from range-bound markets
npx tsx scripts/strategies/grid.ts --coin ETH --lower 3000 --upper 4000 --grids 10 --size 0.1
# DCA - dollar cost average into position
npx tsx scripts/strategies/dca.ts --coin ETH --amount 100 --interval 1h --count 24
# Market making (maker-only with ALO orders)
npx tsx scripts/strategies/mm-maker.ts --coin HYPE --size 1 --offset 1
Common Arguments
| Argument | Description |
|---|---|
--coin | Asset symbol (ETH, BTC, SOL, HYPE, etc.) |
--side | Order direction: buy or sell |
--size | Order size in base asset |
--price | Limit price |
--dry | Preview without executing |
--verbose | Show debug output |
Safety
Always use --dry first to preview any operation:
npx tsx scripts/operations/market-order.ts --coin ETH --side buy --size 0.1 --dry
Use testnet for testing:
export HYPERLIQUID_NETWORK="testnet"
Environment Variables
| Variable | Required | Description |
|---|---|---|
HYPERLIQUID_PRIVATE_KEY | Yes | Wallet private key (0x...) |
HYPERLIQUID_NETWORK | No | mainnet (default) or testnet |
HYPERLIQUID_ACCOUNT_ADDRESS | No | Trade on behalf of another address (for API wallets) |
BUILDER_ADDRESS | No | Custom builder address (default: open-broker) |
BUILDER_FEE | No | Builder fee in tenths of bps (default: 10 = 1bps) |
SLIPPAGE_BPS | No | Default slippage for market orders (default: 50) |
API Wallet Setup
To use an API wallet (recommended for automated trading):
# Your API wallet's private key (the signer)
export HYPERLIQUID_PRIVATE_KEY="0x..."
# The main account address to trade on behalf of
export HYPERLIQUID_ACCOUNT_ADDRESS="0x..."
Important: Builder fee approval must be done with the main wallet, not the API wallet. After approval, you can switch to using your API wallet for trading.
Order Types
| Type | Flag | Description |
|---|---|---|
| GTC | --tif GTC | Good Till Cancel - rests on book |
| IOC | --tif IOC | Immediate Or Cancel - fills or cancels |
| ALO | --tif ALO | Add Liquidity Only - maker only, rejected if would cross |
Strategy Reference
| Strategy | Use Case | Risk |
|---|---|---|
funding-arb | Collect funding when rates are high | Medium |
grid | Profit from sideways markets | Medium |
dca | Accumulate over time | Low |
mm-maker | Provide liquidity, earn rebates | Medium |
Examples
Open a long position with stop loss
# Enter long with bracket (TP at +5%, SL at -2%)
npx tsx scripts/operations/bracket.ts --coin ETH --side buy --size 0.5 --tp 5 --sl 2
Scale into a position
# Place 5 buy orders from -1% to -3% below current price
npx tsx scripts/operations/scale.ts --coin BTC --side buy --size 0.1 --levels 5 --range 3
Run a funding arbitrage
# Collect funding on ETH when rate > 25% annualized
npx tsx scripts/strategies/funding-arb.ts --coin ETH --size 5000 --min-funding 25 --duration 24
Provide liquidity with maker rebates
# Market make using ALO orders (guaranteed maker rebates)
npx tsx scripts/strategies/mm-maker.ts --coin HYPE --size 1 --offset 1
Files
scripts/
├── info/ # Account and market information
├── operations/ # Single order operations
├── strategies/ # Multi-order trading strategies
└── core/ # Shared client and utilities
References
references/OPERATIONS.md- Detailed operation documentationreferences/STRATEGIES.md- Strategy documentation and parameters
License
MIT
Permissions & Security
Security level L1: Low-risk skills with minimal permissions. Review inputs and outputs before running in production.
Requirements
- OpenClaw CLI installed and configured.
- Language: Markdown
- License: MIT
- Topics:
FAQ
How do I install open-broker?
Run openclaw add @ya7ya/openbroker in your terminal. This installs open-broker into your OpenClaw Skills catalog.
Does this skill run locally or in the cloud?
OpenClaw Skills execute locally by default. Review the SKILL.md and permissions before running any skill.
Where can I verify the source code?
The source repository is available at https://github.com/openclaw/skills/tree/main/skills/ya7ya/openbroker. Review commits and README documentation before installing.
