55 Column ,
66 Divider ,
77 dollarValueFormatter ,
8- dollarValueFormatterWithDecimals ,
98 ImageForTokenLogo ,
109 InfoIcon ,
1110 Inline ,
@@ -34,6 +33,8 @@ type LiquidityBreakdownProps = {
3433 yieldPercentageReturn : number
3534 rewardsContracts : Array < SerializedRewardsContract >
3635 size : 'large' | 'small'
36+ lpFee ?: number
37+ protocolFee ?: number
3738}
3839
3940type PoolHeaderProps = {
@@ -73,13 +74,32 @@ const PoolHeader = ({ tokenA, tokenB, priceBreakdown }: PoolHeaderProps) => (
7374 </ Inline >
7475)
7576
77+ const SwapFee = ( {
78+ protocolFee = 0 ,
79+ lpFee = 0.3 ,
80+ } : {
81+ protocolFee ?: number
82+ lpFee ?: number
83+ } ) => (
84+ < >
85+ < Text variant = "header" > { `${ protocolFee + lpFee } %` } </ Text >
86+ < Tooltip
87+ label = { `${ lpFee } % of Swap Fee goes to LP Providers (LP) and ${ protocolFee } % goes to Raw DAO` }
88+ >
89+ < Button variant = "ghost" size = "small" icon = { < InfoIcon /> } />
90+ </ Tooltip >
91+ </ >
92+ )
93+
7694export const LiquidityBreakdown = ( {
7795 tokenA,
7896 tokenB,
7997 poolId,
8098 totalLiquidity,
8199 yieldPercentageReturn,
82100 rewardsContracts,
101+ lpFee,
102+ protocolFee,
83103 size = 'large' ,
84104} : LiquidityBreakdownProps ) => {
85105 const [ { price : tokenPrice } , isPriceLoading ] = useTokenToTokenPrice ( {
@@ -103,9 +123,8 @@ export const LiquidityBreakdown = ({
103123 const compactTokenAAmount = formatCompactNumber ( tokenAAmount , 'tokenAmount' )
104124 const compactTokenBAmount = formatCompactNumber ( tokenBAmount , 'tokenAmount' )
105125
106- const formattedTotalLiquidity = dollarValueFormatterWithDecimals (
107- totalLiquidity ?. dollarValue ,
108- { includeCommaSeparation : true }
126+ const formattedTotalLiquidity = formatCompactNumber (
127+ totalLiquidity ?. dollarValue
109128 )
110129
111130 const formattedYieldPercentageReturn = dollarValueFormatter (
@@ -176,12 +195,7 @@ export const LiquidityBreakdown = ({
176195 </ Text >
177196
178197 < Inline gap = { 2 } >
179- < Text variant = "header" > 0.3%</ Text >
180- < Tooltip
181- label = { `0.2% of Swap Fee goes to LP Providers (LP) and 0.1% goes to Raw DAO` }
182- >
183- < Button variant = "ghost" size = "small" icon = { < InfoIcon /> } />
184- </ Tooltip >
198+ < SwapFee lpFee = { lpFee } protocolFee = { protocolFee } />
185199 </ Inline >
186200 </ Column >
187201 { __POOL_REWARDS_ENABLED__ &&
@@ -251,12 +265,7 @@ export const LiquidityBreakdown = ({
251265 </ Text >
252266
253267 < Inline gap = { 2 } >
254- < Text variant = "header" > 0.3%</ Text >
255- < Tooltip
256- label = { `0.2% of Swap Fee goes to LP Providers (LP) and 0.1% goes to Raw DAO` }
257- >
258- < Button variant = "ghost" size = "small" icon = { < InfoIcon /> } />
259- </ Tooltip >
268+ < SwapFee lpFee = { lpFee } protocolFee = { protocolFee } />
260269 </ Inline >
261270 </ Column >
262271
0 commit comments