Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOV-4493: Show ecosystem statistics only in BTC and USD #1034

Merged
merged 8 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/gentle-schools-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"frontend": patch
---

chore: fix asset icon styles
5 changes: 5 additions & 0 deletions .changeset/mighty-swans-remember.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"frontend": patch
---

SOV-4493: Show ecosystem statistics only in BTC and USD
11 changes: 11 additions & 0 deletions apps/frontend/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# frontend

## 1.1.24

### Patch Changes

- 0bc23cc0: chore: update rune symbols
- 52b7c4fe: chore: add new pools
- Updated dependencies [0bc23cc0]
- Updated dependencies [52b7c4fe]
- @sovryn/[email protected]
- @sovryn/[email protected]

## 1.1.23

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "frontend",
"version": "1.1.23",
"version": "1.1.24",
"homepage": ".",
"private": true,
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
}

.assetLogo svg {
@apply mr-2 w-5 h-5;
@apply mr-2 w-5 h-5 bg-gray-80 rounded-full overflow-hidden;
}

.asset {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,7 @@ export const AssetRenderer: FC<AssetRendererProps> = ({
>
{showAssetLogo && logo && (
<div
className={classNames(
styles.assetLogo,
logoClassName,
'rounded-full overflow-hidden',
)}
className={classNames(styles.assetLogo, logoClassName)}
dangerouslySetInnerHTML={{ __html: logo }}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,6 @@ export const CATEGORY_TOKENS: Record<CategoryType, string[]> = {
[CategoryType.Stablecoins]: SMART_ROUTER_STABLECOINS,
[CategoryType.BTC]: [COMMON_SYMBOLS.BTC],
[CategoryType.Runes]: ['POWA', 'DOGGOTOTHEMOON'],
[CategoryType.LST]: ['SolvBTC.BBN', 'UniBTC'],
[CategoryType.All]: [],
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ export enum CategoryType {
Stablecoins = 'Stablecoins',
BTC = 'BTC',
Runes = 'Runes',
LST = 'LST',
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,38 +112,38 @@ export const bobMainnet: AmbientLiquidityPool[] = [
// new AmbientLiquidityPool('RETH', 'ETH', ChainIds.BOB_MAINNET, 400),
// new AmbientLiquidityPool('WSTETH', 'ETH', ChainIds.BOB_MAINNET, 400),

// new AmbientLiquidityPool(
// 'UniBTC',
// 'SolvBTC.BBN',
// ChainIds.BOB_MAINNET,
// 400,
// '0xEBE212e59c012Bd2f092489d98d11fCe17697cb2',
// PoolListGroup.new,
// ),
// new AmbientLiquidityPool(
// 'UniBTC',
// 'wBTC',
// ChainIds.BOB_MAINNET,
// 400, // todo
// '0x6D1529a7b34D452488f577495Dd7574954339dD9',
// PoolListGroup.new,
// ),
// new AmbientLiquidityPool(
// 'SolvBTC.BBN',
// 'wBTC',
// ChainIds.BOB_MAINNET,
// 400,
// '0x0F3dAef46d5631f4C335643e287314580135011E',
// PoolListGroup.new,
// ),
// new AmbientLiquidityPool(
// 'wBTC',
// 'SolvBTC',
// ChainIds.BOB_MAINNET,
// 400,
// '0xF11aB627c41044f40B5C2587e77540e7fC7Af42a',
// PoolListGroup.new,
// ),
new AmbientLiquidityPool(
'UniBTC',
'SolvBTC.BBN',
ChainIds.BOB_MAINNET,
400,
'0xEBE212e59c012Bd2f092489d98d11fCe17697cb2',
PoolListGroup.new,
),
new AmbientLiquidityPool(
'UniBTC',
'wBTC',
ChainIds.BOB_MAINNET,
400, // todo
'0x6D1529a7b34D452488f577495Dd7574954339dD9',
PoolListGroup.new,
),
new AmbientLiquidityPool(
'SolvBTC.BBN',
'wBTC',
ChainIds.BOB_MAINNET,
400,
'0x0F3dAef46d5631f4C335643e287314580135011E',
PoolListGroup.new,
),
new AmbientLiquidityPool(
'wBTC',
'SolvBTC',
ChainIds.BOB_MAINNET,
400,
'0xF11aB627c41044f40B5C2587e77540e7fC7Af42a',
PoolListGroup.new,
),
new AmbientLiquidityPool(
'DOGGOTOTHEMOON',
'POWA',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,32 @@ import { t } from 'i18next';

import { Button, ButtonStyle, Paragraph } from '@sovryn/ui';

import { RSK_CHAIN_ID } from '../../../../../config/chains';

import { AmountRenderer } from '../../../../2_molecules/AmountRenderer/AmountRenderer';
import { NativeTokenAmount } from '../../../../2_molecules/NativeTokenAmount/NativeTokenAmount';
import { BITCOIN, ETH, USD } from '../../../../../constants/currencies';
import { BITCOIN, USD } from '../../../../../constants/currencies';
import { useCurrentChain } from '../../../../../hooks/useChainStore';
import { translations } from '../../../../../locales/i18n';
import { isBobChain, isRskChain } from '../../../../../utils/chain';
import { isBobChain } from '../../../../../utils/chain';
import { useGetLockedData } from '../../../LandingPage/components/ProtocolData/hooks/useGetLockedData';
import { getCurrencyPrecision } from '../../../PortfolioPage/components/ProtocolSection/ProtocolSection.utils';
import { pageTranslations } from '../../ProtocolDataPage.constants';
import { ContractData } from './EcosystemStatistics.types';

const currencies = [BITCOIN, USD];

export const EcosystemStatistics: FC = () => {
const lockedData = useGetLockedData();
const chainId = useCurrentChain();

const currencies = useMemo(
() => (isRskChain(chainId) ? [BITCOIN, USD] : [ETH, USD]),
[chainId],
);
const [selectedCurrency, setSelectedCurrency] = useState(USD);

useEffect(() => {
if (!currencies.includes(selectedCurrency)) {
setSelectedCurrency(currencies[0]);
}
}, [currencies, selectedCurrency]);
}, [selectedCurrency]);

const totalValue = useMemo(() => {
if (isBobChain(chainId)) {
Expand Down Expand Up @@ -59,13 +59,10 @@ export const EcosystemStatistics: FC = () => {
lockedData.tvlZero?.totalUsd,
]);

const subTotalValue = useMemo(() => {
if (isBobChain(chainId)) {
return totalValue - Number(lockedData.tvlStaking?.totalUsd || 0);
} else {
return totalValue - Number(lockedData.tvlStaking?.totalUsd || 0);
}
}, [chainId, lockedData.tvlStaking?.totalUsd, totalValue]);
const subTotalValue = useMemo(
() => totalValue - Number(lockedData.tvlStaking?.totalUsd || 0),
[lockedData.tvlStaking?.totalUsd, totalValue],
);

const list: ContractData[] = useMemo(() => {
if (isBobChain(chainId)) {
Expand All @@ -83,6 +80,7 @@ export const EcosystemStatistics: FC = () => {
) : (
<NativeTokenAmount
usdValue={lockedData.tvlSdex?.totalUsd}
chainId={RSK_CHAIN_ID}
precision={getCurrencyPrecision(selectedCurrency)}
dataAttribute="ecosystem-statistics-sdex-contract-value"
/>
Expand All @@ -103,6 +101,7 @@ export const EcosystemStatistics: FC = () => {
) : (
<NativeTokenAmount
usdValue={lockedData.tvlStaking?.totalUsd}
chainId={RSK_CHAIN_ID}
precision={getCurrencyPrecision(selectedCurrency)}
dataAttribute="ecosystem-statistics-bitocracy-staking-value"
/>
Expand All @@ -121,6 +120,7 @@ export const EcosystemStatistics: FC = () => {
) : (
<NativeTokenAmount
usdValue={totalValue}
chainId={RSK_CHAIN_ID}
precision={getCurrencyPrecision(selectedCurrency)}
dataAttribute="ecosystem-statistics-total-value"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { translations } from '../../../locales/i18n';
import { RUNES_USE_CASE_ACTIONS, AvailableRunes } from './RunesPage.types';
import convertIcon from './assets/convert.svg';
import earnIcon from './assets/earn.svg';
import iconDog from './assets/iconDog.svg';
import iconPups from './assets/iconPups.svg';
import runesBenefitsIcon1 from './assets/l1.svg';
import runesBenefitsIcon2 from './assets/l2.svg';
Expand All @@ -16,11 +15,10 @@ export const AVAILABLE_RUNES: AvailableRunes = {
symbol: 'POWA',
},
DOG: {
symbol: 'DOG',
icon: iconDog,
symbol: 'DOGGOTOTHEMOON',
},
PUPS: {
symbol: 'PUPS',
symbol: 'PUPSWORLDPEACE',
icon: iconPups,
},
};
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/src/app/5_pages/RunesPage/RunesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const RunesPage: FC = () => {
className="text-gray-30 text-center font-medium text-base"
children={t(pageTranslations.availableRunes)}
/>
<div className="flex justify-center gap-3 my-6 flex-wrap px-6">
<div className="flex justify-center gap-3 my-6 flex-wrap">
{renderAvailableRunes()}
</div>

Expand Down
6 changes: 5 additions & 1 deletion apps/frontend/src/app/5_pages/RunesPage/RunesPage.utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { t } from 'i18next';

import { Button, ButtonSize, ButtonStyle, Paragraph } from '@sovryn/ui';

import { BOB_CHAIN_ID } from '../../../config/chains';

import { AssetRenderer } from '../../2_molecules/AssetRenderer/AssetRenderer';
import { translations } from '../../../locales/i18n';
import {
Expand All @@ -29,11 +31,13 @@ export const renderAvailableRunes = () =>
asset={symbol}
showAssetLogo
assetClassName="font-semibold text-gray-30"
logoClassName="rounded-full w-5 h-5 mr-2"
chainId={BOB_CHAIN_ID}
/>
)}
</div>
{symbol === AVAILABLE_RUNES.PUPS.symbol && (
<div className="text-xs text-gray-30">
<div className="text-xs text-gray-30 text-center">
{t(pageTranslations.availableSoon)}
</div>
)}
Expand Down
7 changes: 7 additions & 0 deletions packages/contracts/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @sovryn/contracts

## 1.2.3

### Patch Changes

- 0bc23cc0: chore: update rune symbols
- 52b7c4fe: chore: add new pools

## 1.2.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sovryn/contracts",
"version": "1.2.2",
"version": "1.2.3",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"license": "MIT",
Expand Down
42 changes: 21 additions & 21 deletions packages/contracts/src/contracts/assets/bob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,25 +96,25 @@ export const bob: Array<AssetDetails> = [
decimals: 18,
getIcon: async () => (await import('./icons/bob/sat')).default,
},
// {
// symbol: 'SolvBTC',
// address: '0x541FD749419CA806a8bc7da8ac23D346f2dF8B77',
// name: 'SolvBTC',
// decimals: 18,
// getIcon: async () => (await import('./icons/bob/solvbtc')).default,
// },
// {
// symbol: 'SolvBTC.BBN',
// address: '0xCC0966D8418d412c599A6421b760a847eB169A8c',
// name: 'SolvBTC Babylon',
// decimals: 18,
// getIcon: async () => (await import('./icons/bob/solvbtc_bbn')).default,
// },
// {
// symbol: 'UniBTC',
// address: '0x236f8c0a61dA474dB21B693fB2ea7AAB0c803894',
// name: 'UniBTC',
// decimals: 8,
// getIcon: async () => (await import('./icons/bob/unibtc')).default,
// },
{
symbol: 'SolvBTC',
address: '0x541FD749419CA806a8bc7da8ac23D346f2dF8B77',
name: 'SolvBTC',
decimals: 18,
getIcon: async () => (await import('./icons/bob/solvbtc')).default,
},
{
symbol: 'SolvBTC.BBN',
address: '0xCC0966D8418d412c599A6421b760a847eB169A8c',
name: 'SolvBTC Babylon',
decimals: 18,
getIcon: async () => (await import('./icons/bob/solvbtc_bbn')).default,
},
{
symbol: 'UniBTC',
address: '0x236f8c0a61dA474dB21B693fB2ea7AAB0c803894',
name: 'UniBTC',
decimals: 8,
getIcon: async () => (await import('./icons/bob/unibtc')).default,
},
];
7 changes: 7 additions & 0 deletions packages/contracts/src/contracts/assets/bobTestnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ export const bobTestnet: Array<AssetDetails> = [
decimals: 18,
getIcon: async () => (await import('./icons/bob/powa')).default,
},
{
symbol: 'DOGGOTOTHEMOON',
address: '', //TODO add testnet address for DOG•GO•TO•THE•MOON
name: 'DOG•GO•TO•THE•MOON',
decimals: 18,
getIcon: async () => (await import('./icons/bob/dog')).default,
},
{
symbol: 'WSTETH',
address: '0xf83A152C0A526a45E93D91c95894a19A1258E30E',
Expand Down
9 changes: 9 additions & 0 deletions packages/sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @sovryn/sdk

## 2.0.3

### Patch Changes

- 52b7c4fe: chore: add new pools
- Updated dependencies [0bc23cc0]
- Updated dependencies [52b7c4fe]
- @sovryn/[email protected]

## 2.0.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sovryn/sdk",
"version": "2.0.2",
"version": "2.0.3",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"license": "MIT",
Expand Down
8 changes: 4 additions & 4 deletions packages/sdk/src/swaps/smart-router/utils/ambient-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ const POOLS: Partial<Record<ChainIds, PoolWithIndex[]>> = {
['POWA', 'SOV', 420],
['WBTC', 'satUSD', 410],
['USDT', 'satUSD', 400],
// ['UniBTC', 'SolvBTC.BBN', 400],
// ['SolvBTC.BBN', 'wBTC', 400],
// ['UniBTC', 'wBTC', 400],
// ['SolvBTC', 'wBTC', 400],
['UniBTC', 'SolvBTC.BBN', 400],
['SolvBTC.BBN', 'wBTC', 400],
['UniBTC', 'wBTC', 400],
['SolvBTC', 'wBTC', 400],
['DOGGOTOTHEMOON', 'POWA', 420],
['DOGGOTOTHEMOON', 'wBTC', 420],
],
Expand Down
Loading