トレーディング
注文のキャンセル
Cancellation is free, best-effort, and idempotent. Today you can cancel one order at a time per request. Bulk cancel — by ID list, by market, or account-wide — is planned; see the workaround below until it ships. A race window exists in all modes: in-flight fills committed before your cancel reaches the matcher will still complete.
単件注文のキャンセル
注文IDがある場合はDELETEを使用します。レスポンスでキャンセルを確認できます。DELETEを2回呼び出しても安全です。
POST /api/v1/orders/:id/cancel
Authorization: Bearer $SATORIEX_TOKEN
202 Accepted -> { "code": 0, "data": { ...full order object with status "cancelled" } }一括キャンセル
計画中3つの一括パターンがサポートされています:IDのリスト、1マーケットの全注文、パニックボタン — アカウントの全オープン注文。
その間、クライアントサイドで単件キャンセルエンドポイントをループしてください。キャンセルは無料で高速なため、緊急アンワインドにはオープン注文リストの短いループが有効です。
# Today: cancel one order at a time.
for id in "${ORDER_IDS[@]}"; do
curl -X POST https://staging.satoriex.io/api/v1/orders/$id/cancel \
-H "Authorization: Bearer $SATORIEX_TOKEN"
doneパニックキャンセルは数秒に1回のレート制限があります — 緊急アンワインド用であり、通常フローには使用しないでください。
キャンセルできるもの
| 注文の状態 | キャンセル可能? | 備考 |
|---|---|---|
| pending | はい | Flagged for cancel; the matcher skips it on next processing — the order has not yet been added to the book. |
| open | はい | Resting in the book; cancel removes it immediately. This is the common cancel case. |
| partial | はい(残りのみ) | 既に約定したシェアはポジションに残ります。未約定の残りのみキャンセルされます。 |
| filled | いいえ | 既に決済済み — 操作不可。 |
| cancelled | べき等 | 再呼び出しは同じ成功レスポンスを返します。 |
キャンセルは遡及しません
キャンセルがマッチングの1ミリ秒後に到着した場合、取引は成立しています。このウィンドウを許容できる戦略を構築してください — 重要な場合はIOCまたはFOKの有効期限を使用してください。