一键导入
bitmex-fee-optimization
Minimize trading fees on bitmex-cli: maker vs taker, post-only orders, commission tiers, and fee audit.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Minimize trading fees on bitmex-cli: maker vs taker, post-only orders, commission tiers, and fee audit.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Price, funding, liquidation, and balance alerts using polling and WebSocket on bitmex-cli.
Autonomy progression for bitmex-cli agents: from read-only market data to autonomous fund management.
Delta-neutral basis trading between BitMEX perpetuals and fixed-date futures: entry, monitoring, and exit.
Dollar cost averaging on bitmex-cli: testnet-first, fixed qty per interval, limit orders, and position cap enforcement.
Error category handling, duplicate order prevention, retry logic, and partial fill management for bitmex-cli.
Capture funding rate payments on BitMEX perpetuals: scan rates, entry, monitoring, yield calculation, and exit.
| name | bitmex-fee-optimization |
| version | 1.0.0 |
| description | Minimize trading fees on bitmex-cli: maker vs taker, post-only orders, commission tiers, and fee audit. |
| metadata | {"openclaw":{"category":"finance"},"requires":{"bins":["bitmex"]},"depends":["bitmex-shared","bitmex-order-types"]} |
BitMEX charges taker fees and pays maker rebates. The difference is meaningful at scale. Default to limit orders with ParticipateDoNotInitiate for passive entries. For aggressive fills where immediate execution matters more than fee savings, use a limit order at the ask/bid price without this flag — see Avoid Market Orders below.
| Role | Fee Type | Direction |
|---|---|---|
| Maker | Rebate | You earn (negative fee) |
| Taker | Fee | You pay |
Check your current fee schedule (returns a map of symbol → fees):
# All symbols
bitmex account commission -o json 2>/dev/null
# Single symbol
bitmex account commission -o json 2>/dev/null | \
jq '.XBTUSD | {makerFee, takerFee, settlementFee}'
ParticipateDoNotInitiate rejects the order if it would immediately match (become a taker). This guarantees the maker rebate or no fill at all.
# Post-only buy — earns rebate or does not fill
bitmex order buy XBTUSD 100 \
--price 50000 \
--order-type Limit \
--exec-inst ParticipateDoNotInitiate \
--validate -o json 2>/dev/null
bitmex order buy XBTUSD 100 \
--price 50000 \
--order-type Limit \
--exec-inst ParticipateDoNotInitiate \
-o json 2>/dev/null
# Post-only sell
bitmex order sell XBTUSD 100 \
--price 50500 \
--order-type Limit \
--exec-inst ParticipateDoNotInitiate \
-o json 2>/dev/null
Market orders always pay taker fees. Use limit orders at aggressive prices (inside the spread) instead:
# Instead of market buy, use aggressive limit:
ASK=$(bitmex market orderbook XBTUSD --depth 1 -o json 2>/dev/null | jq '[.[] | select(.side=="Sell") | .price][0]')
bitmex order buy XBTUSD 100 \
--price "$ASK" \
--order-type Limit \
-o json 2>/dev/null
# Note: no ParticipateDoNotInitiate here — we want to take liquidity at ask
Fill at existing prices only, no remainder:
bitmex order buy XBTUSD 100 \
--price 50000 \
--order-type Limit \
--tif ImmediateOrCancel \
-o json 2>/dev/null
Higher 30-day trading volume unlocks lower fees:
# Check your 30-day volume (returns array; first element has the totals)
bitmex account volume -o json 2>/dev/null | \
jq '.[0] | {advUsd, advUsdContract, advUsdSpot}'
# Cross-reference with commission tiers (returns map of symbol → fees)
bitmex account commission -o json 2>/dev/null | jq '.XBTUSD'
# Sum fees paid over last 500 executions
bitmex execution trade-history --reverse --count 500 -o json 2>/dev/null | \
jq '
{
total_fee: (map(.commission // 0) | add),
total_volume: (map(.lastQty // 0) | add),
trade_count: length,
avg_fee_per_trade: ((map(.commission // 0) | add) / length | round / 100)
}
'
bitmex execution trade-history --reverse --count 500 -o json 2>/dev/null | \
jq '
{
maker_count: (map(select(.commission < 0)) | length),
taker_count: (map(select(.commission > 0)) | length),
maker_rebate: (map(select(.commission < 0) | .commission) | add // 0),
taker_paid: (map(select(.commission > 0) | .commission) | add // 0)
}
'
# --validate returns the expected execInst, confirming post-only
bitmex order buy XBTUSD 100 \
--price 50000 \
--order-type Limit \
--exec-inst ParticipateDoNotInitiate \
--validate -o json 2>/dev/null | \
jq '{ordType, execInst, price}'
If execInst in the validate response does not include ParticipateDoNotInitiate, do not submit.