From f6e336511eb5762bbe820dfe399f3f96cc22fdf5 Mon Sep 17 00:00:00 2001 From: frankchen07 Date: Thu, 24 Sep 2020 08:40:07 -0700 Subject: [PATCH 1/4] add twitter verified profile id combinations --- app/grants/clr.py | 54 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/app/grants/clr.py b/app/grants/clr.py index 73ea16307a4..2a73323bca3 100644 --- a/app/grants/clr.py +++ b/app/grants/clr.py @@ -64,6 +64,8 @@ def translate_data(grants_data): verification_status = 'sms' elif c.get('is_brightid_verified'): verification_status = 'brightid' + elif c.get('is_twitter_verified'): + verification_status = 'twitter' if profile_id: val = [grant_id] + [c.get('id')] + [verification_status] + [c.get('sum_of_each_profiles_contributions')] grants_list.append(val) @@ -90,13 +92,16 @@ def translate_data(grants_data): def get_verified_list(grant_contributions): sms_verified_list = [] bright_verified_list = [] + twitter_verified_list = [] for _, user, ver_stat, _ in grant_contributions: if ver_stat == 'sms' and user not in sms_verified_list: sms_verified_list.append(user) elif ver_stat == 'brightid' and user not in bright_verified_list: bright_verified_list.append(user) + elif ver_stat == 'twitter' and user not in twitter_verified_list: + twitter_verified_list.append(user) - return sms_verified_list, bright_verified_list + return sms_verified_list, bright_verified_list, twitter_verified_list @@ -189,7 +194,7 @@ def get_totals_by_pair(contrib_dict): saturation point boolean ''' -def calculate_clr(aggregated_contributions, pair_totals, sms_verified_list, bright_verified_list, v_threshold, uv_threshold, total_pot): +def calculate_clr(aggregated_contributions, pair_totals, sms_verified_list, bright_verified_list, twitter_verified_list, v_threshold, uv_threshold, total_pot): bigtot = 0 totals = [] @@ -205,21 +210,33 @@ def calculate_clr(aggregated_contributions, pair_totals, sms_verified_list, brig # pairwise matches to current round for k2, v2 in contribz.items(): - # both sms - if k2 > k1 and all(i in sms_verified_list for i in [k2, k1]): - tot += ((v1 * v2) ** 0.5) / (pair_totals[k1][k2] / (v_threshold * 1.05) + 1) + # both twitter + elif k2 > k1 and all(i in twitter_verified_list for i in [k2, k1]): + tot += ((v1 * v2) ** 0.5) / (pair_totals[k1][k2] / (v_threshold * 1.25) + 1) # both bright elif k2 > k1 and all(i in bright_verified_list for i in [k2, k1]): tot += ((v1 * v2) ** 0.5) / (pair_totals[k1][k2] / (v_threshold * 1.2) + 1) + # both sms + if k2 > k1 and all(i in sms_verified_list for i in [k2, k1]): + tot += ((v1 * v2) ** 0.5) / (pair_totals[k1][k2] / (v_threshold * 1.05) + 1) + # one bright, one twitter + elif k2 > k1 and (((k2 in bright_verified_list) and (k1 in twitter_verified_list)) or ((k1 in bright_verified_list) and (k2 in twitter_verified_list))): + tot += ((v1 * v2) ** 0.5) / (pair_totals[k1][k2] / (uv_threshold * 1.225) + 1) + # one sms, one twitter + elif k2 > k1 and (((k2 in twitter_verified_list) and (k1 in sms_verified_list)) or ((k1 in twitter_verified_list) and (k2 in sms_verified_list))): + tot += ((v1 * v2) ** 0.5) / (pair_totals[k1][k2] / (uv_threshold * 1.15) + 1) + # one bright, one sms + elif k2 > k1 and (((k2 in bright_verified_list) and (k1 in sms_verified_list)) or ((k1 in bright_verified_list) and (k2 in sms_verified_list))): + tot += ((v1 * v2) ** 0.5) / (pair_totals[k1][k2] / (uv_threshold * 1.125) + 1) + # one bright / sms / twitter, one none + elif k2 > k1 and (((k2 in sms_verified_list + bright_verified_list + twitter_verified_list) and (k1 not in sms_verified_list + bright_verified_list + twitter_verified_list)) or ((k1 in sms_verified_list + bright_verified_list + twitter_verified_list) and (k2 not in sms_verified_list + bright_verified_list + twitter_verified_list))): + tot += ((v1 * v2) ** 0.5) / (pair_totals[k1][k2] / (uv_threshold * 1.08) + 1) # both none - elif k2 > k1 and not any(i in sms_verified_list + bright_verified_list for i in [k2, k1]): - tot += ((v1 * v2) ** 0.5) / (pair_totals[k1][k2] / uv_threshold + 1) - # one bright or sms, one none - elif k2 > k1 and (((k2 in sms_verified_list + bright_verified_list) and (k1 not in sms_verified_list + bright_verified_list)) or ((k1 in sms_verified_list + bright_verified_list) and (k2 not in sms_verified_list + bright_verified_list))): + elif k2 > k1 and not any(i in sms_verified_list + bright_verified_list + twitter_verified_list for i in [k2, k1]): tot += ((v1 * v2) ** 0.5) / (pair_totals[k1][k2] / uv_threshold + 1) - # one bright, one sms + # everything else elif k2 > k1: - tot += ((v1 * v2) ** 0.5) / (pair_totals[k1][k2] / (v_threshold * 1.125) + 1) + tot += ((v1 * v2) ** 0.5) / (pair_totals[k1][k2] / v_threshold + 1) if type(tot) == complex: tot = float(tot.real) @@ -270,7 +287,7 @@ def run_clr_calcs(grant_contribs_curr, v_threshold, uv_threshold, total_pot): # get data curr_round = translate_data(grant_contribs_curr) - sms_list, bright_list = get_verified_list(curr_round) + sms_list, bright_list, twitter_list = get_verified_list(curr_round) # aggregate data curr_agg = aggregate_contributions(curr_round) @@ -279,7 +296,7 @@ def run_clr_calcs(grant_contribs_curr, v_threshold, uv_threshold, total_pot): ptots = get_totals_by_pair(curr_agg) # clr calcluation - totals = calculate_clr(curr_agg, ptots, sms_list, bright_list, v_threshold, uv_threshold, total_pot) + totals = calculate_clr(curr_agg, ptots, sms_list, bright_list, twitter_list, v_threshold, uv_threshold, total_pot) return totals @@ -298,7 +315,8 @@ def calculate_clr_for_donation(grant, amount, grant_contributions_curr, total_po 'id': '999999999999', 'sum_of_each_profiles_contributions': amount, 'is_sms_verified': True, - 'is_brightid_verified': True + 'is_brightid_verified': True, + 'is_twitter_verified': True }) grants_clr = run_clr_calcs(_grant_contributions_curr, v_threshold, uv_threshold, total_pot) @@ -399,6 +417,11 @@ def populate_data_for_clr(grants, contributions, phantom_funding_profiles, clr_r brightid_verified_phantom_funding_contribution_ids = [ele.profile_id for ele in grant_phantom_funding_contributions if ele.profile.is_brightid_verified] brightid_verified_profile = list(set(brightid_verified_contribution_ids + brightid_verified_phantom_funding_contribution_ids)) + # Twitter verified contributions + twitter_verified_contribution_ids = [ele.pk for ele in contribs if ele.profile_for_clr.is_twitter_verified] + twitter_verified_phantom_funding_contribution_ids = [ele.profile_id for ele in grant_phantom_funding_contributions if ele.profile.is_twitter_verified] + twitter_verified_profile = list(set(twitter_verified_contribution_ids + twitter_verified_phantom_funding_contribution_ids)) + # combine contributing_profile_ids = list(set([c.identity_identifier(mechanism) for c in contribs] + [p.profile_id for p in grant_phantom_funding_contributions])) @@ -417,7 +440,8 @@ def populate_data_for_clr(grants, contributions, phantom_funding_profiles, clr_r 'id': str(profile_id), 'sum_of_each_profiles_contributions': sum_of_each_profiles_contributions, 'is_sms_verified': True if profile_id in sms_verified_profile else False, - 'is_brightid_verified': True if profile_id in brightid_verified_profile else False + 'is_brightid_verified': True if profile_id in brightid_verified_profile else False, + 'is_twitter_verified': True if profile_id in twitter_verified_profile else False }) contrib_data_list.append({ From 3c3e18f9788e91359c708483199b37d473c8c7c6 Mon Sep 17 00:00:00 2001 From: frankchen07 Date: Fri, 25 Sep 2020 08:59:49 -0700 Subject: [PATCH 2/4] simplify verification scheme --- app/grants/clr.py | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/app/grants/clr.py b/app/grants/clr.py index 2a73323bca3..0c0a9b71c4c 100644 --- a/app/grants/clr.py +++ b/app/grants/clr.py @@ -210,27 +210,15 @@ def calculate_clr(aggregated_contributions, pair_totals, sms_verified_list, brig # pairwise matches to current round for k2, v2 in contribz.items(): - # both twitter - elif k2 > k1 and all(i in twitter_verified_list for i in [k2, k1]): + # one twitter + if k2 > k1 and any(i in twitter_verified_list for i in [k2, k1]): tot += ((v1 * v2) ** 0.5) / (pair_totals[k1][k2] / (v_threshold * 1.25) + 1) - # both bright - elif k2 > k1 and all(i in bright_verified_list for i in [k2, k1]): + # one bright + elif k2 > k1 and any(i in bright_verified_list for i in [k2, k1]): tot += ((v1 * v2) ** 0.5) / (pair_totals[k1][k2] / (v_threshold * 1.2) + 1) - # both sms - if k2 > k1 and all(i in sms_verified_list for i in [k2, k1]): + # one sms + elif k2 > k1 and any(i in sms_verified_list for i in [k2, k1]): tot += ((v1 * v2) ** 0.5) / (pair_totals[k1][k2] / (v_threshold * 1.05) + 1) - # one bright, one twitter - elif k2 > k1 and (((k2 in bright_verified_list) and (k1 in twitter_verified_list)) or ((k1 in bright_verified_list) and (k2 in twitter_verified_list))): - tot += ((v1 * v2) ** 0.5) / (pair_totals[k1][k2] / (uv_threshold * 1.225) + 1) - # one sms, one twitter - elif k2 > k1 and (((k2 in twitter_verified_list) and (k1 in sms_verified_list)) or ((k1 in twitter_verified_list) and (k2 in sms_verified_list))): - tot += ((v1 * v2) ** 0.5) / (pair_totals[k1][k2] / (uv_threshold * 1.15) + 1) - # one bright, one sms - elif k2 > k1 and (((k2 in bright_verified_list) and (k1 in sms_verified_list)) or ((k1 in bright_verified_list) and (k2 in sms_verified_list))): - tot += ((v1 * v2) ** 0.5) / (pair_totals[k1][k2] / (uv_threshold * 1.125) + 1) - # one bright / sms / twitter, one none - elif k2 > k1 and (((k2 in sms_verified_list + bright_verified_list + twitter_verified_list) and (k1 not in sms_verified_list + bright_verified_list + twitter_verified_list)) or ((k1 in sms_verified_list + bright_verified_list + twitter_verified_list) and (k2 not in sms_verified_list + bright_verified_list + twitter_verified_list))): - tot += ((v1 * v2) ** 0.5) / (pair_totals[k1][k2] / (uv_threshold * 1.08) + 1) # both none elif k2 > k1 and not any(i in sms_verified_list + bright_verified_list + twitter_verified_list for i in [k2, k1]): tot += ((v1 * v2) ** 0.5) / (pair_totals[k1][k2] / uv_threshold + 1) From 4d20cb4731ca4b2017fc9818c9b0e886cc75d550 Mon Sep 17 00:00:00 2001 From: frankchen07 Date: Mon, 28 Sep 2020 10:05:46 -0700 Subject: [PATCH 3/4] updated clr.py to account for trust bonus model --- app/grants/clr.py | 115 +++++++++++----------------------------------- 1 file changed, 26 insertions(+), 89 deletions(-) diff --git a/app/grants/clr.py b/app/grants/clr.py index 0c0a9b71c4c..7d0d86e3130 100644 --- a/app/grants/clr.py +++ b/app/grants/clr.py @@ -44,64 +44,31 @@ 'id': (string) , 'contibutions' : [ { - contributor_profile (str) : contribution_amount (int) + contributor_profile (str) : summed_contributions } ] } returns: list of lists of grant data - [[grant_id (str), user_id (str), verification_status (str), contribution_amount (float)]] + [[grant_id (str), user_id (str), contribution_amount (float)]] + dictionary of profile_ids and trust scores + {user_id (str): trust_score (float)} ''' def translate_data(grants_data): + trust_dict = {} grants_list = [] for g in grants_data: grant_id = g.get('id') for c in g.get('contributions'): profile_id = c.get('id') - verification_status = None - if c.get('is_sms_verified'): - verification_status = 'sms' - elif c.get('is_brightid_verified'): - verification_status = 'brightid' - elif c.get('is_twitter_verified'): - verification_status = 'twitter' + trust_bonus = c.get('trust_bonus') if profile_id: - val = [grant_id] + [c.get('id')] + [verification_status] + [c.get('sum_of_each_profiles_contributions')] + val = [grant_id] + [c.get('id')] + [c.get('sum_of_each_profiles_contributions')] grants_list.append(val) + profile_trust[c.get('id')] = trust_bonus - return grants_list - - - -''' - gets list of verified profile ids - - args: - list of lists of grant data - [[grant_id (str), user_id (str), verification_status (str), contribution_amount (float)]] - - returns: - set list of sms verified user_ids - [user_id (str)] - set list of bright verified user_ids - [user_id (str)] - - -''' -def get_verified_list(grant_contributions): - sms_verified_list = [] - bright_verified_list = [] - twitter_verified_list = [] - for _, user, ver_stat, _ in grant_contributions: - if ver_stat == 'sms' and user not in sms_verified_list: - sms_verified_list.append(user) - elif ver_stat == 'brightid' and user not in bright_verified_list: - bright_verified_list.append(user) - elif ver_stat == 'twitter' and user not in twitter_verified_list: - twitter_verified_list.append(user) - - return sms_verified_list, bright_verified_list, twitter_verified_list + return grants_list, trust_dict @@ -110,7 +77,7 @@ def get_verified_list(grant_contributions): args: list of lists of grant data - [[grant_id (str), user_id (str), verification_status (boolean), contribution_amount (float)]] + [[grant_id (str), user_id (str), verification_status (str), trust_bonus (float), contribution_amount (float)]] returns: aggregated contributions by pair nested dict @@ -122,7 +89,7 @@ def get_verified_list(grant_contributions): ''' def aggregate_contributions(grant_contributions): contrib_dict = {} - for proj, user, _, amount in grant_contributions: + for proj, user, amount in grant_contributions: if proj not in contrib_dict: contrib_dict[proj] = {} contrib_dict[proj][user] = contrib_dict[proj].get(user, 0) + amount @@ -177,10 +144,8 @@ def get_totals_by_pair(contrib_dict): } pair_totals {user_id (str): {user_id (str): pair_total (float)}} - sms_verified_list - [user_id (str)] - bright_verified_list - [user_id (str)] + trust_dict + {user_id (str): trust_score (float)} v_threshold float uv_threshold @@ -194,7 +159,8 @@ def get_totals_by_pair(contrib_dict): saturation point boolean ''' -def calculate_clr(aggregated_contributions, pair_totals, sms_verified_list, bright_verified_list, twitter_verified_list, v_threshold, uv_threshold, total_pot): +def calculate_clr(aggregated_contributions, pair_totals, trust_dict, v_threshold, uv_threshold, total_pot): + bigtot = 0 totals = [] @@ -210,21 +176,8 @@ def calculate_clr(aggregated_contributions, pair_totals, sms_verified_list, brig # pairwise matches to current round for k2, v2 in contribz.items(): - # one twitter - if k2 > k1 and any(i in twitter_verified_list for i in [k2, k1]): - tot += ((v1 * v2) ** 0.5) / (pair_totals[k1][k2] / (v_threshold * 1.25) + 1) - # one bright - elif k2 > k1 and any(i in bright_verified_list for i in [k2, k1]): - tot += ((v1 * v2) ** 0.5) / (pair_totals[k1][k2] / (v_threshold * 1.2) + 1) - # one sms - elif k2 > k1 and any(i in sms_verified_list for i in [k2, k1]): - tot += ((v1 * v2) ** 0.5) / (pair_totals[k1][k2] / (v_threshold * 1.05) + 1) - # both none - elif k2 > k1 and not any(i in sms_verified_list + bright_verified_list + twitter_verified_list for i in [k2, k1]): - tot += ((v1 * v2) ** 0.5) / (pair_totals[k1][k2] / uv_threshold + 1) - # everything else - elif k2 > k1: - tot += ((v1 * v2) ** 0.5) / (pair_totals[k1][k2] / v_threshold + 1) + if k2 > k1: + tot += ((v1 * v2) ** 0.5) / (pair_totals[k1][k2] / (v_threshold * max(trust_dict[k2], trust_dict[k1])) + 1) if type(tot) == complex: tot = float(tot.real) @@ -273,9 +226,7 @@ def calculate_clr(aggregated_contributions, pair_totals, sms_verified_list, brig def run_clr_calcs(grant_contribs_curr, v_threshold, uv_threshold, total_pot): # get data - curr_round = translate_data(grant_contribs_curr) - - sms_list, bright_list, twitter_list = get_verified_list(curr_round) + curr_round, trust_dict = translate_data(grant_contribs_curr) # aggregate data curr_agg = aggregate_contributions(curr_round) @@ -284,7 +235,7 @@ def run_clr_calcs(grant_contribs_curr, v_threshold, uv_threshold, total_pot): ptots = get_totals_by_pair(curr_agg) # clr calcluation - totals = calculate_clr(curr_agg, ptots, sms_list, bright_list, twitter_list, v_threshold, uv_threshold, total_pot) + totals = calculate_clr(curr_agg, ptots, trust_dict, v_threshold, uv_threshold, total_pot) return totals @@ -302,9 +253,7 @@ def calculate_clr_for_donation(grant, amount, grant_contributions_curr, total_po grant_contribution['contributions'].append({ 'id': '999999999999', 'sum_of_each_profiles_contributions': amount, - 'is_sms_verified': True, - 'is_brightid_verified': True, - 'is_twitter_verified': True + 'profile_trust_bonus': 1 }) grants_clr = run_clr_calcs(_grant_contributions_curr, v_threshold, uv_threshold, total_pot) @@ -395,21 +344,6 @@ def populate_data_for_clr(grants, contributions, phantom_funding_profiles, clr_r # phantom funding grant_phantom_funding_contributions = phantom_funding_profiles.filter(grant_id=grant.id, created_on__gte=clr_start_date, created_on__lte=clr_end_date) - # SMS verified contributions - sms_verified_contribution_ids = [ele.pk for ele in contribs if ele.profile_for_clr.sms_verification] - sms_verified_phantom_funding_contribution_ids = [ele.profile_id for ele in grant_phantom_funding_contributions if ele.profile.sms_verification] - sms_verified_profile = list(set(sms_verified_contribution_ids + sms_verified_phantom_funding_contribution_ids)) - - # BrightID verified contributions - brightid_verified_contribution_ids = [ele.pk for ele in contribs if ele.profile_for_clr.is_brightid_verified] - brightid_verified_phantom_funding_contribution_ids = [ele.profile_id for ele in grant_phantom_funding_contributions if ele.profile.is_brightid_verified] - brightid_verified_profile = list(set(brightid_verified_contribution_ids + brightid_verified_phantom_funding_contribution_ids)) - - # Twitter verified contributions - twitter_verified_contribution_ids = [ele.pk for ele in contribs if ele.profile_for_clr.is_twitter_verified] - twitter_verified_phantom_funding_contribution_ids = [ele.profile_id for ele in grant_phantom_funding_contributions if ele.profile.is_twitter_verified] - twitter_verified_profile = list(set(twitter_verified_contribution_ids + twitter_verified_phantom_funding_contribution_ids)) - # combine contributing_profile_ids = list(set([c.identity_identifier(mechanism) for c in contribs] + [p.profile_id for p in grant_phantom_funding_contributions])) @@ -421,15 +355,18 @@ def populate_data_for_clr(grants, contributions, phantom_funding_profiles, clr_r profile_contributions = contribs.filter(profile_for_clr_id=profile_id) sum_of_each_profiles_contributions = float(sum([c.subscription.amount_per_period_usdt * clr_round.contribution_multiplier for c in profile_contributions if c.subscription.amount_per_period_usdt])) phantom_funding = grant_phantom_funding_contributions.filter(profile_id=profile_id) + + # get trust bonus + # # # MIGHT HAVE TO TURN THIS INTO A DISTINCT SET + profile_trust_bonus = profile_contributions.profile_for_clr.trust_bonus + if phantom_funding.exists(): sum_of_each_profiles_contributions = sum_of_each_profiles_contributions + phantom_funding.first().value summed_contributions.append({ 'id': str(profile_id), 'sum_of_each_profiles_contributions': sum_of_each_profiles_contributions, - 'is_sms_verified': True if profile_id in sms_verified_profile else False, - 'is_brightid_verified': True if profile_id in brightid_verified_profile else False, - 'is_twitter_verified': True if profile_id in twitter_verified_profile else False + 'profile_trust_bonus': profile_trust_bonus }) contrib_data_list.append({ From 794e3dbacd05ed22d011ba4c9a6e036d1761d3b9 Mon Sep 17 00:00:00 2001 From: frankchen07 Date: Fri, 6 Nov 2020 14:28:54 -0800 Subject: [PATCH 4/4] fixed up bugs and add trust bonus --- app/grants/clr.py | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/app/grants/clr.py b/app/grants/clr.py index 893345671b3..f36647a03dd 100644 --- a/app/grants/clr.py +++ b/app/grants/clr.py @@ -62,11 +62,11 @@ def translate_data(grants_data): grant_id = g.get('id') for c in g.get('contributions'): profile_id = c.get('id') - trust_bonus = c.get('trust_bonus') + trust_bonus = c.get('profile_trust_bonus') if profile_id: val = [grant_id] + [c.get('id')] + [c.get('sum_of_each_profiles_contributions')] grants_list.append(val) - profile_trust[c.get('id')] = trust_bonus + trust_dict[profile_id] = trust_bonus return grants_list, trust_dict @@ -292,7 +292,7 @@ def fetch_data(clr_round, network='mainnet'): grant_filters = clr_round.grant_filters subscription_filters = clr_round.subscription_filters - contributions = Contribution.objects.prefetch_related('subscription').filter(match=True, created_on__gte=clr_start_date, created_on__lte=clr_end_date, success=True).nocache() + contributions = Contribution.objects.prefetch_related('subscription', 'profile_for_clr').filter(match=True, created_on__gte=clr_start_date, created_on__lte=clr_end_date, success=True).nocache() if subscription_filters: contributions = contributions.filter(**subscription_filters) @@ -341,32 +341,21 @@ def populate_data_for_clr(grants, contributions, phantom_funding_profiles, clr_r # contributions contribs = copy.deepcopy(contributions).filter(subscription__grant_id=grant.id, subscription__is_postive_vote=True, created_on__gte=clr_start_date, created_on__lte=clr_end_date) - # phantom funding - grant_phantom_funding_contributions = phantom_funding_profiles.filter(grant_id=grant.id, created_on__gte=clr_start_date, created_on__lte=clr_end_date) - # combine - contributing_profile_ids = list(set([c.identity_identifier(mechanism) for c in contribs] + [p.profile_id for p in grant_phantom_funding_contributions])) + contributing_profile_ids = list(set([(c.identity_identifier(mechanism), c.profile_for_clr.trust_bonus) for c in contribs])) summed_contributions = [] # contributions if len(contributing_profile_ids) > 0: - for profile_id in contributing_profile_ids: + for profile_id, trust_bonus in contributing_profile_ids: profile_contributions = contribs.filter(profile_for_clr__id=profile_id) sum_of_each_profiles_contributions = float(sum([c.subscription.amount_per_period_usdt * clr_round.contribution_multiplier for c in profile_contributions if c.subscription.amount_per_period_usdt])) - phantom_funding = grant_phantom_funding_contributions.filter(profile_id=profile_id) - - # get trust bonus - # # # MIGHT HAVE TO TURN THIS INTO A DISTINCT SET - profile_trust_bonus = profile_contributions.profile_for_clr.trust_bonus - - if phantom_funding.exists(): - sum_of_each_profiles_contributions = sum_of_each_profiles_contributions + phantom_funding.first().value summed_contributions.append({ 'id': str(profile_id), 'sum_of_each_profiles_contributions': sum_of_each_profiles_contributions, - 'profile_trust_bonus': profile_trust_bonus + 'profile_trust_bonus': trust_bonus }) contrib_data_list.append({