Skip to content

Commit

Permalink
v6.1.1
Browse files Browse the repository at this point in the history
v6.1.1
  • Loading branch information
platschi authored Feb 10, 2023
2 parents 9614200 + 7eabac8 commit b54a691
Show file tree
Hide file tree
Showing 12 changed files with 161 additions and 213 deletions.
10 changes: 5 additions & 5 deletions hooks/useStatsData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@ import { useMemo } from 'react';

import { useGetFuturesTradersStats } from 'queries/futures/useGetFuturesTradersStats';
import { useGetStatsVolumes } from 'queries/futures/useGetStatsVolumes';
import { selectMarketPrice, selectMarkets } from 'state/futures/selectors';
import { selectMarkPrices, selectMarkets } from 'state/futures/selectors';
import { useAppSelector } from 'state/hooks';

export type StatsTimeframe = '1M' | '1Y' | 'MAX';

const useStatsData = () => {
const futuresMarkets = useAppSelector(selectMarkets);
const price = useAppSelector(selectMarketPrice);
const prices = useAppSelector(selectMarkPrices);

const { data: volumeData, isLoading: volumeIsLoading } = useGetStatsVolumes();
const { data: tradersData, isLoading: tradersIsLoading } = useGetFuturesTradersStats();

const openInterestData = useMemo(() => {
return futuresMarkets.map(({ asset, marketSize }) => {
return futuresMarkets.map(({ marketKey, asset, marketSize }) => {
return {
asset,
openInterest: marketSize.mul(price).toNumber(),
openInterest: marketSize.mul(prices[marketKey]).toNumber(),
};
});
}, [futuresMarkets, price]);
}, [futuresMarkets, prices]);

return {
volumeData,
Expand Down
139 changes: 68 additions & 71 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kwenta",
"version": "6.1.0",
"version": "6.1.1",
"scripts": {
"dev": "next",
"build": "next build",
Expand Down Expand Up @@ -37,8 +37,8 @@
"@reach/dialog": "0.15.0",
"@reduxjs/toolkit": "^1.8.5",
"@socket.tech/plugin": "^1.0.3",
"@sentry/browser": "^7.28.0",
"@sentry/tracing": "^7.28.0",
"@sentry/browser": "^7.37.0",
"@sentry/tracing": "^7.37.0",
"@synthetixio/contracts-interface": "2.76.3",
"@synthetixio/optimism-networks": "2.74.6",
"@synthetixio/providers": "2.74.10",
Expand Down
10 changes: 7 additions & 3 deletions sections/futures/MarketDetails/MarketDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import media from 'styles/media';

import MarketsDropdown from '../Trade/MarketsDropdown';
import MarketDetail from './MarketDetail';
import MobileMarketDetail from './MobileMarketDetail';
import useGetMarketData from './useGetMarketData';

type MarketDetailsProps = {
Expand All @@ -26,9 +25,14 @@ const MarketDetails: React.FC<MarketDetailsProps> = ({ mobile }) => {

<MarketDetailsContainer mobile={mobile}>
{Object.entries(marketData).map(([marketKey, data]) => (
<MarketDetail {...data} key={marketKey} marketKey={marketKey} mobile={Boolean(mobile)} />
<MarketDetail
color={data.color}
value={data.value}
key={marketKey}
marketKey={marketKey}
mobile={Boolean(mobile)}
/>
))}
{mobile && <MobileMarketDetail />}
</MarketDetailsContainer>
</FlexDivCentered>
);
Expand Down
52 changes: 0 additions & 52 deletions sections/futures/MarketDetails/MobileMarketDetail.tsx

This file was deleted.

Loading

0 comments on commit b54a691

Please sign in to comment.