completed base for query and encoding functions as well as initial market cap querying and filtering