From 13e8db987e75ed407a49cf0992fa527cc3126ec2 Mon Sep 17 00:00:00 2001 From: halaprix Date: Wed, 3 Apr 2024 17:02:22 +0200 Subject: [PATCH] chore: add `SUSD`,`USDC`,`USDC.E` pairs on optimism with `0.02%` fee --- actions/aave-like/get-addresses.ts | 3 ++ blockchain/tokens/mainnet.ts | 1 + blockchain/tokens/optimism.ts | 1 + .../strategies/optimism-aave-v3-strategies.ts | 50 +++++++++++++++++++ .../aave-v3-products/optimims-mainnet.ts | 12 +++++ package.json | 2 +- yarn.lock | 8 +-- 7 files changed, 72 insertions(+), 5 deletions(-) diff --git a/actions/aave-like/get-addresses.ts b/actions/aave-like/get-addresses.ts index 75331eecbe..31246e0459 100644 --- a/actions/aave-like/get-addresses.ts +++ b/actions/aave-like/get-addresses.ts @@ -91,6 +91,9 @@ export function getAddresses( if (networkId === NetworkIds.OPTIMISMMAINNET || networkId === NetworkIds.ARBITRUMMAINNET) { sharedAddresses.tokens['USDC.E'] = contracts.tokens['USDC.E'].address } + if (networkId === NetworkIds.OPTIMISMMAINNET) { + sharedAddresses.tokens.SUSD = contracts.tokens['SUSD'].address + } switch (lendingProtocol) { case LendingProtocol.AaveV2: diff --git a/blockchain/tokens/mainnet.ts b/blockchain/tokens/mainnet.ts index fe5dec0ace..d455d9336e 100644 --- a/blockchain/tokens/mainnet.ts +++ b/blockchain/tokens/mainnet.ts @@ -79,6 +79,7 @@ export const tokensMainnet = { STETH: contractDesc(erc20, mainnet.common.STETH), STYETH: contractDesc(erc20, mainnet.common.STYETH), SUSDE: contractDesc(erc20, mainnet.common.SUSDE), + SUSD: contractDesc(erc20, mainnet.common.SUSD), USDE: contractDesc(erc20, mainnet.common.USDE), TBTC: contractDesc(erc20, mainnet.common.TBTC), USDC: contractDesc(erc20, mainnet.common.USDC), diff --git a/blockchain/tokens/optimism.ts b/blockchain/tokens/optimism.ts index df83bbecb3..8f809df18c 100644 --- a/blockchain/tokens/optimism.ts +++ b/blockchain/tokens/optimism.ts @@ -22,6 +22,7 @@ export const tokensOptimism = { RETH: contractDesc(erc20, optimism.common.RETH), RENBTC: contractDesc(erc20, optimism.common.RENBTC), SDAI: contractDesc(erc20, optimism.common.SDAI), + SUSD: contractDesc(erc20, optimism.common.SUSD), STETH: contractDesc(erc20, optimism.common.STETH), STYETH: contractDesc(erc20, optimism.common.STYETH), TBTC: contractDesc(erc20, optimism.common.TBTC), diff --git a/features/aave/strategies/optimism-aave-v3-strategies.ts b/features/aave/strategies/optimism-aave-v3-strategies.ts index ada61d613d..5524bb3db8 100644 --- a/features/aave/strategies/optimism-aave-v3-strategies.ts +++ b/features/aave/strategies/optimism-aave-v3-strategies.ts @@ -73,6 +73,56 @@ const availableTokenPairs: TokenPairConfig[] = [ }, }, }, + { + collateral: 'USDC', + debt: 'SUSD', + strategyType: StrategyType.Long, + productTypes: { + [ProductType.Borrow]: { + featureToggle: FeaturesEnum.AaveV3OptimismBorrow, + additionalManageActions: [ + { + action: 'switch-to-multiply', + featureToggle: undefined, + }, + ], + }, + [ProductType.Multiply]: { + featureToggle: undefined, + additionalManageActions: [ + { + action: 'switch-to-borrow', + featureToggle: FeaturesEnum.AaveV3OptimismBorrow, + }, + ], + }, + }, + }, + { + collateral: 'USDC.E', + debt: 'SUSD', + strategyType: StrategyType.Long, + productTypes: { + [ProductType.Borrow]: { + featureToggle: FeaturesEnum.AaveV3OptimismBorrow, + additionalManageActions: [ + { + action: 'switch-to-multiply', + featureToggle: undefined, + }, + ], + }, + [ProductType.Multiply]: { + featureToggle: undefined, + additionalManageActions: [ + { + action: 'switch-to-borrow', + featureToggle: FeaturesEnum.AaveV3OptimismBorrow, + }, + ], + }, + }, + }, { collateral: 'WSTETH', debt: 'USDC', diff --git a/handlers/product-hub/update-handlers/aaveV3/aave-v3-products/optimims-mainnet.ts b/handlers/product-hub/update-handlers/aaveV3/aave-v3-products/optimims-mainnet.ts index e3e377c889..0df7bdea61 100644 --- a/handlers/product-hub/update-handlers/aaveV3/aave-v3-products/optimims-mainnet.ts +++ b/handlers/product-hub/update-handlers/aaveV3/aave-v3-products/optimims-mainnet.ts @@ -102,6 +102,18 @@ const aaveSeed: AaveProductHubItemSeed[] = [ strategyType: 'short', types: ['borrow', 'multiply'], }, + { + collateral: 'USDC', + debt: 'SUSD', + strategyType: 'long', + types: ['borrow', 'multiply', 'earn'], + }, + { + collateral: 'USDC.E', + debt: 'SUSD', + strategyType: 'long', + types: ['borrow', 'multiply', 'earn'], + }, ] const borrowProducts = aaveSeed diff --git a/package.json b/package.json index 359571873d..de3f152880 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "@metamask/eth-sig-util": "^5.0.2", "@oasisdex/addresses": "0.1.54", "@oasisdex/automation": "1.6.5", - "@oasisdex/dma-library": "0.6.49", + "@oasisdex/dma-library": "0.6.50", "@oasisdex/multiply": "^0.2.11", "@oasisdex/transactions": "0.1.4-alpha.0", "@oasisdex/utils": "^0.0.8", diff --git a/yarn.lock b/yarn.lock index ca22c0fc13..bfd1e4f84a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2425,10 +2425,10 @@ dependencies: ethers "^5.6.2" -"@oasisdex/dma-library@0.6.49": - version "0.6.49" - resolved "https://registry.yarnpkg.com/@oasisdex/dma-library/-/dma-library-0.6.49.tgz#d3870e638774bf3a8b259afb26535c63c223f369" - integrity sha512-Alyx09r+KgXnej7RZrWD8w1tk3B3YgwMCrjdLRtRiRTYcQ9IRlMJ5PR3TspAu6tmvbdWM/4pZFf3AbvXcRDQtA== +"@oasisdex/dma-library@0.6.50": + version "0.6.50" + resolved "https://registry.yarnpkg.com/@oasisdex/dma-library/-/dma-library-0.6.50.tgz#c0e6fe0fe154430d6b95b5b3f9321d627b4770d2" + integrity sha512-KyL69i0wz1sS689NNQCryJ2gHBP7BonUQ3/SmIJj4H06IXh8QbS/z7ciNSu5Rf9fZ99TL3ly3ZAP5lKLaOQX0A== dependencies: bignumber.js "9.0.1" ethers "^5.7.2"