= [];
const coinArray = await mysqlConnection.execute("SELECT coin FROM coins");
for(const coinObj of coinArray) {
const candleArray = await mysqlConnection.execute(
"SELECT current_price, low_price FROM candles WHERE coin = ? ORDER BY start_time DESC LIMIT 0,2",
[coinObj.coin]
);
try {
price_changes.push({
coin: coinObj.coin,
change: (
(candleArray[0].current_price - candleArray[1].low_price) /
candleArray[0].current_price
) * 100
});
} catch (e) {}
}
console.log(price_changes);
}
Обсуждают сегодня