binance-public-data icon indicating copy to clipboard operation
binance-public-data copied to clipboard

How to discover delivery contracts?

Open dr1ver1 opened this issue 2 years ago • 16 comments

Hi, I'm want to automatically download (from Python) delivery contracts, e.g. BTCUSDT_220325 They are not in symbols.txt. How can I programmatically find out which delivery contracts are available?

dr1ver1 avatar Jul 09 '22 11:07 dr1ver1

The available trading symbols can be found from the endpoint GET /dapi/v1/exchangeInfo, it's reasonable to call it first and then download data of the symbols you find.

2pd avatar Jul 12 '22 02:07 2pd

The API only has live data and so does not contain historical contracts. The web file download is for historical. The web download should be self-contained - i.e. query what is available in order to then download.

dr1ver1 avatar Jul 12 '22 08:07 dr1ver1

OK, we will see if all CM futures symbols are available/

2pd avatar Jul 13 '22 06:07 2pd

Thanks - appreciate it - and also UM futures symbols please

dr1ver1 avatar Jul 13 '22 07:07 dr1ver1

Please find futures symbols from here:

https://github.com/binance/binance-public-data/tree/master/data

2pd avatar Jul 14 '22 02:07 2pd

Thanks for that. How will these be kept up to date? So what happens just after a contract has expired?

dr1ver1 avatar Jul 14 '22 04:07 dr1ver1

we try to keep them up to date. You are also welcome to get current symbols from endpoint /dapi/v3/exchangeInfo regularly.

2pd avatar Jul 14 '22 07:07 2pd

There are items missing from cm-futures-symbols.txt. For instance searching for "_211231" returns 5 contracts. https://data.binance.vision/?prefix=data/futures/cm/daily/klines/ has 9 contracts for _211231

dr1ver1 avatar Jul 18 '22 15:07 dr1ver1

Are the various symbols.txt files manually populated? (Hopefully not!) They could be populated by a query that looks at data.binance.vision and runs on a schedule (e.g. daily)

dr1ver1 avatar Jul 18 '22 15:07 dr1ver1

some 2206 and 2209 contracts are also missing from cm-futures-symbols.txt. I think there are other contracts missing for other months.

dr1ver1 avatar Jul 18 '22 17:07 dr1ver1

Are the various symbols.txt files manually populated? (Hopefully not!) They could be populated by a query that looks at data.binance.vision and runs on a schedule (e.g. daily)

symbols.txt contains part of the spot trading symbols, you can get all of them from the endpoint GET /api/v3/exchangeInfo

2pd avatar Jul 19 '22 02:07 2pd

some 2206 and 2209 contracts are also missing from cm-futures-symbols.txt. I think there are other contracts missing for other months.

we will verify the cm futures symbols.

2pd avatar Jul 19 '22 02:07 2pd

Please check again. #165

2pd avatar Jul 19 '22 03:07 2pd

ok - I can see all the contracts for BTCUSD and ETHUSD now

dr1ver1 avatar Jul 19 '22 08:07 dr1ver1

Are the various symbols.txt files manually populated? (Hopefully not!) They could be populated by a query that looks at data.binance.vision and runs on a schedule (e.g. daily)

symbols.txt contains part of the spot trading symbols, you can get all of them from the endpoint GET /api/v3/exchangeInfo

ok - I wasn't clear enough. Specifically, are cm-futures-symbols.txt and um-futures-symbols.txt populated manually? As I previously said, the endpoint GET /api/v3/exchangeInfo will not contain expired contracts. Someone would need to monitor contracts expiring and then update the the relevant cm/um symbols file accordingly.

Alternatively, for binance-public-data to be self-contained, it could for instance query https://data.binance.vision/ to see what data is stored, every day and then automatically update cm-futures-symbols.txt and um-futures-symbols.txt.

A process that relies on a manual update is not particularly robust. I'm building a trading system using this data.

dr1ver1 avatar Jul 19 '22 08:07 dr1ver1

Well since we have uploaded all data into the storage, users can get the symbol list from there. We will make a plan and see how to upload all symbols more frequently.

2pd avatar Jul 26 '22 01:07 2pd