def convert_assets_to_csv(assets):
    """
    convert assets from a list of dictionaries to csv
    :param assets: a list of asset in dictionary format
    :returns: a sting representing the csv format of the assets
    """
    headers = 'source_id_types,source_ids,offer_ids,description,set_ids'
    result = [headers]
    for asset in assets:
        source_ids = asset['source_ids']
        source_id_types = '~'.join([item['source_id_type']
                                    for item in source_ids])
        source_ids = '~'.join([item['source_id'] for item in source_ids])
        offer_ids = '~'.join(asset['offer_ids'])
        set_ids = '~'.join(asset['set_ids'])
        description = asset.get('description', '')
        row = ','.join([source_id_types, source_ids, offer_ids, description, set_ids])
        result.append(row)
    return '\n'.join(result)