Skip to content

Commit

Permalink
add sizedelta to runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
Tburm committed Jun 29, 2023
1 parent 081a06f commit d42307a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ interface IAsyncOrderModule {
struct SettleOrderRuntime {
uint128 marketId;
uint128 accountId;
int128 sizeDelta;
int128 newPositionSize;
int256 pnl;
uint256 pnlUint;
Expand Down
4 changes: 2 additions & 2 deletions markets/perps-market/contracts/modules/AsyncOrderModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();

Expand All @@ -234,7 +234,7 @@ contract AsyncOrderModule is IAsyncOrderModule {
runtime.accountId,
fillPrice,
runtime.pnl,
sizeDelta,
runtime.sizeDelta,
runtime.newPositionSize,
totalFees,
runtime.settlementReward,
Expand Down

0 comments on commit d42307a

Please sign in to comment.