Skip to content

Commit 2123c2c

Browse files
authored
Merge pull request #5 from BitMEX-private/docs/agent-discoverability
install, onboarding, and skills safety improvements
2 parents 7216de0 + 1815361 commit 2123c2c

23 files changed

Lines changed: 69 additions & 49 deletions

File tree

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,13 @@ Ask me to choose:
4242
## Verify
4343
Run: bitmex account me -o json
4444
45+
## MCP (optional)
46+
Ask me if I want to set up the built-in MCP server (`bitmex mcp`), which
47+
lets you (the AI agent) call bitmex commands directly as tools without subprocess wrappers
48+
— smoother integration for agents that support MCP.
49+
4550
## What's Next
46-
Read the skills in the skills/ folder and ask me what I want to do. Offer these:
51+
Use the bitmex-* skills available to you and ask me what I want to do. Offer these:
4752
- Morning market brief (prices, funding rates, positions)
4853
- Start a DCA bot (dollar-cost average into a position)
4954
- Launch a grid trading bot (buy dips, sell rallies automatically)
@@ -70,7 +75,7 @@ And suggest starting with --testnet to practice safely before using real funds.
7075
### Install script (recommended)
7176

7277
```bash
73-
tmpfile="$(mktemp)" && curl -sSfL https://raw.githubusercontent.com/BitMEX/bitmex-cli/master/install.sh -o "$tmpfile" && sh "$tmpfile"
78+
curl -sSfL https://raw.githubusercontent.com/BitMEX/bitmex-cli/master/install.sh | sh
7479
```
7580

7681
Downloads a pre-built binary for your platform (macOS/Linux, x86_64/arm64), verifies the SHA256 checksum, and installs to `~/.local/bin`. No Rust or build tools needed. No `sudo` required. Requires `curl`, `tar`, and `sha256sum` (or `shasum`). Override the install location with `BITMEX_INSTALL_DIR`.
@@ -103,9 +108,8 @@ bitmex market orderbook XBTUSD --depth 10 -o json
103108
bitmex market trades --symbol XBTUSD --count 20 -o json
104109
bitmex market funding --symbol XBTUSD -o json
105110

106-
# Set up credentials
107-
export BITMEX_API_KEY="your-key"
108-
export BITMEX_API_SECRET="your-secret"
111+
# Set up credentials (stored securely in OS keychain)
112+
bitmex auth add
109113

110114
# Account data
111115
bitmex account me -o json

skills/bitmex-autonomy-levels/SKILL.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ bitmex market funding --symbol XBTUSD -o json 2>/dev/null
2727
# Account state — auth required, read-only
2828
bitmex account me -o json 2>/dev/null
2929
bitmex position list -o json 2>/dev/null
30-
bitmex order list -o json 2>/dev/null
30+
bitmex order list --reverse -o json 2>/dev/null
3131
bitmex wallet balance -o json 2>/dev/null
3232
```
3333

@@ -62,13 +62,15 @@ bitmex order buy XBTUSD 100 --price 50000 --order-type Limit --validate -o json
6262
bitmex order buy XBTUSD 100 --price 50000 --order-type Limit -o json 2>/dev/null
6363

6464
# Confirm fill
65-
bitmex order list --symbol XBTUSD -o json 2>/dev/null | jq '.[] | {orderID, ordStatus, price, cumQty}'
65+
bitmex order list --reverse --symbol XBTUSD -o json 2>/dev/null | jq '.[] | {orderID, ordStatus, price, cumQty}'
6666
```
6767

6868
Constraints: max qty per order, no compounding without approval, stop loss required.
6969

7070
## Level 4: Autonomous
7171

72+
> ⚠️ Even at this level, active monitoring is required. Dead man's switch failure, position cap misconfiguration, or network outages can result in unprotected positions or runaway accumulation. You remain responsible for all outcomes.
73+
7274
Pre-approved strategy parameters. Position limits enforced in code. Dead man's switch active on every session.
7375

7476
```bash
@@ -92,6 +94,8 @@ Requirements: strategy approved in writing, position limits in config, automated
9294

9395
## Level 5: Fund Management
9496

97+
> ⚠️ Even at this level, active monitoring is required. Dead man's switch failure, position cap misconfiguration, or network outages can result in unprotected positions or runaway accumulation. You remain responsible for all outcomes.
98+
9599
Multi-account, risk budget per strategy. Each strategy has an independent margin allocation.
96100

97101
```bash

skills/bitmex-basis-trading/SKILL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ metadata:
1414

1515
Basis trading captures the spread between a perpetual and a fixed-date future on the same underlying. The spread converges to zero at expiry, yielding a predictable return when entered at a wide basis.
1616

17+
Always validate on testnet first: prefix commands with `bitmex --testnet` until the strategy behaves as expected.
18+
1719
## What Is the Basis?
1820

1921
```

skills/bitmex-dca-strategy/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ metadata:
1212

1313
# bitmex-dca-strategy
1414

15-
DCA on BitMEX perpetuals: buy a fixed quantity at regular intervals regardless of price, using limit orders to earn maker rebates.
15+
DCA on BitMEX perpetuals: buy a fixed quantity at regular intervals regardless of price, using limit orders to potentially reduce costs with maker orders.
1616

1717
**Always test with `--testnet` first for at least 5 cycles before using real funds.**
1818

@@ -87,7 +87,7 @@ done
8787
## Track Average Entry Price
8888

8989
```bash
90-
bitmex execution trade-history --symbol XBTUSD --count 100 -o json 2>/dev/null | \
90+
bitmex execution trade-history --symbol XBTUSD --reverse --count 100 -o json 2>/dev/null | \
9191
jq '
9292
[.[] | select(.side == "Buy" and .execType == "Trade")] |
9393
{

skills/bitmex-error-recovery/SKILL.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ bitmex order buy XBTUSD 100 --price 50000 \
7373
--cl-ord-id "$CL_ORD_ID" -o json 2>/dev/null
7474

7575
# On network error, check if order exists before retrying
76-
EXISTING=$(bitmex order list --symbol XBTUSD -o json 2>/dev/null | \
76+
EXISTING=$(bitmex order list --reverse --symbol XBTUSD -o json 2>/dev/null | \
7777
jq --arg id "$CL_ORD_ID" '[.[] | select(.clOrdID == $id)]')
7878

7979
COUNT=$(echo "$EXISTING" | jq 'length')
@@ -102,11 +102,11 @@ done
102102

103103
```bash
104104
ORDER_ID="<id>"
105-
STATUS=$(bitmex order list --symbol XBTUSD -o json 2>/dev/null | \
105+
STATUS=$(bitmex order list --reverse --symbol XBTUSD -o json 2>/dev/null | \
106106
jq -r --arg id "$ORDER_ID" '.[] | select(.orderID == $id) | .ordStatus')
107-
FILLED=$(bitmex order list --symbol XBTUSD -o json 2>/dev/null | \
107+
FILLED=$(bitmex order list --reverse --symbol XBTUSD -o json 2>/dev/null | \
108108
jq -r --arg id "$ORDER_ID" '.[] | select(.orderID == $id) | .cumQty')
109-
REMAINING=$(bitmex order list --symbol XBTUSD -o json 2>/dev/null | \
109+
REMAINING=$(bitmex order list --reverse --symbol XBTUSD -o json 2>/dev/null | \
110110
jq -r --arg id "$ORDER_ID" '.[] | select(.orderID == $id) | .leavesQty')
111111

112112
echo "Status: $STATUS | Filled: $FILLED | Remaining: $REMAINING"

skills/bitmex-fee-optimization/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ bitmex account commission -o json 2>/dev/null | jq '.XBTUSD'
101101

102102
```bash
103103
# Sum fees paid over last 500 executions
104-
bitmex execution trade-history --count 500 -o json 2>/dev/null | \
104+
bitmex execution trade-history --reverse --count 500 -o json 2>/dev/null | \
105105
jq '
106106
{
107107
total_fee: (map(.commission // 0) | add),
@@ -115,7 +115,7 @@ bitmex execution trade-history --count 500 -o json 2>/dev/null | \
115115
## Maker vs Taker Split
116116

117117
```bash
118-
bitmex execution trade-history --count 500 -o json 2>/dev/null | \
118+
bitmex execution trade-history --reverse --count 500 -o json 2>/dev/null | \
119119
jq '
120120
{
121121
maker_count: (map(select(.commission < 0)) | length),

skills/bitmex-funding-carry/SKILL.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: bitmex-funding-carry
33
version: 1.0.0
4-
description: "Earn funding payments on BitMEX perpetuals: scan rates, entry, monitoring, yield calculation, and exit."
4+
description: "Capture funding rate payments on BitMEX perpetuals: scan rates, entry, monitoring, yield calculation, and exit."
55
metadata:
66
openclaw:
77
category: "finance"
@@ -113,6 +113,8 @@ fi
113113

114114
## Annualized Yield Calculation
115115

116+
> Note: annualized yield is illustrative only. Funding rates change every 8 hours and can flip from payment to cost. Past rates are not indicative of future returns.
117+
116118
```bash
117119
# Per 8h rate → annualized
118120
# 3 payments/day × 365 days = 1095 periods/year

skills/bitmex-market-intel/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ bitmex market orderbook XBTUSD --depth 1 -o json 2>/dev/null | \
5151

5252
```bash
5353
# Last 100 trades
54-
bitmex market trades --symbol XBTUSD --count 100 -o json 2>/dev/null | \
54+
bitmex market trades --symbol XBTUSD --reverse --count 100 -o json 2>/dev/null | \
5555
jq '[.[] | {timestamp, side, price, size}]'
5656

5757
# Bucketed candles (OHLCV)

skills/bitmex-order-execution/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ bitmex account margin --currency XBt -o json 2>/dev/null | \
2626
jq '{availableMargin, marginBalance, marginLeverage}'
2727

2828
# 3. Check for stale open orders
29-
bitmex order list --symbol XBTUSD -o json 2>/dev/null | \
29+
bitmex order list --reverse --symbol XBTUSD -o json 2>/dev/null | \
3030
jq '[.[] | select(.ordStatus == "New" or .ordStatus == "PartiallyFilled") | {orderID, side, price, leavesQty}]'
3131
```
3232

@@ -67,7 +67,7 @@ ORDER_ID=$(echo "$ORDER" | jq -r '.orderID')
6767
Via REST polling:
6868

6969
```bash
70-
bitmex order list --symbol XBTUSD -o json 2>/dev/null | \
70+
bitmex order list --reverse --symbol XBTUSD -o json 2>/dev/null | \
7171
jq --arg id "$ORDER_ID" '.[] | select(.orderID == $id) | {ordStatus, cumQty, leavesQty, avgPx}'
7272
```
7373

skills/bitmex-order-types/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ bitmex order buy XBTUSD 100 --price 50000 --order-type Limit \
127127
Change price or qty on an open order without cancelling and re-placing:
128128

129129
```bash
130-
ORDER_ID=$(bitmex order list --symbol XBTUSD -o json 2>/dev/null | \
130+
ORDER_ID=$(bitmex order list --reverse --symbol XBTUSD -o json 2>/dev/null | \
131131
jq -r '[.[] | select(.ordStatus=="New")][0].orderID')
132132

133133
bitmex order amend --order-id "$ORDER_ID" --price 50500 -o json 2>/dev/null

0 commit comments

Comments
 (0)