From 545d15f3d8540e89882c7da5c4382a4b88f4055c Mon Sep 17 00:00:00 2001 From: Jakub Swierczek Date: Fri, 16 Feb 2024 16:18:03 +0100 Subject: [PATCH 1/6] optimism --- .../deploy-configurations/configs/optimism.conf.ts | 13 +++++++------ .../types/deployment-config/tokens.ts | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/deploy-configurations/configs/optimism.conf.ts b/packages/deploy-configurations/configs/optimism.conf.ts index 29a68af6..561caa16 100644 --- a/packages/deploy-configurations/configs/optimism.conf.ts +++ b/packages/deploy-configurations/configs/optimism.conf.ts @@ -609,19 +609,20 @@ export const config: SystemConfig = { name: 'UNIV2WBTCETH', address: '0x0000000000000000000000000000000000000000', }, - USDC: { - name: 'USDC', + 'USDC.E': { + name: 'USDC.E', address: '0x7F5c764cBc14f9669B88837ca1490cCa17c31607', serviceRegistryName: SERVICE_REGISTRY_NAMES.common.USDC, }, + USDC: { + name: 'USDC', + address: '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85', + }, USDBC: { name: 'USDBC', address: '0x0000000000000000000000000000000000000000', }, - USDT: { - name: 'USDT', - address: '0x0000000000000000000000000000000000000000', - }, + USDT: { name: 'USDT', address: '0x94b008aa00579c1307b0ef2c499ad98a8ce58e58' }, WBTC: { name: 'WBTC', address: '0x68f180fcce6836688e9084f035309e29bf0a2095', diff --git a/packages/deploy-configurations/types/deployment-config/tokens.ts b/packages/deploy-configurations/types/deployment-config/tokens.ts index 93d1cbdf..f630c29b 100644 --- a/packages/deploy-configurations/types/deployment-config/tokens.ts +++ b/packages/deploy-configurations/types/deployment-config/tokens.ts @@ -46,6 +46,7 @@ export type Tokens = | 'UNIV2USDCETH' | 'UNIV2WBTCDAI' | 'UNIV2WBTCETH' + | 'USDC.E' | 'USDC' | 'USDT' | 'USDBC' From bee1ac3c05c2aa1967e1fc4769edea52ca1c004a Mon Sep 17 00:00:00 2001 From: Jakub Swierczek Date: Fri, 16 Feb 2024 16:26:40 +0100 Subject: [PATCH 2/6] optimism --- packages/deploy-configurations/configs/optimism.conf.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/deploy-configurations/configs/optimism.conf.ts b/packages/deploy-configurations/configs/optimism.conf.ts index 561caa16..06df8a3a 100644 --- a/packages/deploy-configurations/configs/optimism.conf.ts +++ b/packages/deploy-configurations/configs/optimism.conf.ts @@ -332,6 +332,10 @@ export const config: SystemConfig = { address: '0x1111111254EEB25477B68fb85Ed929f73A960582', serviceRegistryName: SERVICE_REGISTRY_NAMES.common.ONE_INCH_AGGREGATOR, }, + OneInchAggregator5: { + name: 'OneInchAggregator5', + address: '0x1111111254EEB25477B68fb85Ed929f73A960582', + }, MerkleRedeemer: { name: 'MerkleRedeemer', address: '0x7D1405e1Bafd1c48721403D2Eb2F394e10a67A1b', From 3cd25c28a165701bd8a2a3448900f08c76219d53 Mon Sep 17 00:00:00 2001 From: Jakub Swierczek Date: Fri, 16 Feb 2024 16:30:22 +0100 Subject: [PATCH 3/6] 0.1.16-dma-v2-workers.10 --- packages/addresses/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/addresses/package.json b/packages/addresses/package.json index 9ae3a60f..ff100bc3 100644 --- a/packages/addresses/package.json +++ b/packages/addresses/package.json @@ -1,6 +1,6 @@ { "name": "@oasisdex/addresses", - "version": "0.1.16-dma-v2-workers.6", + "version": "0.1.16-dma-v2-workers.10", "typings": "lib/index.d.ts", "types": "lib/index.d.ts", "main": "lib/index.js", From a90c02e4b1da8a1b224d97453a070cf92c0069f0 Mon Sep 17 00:00:00 2001 From: Jakub Swierczek Date: Fri, 16 Feb 2024 16:41:30 +0100 Subject: [PATCH 4/6] add usdc.e --- packages/deploy-configurations/configs/arbitrum.conf.ts | 4 ++++ packages/deploy-configurations/configs/base.conf.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/packages/deploy-configurations/configs/arbitrum.conf.ts b/packages/deploy-configurations/configs/arbitrum.conf.ts index 6dd528d6..eb943f5d 100644 --- a/packages/deploy-configurations/configs/arbitrum.conf.ts +++ b/packages/deploy-configurations/configs/arbitrum.conf.ts @@ -549,6 +549,10 @@ export const config: SystemConfig = { name: 'USDBC', address: '0x0000000000000000000000000000000000000000', }, + 'USDC.E': { + name: 'USDC.E', + address: '0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8', + }, USDT: { name: 'USDT', address: '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9', diff --git a/packages/deploy-configurations/configs/base.conf.ts b/packages/deploy-configurations/configs/base.conf.ts index 1d2abb37..54df4a9b 100644 --- a/packages/deploy-configurations/configs/base.conf.ts +++ b/packages/deploy-configurations/configs/base.conf.ts @@ -562,6 +562,10 @@ export const config: SystemConfig = { address: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', serviceRegistryName: SERVICE_REGISTRY_NAMES.common.USDC }, + 'USDC.E': { + name: 'USDC.E', + address: '0x0000000000000000000000000000000000000000', + }, USDT: { name: 'USDT', address: '0x0000000000000000000000000000000000000000' From 8fe4a0f87962e90c8e3c8338c6e780db53b823da Mon Sep 17 00:00:00 2001 From: Jakub Swierczek Date: Fri, 16 Feb 2024 16:42:38 +0100 Subject: [PATCH 5/6] v0.1.16-dma-v2-workers.11 --- packages/addresses/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/addresses/package.json b/packages/addresses/package.json index ff100bc3..4e4f0020 100644 --- a/packages/addresses/package.json +++ b/packages/addresses/package.json @@ -1,6 +1,6 @@ { "name": "@oasisdex/addresses", - "version": "0.1.16-dma-v2-workers.10", + "version": "0.1.16-dma-v2-workers.11", "typings": "lib/index.d.ts", "types": "lib/index.d.ts", "main": "lib/index.js", From 361074b74ba4da1a1b755d91c987c8c0090d60aa Mon Sep 17 00:00:00 2001 From: halaprix Date: Mon, 19 Feb 2024 09:23:59 +0100 Subject: [PATCH 6/6] chore: subtract one unit from swap amount --- packages/dma-library/package.json | 2 +- packages/dma-library/src/operations/aave/multiply/v3/close.ts | 4 ++-- .../src/strategies/aave-like/multiply/close/close.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/dma-library/package.json b/packages/dma-library/package.json index 9fb3fc73..6451697f 100644 --- a/packages/dma-library/package.json +++ b/packages/dma-library/package.json @@ -1,6 +1,6 @@ { "name": "@oasisdex/dma-library", - "version": "0.5.21-dma-v2-workers.18", + "version": "0.5.21-dma-v2-workers.19-test.0", "typings": "lib/index.d.ts", "types": "lib/index.d.ts", "main": "lib/index.js", diff --git a/packages/dma-library/src/operations/aave/multiply/v3/close.ts b/packages/dma-library/src/operations/aave/multiply/v3/close.ts index b91a377d..5855414d 100644 --- a/packages/dma-library/src/operations/aave/multiply/v3/close.ts +++ b/packages/dma-library/src/operations/aave/multiply/v3/close.ts @@ -66,14 +66,14 @@ export const close: AaveV3CloseOperation = async ({ const withdrawCollateralFromAAVE = actions.aave.v3.aaveV3Withdraw(network, { asset: collateral.address, - amount: collateralAmountToBeSwapped, + amount: collateralAmountToBeSwapped.minus(1), to: proxy.address, }) const swapCollateralTokensForDebtTokens = actions.common.swap(network, { fromAsset: collateral.address, toAsset: debt.address, - amount: collateralAmountToBeSwapped || ZERO, + amount: collateralAmountToBeSwapped.minus(1) || ZERO, receiveAtLeast: swap.receiveAtLeast, fee: swap.fee, withData: swap.data, diff --git a/packages/dma-library/src/strategies/aave-like/multiply/close/close.ts b/packages/dma-library/src/strategies/aave-like/multiply/close/close.ts index 84ed71b8..35a8af41 100644 --- a/packages/dma-library/src/strategies/aave-like/multiply/close/close.ts +++ b/packages/dma-library/src/strategies/aave-like/multiply/close/close.ts @@ -128,7 +128,7 @@ async function getAaveSwapDataToCloseToDebt( addresses, ) - const swapAmountBeforeFees = dependencies.currentPosition.collateral.amount + const swapAmountBeforeFees = dependencies.currentPosition.collateral.amount.minus(1) const fromToken = { ...collateralToken, precision: collateralToken.precision || TYPICAL_PRECISION,