Skip to content

Commit

Permalink
πŸ‘·πŸ»β€β™‚οΈ add SCALING_FACTOR
Browse files Browse the repository at this point in the history
  • Loading branch information
JaredBorders committed May 21, 2024
1 parent 3fbfe12 commit 09904be
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Account.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
//////////////////////////////////////////////////////////////*/
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -923,7 +926,7 @@ contract Account is IAccount, Auth, OpsReady {
execAddress: address(this),
execData: abi.encodeCall(
this.executeConditionalOrder, conditionalOrderId
),
),
moduleData: moduleData,
feeToken: ETH
});
Expand Down

0 comments on commit 09904be

Please sign in to comment.