dailyReturns = {
return dailyFlat[0].map((day, idx, arr) => {
let total = 0
if (!idx) {
let total = day.oneDayReturn * (day.totalSupplyInUSD / dailyTotalUsd[idx])
} else {
let total = day.oneDayReturn * (arr[idx-1].totalSupplyInUSD / dailyTotalUsd[idx-1])
}
for(let i=1; i < dailyFlat.length;i++) {
if (!idx) {
total += dailyFlat[i][idx].oneDayReturn * (dailyFlat[i][idx].totalSupplyInUSD / dailyTotalUsd[idx])
} else {
total += dailyFlat[i][idx].oneDayReturn * (dailyFlat[i][idx-1].totalSupplyInUSD / dailyTotalUsd[idx-1])
}
}
return total
})
}