Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,16 @@ export const MAINNET_AMM = [
'0x4531DD0f24D204c08b251084E12ce3D3e70Dd03e',
'0xBfd61419D30650FD943855b2bbE4C2A2E54857f9',
),
new AmmLiquidityPool(
'BOS',
COMMON_SYMBOLS.BTC,
1,
ChainIds.RSK_MAINNET,
'0xF1DeE3175593f4e13a2b9e09a5FaafC513c9A27F',
'0xfd834bbcde8c3ac4766bf5c1f5d861400103087b',
undefined,
true,
),
];

export const TESTNET_AMM = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC, useCallback, useEffect, useState } from 'react';
import React, { FC, useCallback, useEffect, useMemo, useState } from 'react';

import { t } from 'i18next';
import { Helmet } from 'react-helmet-async';
Expand All @@ -17,8 +17,11 @@ import { MarketMakingNetworkBanner } from '../../../../2_molecules/MarketMakingN
import { RSK_STORAGE_KEY } from '../../../../2_molecules/MarketMakingNetworkBanner/MarketMakingNetworkBanner.constants';
import { useIsMobile } from '../../../../../hooks/useIsMobile';
import { translations } from '../../../../../locales/i18n';
import { AmmLiquidityPoolDictionary } from '../../utils/AmmLiquidityPoolDictionary';
import { PoolsTable } from '../PoolsTable/PoolsTable';

const ammPools = AmmLiquidityPoolDictionary.list();

export const MarketMaking: FC = () => {
const { isMobile } = useIsMobile();
const [activePool, setActivePool] = useState('');
Expand All @@ -38,6 +41,11 @@ export const MarketMaking: FC = () => {
}
}, [activePool, isMobile]);

const isAnyPoolHighlighted = useMemo(
() => ammPools.some(pool => pool.isHighlighted),
[],
);

return (
<>
<Helmet>
Expand Down Expand Up @@ -71,6 +79,33 @@ export const MarketMaking: FC = () => {
)}
/>
</div>

{isAnyPoolHighlighted && (
<>
<Paragraph
className="pl-2 w-full text-base font-medium text-left mb-4 mt-8"
size={ParagraphSize.base}
>
{t(translations.marketMakingPage.newPairs)}
</Paragraph>

<PoolsTable
setActivePool={setActivePoolKey}
shouldScroll={isPromoCardClicked}
activePool={activePool}
filter={searchInputValue}
showHighlightedPools={true}
/>

<Paragraph
className="pl-2 w-full text-base font-medium text-left mb-4 mt-8"
size={ParagraphSize.base}
>
{t(translations.marketMakingPage.allPairs)}
</Paragraph>
</>
)}

<PoolsTable
setActivePool={setActivePoolKey}
shouldScroll={isPromoCardClicked}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ export const PoolsStatistics: FC<PoolsStatisticsProps> = ({ pool }) => {
} = useGetProtocolFee();

const renderLpFeeRate = useMemo(() => {
// Temporary fix for BOS pool
if (pool.poolTokenA === '0xfd834bbcde8c3ac4766bf5c1f5d861400103087b') {
return (
<AmountRenderer
value={0.25}
suffix="%"
dataAttribute="market-making-pool-statistics-lp-fee-rate"
/>
);
}

if (pool.converterVersion === 2) {
return (
<AmountRenderer
Expand All @@ -55,7 +66,12 @@ export const PoolsStatistics: FC<PoolsStatisticsProps> = ({ pool }) => {
) : (
0
);
}, [conversionFee, conversionFeeLoading, pool.converterVersion]);
}, [
conversionFee,
conversionFeeLoading,
pool.converterVersion,
pool.poolTokenA,
]);

const renderBitocracyFeeRate = useMemo(
() =>
Expand All @@ -73,6 +89,17 @@ export const PoolsStatistics: FC<PoolsStatisticsProps> = ({ pool }) => {
);

const renderTotalSwapFeeRate = useMemo(() => {
// Temporary fix for BOS pool
if (pool.poolTokenA === '0xfd834bbcde8c3ac4766bf5c1f5d861400103087b') {
return (
<AmountRenderer
value={0.35}
suffix="%"
dataAttribute="market-making-pool-statistics-total-swap-fee-rate"
/>
);
}

if (pool.converterVersion === 2) {
return (
<AmountRenderer
Expand All @@ -93,6 +120,7 @@ export const PoolsStatistics: FC<PoolsStatisticsProps> = ({ pool }) => {
0
);
}, [
pool.poolTokenA,
pool.converterVersion,
protocolFeeLoading,
conversionFeeLoading,
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/src/constants/gasLimits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const GAS_LIMIT = {
PROPOSAL_QUEUE: 250_000,
PROPOSAL_EXECUTE: 6_000_000,
MARKET_MAKING_DEPOSIT: 6_000_000,
MARKET_MAKING_ADD_LIQUIDITY: 550_000,
MARKET_MAKING_ADD_LIQUIDITY: 750_000,
MARKET_MAKING_REMOVE_LIQUIDITY: 650_000,
MARKET_MAKING_CLAIM_FEES: 650_000,
MARKET_MAKING_REPOSITION: 600_000,
Expand Down
6 changes: 6 additions & 0 deletions packages/contracts/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @sovryn/contracts

## 1.2.7

### Patch Changes

- 0855c695: SOV-5247: BOS bridging and trading

## 1.2.6

### 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.6",
"version": "1.2.7",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"license": "MIT",
Expand Down
7 changes: 7 additions & 0 deletions packages/contracts/src/contracts/assets/eth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,11 @@ export const eth: Array<AssetDetails> = [
decimals: 18,
getIcon: async () => (await import('./icons/rsk/dllr')).default,
},
{
symbol: 'BOS',
address: '0x13239C268BEDDd88aD0Cb02050D3ff6a9d00de6D',
name: 'BitcoinOS Token',
decimals: 18,
getIcon: async () => (await import('./icons/rsk/bos')).default,
},
];
34 changes: 34 additions & 0 deletions packages/contracts/src/contracts/assets/icons/rsk/bos.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// eslint-disable-next-line import/no-anonymous-default-export
export default `<svg
width="35"
height="35"
viewBox="0 0 35 35"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<circle cx="17.5" cy="17.8" r="16.5" fill="#101010" stroke="#272727" />
<path
d="M20.0559 17.7826C20.0186 17.649 19.9228 17.5476 19.8003 17.4942C19.747 17.4728 19.6884 17.4621 19.6352 17.4621C19.5606 17.4621 19.486 17.4835 19.4168 17.5209L18.8203 17.868C18.4795 18.0656 18.2664 18.4342 18.2664 18.8294V28.3521C18.2664 28.5017 18.341 28.6352 18.4741 28.7099C18.602 28.7847 18.7617 28.7847 18.8896 28.7099L21.9732 26.9261C22.298 26.7392 22.4578 26.3493 22.3566 25.9861L20.0612 17.7879L20.0559 17.7826Z"
fill="#FFFAFA"
/>
<path
d="M13.2014 15.689L8.74372 13.1093C8.67981 13.0719 8.60525 13.0559 8.53602 13.0559C8.46678 13.0559 8.39222 13.0773 8.32831 13.1147C8.20049 13.1894 8.12061 13.323 8.12061 13.4725V22.9952C8.12061 23.3905 8.33364 23.759 8.67448 23.9566L9.14848 24.229C9.29227 24.3144 9.4627 24.3305 9.6278 24.2824C9.7929 24.2343 9.91539 24.1222 9.98995 23.9673L13.4783 16.5969C13.6328 16.2711 13.5103 15.8759 13.1961 15.6943L13.2014 15.689Z"
fill="#FFFAFA"
/>
<path
d="M16.9621 17.868L14.9649 16.709C14.8212 16.6236 14.6507 16.6076 14.4856 16.6556C14.3259 16.7037 14.198 16.8159 14.1235 16.9707L10.6351 24.3411C10.4807 24.6669 10.6031 25.0621 10.9174 25.2437L16.8982 28.7046C17.026 28.7794 17.1805 28.7794 17.3136 28.7046C17.4414 28.6298 17.5213 28.4963 17.5213 28.3467V18.824C17.5213 18.4288 17.3083 18.0603 16.9674 17.8627L16.9621 17.868Z"
fill="#FFFAFA"
/>
<path
d="M26.8726 12.1C26.8726 11.9504 26.7927 11.8169 26.6649 11.7421L25.2376 10.9196C24.998 10.7808 24.7263 10.7113 24.4547 10.7113C24.3216 10.7113 24.1938 10.7274 24.0606 10.7594L12.4291 13.761C12.2747 13.7983 12.2108 13.9212 12.1948 14.028C12.1788 14.1295 12.2161 14.2683 12.3493 14.3431L17.3289 17.2272C17.6697 17.4248 18.0958 17.4248 18.4366 17.2272L26.6596 12.4685C26.7874 12.3937 26.8673 12.2602 26.8673 12.1106L26.8726 12.1Z"
fill="#FFFAFA"
/>
<path
d="M27.4534 13.1094C27.3895 13.072 27.3149 13.0506 27.2457 13.0506C27.1764 13.0506 27.1019 13.072 27.038 13.104L21.121 16.5275C20.7962 16.7144 20.6364 17.1043 20.7376 17.4675L23.033 25.6657C23.0703 25.7992 23.1661 25.9007 23.2886 25.9541C23.4164 26.0022 23.5549 25.9968 23.6721 25.9274L27.0965 23.9459C27.4374 23.7483 27.6504 23.3798 27.6504 22.9846V13.4672C27.6504 13.3176 27.5705 13.1841 27.4427 13.1094H27.4534Z"
fill="#FFFAFA"
/>
<path
d="M9.11694 12.4631L10.2087 13.0987C10.5655 13.307 10.981 13.3604 11.3804 13.2589L23.0119 10.2573C23.161 10.22 23.2302 10.0971 23.2462 9.99564C23.2622 9.89417 23.2249 9.75531 23.0917 9.68053L18.4424 6.98341C18.2719 6.88193 18.0802 6.83386 17.8885 6.83386C17.6967 6.83386 17.505 6.88193 17.3346 6.98341L9.11694 11.7421C8.98912 11.8169 8.90923 11.9504 8.90923 12.0999C8.90923 12.2495 8.98379 12.383 9.11694 12.4578V12.4631Z"
fill="#FFFAFA"
/>
</svg>`;
7 changes: 7 additions & 0 deletions packages/contracts/src/contracts/assets/rsk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,11 @@ export const rsk: Array<AssetDetails> = [
decimals: 18,
getIcon: async () => (await import('./icons/rsk/powa')).default,
},
{
symbol: 'BOS',
address: '0x3E3006896458F0ACfE79b57A1A0fe067B3a1ce6f',
name: 'BitcoinOS Token',
decimals: 18,
getIcon: async () => (await import('./icons/rsk/bos')).default,
},
];
8 changes: 8 additions & 0 deletions packages/sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @sovryn/sdk

## 2.0.9

### Patch Changes

- 0855c695: SOV-5247: BOS bridging and trading
- Updated dependencies [0855c695]
- @sovryn/contracts@1.2.7

## 2.0.8

### 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.8",
"version": "2.0.9",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk/src/_tests/swaps/smart-router.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ describe('SmartRouter', () => {
});

it('returns all available entries', async () => {
await expect(router.getEntries(chainId)).resolves.toHaveLength(16);
await expect(router.getEntries(chainId)).resolves.toHaveLength(17);
});

it('returns all available destinations for entry token', async () => {
await expect(router.getDestination(chainId, sov)).resolves.toHaveLength(
14,
15,
);
});

Expand Down
17 changes: 17 additions & 0 deletions packages/sdk/src/bridge/config/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,15 @@ export const ethToRskMainnetAssets: AssetConfig[] = [
aggregatorContractAddress: aggregators.mainnet.eths,
bridgeTokenAddress: '0xd412acd34a832a09c80c8a4895ff46d733f09538',
},
{
symbol: 'BOS',
minDecimals: 4,
isNative: false,
isBase: false,
usesAggregator: false,
aggregatorContractAddress: undefined,
bridgeTokenAddress: '0x13239C268BEDDd88aD0Cb02050D3ff6a9d00de6D',
},
];

// RSK to ETH Assets (Mainnet)
Expand Down Expand Up @@ -115,6 +124,14 @@ export const rskToEthMainnetAssets: AssetConfig[] = [
aggregatorContractAddress: aggregators.mainnet.eths,
bridgeTokenAddress: '0xFe878227c8F334038DAb20a99fC3B373fFe0a755',
},
{
symbol: 'BOS',
minDecimals: 4,
isNative: false,
isBase: false,
usesAggregator: false,
aggregatorContractAddress: undefined,
},
];

// BSC to RSK Assets (Testnet)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export const ammSwapRoute: SwapRouteFunction = (
'MYNT',
'BPRO',
'POWA',
'BOS',
];

const contracts = (
Expand Down