cleanup
This commit is contained in:
@@ -2,7 +2,6 @@ import { MarketOrderHistory } from "@/market";
|
|||||||
|
|
||||||
export type HistoryQuartils = {
|
export type HistoryQuartils = {
|
||||||
totalVolume: number,
|
totalVolume: number,
|
||||||
totalOrders: number,
|
|
||||||
q1: number,
|
q1: number,
|
||||||
median: number,
|
median: number,
|
||||||
q3: number,
|
q3: number,
|
||||||
@@ -11,7 +10,6 @@ export type HistoryQuartils = {
|
|||||||
export const getHistoryQuartils = (history: MarketOrderHistory[], days?: number): HistoryQuartils => {
|
export const getHistoryQuartils = (history: MarketOrderHistory[], days?: number): HistoryQuartils => {
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
|
|
||||||
let totalOrders = 0;
|
|
||||||
const volumes = history
|
const volumes = history
|
||||||
.flatMap(h => {
|
.flatMap(h => {
|
||||||
const volume = h.volume;
|
const volume = h.volume;
|
||||||
@@ -22,7 +20,6 @@ export const getHistoryQuartils = (history: MarketOrderHistory[], days?: number)
|
|||||||
|
|
||||||
const e = estimateVolume(h);
|
const e = estimateVolume(h);
|
||||||
|
|
||||||
totalOrders += h.order_count;
|
|
||||||
return [[h.highest, e], [h.lowest, volume - e]];
|
return [[h.highest, e], [h.lowest, volume - e]];
|
||||||
})
|
})
|
||||||
.filter(h => h[1] > 0)
|
.filter(h => h[1] > 0)
|
||||||
@@ -48,7 +45,6 @@ export const getHistoryQuartils = (history: MarketOrderHistory[], days?: number)
|
|||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
totalVolume,
|
totalVolume,
|
||||||
totalOrders,
|
|
||||||
q1: quartils[0],
|
q1: quartils[0],
|
||||||
median: quartils[1],
|
median: quartils[1],
|
||||||
q3: quartils[2],
|
q3: quartils[2],
|
||||||
|
|||||||
Reference in New Issue
Block a user