Skip to content

Commit 9a4b012

Browse files
committed
add last statics in market data
1 parent 61edf51 commit 9a4b012

File tree

4 files changed

+18
-14
lines changed

4 files changed

+18
-14
lines changed

server/cron/ws.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ cron.schedule("*/10 * * * * *", async () => {
109109
{
110110
$match: {
111111
createdAt: {
112-
$gte: new Date(Date.now() - EXPIRE_48H * 1000),
112+
$lt: new Date(Date.now() + EXPIRE_48H * 1000),
113113
},
114114
},
115115
},
@@ -127,7 +127,7 @@ cron.schedule("*/10 * * * * *", async () => {
127127
{
128128
$match: {
129129
createdAt: {
130-
$gte: new Date(Date.now() - EXPIRE_14D * 1000),
130+
$lt: new Date(Date.now() + EXPIRE_14D * 1000),
131131
},
132132
},
133133
},
@@ -144,7 +144,7 @@ cron.schedule("*/10 * * * * *", async () => {
144144
{
145145
$match: {
146146
createdAt: {
147-
$gte: new Date(Date.now() - EXPIRE_24H * 1000),
147+
$lt: new Date(Date.now() + EXPIRE_24H * 1000),
148148
},
149149
},
150150
},
@@ -161,7 +161,7 @@ cron.schedule("*/10 * * * * *", async () => {
161161
{
162162
$match: {
163163
createdAt: {
164-
$gte: new Date(Date.now() - EXPIRE_7D * 1000),
164+
$lt: new Date(Date.now() + EXPIRE_7D * 1000),
165165
},
166166
},
167167
},
@@ -178,7 +178,7 @@ cron.schedule("*/10 * * * * *", async () => {
178178
{
179179
$match: {
180180
createdAt: {
181-
$gte: new Date(Date.now() - TOTAL_VOLUME_14D * 1000),
181+
$lt: new Date(Date.now() +TOTAL_VOLUME_14D * 1000),
182182
},
183183
},
184184
},
@@ -195,7 +195,7 @@ cron.schedule("*/10 * * * * *", async () => {
195195
{
196196
$match: {
197197
createdAt: {
198-
$gte: new Date(Date.now() - EXPIRE_48H * 1000),
198+
$lt: new Date(Date.now() + EXPIRE_48H * 1000),
199199
},
200200
},
201201
},
@@ -212,7 +212,7 @@ cron.schedule("*/10 * * * * *", async () => {
212212
{
213213
$match: {
214214
createdAt: {
215-
$gte: new Date(Date.now() - EXPIRE_7D * 1000),
215+
$lt: new Date(Date.now() + EXPIRE_7D * 1000),
216216
},
217217
},
218218
},
@@ -228,7 +228,7 @@ cron.schedule("*/10 * * * * *", async () => {
228228
{
229229
$match: {
230230
createdAt: {
231-
$gte: new Date(Date.now() - EXPIRE_14D * 1000),
231+
$lt: new Date(Date.now() + EXPIRE_14D * 1000),
232232
},
233233
},
234234
},

server/server.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ const {
3434
TOTAL_CONFIRMATIONS_7D,
3535
TOTAL_CONFIRMATIONS_14D,
3636
TOTAL_VOLUME_24H,
37+
TOTAL_VOLUME_7D,
3738
TOTAL_CONFIRMATIONS_48H,
3839
TOTAL_VOLUME_48H,
40+
TOTAL_VOLUME_14D,
3941
CONFIRMATIONS_PER_SECOND,
4042
NANOTICKER_STATS,
4143
NANOBROWSERQUEST_PLAYERS,
@@ -151,8 +153,10 @@ app.get("/api/market-statistics", async (req, res) => {
151153
const cachedConfirmations7d = nodeCache.get(TOTAL_CONFIRMATIONS_7D);
152154
const cachedConfirmations14d = nodeCache.get(TOTAL_CONFIRMATIONS_14D);
153155
const cachedVolume24h = nodeCache.get(TOTAL_VOLUME_24H);
156+
const cachedVolume7d = nodeCache.get(TOTAL_VOLUME_7D);
154157
const cachedConfirmations48h = nodeCache.get(TOTAL_CONFIRMATIONS_48H);
155158
const cachedVolume48h = nodeCache.get(TOTAL_VOLUME_48H);
159+
const cachedVolume14d = nodeCache.get(TOTAL_VOLUME_14D);
156160
const nanotpsStats = nodeCache.get(NANOTPS_STATS);
157161
const nanoSpeedStats = nodeCache.get(NANOSPEED_STATS);
158162

@@ -168,19 +172,19 @@ app.get("/api/market-statistics", async (req, res) => {
168172
cryptocurrency: req.query.cryptocurrency,
169173
});
170174

171-
172175
res.send({
173176
[TOTAL_CONFIRMATIONS_24H]: cachedConfirmations24h,
174177
[TOTAL_CONFIRMATIONS_7D]: cachedConfirmations7d,
175178
[TOTAL_CONFIRMATIONS_14D]: cachedConfirmations14d,
176179
[TOTAL_VOLUME_24H]: cachedVolume24h,
180+
[TOTAL_VOLUME_7D]: cachedVolume7d,
177181
[TOTAL_CONFIRMATIONS_48H]: cachedConfirmations48h,
178182
[TOTAL_VOLUME_48H]: cachedVolume48h,
183+
[TOTAL_VOLUME_14D]: cachedVolume14d,
179184
[BITCOIN_TOTAL_TRANSACTION_FEES_24H]: btcTransactionFees24h,
180185
[BITCOIN_TOTAL_TRANSACTION_FEES_7D]: btcTransactionFees7d,
181186
[BITCOIN_TOTAL_TRANSACTION_FEES_14D]: btcTransactionFees14d,
182187
[BITCOIN_TOTAL_TRANSACTION_FEES_48H]: btcTransactionFees48h,
183-
[BITCOIN_TOTAL_TRANSACTION_FEES_48H]: btcTransactionFees48h,
184188
[NANOTPS_STATS]: nanotpsStats,
185189
[NANOSPEED_STATS]: nanoSpeedStats,
186190
...marketStats,

src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import "components/utils/analytics";
1616
import { PreferencesContext, Theme } from "api/contexts/Preferences";
1717
import AppFooter from "components/AppFooter";
1818
import AppHeader from "components/AppHeader";
19-
import NodeHealth from "components/NodeHealth";
19+
// import NodeHealth from "components/NodeHealth";
2020
import Notification from "components/Notification";
2121
import i18next from "i18next";
2222
import AccountPage from "pages/Account";
@@ -65,7 +65,7 @@ const App: React.FC = () => {
6565
style={{ minHeight: "100vh" }}
6666
className={themeContext ? `theme-${themeContext}` : undefined}
6767
>
68-
<NodeHealth />
68+
{/* <NodeHealth /> */}
6969
<AppHeader />
7070
<Notification />
7171
<Content>

src/pages/Home/Banner.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ const Banner: React.FC = () => {
130130
</Button>
131131
</Link>
132132

133-
<Link to={"/nanoquakejs"}>
133+
{/* <Link to={"/nanoquakejs"}>
134134
<Button ghost>
135135
<img
136136
alt="NanoQuakeJS"
@@ -142,7 +142,7 @@ const Banner: React.FC = () => {
142142
/>{" "}
143143
NanoQuakeJS
144144
</Button>
145-
</Link>
145+
</Link> */}
146146

147147
{/* <Button
148148
ghost

0 commit comments

Comments
 (0)