بنقرة واحدة
bitmex-recipe-basis-trade-entry
Enter a perp-futures basis trade when premium exceeds threshold.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Enter a perp-futures basis trade when premium exceeds threshold.
التثبيت باستخدام 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.
Minimize trading fees on bitmex-cli: maker vs taker, post-only orders, commission tiers, and fee audit.
| name | bitmex-recipe-basis-trade-entry |
| description | Enter a perp-futures basis trade when premium exceeds threshold. |
A basis trade is delta-neutral: long the cheaper leg (usually the perpetual) and short the more expensive leg (the fixed-date future) when the premium between them exceeds the cost of carry. The trade profits as the basis converges to zero at expiry.
BITMEX_API_KEY and BITMEX_API_SECRET set.jq and bc installed.XBTUSD (perp) and XBTM25 (fixed-date future).PERP_PRICE=$(bitmex market instrument --symbol XBTUSD -o json \
| jq '.[0].markPrice')
echo "Perp: $PERP_PRICE"
FUT_PRICE=$(bitmex market instrument --symbol XBTM25 -o json \
| jq '.[0].markPrice')
echo "Futures: $FUT_PRICE"
BASIS=$(echo "scale=6; ($FUT_PRICE - $PERP_PRICE) / $PERP_PRICE * 100" | bc)
echo "Basis: ${BASIS}%"
Only enter if basis exceeds 1% (adjust to your cost model):
THRESHOLD=1.0
if (( $(echo "$BASIS > $THRESHOLD" | bc -l) )); then
echo "Basis ${BASIS}% > ${THRESHOLD}% threshold — entering trade"
else
echo "Basis too thin, skipping"
exit 0
fi
QTY=100
# Long perp
bitmex order buy XBTUSD $QTY --order-type Limit \
--price $PERP_PRICE --validate -o json
# Short future
bitmex order sell XBTM25 $QTY --order-type Limit \
--price $FUT_PRICE --validate -o json
If validate output looks correct, submit both with --yes instead of --validate.
bitmex position list -o json \
| jq '[.[] | select(.symbol == "XBTUSD" or .symbol == "XBTM25")
| {symbol, currentQty, avgEntryPrice, unrealisedPnl}]'
Exit both legs when basis narrows to under 0.1% or at futures expiry.
bitmex market funding --symbol XBTUSD before entering.bitmex-basis-trading skill.