LUCIT-Systems-and-Development / unicorn-fy

A Python SDK by LUCIT to convert received raw data from crypto exchange API endpoints into well-formed python dictionaries.
https://unicorn-fy.docs.lucit.tech
MIT License
54 stars 20 forks source link

Updated All Futures Market Streams, Implemented Proper Coin-Futures Handling #39

Closed Tidone closed 10 months ago

Tidone commented 2 years ago

PR Details

Description

Updated all futures market streams:

Related Issue

26

Motivation and Context

How Has This Been Tested

Types of changes

Checklist

Tidone commented 2 years ago

Plese wait a bit before you merge this.

I forgot to check & update some of the more obscure streams. I will do that in the next few days.

oliver-zehentleitner commented 2 years ago

thanks for the updates, sure i wait :)

Tidone commented 2 years ago

This PR is now ready.

I checked & updated all futures streams. I also properly implemented all coin-futures streams.

Tidone commented 2 years ago

The explicit call to .keys() is not only not necessary but will also be much slower because a new list of all keys is generated and searched linearly, instead of using the dictionary's hashing algorithm.

in checks if a key is in a dictionary: if 'key' in dict:

If you want to check the values too you have to explicitly call .values(): if 'value' in dict.values():

Also see these SO answers.

oliver-zehentleitner commented 2 years ago

Cool, I did not expect this:

d = {'a': 1, 'b': 2}

if 'a' in d:
    print(f"Key found!")

if '2' in d:
    print(f"Value found!")

Thank you!

Tidone commented 2 years ago

Btw, both PRs are ready to be merged.

oliver-zehentleitner commented 10 months ago

Thanks again and sorry it took so long, but the UNICORN Binance Suite has become a full-time job and I only now have the resources for further development.