From 3b0c50ed5a3b5ec460fdf952181a41f6bb7924da Mon Sep 17 00:00:00 2001 From: FazioNico Date: Fri, 6 Oct 2023 22:42:20 +0200 Subject: [PATCH] refactor: use dedicated coponent --- src/components/ETHLiquidStakingstrategy.tsx | 38 ++-- src/components/ETHOptimizedStrategy.tsx | 213 ++++++++------------ 2 files changed, 103 insertions(+), 148 deletions(-) diff --git a/src/components/ETHLiquidStakingstrategy.tsx b/src/components/ETHLiquidStakingstrategy.tsx index 8d47f43e..9765b9a1 100644 --- a/src/components/ETHLiquidStakingstrategy.tsx +++ b/src/components/ETHLiquidStakingstrategy.tsx @@ -502,24 +502,26 @@ export function ETHLiquidStakingstrategyCard() { - -

Staking WETH with Lido

-

- - By swapping WETH to wstETH you will incrase your WETH - holdings by {baseAPRstETH.toFixed(2)}% APY revard from - staking WETH using{" "} - - Lido - - . - -

-
+
+ +

Staking WETH with Lido

+

+ + By swapping WETH to wstETH you will incrase your WETH + holdings by {baseAPRstETH.toFixed(2)}% APY revard from + staking WETH using{" "} + + Lido + + . + +

+
+
{CardButton}
diff --git a/src/components/ETHOptimizedStrategy.tsx b/src/components/ETHOptimizedStrategy.tsx index 455a621a..2abaf3fd 100644 --- a/src/components/ETHOptimizedStrategy.tsx +++ b/src/components/ETHOptimizedStrategy.tsx @@ -57,6 +57,7 @@ import { useAave } from "../context/AaveContext"; import { FormattedNumber } from "./FormattedNumber"; import { AssetInput } from "./AssetInput"; import { ApyDetail } from "./ApyDetail"; +import { HowItWork } from "./HowItWork"; export const minBaseTokenRemainingByNetwork: Record = { [ChainId.optimism]: "0.0001", @@ -952,136 +953,88 @@ export function EthOptimizedStrategyCard(props: { asImage?: boolean }) { const Loader = ; const InfoButton = ( <> - setIsDisplayHowItWork(true)} - > - how it work - - setIsDisplayHowItWork(false)} - > - - - - -

How it work

-
-
- - - !isDisplayAPYDef - ? setIsDisplayHowItWork(false) - : setIsDisplayHowItWork(false) - } - > - - - - - -

- - Strategy setps process below explained how you can incrase - your APY revard. - -

-
-
-
- - - - - - -
1
- Staking WETH with Lido -
-
-

- - By swapping WETH to wstETH you will incrase your WETH - holdings by {baseAPRstETH}% APY revard from staking WETH - using{" "} - - Lido - - . - -

-
-
- - -
2
- Deposit wstETH to AAVE -
-
-

- - By deposit wstETH as collateral on{" "} - - AAVE - {" "} - you will be able to borrow up to{" "} - {Number(strategy?.userLiquidationThreshold) * 100}% of - your wstETH value in WETH. - -

-
-
- - -
3
- Borrow WETH from AAVE -
-
-

- - By borrowing WETH from AAVE you will incrase your WETH - holdings by{" "} - {Number(strategy?.userLiquidationThreshold) * 100}%. - -

-
-
- - -
4
- Swap WETH to wstETH -
-
-

- - By repeating step 1, you will incrase your wstETH holdings - by {Number(strategy?.userLiquidationThreshold) * 100}% and - you will cumulate {baseAPRstETH}% APY. You can now repeat - again all process untill you reach the maximum AAVE user - threshold liquidation. - -

-
-
-
-
-
-
-
+ + + + +
1
+ Staking WETH with Lido +
+
+

+ + By swapping WETH to wstETH you will incrase your WETH + holdings by {baseAPRstETH}% APY revard from staking WETH + using{" "} + + Lido + + . + +

+
+
+ + +
2
+ Deposit wstETH to AAVE +
+
+

+ + By deposit wstETH as collateral on{" "} + + AAVE + {" "} + you will be able to borrow up to{" "} + {Number(strategy?.userLiquidationThreshold) * 100}% of + your wstETH value in WETH. + +

+
+
+ + +
3
+ Borrow WETH from AAVE +
+
+

+ + By borrowing WETH from AAVE you will incrase your WETH + holdings by{" "} + {Number(strategy?.userLiquidationThreshold) * 100}%. + +

+
+
+ + +
4
+ Swap WETH to wstETH +
+
+

+ + By repeating step 1, you will incrase your wstETH holdings + by {Number(strategy?.userLiquidationThreshold) * 100}% and + you will cumulate {baseAPRstETH}% APY. You can now repeat + again all process untill you reach the maximum AAVE user + threshold liquidation. + +

+
+
+
+
); const CardButton =