Skip to content

Commit 5174478

Browse files
committed
feat: display eg sharing for farming tab
1 parent 93e9015 commit 5174478

File tree

5 files changed

+38
-14
lines changed

5 files changed

+38
-14
lines changed

apps/kyberswap-interface/.env.production

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ VITE_CAMPAIGN_URL=https://kyberswap-arbitrum-stip.kyberengineering.io/api
4242
VITE_REFERRAL_URL=https://referral.kyberswap.com/api
4343

4444
VITE_TOKEN_API_URL=https://token-api.kyberengineering.io/api
45-
VITE_ZAP_EARN_URL=https://zap-earn-service-v3.kyberengineering.io/api
45+
VITE_ZAP_EARN_URL=https://pre-zap-earn-service.kyberengineering.io/api
4646

4747
VITE_AFFILIATE_SERVICE=https://affiliate-service.kyberengineering.io/api
4848
VITE_SOLANA_RPC=https://solana.kyberengineering.io

apps/kyberswap-interface/src/pages/Earns/PoolExplorer/DesktopTableRow.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,10 @@ const DesktopTableRow = ({
121121
</Flex>
122122
)}
123123
<Flex justifyContent="flex-end">
124-
{formatDisplayNumber(pool.earnFee, { style: 'currency', significantDigits: 6 })}
124+
{formatDisplayNumber(isFarmingFiltered ? pool.egUsd : pool.earnFee, {
125+
style: 'currency',
126+
significantDigits: 6,
127+
})}
125128
</Flex>
126129
<Flex justifyContent="flex-end">
127130
{formatDisplayNumber(pool.tvl, { style: 'currency', significantDigits: 6 })}

apps/kyberswap-interface/src/pages/Earns/PoolExplorer/MobileTableRow.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,13 @@ const MobileTableRow = ({
110110
</Flex>
111111
)}
112112
<Flex justifyContent="space-between" sx={{ gap: 1 }}>
113-
<Text color={theme.subText}>{t`Earn Fees`}</Text>
114-
<Text>{formatDisplayNumber(pool.earnFee, { style: 'currency', significantDigits: 6 })}</Text>
113+
<Text color={theme.subText}>{isFarmingFiltered ? t`EG Sharing` : t`Earn Fees`}</Text>
114+
<Text>
115+
{formatDisplayNumber(isFarmingFiltered ? pool.egUsd : pool.earnFee, {
116+
style: 'currency',
117+
significantDigits: 6,
118+
})}
119+
</Text>
115120
</Flex>
116121
<Flex justifyContent="space-between" sx={{ gap: 1 }}>
117122
<Text color={theme.subText}>{t`TVL`}</Text>

apps/kyberswap-interface/src/pages/Earns/PoolExplorer/TableHeader.tsx

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { t } from '@lingui/macro'
1+
import { Trans, t } from '@lingui/macro'
22
import { useMedia } from 'react-use'
33
import { Flex, Text } from 'rebass'
44
import { PoolQueryParams } from 'services/zapEarn'
@@ -41,15 +41,30 @@ const TableHeader = ({
4141
/>
4242
</Flex>
4343
)}
44-
<Flex
45-
justifyContent="flex-end"
46-
sx={{ gap: '4px', alignItems: 'center', cursor: 'pointer' }}
47-
role="button"
48-
onClick={() => onSortChange(SortBy.EARN_FEE)}
49-
>
50-
{t`Earn Fees`}
51-
<SortIcon sorted={filters.sortBy === SortBy.EARN_FEE ? (filters.orderBy as Direction) : undefined} />
52-
</Flex>
44+
{isFarmingFiltered ? (
45+
<Flex justifyContent="flex-end" sx={{ gap: '4px', alignItems: 'center' }} role="button">
46+
{t`EG Sharing`}
47+
<InfoHelper
48+
width="250px"
49+
text={
50+
<Trans>
51+
The estimated amount of <b>Equilibrium Gain</b> rewards that would be shared with liquidity providers
52+
during the selected time range
53+
</Trans>
54+
}
55+
/>
56+
</Flex>
57+
) : (
58+
<Flex
59+
justifyContent="flex-end"
60+
sx={{ gap: '4px', alignItems: 'center', cursor: 'pointer' }}
61+
role="button"
62+
onClick={() => onSortChange(SortBy.EARN_FEE)}
63+
>
64+
{t`Earn Fees`}
65+
<SortIcon sorted={filters.sortBy === SortBy.EARN_FEE ? (filters.orderBy as Direction) : undefined} />
66+
</Flex>
67+
)}
5368
<Flex
5469
justifyContent="flex-end"
5570
sx={{ gap: '4px', alignItems: 'center', cursor: 'pointer' }}

apps/kyberswap-interface/src/pages/Earns/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export interface EarnPool {
6161
kemEGApr: string
6262
kemLMApr: string
6363
}
64+
egUsd?: number
6465
}
6566

6667
export interface ParsedEarnPool extends EarnPool {

0 commit comments

Comments
 (0)