def base_quote_short_from_asset_pair(ap_str):
    """Try to identify the short version of the base and quote of the asset pair"""
    ap_str = ap_str.upper()
    if len(ap_str) == 8:
        base = ap_str[1:4] if ap_str[0] in ['Z', 'X'] else ap_str[:4]
        quote = ap_str[5:] if ap_str[4] in ['Z', 'X'] else ap_str[4:]
    elif len(ap_str) == 6:
        base = ap_str[:3]
        quote = ap_str[3:]
    elif len(ap_str) == 7:
        if ap_str[-4] in ['Z', 'X']:
            base = ap_str[:3]
            quote = ap_str[4:]
        elif ap_str[0] in ['Z', 'X']:
            base = ap_str[1:4]
            quote = ap_str[4:]
        else:
            base = ap_str[:4]
            quote = ap_str[4:]
    return base, quote
