Updated

Bybit USDT spot–linear-perp basis arb(multi-symbol)

spot-future-arb

所有交易 symbol 喺同一個 algo/spot-future-arb/config.json(根設定 + instances[]);Start 會每幣起一個 C++ subprocess(--instance <id>)。下表一眼睇晒邊個 run緊、LIVE/DRY、algo 狀態、掛單數、送單/成交比例。

Idle

config.json

直接編輯伺服器上 algo/spot-future-arb/config.json;API key 請放 algo/bybit-account.json儲存前會驗證每個 instance 合併設定;若 fleet 當時跑緊,會自動 Stop 再 Start 套用新檔。

Live fleet(營運總表)

每行對應 config.jsoninstances[] 一條;跑緊=subprocess 存活;LIVE=真落單;單/填=stdout METRIC 累計送單/成交;掛單=algo 視角 open orders。

id 跑緊 LIVE 合約對 algo 方向 bps 信號 spot future algo現 algo期 現貨錢包 交易所期 掛單 單/填 動作 錯誤

Current Algo State & Holdings

對照交易所實際持倉與 C++ algo 內部倉位(上表每行一幣);重啟後讀各自 persisted snapshot(state_path)。

snapshot —
Spot(首幣種) exchange — algo —
Future(首幣種) exchange — algo —
State direction —
Last Action error —

Account Status / Info

Trade Logic

basis = future_mid / spot_mid - 1 basis_bps = basis × 10,000;10 bps = 0.1%。正數代表 future 比 spot 貴。
basis > threshold Long spot + short future;先追 spot entry,成交後才開 race exit。
basis < -threshold Sell spot + long future;只有 base coin(如 BTC)現貨 inventory 足夠時才允許 short spot entry。
Halted 安全停機狀態:C++ 保持運行但不再開新倉,用來避免 create/cancel/unwind 失敗後重複交易。

stdout