gate-exchange-futures
Gate ExchangeのUSDT無期限先物取引機能で、ポジションの新規建て、決済、注文のキャンセルや修正を、トリガーフレーズを使ってスムーズに行えるようにサポートするSkill。
📜 元の英語説明(参考)
The USDT perpetual futures trading function of Gate Exchange: open position, close position, cancel order, amend order. Trigger phrases: open position, close position, cancel order, amend order, reverse, close all.
🇯🇵 日本人クリエイター向け解説
Gate ExchangeのUSDT無期限先物取引機能で、ポジションの新規建て、決済、注文のキャンセルや修正を、トリガーフレーズを使ってスムーズに行えるようにサポートするSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o gate-exchange-futures.zip https://jpskill.com/download/19134.zip && unzip -o gate-exchange-futures.zip && rm gate-exchange-futures.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/19134.zip -OutFile "$d\gate-exchange-futures.zip"; Expand-Archive "$d\gate-exchange-futures.zip" -DestinationPath $d -Force; ri "$d\gate-exchange-futures.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
gate-exchange-futures.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
gate-exchange-futuresフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 6
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
[Skill 名] gate-exchange-futures
Gate 先物取引スイート
このスキルは、Gate USDT 無期限先物取引の単一エントリーです。以下の4つの操作のみをサポートしています。建玉の開始、建玉の決済、注文のキャンセル、注文の修正。ユーザーの意図は、一致するワークフローにルーティングされます。
モジュール概要
| モジュール | 説明 | トリガーキーワード |
|---|---|---|
| Open | 指値/成行でのロングまたはショートの建玉、クロスマージン/分離マージンモード | long, short, buy, sell, open |
| Close | 全決済、部分決済、ポジション反転 | close, close all, reverse |
| Cancel | 1つまたは複数の注文をキャンセル | cancel, revoke |
| Amend | 注文価格またはサイズを変更 | amend, modify |
ルーティングルール
| 意図 | 例となるフレーズ | ルート先 |
|---|---|---|
| 建玉の開始 | "BTC long 1 contract", "market short ETH", "10x leverage long" | references/open-position.md を参照 |
| 建玉の決済 | "close all BTC", "close half", "reverse to short", "close everything" | references/close-position.md を参照 |
| 注文のキャンセル | "cancel that buy order", "cancel all orders", "list my orders" | references/cancel-order.md を参照 |
| 注文の修正 | "change price to 60000", "change order size" | references/amend-order.md を参照 |
| 不明確 | "help with futures", "show my position" | 明確化: ポジション/注文を照会し、ユーザーをガイド |
実行ワークフロー
1. 意図とパラメータ
- モジュール(Open/Close/Cancel/Amend)を決定します。
contract,side,size,price,leverageを抽出します。- 不足: 必須パラメータ(例:サイズ)が不足している場合は、ユーザーに尋ねます(明確化モード)。
2. 事前チェック
-
契約:
get_futures_contractを呼び出し、契約が存在し取引可能であることを確認します。 -
アカウント: 残高と競合するポジション(例:マージンモードを切り替える場合)を確認します。
-
リスク:
order_price_deviateから有効な指値価格を事前に計算しません(実際の乖離制限はrisk_limit_tierに依存します)。PRICE_TOO_DEVIATEDの場合は、エラーメッセージから有効な範囲を表示します。 -
マージンモード vs ポジションモード(ユーザーが明示的にマージンモードを要求し、それが現在のモードと異なる場合のみ):
get_futures_accounts(settle)を呼び出してポジションモードを取得します。応答のposition_modeから:single= シングルポジションモード、dual= デュアル(ヘッジ)ポジションモード。ポジションからのマージンモード:上記のデュアル/シングルごとのポジション照会を使用 →pos_margin_mode(クロス/分離)。ユーザーがマージンモードを指定しなかった場合、切り替えません。現在のモードで注文を配置します。- シングルポジション(
position_mode === "single"):中断しません。ユーザーにプロンプトを表示します:「すでに{currency}のポジションがあります。マージンモードを切り替えると、このポジションにも適用されます。続行しますか?」(例:契約からの通貨:BTC_USDT → BTC)。ユーザーの確認を待ってから続行します。 - デュアルポジション(
position_mode === "dual"):フローを中断します。ユーザーに伝えます:「まずポジションを決済してから、新しいポジションをオープンしてください。」
- シングルポジション(
-
デュアルモード vs シングルモード(APIの選択): まず
get_futures_accounts(settle)を呼び出します。position_mode === "dual"(またはin_dual_mode === true)の場合:- ポジション/レバレッジ照会:
list_futures_positions(settle, holding=true)またはget_futures_dual_mode_position(settle, contract)を使用します。デュアルモードではget_futures_positionを使用しません(APIは配列を返し、解析エラーを引き起こします)。 - マージンモード切り替え:
update_futures_dual_comp_position_cross_mode(settle, contract, mode)を使用します(デュアルモードではupdate_futures_position_cross_modeを使用しません)。 - レバレッジ:
update_futures_dual_mode_position_leverage(settle, contract, leverage)を使用します(デュアルモードではupdate_futures_position_leverageを使用しません。配列を返し、解析エラーを引き起こします)。 シングルモードの場合:ポジションにはget_futures_position(settle, contract)を使用します。モード切り替えにはupdate_futures_dual_comp_position_cross_modeを使用します。レバレッジにはupdate_futures_position_leverageを使用します。
- ポジション/レバレッジ照会:
3. モジュールロジック
モジュール A: 建玉の開始
- 単位変換: ユーザーが契約単位でサイズを指定しない場合、
get_futures_contractからmark_price,quanto_multiplierを取得し、変換します。- U (USDT想定元本): 契約数 = U ÷ mark_price ÷ quanto_multiplier (レバレッジなし); レバレッジあり: 契約数 = U × leverage ÷ mark_price ÷ quanto_multiplier
- ベース (例: BTC, ETH): 契約数 = base_amount ÷ quanto_multiplier
order_size_minとサイズの精度に合わせて丸め/切り捨てを行います。
- モード: ユーザーが明示的に要求した場合にのみマージンモードを切り替えます。ユーザーが明示的に分離マージンを要求した場合(例:「isolated」、「逐仓」)にのみ分離マージンに切り替えます。ユーザーが明示的にクロスマージンを要求した場合(例:「cross」、「全仓」)にのみクロスマージンに切り替えます。ユーザーがマージンモードを指定しない場合、切り替えません。現在のマージンモード(ポジションの
pos_margin_modeから)で注文を配置します。ユーザーが明示的に分離マージンを希望する場合、レバレッジを確認します。 - モード切り替え: ユーザーが明示的にマージンモードを要求し、それが現在のモードと異なる場合(現在のモードはポジションの
pos_margin_modeから)、update_futures_dual_comp_position_cross_modeを呼び出す前に:get_futures_accounts(settle)→position_mode(シングル/デュアル)を介してポジションモードを取得します。position_mode === "single"の場合、プロンプト「すでに{currency}のポジションがあります。マージンモードを切り替えると、このポジションにも適用されます。続行しますか?」を表示し、ユーザーが確認した場合にのみ続行します。position_mode === "dual"の場合、切り替えません。中断してユーザーに「まずポジションを決済してから、新しいポジションをオープンしてください。」と伝えます。 - モード切り替え(競合なし): ユーザーが明示的にクロスマージンまたは分離マージンを要求し、そのターゲットが現在のモードと異なる場合のみ:ポジションがない場合、またはシングルポジションでユーザーが確認した場合、
modeを"CROSS"または"ISOLATED"としてupdate_futures_dual_comp_position_cross_mode(settle, contract, mode)を呼び出します。ユーザーが明示的にマージンモードを要求しなかった場合、切り替えません。 - レバレッジ: ユーザーがレバレッジを指定し、それが現在のレバレッジと異なる場合(上記のデュアル/シングルごとのポジション照会から)
(原文はここで途切れています)
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Gate Futures Trading Suite
This skill is the single entry for Gate USDT perpetual futures. It supports four operations only: open position, close position, cancel order, amend order. User intent is routed to the matching workflow.
Module overview
| Module | Description | Trigger keywords |
|---|---|---|
| Open | Limit/market open long or short, cross/isolated mode | long, short, buy, sell, open |
| Close | Full close, partial close, reverse position | close, close all, reverse |
| Cancel | Cancel one or many orders | cancel, revoke |
| Amend | Change order price or size | amend, modify |
Routing rules
| Intent | Example phrases | Route to |
|---|---|---|
| Open position | "BTC long 1 contract", "market short ETH", "10x leverage long" | Read references/open-position.md |
| Close position | "close all BTC", "close half", "reverse to short", "close everything" | Read references/close-position.md |
| Cancel orders | "cancel that buy order", "cancel all orders", "list my orders" | Read references/cancel-order.md |
| Amend order | "change price to 60000", "change order size" | Read references/amend-order.md |
| Unclear | "help with futures", "show my position" | Clarify: query position/orders, then guide user |
Execution workflow
1. Intent and parameters
- Determine module (Open/Close/Cancel/Amend).
- Extract:
contract,side,size,price,leverage. - Missing: if required params missing (e.g. size), ask user (clarify mode).
2. Pre-flight checks
-
Contract: call
get_futures_contractto ensure contract exists and is tradeable. -
Account: check balance and conflicting positions (e.g. when switching margin mode).
-
Risk: do not pre-calculate valid limit price from
order_price_deviate(actual deviation limit depends on risk_limit_tier). OnPRICE_TOO_DEVIATED, show the valid range from the error message. -
Margin mode vs position mode (only when user explicitly requested a margin mode and it differs from current): call
get_futures_accounts(settle)to get position mode. From responseposition_mode:single= single position mode,dual= dual (hedge) position mode. Margin mode from position: use position query per dual/single above →pos_margin_mode(cross/isolated). If user did not specify margin mode, do not switch; place order in current mode.- Single position (
position_mode === "single"): do not interrupt. Prompt user: "You already have a {currency} position; switching margin mode will apply to this position too. Continue?" (e.g. currency from contract: BTC_USDT → BTC). Wait for user confirmation, then continue. - Dual position (
position_mode === "dual"): interrupt flow. Tell user: "Please close the position first, then open a new one."
- Single position (
-
Dual mode vs single mode (API choice): call
get_futures_accounts(settle)first. Ifposition_mode === "dual"(orin_dual_mode === true):- Position / leverage query: use
list_futures_positions(settle, holding=true)orget_futures_dual_mode_position(settle, contract). Do not useget_futures_positionin dual mode (API returns an array and causes parse error). - Margin mode switch: use
update_futures_dual_comp_position_cross_mode(settle, contract, mode)(do not useupdate_futures_position_cross_modein dual mode). - Leverage: use
update_futures_dual_mode_position_leverage(settle, contract, leverage)(do not useupdate_futures_position_leveragein dual mode; it returns array and causes parse error). If single mode: useget_futures_position(settle, contract)for position;update_futures_dual_comp_position_cross_modefor mode switch;update_futures_position_leveragefor leverage.
- Position / leverage query: use
3. Module logic
Module A: Open position
- Unit conversion: if user does not specify size in contracts, get
mark_price,quanto_multiplierfromget_futures_contract, then convert:- U (USDT notional): contracts = u ÷ mark_price ÷ quanto_multiplier (no leverage); with leverage: contracts = u × leverage ÷ mark_price ÷ quanto_multiplier
- Base (e.g. BTC, ETH): contracts = base_amount ÷ quanto_multiplier
- Round/truncate to
order_size_minand size precision.
- Mode: Switch margin mode only when the user explicitly requests it: switch to isolated only when user explicitly asks for isolated (e.g. "isolated", "逐仓"); switch to cross only when user explicitly asks for cross (e.g. "cross", "全仓"). If the user does not specify margin mode, do not switch — place the order in the current margin mode (from position
pos_margin_mode). If user explicitly wants isolated, check leverage. - Mode switch: only when user explicitly requested a margin mode and it differs from current (current from position:
pos_margin_mode), then before callingupdate_futures_dual_comp_position_cross_mode: get position mode viaget_futures_accounts(settle)→position_mode(single/dual); ifposition_mode === "single", show prompt "You already have a {currency} position; switching margin mode will apply to this position too. Continue?" and continue only after user confirms; ifposition_mode === "dual", do not switch—interrupt and tell user "Please close the position first, then open a new one." - Mode switch (no conflict): only when user explicitly requested cross or isolated and that target differs from current: if no position, or single position and user confirmed, call
update_futures_dual_comp_position_cross_mode(settle, contract, mode)withmode"CROSS"or"ISOLATED". Do not switch if the user did not explicitly request a margin mode. - Leverage: if user specified leverage and it differs from current (from position query per dual/single above), call
update_futures_dual_mode_position_leveragein dual mode orupdate_futures_position_leveragein single mode first, then proceed. - Pre-order confirmation: get current leverage from position query (dual:
list_futures_positionsorget_futures_dual_mode_position; single:get_futures_position) for contract + side. Show final order summary (contract, side, size, price or market, mode, leverage, estimated margin/liq price). Ask user to confirm (e.g. "Reply 'confirm' to place the order."). Only after user confirms, place order. - Place order: call
create_futures_order(market:tif=ioc,price=0). - Verify: confirm position via position query (dual:
list_futures_positions(holding=true)orget_futures_dual_mode_position; single:get_futures_position).
Module B: Close position
- Position: get current
sizeand side via position query (dual:list_futures_positions(settle, holding=true)orget_futures_dual_mode_position(settle, contract); single:get_futures_position(settle, contract)). - Branch: full close (query then close with reduce_only); partial (compute size,
create_futures_orderreduce_only); reverse (close then open opposite in two steps). - Verify: confirm remaining position via same position query as step 1.
Module C: Cancel order
- Locate: by order_id, or
list_futures_ordersand let user choose. - Cancel: single
cancel_futures_orderonly (no batch cancel). - Verify:
finish_as==cancelled.
Module D: Amend order
- Check: order status must be
open. - Precision: validate new price/size against contract.
- Amend: call
amend_futures_orderto update price or size.
Report template
After each operation, output a short standardized result.
Safety rules
Confirmation
- Open: show final order summary (contract, side, size, price/market, mode, leverage, estimated liq/margin), then ask for confirmation before
create_futures_order. Do not add text about mark price vs limit price, order_price_deviate, or suggesting to adjust price. Example: "Reply 'confirm' to place the order." - Close all, reverse, batch cancel: show scope and ask for confirmation. Example: "Close all positions? Reply to confirm." / "Cancel all orders for this contract. Continue?"
Errors
| Code | Action |
|---|---|
BALANCE_NOT_ENOUGH |
Suggest deposit or lower leverage/size. |
PRICE_TOO_DEVIATED |
Extract actual valid price range from the error message and show to user (do not rely on contract order_price_deviate; actual limit depends on risk_limit_tier). |
POSITION_HOLDING (mode switch) |
API returns this (not POSITION_NOT_EMPTY). Ask user to close position first. |
CONTRACT_NOT_FOUND |
Contract invalid or not tradeable. Confirm contract name (e.g. BTC_USDT) and settle; suggest listing contracts. |
ORDER_NOT_FOUND |
Order already filled, cancelled, or wrong order_id. Suggest checking order history. |
SIZE_TOO_LARGE |
Order size exceeds limit. Suggest reducing size or check contract order_size_max. |
ORDER_FOK |
FOK order could not be filled entirely. Suggest different price/size or use GTC/IOC. |
ORDER_POC |
POC order would have taken liquidity; exchange rejected. Suggest different price for maker-only. |
INVALID_PARAM_VALUE |
Often in dual mode when wrong API or params used (e.g. update_futures_position_cross_mode or update_futures_position_leverage in dual). Use dual-mode APIs: update_futures_dual_comp_position_cross_mode, update_futures_dual_mode_position_leverage; for position use list_futures_positions or get_futures_dual_mode_position. |
同梱ファイル
※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。
- 📄 SKILL.md (10,070 bytes)
- 📎 README.md (1,895 bytes)
- 📎 references/amend-order.md (5,916 bytes)
- 📎 references/cancel-order.md (6,239 bytes)
- 📎 references/close-position.md (8,278 bytes)
- 📎 references/open-position.md (14,769 bytes)