mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-09 08:18:07 +00:00
Update Binance WebSocket configuration and enhance depth handling
- Changed WebSocket base URL to support both spot and futures trading. - Adjusted depth tracking parameters for improved performance, increasing the ratio and reducing speed. - Enhanced payload parsing to accommodate additional data structures from Binance, ensuring robust handling of bids and asks. - Updated comments for clarity on connection behavior and heartbeat monitoring.
This commit is contained in:
@@ -190,10 +190,10 @@ export class MakerPointsEngine {
|
||||
this.priceTick = Math.max(1e-9, this.config.priceTick);
|
||||
this.qtyStep = Math.max(1e-9, this.config.qtyStep);
|
||||
this.binanceDepth = new BinanceDepthTracker(resolveBinanceSymbol(this.config.symbol), {
|
||||
baseUrl: process.env.BINANCE_WS_URL,
|
||||
baseUrl: process.env.BINANCE_SPOT_WS_URL ?? process.env.BINANCE_WS_URL,
|
||||
levels: 20,
|
||||
ratio: 5,
|
||||
speedMs: 500,
|
||||
ratio: 9,
|
||||
speedMs: 100,
|
||||
logger: (context, error) => {
|
||||
this.tradeLog.push("warn", `Binance ${context} 异常: ${extractMessage(error)}`);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user