lendingData = Object.keys(perDateGotchis).map(id=>{
let lending = perDateGotchis[id];
return {
date: id,
timestamp: lending.timestamp,
gotchis: lending.reduce((sum, g)=>{return ++sum},0),
earned: lending.map(g=>g.cost).reduce((sum, cost)=> {return sum + cost},0)
}
}).map(g=>{g.earned /= 10**18; return g}).sort((g1,g2)=>moment(g1.date, 'DD-MM-YYYY').toDate() - moment(g2.date, 'DD-MM-YYYY').toDate())