URL: wss://futures.kraken.com/ws/v1
WebSocketプライベートフィードへのサブスクライブおよびアンサブスクライブのリクエストには、ユーザーのapi_secretで署名されたチャレンジメッセージが必要です。
チャレンジは、WebSocket API パブリックセクション(api_key を使用)に示されている方法で取得します。
認証済みリクエストには、元のチャレンジメッセージ(original_challenge)と署名済みチャレンジ(signed_challenge)の両方を JSON 形式で含める必要があります。
Websockets チャレンジを取得するには、API キーと API シークレットを Kraken Options コンポーネントに設定する必要があります。API キーはアカウントの Kraken から提供されます。
Kraken.ApiKey := 'api key';
Kraken.ApiSecret := 'api secret';
このサブスクリプションフィードは、ユーザーのオープンオーダーに関する情報を公開します。このフィードは、板に約定しなかったすべての post-only 注文に関する追加情報を提供します。
SubscribeOpenOrdersVerbose();
後で UnSubscribeOpenOrdersVerbose メソッドを呼び出して OpenOrdersVerbose からサブスクライブ解除できます。
UnSubscribeOpenOrdersVerbose();
サーバーからのレスポンス例
{ 'feed':'open_orders_verbose_snapshot', 'account':'0f9c23b8-63e2-40e4-9592-6d5aa57c12ba', 'orders':[
{ 'instrument':'PI_XBTUSD', 'time':1567428848005, 'last_update_time':1567428848005, 'qty':100.0, 'filled':0.0, 'limit_price':8500.0, 'stop_price':0.0, 'type':'limit', 'order_id':'566942c8-a3b5-4184-a451-622b09493129', 'direction':0, 'reduce_only':False } ]}
このサブスクリプションフィードはユーザーアカウントのオープンポジションを発行します。
SubscribeOpenPositions();
後で、UnSubscribeOpenPositions メソッドを呼び出して OpenPositions からアンサブスクライブできます。
UnSubscribeOpenPositions();
サーバーからのレスポンス例
{
"feed": "open_positions",
"account": "DemoUser",
"positions": [{
"instrument": "fi_xbtusd_180316",
"balance": 2000.0,
"entry_price": 11675.86541981,
"mark_price": 11090.0,
"index_price": 12290.550000000001,
"pnl": -0.00905299
}]
}
このサブスクリプションフィードはアカウント情報を配信します。
SubscribeAccountLog();
後で UnSubscribeAccountLog メソッドを呼び出すことで AccountLog のサブスクリプションを解除できます。
UnSubscribeAccountLog();
サーバーからのレスポンス例
{
'feed': 'account_log_snapshot',
'logs': [{
'id': 1690,
'date': '2019-07-11T08:00:00.000Z',
'asset': 'bch',
'info': 'funding
rate change ','
booking_uid ':'
86 fdc252 - 1 b6e - 40 ec - ac1d - c7bd46ddeebf ','
margin_account ':'
f - bch: usd ','
old_balance ':0.01215667051,'
new_balance ':0.01215736653,'
old_average_entry_price ':0.0,'
new_average_entry_price ':0.0,'
trade_price ':0.0,'
mark_price ':0.0,'
realized_pnl ':0.0,'
fee ':0.0,'
execution ':'
','
collateral ':'
bch ','
funding_rate ':-8.7002552653e-08,'
realized_funding ':6.9602e-07}]
}
このサブスクリプションフィードはフィル情報を発行します。
SubscribeFills();
後で UnSubscribeFills メソッドを呼び出すことで Fills のサブスクライブを解除できます。
UnSubscribeFills();
サーバーからのレスポンス例
{
"feed":"fills_snapshot",
"account":"DemoUser",
"fills":[
{
"instrument":"FI_XBTUSD_200925",
"time":1600256910739,
"price":10937.5,
"seq":36,
"buy":true,
"qty":5000.0,
"order_id":"9e30258b-5a98-4002-968a-5b0e149bcfbf",
"fill_id":"cad76f07-814e-4dc6-8478-7867407b6bff",
"fill_type":"maker",
"fee_paid":-0.00009142857,
"fee_currency":"BTC"
}]
}
このサブスクリプションフィードは、ユーザーのオープンオーダーに関する情報を配信します。
SubscribeOpenOrders();
後で、UnSubscribeOpenOrders メソッドを呼び出して OpenOrders のサブスクライブを解除できます
UnSubscribeOpenOrders();
サーバーからのレスポンス例
{
"feed": "open_orders_snapshot",
"account": "e258dba9-4dd4-4da5-bfef-75beb91c098e",
"orders": [
{
"instrument": "PI_XBTUSD",
"time": 1612275024153,
"last_update_time": 1612275024153,
"qty": 1000,
"filled": 0,
"limit_price": 34900,
"stop_price": 13789,
"type": "stop",
"order_id": "723ba95f-13b7-418b-8fcf-ab7ba6620555",
"direction": 1,
"reduce_only": false,
"triggerSignal": "last"
}
]
}
このサブスクリプションフィードはクライアントのアカウントの残高とマージン情報を返します。
SubscribeAccountBalanceAndMargins();
後で UnSubscribeAccountBalanceAndMargins メソッドを呼び出してアカウント残高の購読を解除できます
UnSubscribeAccountBalanceAndMargins();
サーバーからのレスポンス例
{
"feed": "account_balances_and_margins",
"account": "DemoUser",
"margin_accounts": [
{
"name": "xbt",
"balance": 0,
"pnl": 0,
"funding": 0,
"pv": 0,
"am": 0,
"im": 0,
"mm": 0
},
{
"name": "f-xbt:usd",
"balance": 9.99730211055,
"pnl": -0.00006034858674327812,
"funding": 0,
"pv": 9.997241761963258,
"am": 9.99666885201038,
"im": 0.0005729099528781564,
"mm": 0.0002864549764390782
},
],
"seq": 14
}
このサブスクリプションフィードはクライアントに通知を発行します。
SubscribeNotifications();
後で UnSubscribeNotifications メソッドを呼び出して通知の購読を解除できます
UnSubscribeNotifications();
サーバーからのレスポンス例
{
"feed":"notifications_auth",
"notifications":[
{
"id":5,
"type":"market",
"priority":"low",
"note":"通知を説明するメモ。",
"effective_time":1520288300000
},
...
]
}