def get_market_info_leaderboard(limit=100):
    """returns market leaderboard data for both the XCP and BTC markets"""
    # do two queries because we limit by our sorted results, and we might miss an asset with a high BTC trading value
    # but with little or no XCP trading activity, for instance if we just did one query
    assets_market_info_xcp = list(config.mongo_db.asset_market_info.find({}, {'_id': 0}).sort('market_cap_in_{}'.format(config.XCP.lower()), pymongo.DESCENDING).limit(limit))
    assets_market_info_btc = list(config.mongo_db.asset_market_info.find({}, {'_id': 0}).sort('market_cap_in_{}'.format(config.BTC.lower()), pymongo.DESCENDING).limit(limit))
    assets_market_info = {
        config.XCP.lower(): [a for a in assets_market_info_xcp if a['price_in_{}'.format(config.XCP.lower())]],
        config.BTC.lower(): [a for a in assets_market_info_btc if a['price_in_{}'.format(config.BTC.lower())]]
    }
    # throw on extended info, if it exists for a given asset
    assets = list(set([a['asset'] for a in assets_market_info[config.XCP.lower()]] + [a['asset'] for a in assets_market_info[config.BTC.lower()]]))
    extended_asset_info = config.mongo_db.asset_extended_info.find({'asset': {'$in': assets}})
    extended_asset_info_dict = {}
    for e in extended_asset_info:
        if not e.get('disabled', False):  # skip assets marked disabled
            extended_asset_info_dict[e['asset']] = e
    for r in (assets_market_info[config.XCP.lower()], assets_market_info[config.BTC.lower()]):
        for a in r:
            if a['asset'] in extended_asset_info_dict:
                extended_info = extended_asset_info_dict[a['asset']]
                if 'extended_image' not in a or 'extended_description' not in a or 'extended_website' not in a:
                    continue  # asset has been recognized as having a JSON file description, but has not been successfully processed yet
                a['extended_image'] = bool(extended_info.get('image', ''))
                a['extended_description'] = extended_info.get('description', '')
                a['extended_website'] = extended_info.get('website', '')
            else:
                a['extended_image'] = a['extended_description'] = a['extended_website'] = ''
    return assets_market_info