Skip to content

Commit 3810cd0

Browse files
tiltomcreed-victorgithub-actions[bot]
authored
BOS bridge and trading (#1124)
* SOV-5247: BOS bridging and trading (#1122) * Add BOS to the ERC20 bridge UI * Create red-otters-relax.md * BOS AMM pool and Convert page adjustments * Add BOS to the new pairs section * Bump up gas limit for AMM deposits * fix: bos pool token address * Temporary fix for LP fee rate --------- Co-authored-by: Victor Creed <victor@sovryn.app> * Version Packages (#1123) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: Victor Creed <victor@sovryn.app> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent bacda29 commit 3810cd0

14 files changed

Lines changed: 160 additions & 7 deletions

File tree

apps/frontend/src/app/5_pages/MarketMakingPage/MarketMakingPage.constants.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,16 @@ export const MAINNET_AMM = [
136136
'0x4531DD0f24D204c08b251084E12ce3D3e70Dd03e',
137137
'0xBfd61419D30650FD943855b2bbE4C2A2E54857f9',
138138
),
139+
new AmmLiquidityPool(
140+
'BOS',
141+
COMMON_SYMBOLS.BTC,
142+
1,
143+
ChainIds.RSK_MAINNET,
144+
'0xF1DeE3175593f4e13a2b9e09a5FaafC513c9A27F',
145+
'0xfd834bbcde8c3ac4766bf5c1f5d861400103087b',
146+
undefined,
147+
true,
148+
),
139149
];
140150

141151
export const TESTNET_AMM = [

apps/frontend/src/app/5_pages/MarketMakingPage/components/MarketMaking/MarketMaking.tsx

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { FC, useCallback, useEffect, useState } from 'react';
1+
import React, { FC, useCallback, useEffect, useMemo, useState } from 'react';
22

33
import { t } from 'i18next';
44
import { Helmet } from 'react-helmet-async';
@@ -17,8 +17,11 @@ import { MarketMakingNetworkBanner } from '../../../../2_molecules/MarketMakingN
1717
import { RSK_STORAGE_KEY } from '../../../../2_molecules/MarketMakingNetworkBanner/MarketMakingNetworkBanner.constants';
1818
import { useIsMobile } from '../../../../../hooks/useIsMobile';
1919
import { translations } from '../../../../../locales/i18n';
20+
import { AmmLiquidityPoolDictionary } from '../../utils/AmmLiquidityPoolDictionary';
2021
import { PoolsTable } from '../PoolsTable/PoolsTable';
2122

23+
const ammPools = AmmLiquidityPoolDictionary.list();
24+
2225
export const MarketMaking: FC = () => {
2326
const { isMobile } = useIsMobile();
2427
const [activePool, setActivePool] = useState('');
@@ -38,6 +41,11 @@ export const MarketMaking: FC = () => {
3841
}
3942
}, [activePool, isMobile]);
4043

44+
const isAnyPoolHighlighted = useMemo(
45+
() => ammPools.some(pool => pool.isHighlighted),
46+
[],
47+
);
48+
4149
return (
4250
<>
4351
<Helmet>
@@ -71,6 +79,33 @@ export const MarketMaking: FC = () => {
7179
)}
7280
/>
7381
</div>
82+
83+
{isAnyPoolHighlighted && (
84+
<>
85+
<Paragraph
86+
className="pl-2 w-full text-base font-medium text-left mb-4 mt-8"
87+
size={ParagraphSize.base}
88+
>
89+
{t(translations.marketMakingPage.newPairs)}
90+
</Paragraph>
91+
92+
<PoolsTable
93+
setActivePool={setActivePoolKey}
94+
shouldScroll={isPromoCardClicked}
95+
activePool={activePool}
96+
filter={searchInputValue}
97+
showHighlightedPools={true}
98+
/>
99+
100+
<Paragraph
101+
className="pl-2 w-full text-base font-medium text-left mb-4 mt-8"
102+
size={ParagraphSize.base}
103+
>
104+
{t(translations.marketMakingPage.allPairs)}
105+
</Paragraph>
106+
</>
107+
)}
108+
74109
<PoolsTable
75110
setActivePool={setActivePoolKey}
76111
shouldScroll={isPromoCardClicked}

apps/frontend/src/app/5_pages/MarketMakingPage/components/PoolStatistics/PoolStatistics.tsx

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ export const PoolsStatistics: FC<PoolsStatisticsProps> = ({ pool }) => {
3535
} = useGetProtocolFee();
3636

3737
const renderLpFeeRate = useMemo(() => {
38+
// Temporary fix for BOS pool
39+
if (pool.poolTokenA === '0xfd834bbcde8c3ac4766bf5c1f5d861400103087b') {
40+
return (
41+
<AmountRenderer
42+
value={0.25}
43+
suffix="%"
44+
dataAttribute="market-making-pool-statistics-lp-fee-rate"
45+
/>
46+
);
47+
}
48+
3849
if (pool.converterVersion === 2) {
3950
return (
4051
<AmountRenderer
@@ -55,7 +66,12 @@ export const PoolsStatistics: FC<PoolsStatisticsProps> = ({ pool }) => {
5566
) : (
5667
0
5768
);
58-
}, [conversionFee, conversionFeeLoading, pool.converterVersion]);
69+
}, [
70+
conversionFee,
71+
conversionFeeLoading,
72+
pool.converterVersion,
73+
pool.poolTokenA,
74+
]);
5975

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

7591
const renderTotalSwapFeeRate = useMemo(() => {
92+
// Temporary fix for BOS pool
93+
if (pool.poolTokenA === '0xfd834bbcde8c3ac4766bf5c1f5d861400103087b') {
94+
return (
95+
<AmountRenderer
96+
value={0.35}
97+
suffix="%"
98+
dataAttribute="market-making-pool-statistics-total-swap-fee-rate"
99+
/>
100+
);
101+
}
102+
76103
if (pool.converterVersion === 2) {
77104
return (
78105
<AmountRenderer
@@ -93,6 +120,7 @@ export const PoolsStatistics: FC<PoolsStatisticsProps> = ({ pool }) => {
93120
0
94121
);
95122
}, [
123+
pool.poolTokenA,
96124
pool.converterVersion,
97125
protocolFeeLoading,
98126
conversionFeeLoading,

apps/frontend/src/constants/gasLimits.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const GAS_LIMIT = {
3131
PROPOSAL_QUEUE: 250_000,
3232
PROPOSAL_EXECUTE: 6_000_000,
3333
MARKET_MAKING_DEPOSIT: 6_000_000,
34-
MARKET_MAKING_ADD_LIQUIDITY: 550_000,
34+
MARKET_MAKING_ADD_LIQUIDITY: 750_000,
3535
MARKET_MAKING_REMOVE_LIQUIDITY: 650_000,
3636
MARKET_MAKING_CLAIM_FEES: 650_000,
3737
MARKET_MAKING_REPOSITION: 600_000,

packages/contracts/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @sovryn/contracts
22

3+
## 1.2.7
4+
5+
### Patch Changes
6+
7+
- 0855c695: SOV-5247: BOS bridging and trading
8+
39
## 1.2.6
410

511
### Patch Changes

packages/contracts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sovryn/contracts",
3-
"version": "1.2.6",
3+
"version": "1.2.7",
44
"main": "./dist/index.js",
55
"types": "./dist/index.d.ts",
66
"license": "MIT",

packages/contracts/src/contracts/assets/eth.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,11 @@ export const eth: Array<AssetDetails> = [
2626
decimals: 18,
2727
getIcon: async () => (await import('./icons/rsk/dllr')).default,
2828
},
29+
{
30+
symbol: 'BOS',
31+
address: '0x13239C268BEDDd88aD0Cb02050D3ff6a9d00de6D',
32+
name: 'BitcoinOS Token',
33+
decimals: 18,
34+
getIcon: async () => (await import('./icons/rsk/bos')).default,
35+
},
2936
];
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// eslint-disable-next-line import/no-anonymous-default-export
2+
export default `<svg
3+
width="35"
4+
height="35"
5+
viewBox="0 0 35 35"
6+
fill="none"
7+
xmlns="http://www.w3.org/2000/svg"
8+
>
9+
<circle cx="17.5" cy="17.8" r="16.5" fill="#101010" stroke="#272727" />
10+
<path
11+
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"
12+
fill="#FFFAFA"
13+
/>
14+
<path
15+
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"
16+
fill="#FFFAFA"
17+
/>
18+
<path
19+
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"
20+
fill="#FFFAFA"
21+
/>
22+
<path
23+
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"
24+
fill="#FFFAFA"
25+
/>
26+
<path
27+
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"
28+
fill="#FFFAFA"
29+
/>
30+
<path
31+
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"
32+
fill="#FFFAFA"
33+
/>
34+
</svg>`;

packages/contracts/src/contracts/assets/rsk.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,11 @@ export const rsk: Array<AssetDetails> = [
125125
decimals: 18,
126126
getIcon: async () => (await import('./icons/rsk/powa')).default,
127127
},
128+
{
129+
symbol: 'BOS',
130+
address: '0x3E3006896458F0ACfE79b57A1A0fe067B3a1ce6f',
131+
name: 'BitcoinOS Token',
132+
decimals: 18,
133+
getIcon: async () => (await import('./icons/rsk/bos')).default,
134+
},
128135
];

packages/sdk/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# @sovryn/sdk
22

3+
## 2.0.9
4+
5+
### Patch Changes
6+
7+
- 0855c695: SOV-5247: BOS bridging and trading
8+
- Updated dependencies [0855c695]
9+
- @sovryn/contracts@1.2.7
10+
311
## 2.0.8
412

513
### Patch Changes

0 commit comments

Comments
 (0)