From 39318d54f7aa9279df5a194393a17f9620f12662 Mon Sep 17 00:00:00 2001 From: Doron Zavelevsky Date: Thu, 26 Oct 2023 08:23:38 +0100 Subject: [PATCH] compensate for API error by assuming all fees are network fees --- src/config.ts | 2 +- src/elements/earn/pools/Statistics.tsx | 12 ++------- .../earn/pools/poolsTable/PoolsTable.tsx | 27 +++---------------- .../earn/portfolio/v3/V3AvailableToStake.tsx | 4 +-- src/services/observables/pools.ts | 19 +++++++------ src/services/observables/statistics.ts | 2 +- 6 files changed, 18 insertions(+), 48 deletions(-) diff --git a/src/config.ts b/src/config.ts index f2d172e96..776cae723 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,7 +1,7 @@ export const config = { externalUrls: { networkFeesSnapshotUrl: - 'https://vote.bancor.network/#/proposal/0x61cd3ec4295bf0819fb7fd80a9dcc0922036510f40b02c76213b29c48a1a5137', + 'https://vote.bancor.network/#/proposal/0x74917631a57cfbd39b06f25473941a993cdf1e57f2873bfe46a9f62bfee5e8f4', rewardsProgramsArticle: 'https://support.bancor.network/hc/en-us/articles/5415540047506-Auto-Compounding-Rewards-Standard-Rewards-programs', governance: 'https://gov.bancor.network', diff --git a/src/elements/earn/pools/Statistics.tsx b/src/elements/earn/pools/Statistics.tsx index 6a21e2f1e..e3bf90691 100644 --- a/src/elements/earn/pools/Statistics.tsx +++ b/src/elements/earn/pools/Statistics.tsx @@ -74,19 +74,11 @@ const toolTip = (stats: Statistic) => {
- Fees - 24h -
-
{`$${numbro(stats.totalFees).format(averageFormat)}`}
-
-
-
+ {/* we show the text as Network Fees instead of fees - see this commit to better understand */} Network Fees 24h
-
- {`$${numbro(stats.totalNetworkFees).format(averageFormat)}`} -
+
{`$${numbro(stats.totalFees).format(averageFormat)}`}
diff --git a/src/elements/earn/pools/poolsTable/PoolsTable.tsx b/src/elements/earn/pools/poolsTable/PoolsTable.tsx index fbecd5b70..bf3b63caa 100644 --- a/src/elements/earn/pools/poolsTable/PoolsTable.tsx +++ b/src/elements/earn/pools/poolsTable/PoolsTable.tsx @@ -61,41 +61,22 @@ export const PoolsTable = ({
Liquidity -
- {toBigNumber(row.stakedBalance.usd).isZero() - ? 'New' - : prettifyNumber(row.stakedBalance.usd, true)} -
+
{prettifyNumber(row.stakedBalance.usd, true)}
Volume 7d -
- {toBigNumber(row.volume7d.usd).isZero() - ? 'New' - : prettifyNumber(row.volume7d.usd, true)} -
+
{prettifyNumber(row.volume7d.usd, true)}
Fees 7d -
- {toBigNumber(row.fees7d.usd).isZero() - ? 'New' - : prettifyNumber(row.fees7d.usd, true)} -
+
{prettifyNumber(row.fees7d.usd, true)}
LP Fees 7d
-
- {toBigNumber(row.fees7d.usd).minus(row.networkFees7d.usd).isZero() - ? 'New' - : prettifyNumber( - toBigNumber(row.fees7d.usd).minus(row.networkFees7d.usd), - true - )} -
+
0
), diff --git a/src/elements/earn/portfolio/v3/V3AvailableToStake.tsx b/src/elements/earn/portfolio/v3/V3AvailableToStake.tsx index 00ada31e9..13266b645 100644 --- a/src/elements/earn/portfolio/v3/V3AvailableToStake.tsx +++ b/src/elements/earn/portfolio/v3/V3AvailableToStake.tsx @@ -29,9 +29,7 @@ const AvailableItem = ({ token, pool }: { token: Token; pool: PoolV3 }) => {
Earn
- {pool.apr7d.total === 0 && !pool.depositingEnabled - ? 'New' - : `${pool.apr7d.total.toFixed(2)}%`} + {`${pool.apr7d.total.toFixed(2)}%`}
diff --git a/src/services/observables/pools.ts b/src/services/observables/pools.ts index 9d45e895b..d25975fca 100644 --- a/src/services/observables/pools.ts +++ b/src/services/observables/pools.ts @@ -4,7 +4,6 @@ import { Token, tokensV3$, } from 'services/observables/tokens'; -import BigNumber from 'bignumber.js'; import { combineLatest } from 'rxjs'; import { switchMapIgnoreThrow } from 'services/observables/customOperators'; import { distinctUntilChanged, shareReplay } from 'rxjs/operators'; @@ -201,15 +200,15 @@ const buildPoolV3Object = ( programs ); - const tradingFeesApr24h = calcApr( - new BigNumber(apiPool.fees24h.usd).minus(apiPool.networkFees24h.usd), - stakedBalance.usd - ); - const tradingFeesApr7d = calcApr( - new BigNumber(apiPool.fees7d.usd).minus(apiPool.networkFees7d.usd), - stakedBalance.usd, - true - ); + const tradingFeesApr24h = 0; // calcApr( + // new BigNumber(apiPool.fees24h.usd).minus(apiPool.networkFees24h.usd), + // stakedBalance.usd + // ); + const tradingFeesApr7d = 0; // calcApr( + // new BigNumber(apiPool.fees7d.usd).minus(apiPool.networkFees7d.usd), + // stakedBalance.usd, + // true + // ); // Auto Comp APR const autoCompoundingApr24H = calcApr( diff --git a/src/services/observables/statistics.ts b/src/services/observables/statistics.ts index c60ec93cb..91603b4e1 100644 --- a/src/services/observables/statistics.ts +++ b/src/services/observables/statistics.ts @@ -65,7 +65,7 @@ export const statisticsV3$ = combineLatest([apiData$, oneMinute$]).pipe( bntRate: stats.bntRate, totalBNTStaked: totalBNTStaked.toString(), totalNetworkFees: totalNetworkFees.toString(), - totalLpFees: totalFees.minus(totalNetworkFees).toString(), + totalLpFees: '0', }; return statistics; }),