From 09904be31644a841e991ca8184819f31d6d4496a Mon Sep 17 00:00:00 2001 From: JaredBorders Date: Tue, 21 May 2024 11:10:46 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=F0=9F=8F=BB=E2=80=8D=E2=99=82?= =?UTF-8?q?=EF=B8=8F=20add=20SCALING=5FFACTOR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Account.sol | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Account.sol b/src/Account.sol index b370e4dc..40ca217a 100644 --- a/src/Account.sol +++ b/src/Account.sol @@ -54,6 +54,9 @@ contract Account is IAccount, Auth, OpsReady { IPerpsV2DynamicFeesModule internal constant PERPS_V2_DYNAMIC_FEES_MODULE = IPerpsV2DynamicFeesModule(0x05F6f46e5EED6dec1D8Cc3c6e8169D447966844d); + /// @notice used to scale down values following multiplication + uint256 internal constant SCALING_FACTOR = SCALING_FACTOR; + /*////////////////////////////////////////////////////////////// IMMUTABLES //////////////////////////////////////////////////////////////*/ @@ -685,7 +688,7 @@ contract Account is IAccount, Auth, OpsReady { } // calculate notional value of order - uint256 notionalValue = (_abs(_sizeDelta) / 1 ether) * price; + uint256 notionalValue = (_abs(_sizeDelta) / SCALING_FACTOR) * price; // calculate fee to impose return notionalValue * orderFlowFee / SETTINGS.MAX_ORDER_FLOW_FEE(); @@ -923,7 +926,7 @@ contract Account is IAccount, Auth, OpsReady { execAddress: address(this), execData: abi.encodeCall( this.executeConditionalOrder, conditionalOrderId - ), + ), moduleData: moduleData, feeToken: ETH });