From 0a65647e2d51e455650796a53885a4b8991ce8ed Mon Sep 17 00:00:00 2001 From: piekczyk Date: Fri, 21 Jun 2024 12:23:41 +0200 Subject: [PATCH] Erc4626 net value simulation (#686) --- packages/dma-library/package.json | 2 +- packages/dma-library/src/types/common/erc4626-view.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/dma-library/package.json b/packages/dma-library/package.json index 74fd662ef..b526a3798 100644 --- a/packages/dma-library/package.json +++ b/packages/dma-library/package.json @@ -1,6 +1,6 @@ { "name": "@oasisdex/dma-library", - "version": "0.6.54", + "version": "0.6.55", "typings": "lib/index.d.ts", "types": "lib/index.d.ts", "main": "lib/index.js", diff --git a/packages/dma-library/src/types/common/erc4626-view.ts b/packages/dma-library/src/types/common/erc4626-view.ts index c96f45cf3..d22e6869e 100644 --- a/packages/dma-library/src/types/common/erc4626-view.ts +++ b/packages/dma-library/src/types/common/erc4626-view.ts @@ -282,7 +282,7 @@ export class Erc4626Position implements IErc4626Position { this.owner, this.quoteTokenAmount.plus(quoteTokenAmount), this.marketPrice, - this.netValue, + this.netValue.plus(quoteTokenAmount.times(this.marketPrice)), this.pnl, this.totalEarnings, this.maxWithdrawal.plus(quoteTokenAmount), @@ -303,7 +303,7 @@ export class Erc4626Position implements IErc4626Position { this.owner, this.quoteTokenAmount.minus(quoteTokenAmount), this.marketPrice, - this.netValue, + this.netValue.minus(quoteTokenAmount.times(this.marketPrice)), this.pnl, this.totalEarnings, this.maxWithdrawal.minus(quoteTokenAmount),