Skip to content

Commit

Permalink
Merge pull request #1030 from galacticcouncil/update-fees
Browse files Browse the repository at this point in the history
Update pools fee
  • Loading branch information
vkulinich-cl authored Feb 26, 2024
2 parents 50610c4 + 4cbf4d7 commit e336e11
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 8 deletions.
17 changes: 12 additions & 5 deletions src/sections/pools/modals/AddLiquidity/AddLiquidityForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ export const AddLiquidityForm = ({
const { calculatedShares, spotPrice, omnipoolFee, assetMeta, assetBalance } =
useAddLiquidity(assetId, assetValue)

const { api } = useRpcProvider()
const {
api,
assets: { native },
} = useRpcProvider()
const { createTransaction } = useStore()

const { data: limits } = useVerifyLimits({
Expand Down Expand Up @@ -214,10 +217,14 @@ export const AddLiquidityForm = ({
/>
<SummaryRow
label={t("liquidity.add.modal.lpFee")}
content={t("value.percentage.range", {
from: omnipoolFee?.minFee.multipliedBy(100),
to: omnipoolFee?.maxFee.multipliedBy(100),
})}
content={
assetId === native.id
? "--"
: t("value.percentage.range", {
from: omnipoolFee?.minFee.multipliedBy(100),
to: omnipoolFee?.maxFee.multipliedBy(100),
})
}
/>
<Spacer size={24} />
<Text color="pink500" fs={15} font="FontOver" tTransform="uppercase">
Expand Down
6 changes: 6 additions & 0 deletions src/sections/pools/pool/details/PoolDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,12 @@ export const PoolDetails = ({
<Text color="white" fs={[14, 16]} fw={600}>
{ixXYKPool ? (
t("value.percentage", { value: pool.fee })
) : pool.id === assets.native.id ? (
"--"
) : pool.stablepoolFee ? (
t("value.percentage", {
value: pool.stablepoolFee.times(100),
})
) : omnipoolFee.isLoading ? (
<Skeleton height={16} width={50} />
) : (
Expand Down
5 changes: 4 additions & 1 deletion src/sections/pools/table/PoolsTable.utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,9 @@ const APY = ({
isLoading: boolean
}) => {
const { t } = useTranslation()
const {
assets: { native },
} = useRpcProvider()
const farms = useFarms([assetId])

if (isLoading || farms.isInitialLoading) return <CellSkeleton />
Expand All @@ -313,7 +316,7 @@ const APY = ({
return (
<NonClickableContainer>
<Text color="white" fs={14}>
{t("value.percentage", { value: fee })}
{assetId === native.id ? "--" : t("value.percentage", { value: fee })}
</Text>
</NonClickableContainer>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import BN from "bignumber.js"
import { Farm, useFarmAprs, useFarms } from "api/farms"
import { useMemo } from "react"
import { BN_0 } from "utils/constants"
import { useRpcProvider } from "providers/rpcProvider"

const APYFarmStatsCard = ({ farms, apy }: { farms: Farm[]; apy: number }) => {
const { t } = useTranslation()
Expand Down Expand Up @@ -56,6 +57,9 @@ const APYStatsCard = ({
fee: BN
}) => {
const { t } = useTranslation()
const {
assets: { native },
} = useRpcProvider()
const farms = useFarms([assetId])

if (farms.data?.length)
Expand All @@ -64,7 +68,9 @@ const APYStatsCard = ({
return (
<AssetStatsCard
title={t("stats.omnipool.stats.card.apy")}
value={t("value.percentage", { value: fee })}
value={
assetId === native.id ? "--" : t("value.percentage", { value: fee })
}
loading={loading || farms.isInitialLoading}
tooltip={t("stats.overview.table.assets.header.apy.desc")}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { BN_0 } from "utils/constants"
import BigNumber from "bignumber.js"
import { InfoTooltip } from "components/InfoTooltip/InfoTooltip"
import { SInfoIcon } from "components/InfoTooltip/InfoTooltip.styled"
import { useRpcProvider } from "providers/rpcProvider"

const APYFarming = ({ farms, apy }: { farms: Farm[]; apy: number }) => {
const { t } = useTranslation()
Expand Down Expand Up @@ -72,6 +73,9 @@ const APY = ({
isLoading: boolean
}) => {
const { t } = useTranslation()
const {
assets: { native },
} = useRpcProvider()
const farms = useFarms([assetId])

if (isLoading || farms.isInitialLoading) return <CellSkeleton />
Expand All @@ -81,7 +85,7 @@ const APY = ({

return (
<Text color="white" fs={14}>
{t("value.percentage", { value: fee })}
{assetId === native.id ? "--" : t("value.percentage", { value: fee })}
</Text>
)
}
Expand Down

0 comments on commit e336e11

Please sign in to comment.