From d42307a52151737f1dc151dd130c5bba8290e498 Mon Sep 17 00:00:00 2001 From: Troy Date: Thu, 29 Jun 2023 17:15:32 -0600 Subject: [PATCH] add sizedelta to runtime --- .../perps-market/contracts/interfaces/IAsyncOrderModule.sol | 1 + markets/perps-market/contracts/modules/AsyncOrderModule.sol | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/markets/perps-market/contracts/interfaces/IAsyncOrderModule.sol b/markets/perps-market/contracts/interfaces/IAsyncOrderModule.sol index 8a6b5800cc..7afabaf78d 100644 --- a/markets/perps-market/contracts/interfaces/IAsyncOrderModule.sol +++ b/markets/perps-market/contracts/interfaces/IAsyncOrderModule.sol @@ -60,6 +60,7 @@ interface IAsyncOrderModule { struct SettleOrderRuntime { uint128 marketId; uint128 accountId; + int128 sizeDelta; int128 newPositionSize; int256 pnl; uint256 pnlUint; diff --git a/markets/perps-market/contracts/modules/AsyncOrderModule.sol b/markets/perps-market/contracts/modules/AsyncOrderModule.sol index 488c31e6fe..ab6e415b17 100644 --- a/markets/perps-market/contracts/modules/AsyncOrderModule.sol +++ b/markets/perps-market/contracts/modules/AsyncOrderModule.sol @@ -177,6 +177,7 @@ contract AsyncOrderModule is IAsyncOrderModule { runtime.accountId = asyncOrder.accountId; runtime.marketId = asyncOrder.marketId; + runtime.sizeDelta = asyncOrder.sizeDelta; // check if account is flagged GlobalPerpsMarket.load().checkLiquidation(runtime.accountId); @@ -224,7 +225,6 @@ contract AsyncOrderModule is IAsyncOrderModule { // exctracted from asyncOrder before order is reset bytes32 trackingCode = asyncOrder.trackingCode; - int128 sizeDelta = asyncOrder.sizeDelta; asyncOrder.reset(); @@ -234,7 +234,7 @@ contract AsyncOrderModule is IAsyncOrderModule { runtime.accountId, fillPrice, runtime.pnl, - sizeDelta, + runtime.sizeDelta, runtime.newPositionSize, totalFees, runtime.settlementReward,