Skip to content

Commit eb28c30

Browse files
authored
Merge pull request #108 from renproject/fix/volume-data-all-time-issue
add periodOption when calculating volume data
2 parents b9360af + 9508167 commit eb28c30

4 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/controllers/pages/networkStatsPage/DoughnutChart.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ export const DoughnutChart: React.FC<Props> = ({
9696
() => getOptions(data, quoteCurrency),
9797
[data, quoteCurrency],
9898
);
99-
console.log(options);
10099

101100
return (
102101
<div

src/controllers/pages/networkStatsPage/NetworkStatsPage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export const NetworkStatsPage = () => {
5959
TrackerVolumeType.Locked,
6060
quoteCurrency,
6161
tokenPrices,
62+
volumePeriod,
6263
).difference;
6364
}, [allVolumeData, tokenPrices, quoteCurrency]);
6465

src/controllers/pages/networkStatsPage/VolumeData.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,15 @@ export const VolumeStats: React.FC<VolumeStatsProps> = ({
118118
trackerChain,
119119
quoteCurrency,
120120
tokenPrices,
121+
volumePeriod
121122
);
122123
}
123124
return snapshotDataToAllChainVolumeData(
124125
volumeData,
125126
trackerType,
126127
quoteCurrency,
127128
tokenPrices,
129+
volumePeriod
128130
);
129131
}
130132
return fallback;

src/lib/graphQL/queries/renVmTracker.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ export const snapshotDataToVolumeData = (
386386
chain: TrackerChain,
387387
currency: TokenAmountType | Currency,
388388
tokenPrices: TokenPrices,
389+
period: PeriodOption,
389390
) => {
390391
const snapshots = getSnapshots(data);
391392
const { first, last } = getFirstAndLastSnapshot(snapshots);
@@ -411,7 +412,7 @@ export const snapshotDataToVolumeData = (
411412
let difference = new BigNumber(0);
412413
let differenceStandard = new BigNumber(0);
413414
let differenceQuote = new BigNumber(0);
414-
if (lastEntry && firstEntry) {
415+
if (lastEntry && firstEntry && period !== PeriodOption.ALL) {
415416
differenceQuote = new BigNumber(
416417
getQuoteAmount(lastEntry, currency, assetsData, tokenPrices),
417418
).minus(
@@ -508,6 +509,7 @@ export const snapshotDataToAllChainVolumeData = (
508509
type: TrackerVolumeType,
509510
currency: TokenAmountType | Currency,
510511
tokenPrices: TokenPrices,
512+
period: PeriodOption,
511513
) => {
512514
const assetsData = getAssetsData(data);
513515
let sum = new BigNumber(0);
@@ -519,6 +521,7 @@ export const snapshotDataToAllChainVolumeData = (
519521
chain,
520522
currency,
521523
tokenPrices,
524+
period,
522525
);
523526
sum = sum.plus(difference);
524527
records = mergeAmountRecords(assetsData, records, amountRecords);

0 commit comments

Comments
 (0)