def load_payments(): bfx = Bitfinex() data = bfx.swapPaymentsHistory() for e in sorted(data, key=lambda x: x['timestamp']): payments.append((int(float(e['timestamp'])), float(e['amount'])))
def load_open_loans(): bfx = Bitfinex() bfx_current_loans = bfx.getSwaps() for l in bfx_current_loans: current_loans.append(l)