跳至主要内容

用戶希臘字母信息 (期權)

訂閱用戶希臘字母數據推送

Topic: greeks

響應參數

參數類型說明
idstring消息id
topicstringTopic名
creationTimenumber消息數據創建時間
dataarrayObject
> baseCoinstring交易幣種
> totalDeltastringDelta值
> totalGammastringGamma值
> totalVegastringVega值
> totalThetastringTheta值

訂閱示例

{
"op": "subscribe",
"args": [
"greeks"
]
}
from pybit.unified_trading import WebSocket
from time import sleep
ws = WebSocket(
testnet=True,
channel_type="private",
api_key="XXXXX",
api_secret="XXXXX",
)
def handle_message(message):
print(message)
ws.greek_stream(callback=handle_message)
while True:
sleep(1)

推送示例

{
"id": "592324fa945a30-2603-49a5-b865-21668c29f2a6",
"topic": "greeks",
"creationTime": 1672364262482,
"data": [
{
"baseCoin": "ETH",
"totalDelta": "0.06999986",
"totalGamma": "-0.00000001",
"totalVega": "-0.00000024",
"totalTheta": "0.00001314"
}
]
}