'Returns a data structure in the form of::
[PAYMENT1, PAYMENT2...PAYMENTN],
nreceiving_from,
total_amount_received
where each ``PAYMENTN`` is in the form::
amount,
number_of_tippers_for_this_amount,
total_amount_given_at_this_amount,
proportion_of_payments_at_this_amount,
proportion_of_total_amount_at_this_amount'

def get_payment_distribution(self):

    SQL = u'\n                                                SELECT    amount\n                                                                    ,    count(amount)    AS    nreceiving_from\n                                                        FROM    (    SELECT    DISTINCT    ON    (participant_id)\n                                                                                                                amount\n                                                                                                        ,    participant_id\n                                                                                            FROM    payment_instructions\n                                                                                            JOIN    participants    p    ON    p.id    =    participant_id\n                                                                                        WHERE    team_id=%s\n                                                                                                AND    is_funded\n                                                                                                AND    p.is_suspicious    IS    NOT    true\n                                                                            ORDER    BY    participant_id\n                                                                                                        ,    mtime    DESC\n                                                                                )    AS    foo\n                                                    WHERE    amount    >    0\n                                        GROUP    BY    amount\n                                        ORDER    BY    amount\n                                '
    tip_amounts = []
    npatrons = 0.0
    total_amount = Decimal(u'0.00')
    for rec in self.db.all(SQL, (self.id,)):
        tip_amounts.append([rec.amount, rec.nreceiving_from, (rec.amount * rec.nreceiving_from)])
        total_amount += tip_amounts[(-1)][2]
        npatrons += rec.nreceiving_from
    for row in tip_amounts:
        row.append(((row[1] / npatrons) if (npatrons > 0) else 0))
        row.append(((row[2] / total_amount) if (total_amount > 0) else 0))
    return (tip_amounts, npatrons, total_amount)
