remove debug code

This commit is contained in:
jejolare 2025-07-28 18:27:46 +07:00
parent 802e1713ee
commit 0081a95b3f

View file

@ -73,7 +73,7 @@ class ExchangeModel {
date.setHours(date.getHours() - 24);
const firstTimestamp = 0;
const firstTimestamp = date.getTime();
const orders = (await Order.findAll({
where: {
@ -101,13 +101,15 @@ class ExchangeModel {
})) as OrderWithTransactions[];
const allTransactionsWithPrices = orders
.flatMap((order) => order.buy_orders.map((transaction) => {
const buyOrderPrice = order.price;
return {
...transaction.toJSON(),
buy_order_price: buyOrderPrice,
};
}))
.flatMap((order) =>
order.buy_orders.map((transaction) => {
const buyOrderPrice = order.price;
return {
...transaction.toJSON(),
buy_order_price: buyOrderPrice,
};
}),
)
.sort((a, b) => a.timestamp - b.timestamp);
const firstOrderPrice = allTransactionsWithPrices[0]?.buy_order_price || NaN;