From 677563d7c2ecc7db96dc780f974a6b329169ad01 Mon Sep 17 00:00:00 2001 From: mihaisc Date: Thu, 17 Feb 2022 18:00:08 +0200 Subject: [PATCH] fix pool tab (#1121) * query update * fixes --- package.json | 2 +- src/@context/Pool/_queries.ts | 6 +++--- src/@context/Pool/index.tsx | 8 ++++---- src/components/Footer/MarketStats.tsx | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 569040653..de611dca5 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "type-check": "tsc --noEmit", "deploy:s3": "bash scripts/deploy-s3.sh", "postinstall": "husky install", - "codegen:apollo": "apollo client:codegen --endpoint=https://subgraphv4.rinkeby.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph --target typescript --tsFileExtension=d.ts --outputFlat src/@types/subgraph/" + "codegen:apollo": "apollo client:codegen --endpoint=https://v4.subgraph.rinkeby.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph --target typescript --tsFileExtension=d.ts --outputFlat src/@types/subgraph/" }, "dependencies": { "@coingecko/cryptoformat": "^0.4.4", diff --git a/src/@context/Pool/_queries.ts b/src/@context/Pool/_queries.ts index 8f89c8730..5de8503c5 100644 --- a/src/@context/Pool/_queries.ts +++ b/src/@context/Pool/_queries.ts @@ -10,9 +10,9 @@ export const poolDataQuery = gql` poolData: pool(id: $pool) { id totalShares - poolFee - opfFee - marketFee + liquidityProviderFee + opcFee + marketSwapFee spotPrice baseToken { address diff --git a/src/@context/Pool/index.tsx b/src/@context/Pool/index.tsx index 2451bb18a..8d4ca4339 100644 --- a/src/@context/Pool/index.tsx +++ b/src/@context/Pool/index.tsx @@ -118,10 +118,10 @@ function PoolProvider({ children }: { children: ReactNode }): ReactElement { useEffect(() => { if (!poolData) return - // Fees - const poolFee = getFee(poolData.poolFee) - const marketFee = getFee(poolData.marketFee) - const opfFee = getFee(poolData.opfFee) + // Fees - this will be renamed again in subgraph + const poolFee = getFee(poolData.liquidityProviderFee) + const marketFee = getFee(poolData.marketSwapFee) + const opfFee = getFee(poolData.opcFee) // Total Liquidity const totalLiquidityInOcean = isValidNumber(poolData.spotPrice) diff --git a/src/components/Footer/MarketStats.tsx b/src/components/Footer/MarketStats.tsx index 6735b923f..769c8737a 100644 --- a/src/components/Footer/MarketStats.tsx +++ b/src/components/Footer/MarketStats.tsx @@ -11,11 +11,11 @@ import useNetworkMetadata, { } from '@hooks/useNetworkMetadata' import { LoggerInstance } from '@oceanprotocol/lib' import styles from './MarketStats.module.css' -import { FooterStatsValues_globalStats_totalLiquidity_token as LiquidityToken } from 'src/@types/subgraph/FooterStatsValues' +import { FooterStatsValues_globalStatistics_totalLiquidity as LiquidityToken } from 'src/@types/subgraph/FooterStatsValues' const getGlobalStatsValues = gql` query FooterStatsValues { - globalStats { + globalStatistics { poolCount nftCount datatokenCount @@ -150,7 +150,7 @@ export default function MarketStats(): ReactElement { await setTotalOceanLiquidity((prevState) => ({ ...prevState, [chainId]: totalLiquidity.filter( - (token: LiquidityToken) => token.symbol === 'OCEAN' + (token: LiquidityToken) => token.token.symbol === 'OCEAN' )[0] })) await setPoolCount((prevState) => ({