diff --git a/app/src/components/common/RowItem/index.tsx b/app/src/components/common/RowItem/index.tsx index f74a4d6f..17de8fe2 100644 --- a/app/src/components/common/RowItem/index.tsx +++ b/app/src/components/common/RowItem/index.tsx @@ -7,15 +7,22 @@ type Props = { label: string | React.ReactNode value: string | React.ReactNode valueColor?: TextColor + variant?: 'small' | 'body' } & MarginProps & LayoutProps -export default function RowItem({ label, value, valueColor = 'text', ...styleProps }: Props) { +export default function RowItem({ label, value, variant, valueColor = 'text', ...styleProps }: Props) { return ( - {typeof label === 'string' ? {label} : label} + {typeof label === 'string' ? ( + + {label} + + ) : ( + label + )} {typeof value === 'string' ? ( - + {value} ) : ( diff --git a/app/src/components/rewards/TradingFeeRebateTable/index.tsx b/app/src/components/rewards/TradingFeeRebateTable/index.tsx deleted file mode 100644 index c40645c7..00000000 --- a/app/src/components/rewards/TradingFeeRebateTable/index.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import Flex from '@lyra/ui/components/Flex' -import Text from '@lyra/ui/components/Text' -import { LayoutProps, MarginProps } from '@lyra/ui/types' -import formatNumber from '@lyra/ui/utils/formatNumber' -import formatPercentage from '@lyra/ui/utils/formatPercentage' -import { GlobalRewardEpochTradingFeeRebateTier } from '@lyrafinance/lyra-js' -import React from 'react' - -import RowItem from '../../common/RowItem' - -type Props = { - feeRebateTiers: GlobalRewardEpochTradingFeeRebateTier[] - effectiveRebate?: number -} & MarginProps & - LayoutProps - -export function TradingFeeRebateTable({ effectiveRebate, feeRebateTiers, ...styleProps }: Props) { - return ( - - Staked LYRA} - value={Rebate} - /> - - {feeRebateTiers.map(feeRebateTier => ( - - {formatNumber(feeRebateTier.stakedLyraCutoff)} - - } - value={ - - {formatPercentage(feeRebateTier.feeRebate, true)} - - } - /> - ))} - - - ) -} diff --git a/app/src/constants/ignore.ts b/app/src/constants/ignore.ts deleted file mode 100644 index a210c96f..00000000 --- a/app/src/constants/ignore.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { Chain } from '@lyrafinance/lyra-js' - -import filterNulls from '../utils/filterNulls' - -export type IgnoreStrike = { - marketName: string - strikeId: number - chain: Chain -} - -export type IgnoreVault = { - marketName: string - chain: Chain -} - -export type IgnoreMarket = { - marketName: string - chain: Chain -} - -export const IGNORE_STRIKE_LIST: IgnoreStrike[] = [] - -export const IGNORE_VAULTS_LIST: IgnoreVault[] = filterNulls([ - { - marketName: 'sSOL-sUSD', - chain: Chain.Optimism, - }, -]) - -export const IGNORE_MARKETS_LIST: IgnoreMarket[] = filterNulls([ - { - marketName: 'sSOL-sUSD', - chain: Chain.Optimism, - }, -]) diff --git a/app/src/constants/layout.ts b/app/src/constants/layout.ts index b9bd4353..cc72f71b 100644 --- a/app/src/constants/layout.ts +++ b/app/src/constants/layout.ts @@ -5,7 +5,7 @@ export const MOBILE_HEADER_HEIGHT = 42 export const PAGE_WIDTH = 1300 export const PAGE_FULL_WIDTH = 1800 -export const HEADER_CARD_HEIGHT = 206 +export const HEADER_CARD_HEIGHT = 200 export const VAULTS_CHART_HEIGHT = [120, 250] export const VAULTS_INDEX_CHART_HEIGHT = [120, 250] diff --git a/app/src/containers/common/TotalSupplyHeaderCard/index.tsx b/app/src/containers/common/TotalSupplyHeaderCard/index.tsx index 23ff79d7..4929b704 100644 --- a/app/src/containers/common/TotalSupplyHeaderCard/index.tsx +++ b/app/src/containers/common/TotalSupplyHeaderCard/index.tsx @@ -19,16 +19,15 @@ const TotalSupplyHeaderCard = withSuspense(() => { const circulatingSupplyPct = supply ? supply.totalCirculatingSupply / supply.totalSupply : 0 return supply ? ( - - - Circulating Supply - - + + Circulating Supply + { )})`} /> { )})`} /> { } > - {formatNumber(supply.totalCirculatingSupply)} + {formatNumber(supply.totalCirculatingSupply)} - + {formatNumber(supply.totalSupply)} - {formatPercentage(circulatingSupplyPct, true)} + {formatPercentage(circulatingSupplyPct, true)} ) : null diff --git a/app/src/containers/earn/EarnVaultsHeaderCard/index.tsx b/app/src/containers/earn/EarnVaultsHeaderCard/index.tsx index fa7906ce..59af1c7a 100644 --- a/app/src/containers/earn/EarnVaultsHeaderCard/index.tsx +++ b/app/src/containers/earn/EarnVaultsHeaderCard/index.tsx @@ -28,13 +28,10 @@ const EarnVaultsHeaderCard = ({ latestAccountRewardEpoch, totalClaimableRewards, return ( - - - Vault Rewards - - + + Vault Rewards + { const liquidityTokenBalanceValue = vault.liquidityTokenBalanceValue - if (!firstRewardToken || !vaultRewards) { - return null - } - - const isBoosted = (accountRewardEpoch?.stakedLyraBalance ?? 0) > 0 + const isBoosted = vault.apyMultiplier > 1.01 return ( { {formatTokenName(market.baseToken)} Vault · {getNetworkDisplayName(market.lyra.network)} {vault.isDeprecated ? ( - - [Deprecated] + + Deprecated - ) : null} - {vault.market.lyra.version === Version.Newport && vault.market.lyra.network === Network.Optimism ? ( + ) : vault.market.lyra.version === Version.Newport && vault.market.lyra.network === Network.Optimism ? ( New @@ -136,11 +131,15 @@ const RewardsVaultsMarketCard = ({ vault }: Props) => { Rewards - 0.001 ? 'primaryText' : 'text'} - tokenAmounts={[vaultRewards]} - hideTokenImages={true} - /> + {vaultRewards ? ( + 0.001 ? 'primaryText' : 'text'} + tokenAmounts={[vaultRewards]} + hideTokenImages={true} + /> + ) : ( + - + )} ) : null} diff --git a/app/src/containers/trade/TradeForm/TradeFormButton.tsx b/app/src/containers/trade/TradeForm/TradeFormButton.tsx index 28ffdc55..018a44a2 100644 --- a/app/src/containers/trade/TradeForm/TradeFormButton.tsx +++ b/app/src/containers/trade/TradeForm/TradeFormButton.tsx @@ -181,7 +181,7 @@ const TradeFormButton = ({ onTrade, trade, ...styleProps }: Props) => { const maxCostNum = fromBigNumber(maxCost) const minCostNum = fromBigNumber(minCost) const totalCostNum = fromBigNumber(totalCost) - console.log({ + console.debug({ blockTimestamp: market.block.timestamp, timeSinceBlock: Date.now() / 1000 - market.block.timestamp, maxCostNum, diff --git a/app/src/containers/vaults/VaultsHistoryCard/index.tsx b/app/src/containers/vaults/VaultsHistoryCard/index.tsx index 02b15510..dca19499 100644 --- a/app/src/containers/vaults/VaultsHistoryCard/index.tsx +++ b/app/src/containers/vaults/VaultsHistoryCard/index.tsx @@ -2,7 +2,7 @@ import Box from '@lyra/ui/components/Box' import ToggleButton from '@lyra/ui/components/Button/ToggleButton' import ToggleButtonItem from '@lyra/ui/components/Button/ToggleButtonItem' import Card from '@lyra/ui/components/Card' -import CardBody from '@lyra/ui/components/Card/CardBody' +import CardSection from '@lyra/ui/components/Card/CardSection' import Flex from '@lyra/ui/components/Flex' import Text from '@lyra/ui/components/Text' import Countdown from '@lyra/ui/components/Text/CountdownText' @@ -77,12 +77,12 @@ const VaultsHistoryCard = ({ vault, latestGlobalRewardEpoch, accountRewardEpochs const showDeposits = selectedItem === 'deposits' return ( - - + + History - + {VAULT_HISTORY_TABS.map(item => ( setSelectedItem(id)} - width="100%" - textVariant="body" /> ))} + + {showRewards ? ( account && accountEpochsSorted.length > 0 && !latestGlobalRewardEpoch.isDepositPeriod ? ( @@ -103,9 +103,6 @@ const VaultsHistoryCard = ({ vault, latestGlobalRewardEpoch, accountRewardEpochs Ended - - Your Liquidity - Your Rewards @@ -123,13 +120,6 @@ const VaultsHistoryCard = ({ vault, latestGlobalRewardEpoch, accountRewardEpochs return ( {formatDate(globalEpoch.endTimestamp)} - - {formatBalance({ - balance: accountEpoch?.vaultTokenBalance(market.address) ?? 0, - symbol: market.liquidityToken.symbol, - decimals: market.liquidityToken.decimals, - })} - {vaultRewards.map(t => formatBalance(t)).join(', ')} {isLateDistribution ? ( @@ -137,7 +127,7 @@ const VaultsHistoryCard = ({ vault, latestGlobalRewardEpoch, accountRewardEpochs Claiming delayed ) : isPendingDistribution ? ( - + Claimable in  @@ -148,7 +138,9 @@ const VaultsHistoryCard = ({ vault, latestGlobalRewardEpoch, accountRewardEpochs })} ) : ( - No Rewards History + + No rewards history. + ) ) : null} {showDeposits ? ( @@ -178,10 +170,12 @@ const VaultsHistoryCard = ({ vault, latestGlobalRewardEpoch, accountRewardEpochs })} ) : ( - No Deposit History + + No deposit history. + ) ) : null} - + ) } diff --git a/app/src/containers/vaults/VaultsMarketDropdown/index.tsx b/app/src/containers/vaults/VaultsMarketDropdown/index.tsx index 83829d79..cce97f86 100644 --- a/app/src/containers/vaults/VaultsMarketDropdown/index.tsx +++ b/app/src/containers/vaults/VaultsMarketDropdown/index.tsx @@ -1,7 +1,6 @@ import DropdownButton from '@lyra/ui/components/Button/DropdownButton' import DropdownButtonListItem from '@lyra/ui/components/Button/DropdownButtonListItem' import { DropdownIconButtonElement } from '@lyra/ui/components/Button/DropdownIconButton' -import Flex from '@lyra/ui/components/Flex' import Text from '@lyra/ui/components/Text' import React, { useCallback, useState } from 'react' @@ -39,13 +38,15 @@ const VaultsMarketDropdown = ({ vaults, selectedVault, ...styleProps }: Props): + {formatTokenName(market.baseToken)} Vault{isDeprecated ? ' · Deprecated' : ''} + + } sublabel={ - - - {getNetworkDisplayName(market.lyra.network)} - - + + {getNetworkDisplayName(market.lyra.network)} + } href={getPagePath({ page: PageId.EarnVaults, diff --git a/app/src/containers/vaults/VaultsMyLiquidityCard/index.tsx b/app/src/containers/vaults/VaultsMyLiquidityCard/index.tsx index 7129bc22..118263d8 100644 --- a/app/src/containers/vaults/VaultsMyLiquidityCard/index.tsx +++ b/app/src/containers/vaults/VaultsMyLiquidityCard/index.tsx @@ -11,13 +11,11 @@ import formatBalance from '@lyra/ui/utils/formatBalance' import formatNumber from '@lyra/ui/utils/formatNumber' import formatPercentage from '@lyra/ui/utils/formatPercentage' import formatUSD from '@lyra/ui/utils/formatUSD' -import { Version } from '@lyrafinance/lyra-js' import React, { useCallback, useState } from 'react' import LabelItem from '@/app/components/common/LabelItem' import VaultsPendingDepositsTableOrList from '@/app/components/common/VaultsPendingDepositsTableOrList' import VaultsPendingWithdrawalsTableOrList from '@/app/components/common/VaultsPendingWithdrawalsTableOrList' -import { IGNORE_VAULTS_LIST } from '@/app/constants/ignore' import { Vault } from '@/app/constants/vault' import VaultsBoostFormModal from '@/app/containers/vaults/VaultsBoostFormModal' import formatAPY from '@/app/utils/formatAPY' @@ -79,31 +77,21 @@ const VaultsMyLiquidityCard = ({ vault }: Props) => { ) : null} - {vault.liquidityToken.balance.gt(0) ? ( + {!vault.isDeprecated && vault.liquidityToken.balance.gt(0) ? (