skills$openclaw/open-broker
ya7ya3.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.

3.1k stars7.1k forksSecurity L1
Updated Feb 7, 2026Created Feb 7, 2026coding

Skill Snapshot

nameopen-broker
descriptionHyperliquid 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.
ownerya7ya
repositoryya7ya/openbroker
languageMarkdown
licenseMIT
topics
securityL1
installopenclaw add @ya7ya/openbroker
last updatedFeb 7, 2026

Maintainer

ya7ya

ya7ya

Maintains open-broker in the OpenClaw Skills directory.

View GitHub profile
File Explorer
40 files
.
config
example.env
1.8 KB
references
OPERATIONS.md
7.3 KB
STRATEGIES.md
11.1 KB
scripts
core
client.ts
16.5 KB
config.ts
3.5 KB
types.ts
4.0 KB
utils.ts
3.9 KB
info
account.ts
4.2 KB
funding.ts
4.3 KB
markets.ts
4.8 KB
positions.ts
3.0 KB
operations
bracket.ts
10.0 KB
cancel.ts
3.5 KB
chase.ts
8.0 KB
limit-order.ts
5.1 KB
market-order.ts
5.5 KB
scale.ts
8.4 KB
twap.ts
8.0 KB
setup
approve-builder.ts
5.5 KB
onboard.ts
7.7 KB
strategies
dca.ts
10.1 KB
funding-arb.ts
12.7 KB
grid.ts
14.3 KB
mm-maker.ts
14.9 KB
mm-spread.ts
14.6 KB
_meta.json
272 B
package-lock.json
28.5 KB
package.json
1.5 KB
PLAN.md
8.1 KB
README.md
6.3 KB
SKILL.md
6.4 KB
tsconfig.json
486 B
SKILL.md

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:

  1. Generate a new trading wallet
  2. Create .env with your private key
  3. Approve the builder fee (free, no funds needed)
  4. Display your wallet address to fund

After onboarding, fund your wallet:

  1. Send USDC to your wallet address on Arbitrum
  2. Deposit to Hyperliquid at https://app.hyperliquid.xyz/
  3. Start trading!

Manual Setup (Alternative)

If you prefer manual setup or have an existing wallet:

  1. Install dependencies: npm install
  2. Copy and configure environment:
    cp config/example.env .env
    # Edit .env with your private key
    
  3. 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 --dry first to preview orders
  • Start with small sizes on testnet
  • Monitor positions and liquidation prices
  • Use reduce-only for closing positions
README.md

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 .env with 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

ArgumentDescription
--coinAsset symbol (ETH, BTC, SOL, HYPE, etc.)
--sideOrder direction: buy or sell
--sizeOrder size in base asset
--priceLimit price
--dryPreview without executing
--verboseShow 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

VariableRequiredDescription
HYPERLIQUID_PRIVATE_KEYYesWallet private key (0x...)
HYPERLIQUID_NETWORKNomainnet (default) or testnet
HYPERLIQUID_ACCOUNT_ADDRESSNoTrade on behalf of another address (for API wallets)
BUILDER_ADDRESSNoCustom builder address (default: open-broker)
BUILDER_FEENoBuilder fee in tenths of bps (default: 10 = 1bps)
SLIPPAGE_BPSNoDefault 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

TypeFlagDescription
GTC--tif GTCGood Till Cancel - rests on book
IOC--tif IOCImmediate Or Cancel - fills or cancels
ALO--tif ALOAdd Liquidity Only - maker only, rejected if would cross

Strategy Reference

StrategyUse CaseRisk
funding-arbCollect funding when rates are highMedium
gridProfit from sideways marketsMedium
dcaAccumulate over timeLow
mm-makerProvide liquidity, earn rebatesMedium

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 documentation
  • references/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.