Hi all,

I want to analyze all of the avaliable USDT/BUSD instruments on Binance Futures. I made a simple script that generates the AssetsBinance.csv day-to-day, by just pulling the public fapi exchangeInfo:
Code
https://www.binance.com/fapi/v1/exchangeInfo

I've made a test Zorro script to see how it look like when I'm connecting to Binance Futures.

==== TLDR; ====

There are a lot of assets, and during the websocket subscribing, at some point it stops working, for example:
Code
!RSRUSDT: Subscribing...
!FEED_WS: readloop_handler: The WebSocket stream was gracefully closed at both endpoints
!RSRUSDT: Subscription failure: Book
Error 053: RSRUSDT unavailable at this time


The problem isn't what the log says, because if I put these problematic assets in the top of the AssetsBinance (and restarts Zorro), it connects flawlessly - the asset IS avaliable. So it should be something about the amount of assets.

Is there a trick that I can do for working with this scale?

Thank you!

==== DETALIS ====

Accounts.csv:
Code
Name,Broker,AccountId,User,Pass,Assets,CCY,Real,NFA,Plugin
binance,wss://fstream.binance.com,USDT,(key),(secret),AssetsBinance,USDT,1,14,BinanceFutures


AssetsBinance.csv:
Code
Name,Price,Spread,RollLong,RollShort,PIP,PIPCost,MarginCost,Leverage,LotAmount,Commission
AXSUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
ALPHAUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
BTCUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
ETHUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
BCHUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
XRPUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
EOSUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
LTCUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
TRXUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
ETCUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
LINKUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
XLMUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
ADAUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
XMRUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
DASHUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
ZECUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
XTZUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
BNBUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
ATOMUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
ONTUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
IOTAUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
BATUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
VETUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
NEOUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
QTUMUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
IOSTUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
THETAUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
ALGOUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
ZILUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
KNCUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
ZRXUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
COMPUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
OMGUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
DOGEUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
SXPUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
KAVAUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
BANDUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
BANDUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
RLCUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
WAVESUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
MKRUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
SNXUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
DOTUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
DEFIUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
YFIUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
BALUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
CRVUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
TRBUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
YFIIUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
RUNEUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
SUSHIUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
SRMUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
EGLDUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
SOLUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
ICXUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
STORJUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
BLZUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
UNIUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
AVAXUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
FTMUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
HNTUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
ENJUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
FLMUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
TOMOUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
RENUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
KSMUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
NEARUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
AAVEUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
FILUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
RSRUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
LRCUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
MATICUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
OCEANUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
CVCUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
BELUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
CTKUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
ZENUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
SKLUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
GRTUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
1INCHUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
BTCBUSD,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
AKROUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
CHZUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
SANDUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
ANKRUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
LUNAUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
BTSUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
LITUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
UNFIUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
DODOUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
REEFUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
RVNUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
SFPUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
XEMUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
BTCSTUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
COTIUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
CHRUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
MANAUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
ALICEUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
HBARUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
ONEUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
LINAUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
STMXUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
DENTUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
CELRUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
HOTUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
MTLUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
OGNUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
NKNUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
SCUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
DGBUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
1000SHIBUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
ICPUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
BAKEUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
GTCUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
ETHBUSD,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
BTCDOMUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
TLMUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
BNBBUSD,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
ADABUSD,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
XRPBUSD,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
IOTXUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
DOGEBUSD,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
AUDIOUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
RAYUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
C98USDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
MASKUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
ATAUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
SOLBUSD,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
FTTBUSD,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
DYDXUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
1000XECUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
GALAUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
CELOUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
ARUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
KLAYUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
ARPAUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
CTSIUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
LPTUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
ENSUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
BTCUSDT_220325,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
ETHUSDT_220325,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
PEOPLEUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
ANTUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
ROSEUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
DUSKUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
1000BTTCUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
FLOWUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
IMXUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
API3USDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
ANCUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1
GMTUSDT,0.01,0.0001,0,0,0.000001,0.000001,0,1,1,-0.1


testConnection.c Zorro Code:
Code
function run(){
	set(LOGFILE);
	setf(PlotMode, PL_LONG+PL_FINE+PL_FILE+PL_ALL);
	LookBack = 100;
	StartDate = NOW;
	Verbose = 7+DIAG;
	while(loop(Assets)){
		asset(Loop1);
		if (!is(LOOKBACK)){
			printf("- %s %0.6f\n", Asset, priceClose());
		}
	}
}


When I try this with just some assets it works fine, I see a lot of these records:
Code
...
!FLMUSDT: Subscribing...
Warning 054: FLMUSDT PIP 0.000001000 -> 0.0001000!
BrokerHistory FLMUSDT: 1201 ms
!FLMUSDT 02-13 03:10:52 to 03-17 07:10:52
!=> 03-10 00:00:00 to 03-17 07:00:00, 176 ticks
Load FLMUSDT prices..
BrokerHistory FLMUSDT: 2147 ms
!FLMUSDT 02-13 03:10:52 to 03-09 23:30:00
!=> 03-02 16:00:00 to 03-09 23:00:00, 176 ticks 352 h
FLMUSDT 352 ticks read
FLMUSDT: 0..9117

!TOMOUSDT: Subscribing...
Warning 054: TOMOUSDT PIP 0.000001000 -> 0.0001000!
BrokerHistory TOMOUSDT: 1902 ms
!TOMOUSDT 02-13 03:10:56 to 03-17 07:10:56
!=> 03-10 00:00:00 to 03-17 07:00:00, 176 ticks
Load TOMOUSDT prices..
BrokerHistory TOMOUSDT: 962 ms
!TOMOUSDT 02-13 03:10:56 to 03-09 23:30:00
!=> 03-02 16:00:00 to 03-09 23:00:00, 176 ticks 352 h
TOMOUSDT 352 ticks read
TOMOUSDT: 0..9117
...


Then at some point, this is getting started:

Code
...
!NEARUSDT: Subscribing...
!FEED_WS: readloop_handler: The WebSocket stream was gracefully closed at both endpoints
!NEARUSDT: Subscription failure: BookDepthPartial
Error 053: NEARUSDT unavailable at this time
!FEED_WS: readloop_handler: unspecified system error
!BrokerAsset: stopped
Error 053: AAVEUSDT unavailable at this time
!FILUSDT: Subscribing...
!FILUSDT: Subscription failure: BookDepthPartial
Error 053: FILUSDT unavailable at this time
!FEED_WS: readloop_handler: The WebSocket stream was gracefully closed at both endpoints
!RSRUSDT: Subscribing...
!FEED_WS: readloop_handler: The WebSocket stream was gracefully closed at both endpoints
!RSRUSDT: Subscription failure: Book
Error 053: RSRUSDT unavailable at this time
!LRCUSDT: Subscribing...
!FEED_WS: readloop_handler: The WebSocket stream was gracefully closed at both endpoints
!LRCUSDT: Subscription failure: Book
Error 053: LRCUSDT unavailable at this time
!MATICUSDT: Subscribing...
...


Sometimes there are some success in the middle of these unseccessful connects (SKLUSDT):
Code
!ZENUSDT: Subscribing...
!FEED_WS: readloop_handler: The WebSocket stream was gracefully closed at both endpoints
!ZENUSDT: Subscription failure: Book
Error 053: ZENUSDT unavailable at this time
!SKLUSDT: Subscribing...
Warning 054: SKLUSDT PIP 0.000001000 -> 0.00001000!
BrokerHistory SKLUSDT: 1219 ms
!SKLUSDT 02-13 03:21:03 to 03-17 07:21:03
!=> 03-10 00:00:00 to 03-17 07:00:00, 176 ticks
Load SKLUSDT prices..
BrokerHistory SKLUSDT: 1873 ms
!SKLUSDT 02-13 03:21:03 to 03-09 23:30:00
!=> 03-02 16:00:00 to 03-09 23:00:00, 176 ticks 352 h
SKLUSDT 352 ticks read
SKLUSDT: 0..9117
!GRTUSDT: Subscribing...
!GRTUSDT: Subscription failure: Book
Error 053: GRTUSDT unavailable at this time
!FEED_WS: readloop_handler: The WebSocket stream was gracefully closed at both endpoints
!FEED_WS: readloop_handler: unspecified system error
!BrokerAsset: stopped
Error 053: 1INCHUSDT unavailable at this time


So as mentioned above, the problem isn't what the log says, because if I put these problematic assets in the top of the AssetsBinance (and restarts Zorro), it connects flawlessly - the asset IS avaliable. So it should be something about the amount of assets.

Is there a trick that I can do for working with this scale?

Thank you!

Last edited by NorbertSz; 03/17/22 08:17.