@@ -15,6 +15,8 @@ type DerivativeBatchExecutionData struct {
1515	DepositDeltas         DepositDeltas 
1616	DepositSubaccountIDs  []common.Hash 
1717
18+ 	LiquidityMiningRewards          LiquidityMiningRewards 
19+ 
1820	// updated positions 
1921	Positions              []* Position 
2022	PositionSubaccountIDs  []common.Hash 
@@ -106,16 +108,17 @@ func (e *DerivativeMatchingExpansionData) GetLimitMatchingDerivativeBatchExecuti
106108	positionStates  map [common.Hash ]* PositionState ,
107109) * DerivativeBatchExecutionData  {
108110	depositDeltas  :=  NewDepositDeltas ()
111+ 	liquidityMiningRewards  :=  NewLiquidityMiningRewards ()
109112
110113	// process undermargined resting limit order forced cancellations 
111114	cancelLimitOrdersEvents , restingOrderCancelledDeltas , transientOrderCancelledDeltas  :=  e .applyCancellationsAndGetDerivativeLimitCancelEvents (market .MarketID (), market .MakerFeeRate , market .TakerFeeRate , depositDeltas )
112115
113116	positions , positionSubaccountIDs  :=  GetPositionSliceData (positionStates )
114117
115- 	transientLimitBuyOrderBatchEvent , transientLimitBuyFilledDeltas  :=  ApplyDeltasAndGetDerivativeOrderBatchEvent (true , ExecutionType_LimitMatchNewOrder , market , funding , e .TransientLimitBuyExpansions , depositDeltas )
116- 	restingLimitBuyOrderBatchEvent , restingLimitBuyFilledDeltas  :=  ApplyDeltasAndGetDerivativeOrderBatchEvent (true , ExecutionType_LimitMatchRestingOrder , market , funding , e .RestingLimitBuyExpansions , depositDeltas )
117- 	transientLimitSellOrderBatchEvent , transientLimitSellFilledDeltas  :=  ApplyDeltasAndGetDerivativeOrderBatchEvent (false , ExecutionType_LimitMatchNewOrder , market , funding , e .TransientLimitSellExpansions , depositDeltas )
118- 	restingLimitSellOrderBatchEvent , restingLimitSellFilledDeltas  :=  ApplyDeltasAndGetDerivativeOrderBatchEvent (false , ExecutionType_LimitMatchRestingOrder , market , funding , e .RestingLimitSellExpansions , depositDeltas )
118+ 	transientLimitBuyOrderBatchEvent , transientLimitBuyFilledDeltas  :=  ApplyDeltasAndGetDerivativeOrderBatchEvent (true , ExecutionType_LimitMatchNewOrder , market , funding , e .TransientLimitBuyExpansions , depositDeltas ,  liquidityMiningRewards )
119+ 	restingLimitBuyOrderBatchEvent , restingLimitBuyFilledDeltas  :=  ApplyDeltasAndGetDerivativeOrderBatchEvent (true , ExecutionType_LimitMatchRestingOrder , market , funding , e .RestingLimitBuyExpansions , depositDeltas ,  liquidityMiningRewards )
120+ 	transientLimitSellOrderBatchEvent , transientLimitSellFilledDeltas  :=  ApplyDeltasAndGetDerivativeOrderBatchEvent (false , ExecutionType_LimitMatchNewOrder , market , funding , e .TransientLimitSellExpansions , depositDeltas ,  liquidityMiningRewards )
121+ 	restingLimitSellOrderBatchEvent , restingLimitSellFilledDeltas  :=  ApplyDeltasAndGetDerivativeOrderBatchEvent (false , ExecutionType_LimitMatchRestingOrder , market , funding , e .RestingLimitSellExpansions , depositDeltas ,  liquidityMiningRewards )
119122
120123	restingOrderFilledDeltas  :=  mergeDerivativeLimitOrderFilledDeltas (restingLimitBuyFilledDeltas , restingLimitSellFilledDeltas )
121124	transientOrderFilledDeltas  :=  mergeDerivativeLimitOrderFilledDeltas (transientLimitBuyFilledDeltas , transientLimitSellFilledDeltas )
@@ -144,6 +147,7 @@ func (e *DerivativeMatchingExpansionData) GetLimitMatchingDerivativeBatchExecuti
144147		Funding :                               funding ,
145148		DepositDeltas :                         depositDeltas ,
146149		DepositSubaccountIDs :                  depositDeltaKeys ,
150+ 		LiquidityMiningRewards :                liquidityMiningRewards ,
147151		Positions :                             positions ,
148152		PositionSubaccountIDs :                 positionSubaccountIDs ,
149153		RestingLimitOrderFilledDeltas :         restingOrderFilledDeltas ,
@@ -339,6 +343,7 @@ func (e *DerivativeMarketOrderExpansionData) GetMarketDerivativeBatchExecutionDa
339343	positionStates  map [common.Hash ]* PositionState ,
340344) * DerivativeBatchExecutionData  {
341345	depositDeltas  :=  NewDepositDeltas ()
346+ 	liquidityMiningRewards  :=  NewLiquidityMiningRewards ()
342347
343348	// process undermargined limit order forced cancellations 
344349	cancelLimitOrdersEvents , restingOrderCancelledDeltas  :=  e .applyCancellationsAndGetDerivativeLimitCancelEvents (market .MarketID (), market .MakerFeeRate , depositDeltas )
@@ -348,10 +353,10 @@ func (e *DerivativeMarketOrderExpansionData) GetMarketDerivativeBatchExecutionDa
348353
349354	positions , positionSubaccountIDs  :=  GetPositionSliceData (positionStates )
350355
351- 	buyMarketOrderBatchEvent , _  :=  ApplyDeltasAndGetDerivativeOrderBatchEvent (true , ExecutionType_Market , market , funding , e .MarketBuyExpansions , depositDeltas )
352- 	sellMarketOrderBatchEvent , _  :=  ApplyDeltasAndGetDerivativeOrderBatchEvent (false , ExecutionType_Market , market , funding , e .MarketSellExpansions , depositDeltas )
353- 	restingLimitBuyOrderBatchEvent , limitBuyFilledDeltas  :=  ApplyDeltasAndGetDerivativeOrderBatchEvent (true , ExecutionType_LimitFill , market , funding , e .LimitBuyExpansions , depositDeltas )
354- 	restingLimitSellOrderBatchEvent , limitSellFilledDeltas  :=  ApplyDeltasAndGetDerivativeOrderBatchEvent (false , ExecutionType_LimitFill , market , funding , e .LimitSellExpansions , depositDeltas )
356+ 	buyMarketOrderBatchEvent , _  :=  ApplyDeltasAndGetDerivativeOrderBatchEvent (true , ExecutionType_Market , market , funding , e .MarketBuyExpansions , depositDeltas ,  liquidityMiningRewards )
357+ 	sellMarketOrderBatchEvent , _  :=  ApplyDeltasAndGetDerivativeOrderBatchEvent (false , ExecutionType_Market , market , funding , e .MarketSellExpansions , depositDeltas ,  liquidityMiningRewards )
358+ 	restingLimitBuyOrderBatchEvent , limitBuyFilledDeltas  :=  ApplyDeltasAndGetDerivativeOrderBatchEvent (true , ExecutionType_LimitFill , market , funding , e .LimitBuyExpansions , depositDeltas ,  liquidityMiningRewards )
359+ 	restingLimitSellOrderBatchEvent , limitSellFilledDeltas  :=  ApplyDeltasAndGetDerivativeOrderBatchEvent (false , ExecutionType_LimitFill , market , funding , e .LimitSellExpansions , depositDeltas ,  liquidityMiningRewards )
355360
356361	filledDeltas  :=  mergeDerivativeLimitOrderFilledDeltas (limitBuyFilledDeltas , limitSellFilledDeltas )
357362
@@ -371,6 +376,7 @@ func (e *DerivativeMarketOrderExpansionData) GetMarketDerivativeBatchExecutionDa
371376		Funding :                               funding ,
372377		DepositDeltas :                         depositDeltas ,
373378		DepositSubaccountIDs :                  depositDeltaKeys ,
379+ 		LiquidityMiningRewards :                liquidityMiningRewards ,
374380		Positions :                             positions ,
375381		PositionSubaccountIDs :                 positionSubaccountIDs ,
376382		TransientLimitOrderFilledDeltas :       nil ,
0 commit comments