From 5c667cd2bb7f58652ef06c41d2aa893dd43b1db1 Mon Sep 17 00:00:00 2001 From: neural-machine <98684598+neural-machine@users.noreply.github.com> Date: Fri, 16 Sep 2022 16:03:26 -0700 Subject: [PATCH] Dynamic swap fee display (#260) * Dynamic swap fee display * Upgrade to Typescript 4.5 for Awaited * Upgraded lock file * Compact liquidity total * swap fee fixes for default lpFee * 0 fix * SwapInfo typing fixes * Default params Co-authored-by: Bao --- .../components/LiquidityBreakdown.tsx | 41 +++++++++++-------- package.json | 2 +- pages/pools/[pool].tsx | 2 + queries/querySwapInfo.ts | 25 ++++++++++- queries/useQueryPools.ts | 4 +- yarn.lock | 8 ++-- 6 files changed, 59 insertions(+), 23 deletions(-) diff --git a/features/liquidity/components/LiquidityBreakdown.tsx b/features/liquidity/components/LiquidityBreakdown.tsx index 4003a146..3713b81a 100644 --- a/features/liquidity/components/LiquidityBreakdown.tsx +++ b/features/liquidity/components/LiquidityBreakdown.tsx @@ -5,7 +5,6 @@ import { Column, Divider, dollarValueFormatter, - dollarValueFormatterWithDecimals, ImageForTokenLogo, InfoIcon, Inline, @@ -34,6 +33,8 @@ type LiquidityBreakdownProps = { yieldPercentageReturn: number rewardsContracts: Array size: 'large' | 'small' + lpFee?: number + protocolFee?: number } type PoolHeaderProps = { @@ -73,6 +74,23 @@ const PoolHeader = ({ tokenA, tokenB, priceBreakdown }: PoolHeaderProps) => ( ) +const SwapFee = ({ + protocolFee = 0, + lpFee = 0.3, +}: { + protocolFee?: number + lpFee?: number +}) => ( + <> + {`${protocolFee + lpFee}%`} + +