Skip to content

Commit 0a373ea

Browse files
committed
feat: margin calc tests
1 parent a1a358e commit 0a373ea

File tree

2 files changed

+409
-0
lines changed

2 files changed

+409
-0
lines changed

sdk/tests/dlob/helpers.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ export const mockPerpPosition: PerpPosition = {
4545
lastQuoteAssetAmountPerLp: new BN(0),
4646
perLpBase: 0,
4747
maxMarginRatio: 1,
48+
isolatedPositionScaledBalance: new BN(0),
49+
positionFlag: 0,
4850
};
4951

5052
export const mockAMM: AMM = {
@@ -152,6 +154,8 @@ export const mockAMM: AMM = {
152154
mmOraclePrice: new BN(0),
153155
mmOracleSlot: new BN(0),
154156
lastFundingOracleTwap: new BN(0),
157+
oracleSlotDelayOverride: 0,
158+
referencePriceOffsetDeadbandPct: 0,
155159
};
156160

157161
export const mockPerpMarkets: Array<PerpMarketAccount> = [
@@ -201,6 +205,11 @@ export const mockPerpMarkets: Array<PerpMarketAccount> = [
201205
fuelBoostTaker: 0,
202206
protectedMakerLimitPriceDivisor: 0,
203207
protectedMakerDynamicDivisor: 0,
208+
lpPoolId: 0,
209+
lpFeeTransferScalar: 0,
210+
lpExchangeFeeExcluscionScalar: 0,
211+
lpStatus: 0,
212+
lpPausedOperations: 0,
204213
},
205214
{
206215
status: MarketStatus.INITIALIZED,
@@ -248,6 +257,11 @@ export const mockPerpMarkets: Array<PerpMarketAccount> = [
248257
fuelBoostTaker: 0,
249258
protectedMakerLimitPriceDivisor: 0,
250259
protectedMakerDynamicDivisor: 0,
260+
lpPoolId: 0,
261+
lpFeeTransferScalar: 0,
262+
lpExchangeFeeExcluscionScalar: 0,
263+
lpStatus: 0,
264+
lpPausedOperations: 0,
251265
},
252266
{
253267
status: MarketStatus.INITIALIZED,
@@ -295,6 +309,11 @@ export const mockPerpMarkets: Array<PerpMarketAccount> = [
295309
fuelBoostTaker: 0,
296310
protectedMakerLimitPriceDivisor: 0,
297311
protectedMakerDynamicDivisor: 0,
312+
lpPoolId: 0,
313+
lpFeeTransferScalar: 0,
314+
lpExchangeFeeExcluscionScalar: 0,
315+
lpStatus: 0,
316+
lpPausedOperations: 0,
298317
},
299318
];
300319

0 commit comments

Comments
 (0)