@percolatorct/sdk 1.0.0-beta.34 → 1.0.0-beta.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +26 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2118,9 +2118,13 @@ var V12_17_ENGINE_MARKET_MODE_OFF = 232;
|
|
|
2118
2118
|
var V12_17_ENGINE_RESOLVED_K_LONG_OFF = 304;
|
|
2119
2119
|
var V12_17_ENGINE_RESOLVED_K_SHORT_OFF = 320;
|
|
2120
2120
|
var V12_17_ENGINE_RESOLVED_LIVE_PRICE_OFF = 336;
|
|
2121
|
+
var V12_17_ENGINE_LAST_CRANK_SLOT_OFF = 344;
|
|
2121
2122
|
var V12_17_ENGINE_C_TOT_OFF = 352;
|
|
2122
2123
|
var V12_17_ENGINE_PNL_POS_TOT_OFF = 368;
|
|
2123
2124
|
var V12_17_ENGINE_PNL_MATURED_POS_TOT_OFF = 384;
|
|
2125
|
+
var V12_17_ENGINE_GC_CURSOR_OFF = 400;
|
|
2126
|
+
var V12_17_ENGINE_OI_EFF_LONG_OFF = 528;
|
|
2127
|
+
var V12_17_ENGINE_OI_EFF_SHORT_OFF = 544;
|
|
2124
2128
|
var V12_17_ENGINE_NEG_PNL_COUNT_OFF = 648;
|
|
2125
2129
|
var V12_17_ENGINE_LAST_ORACLE_PRICE_OFF = 656;
|
|
2126
2130
|
var V12_17_ENGINE_FUND_PX_LAST_OFF = 664;
|
|
@@ -2128,9 +2132,13 @@ var V12_17_ENGINE_F_LONG_NUM_OFF = 688;
|
|
|
2128
2132
|
var V12_17_ENGINE_F_SHORT_NUM_OFF = 704;
|
|
2129
2133
|
var V12_17_SBF_ENGINE_CURRENT_SLOT_OFF = 216;
|
|
2130
2134
|
var V12_17_SBF_ENGINE_MARKET_MODE_OFF = 224;
|
|
2135
|
+
var V12_17_SBF_ENGINE_LAST_CRANK_SLOT_OFF = 328;
|
|
2131
2136
|
var V12_17_SBF_ENGINE_C_TOT_OFF = 336;
|
|
2132
2137
|
var V12_17_SBF_ENGINE_PNL_POS_TOT_OFF = 352;
|
|
2133
2138
|
var V12_17_SBF_ENGINE_PNL_MATURED_POS_TOT_OFF = 368;
|
|
2139
|
+
var V12_17_SBF_ENGINE_GC_CURSOR_OFF = 384;
|
|
2140
|
+
var V12_17_SBF_ENGINE_OI_EFF_LONG_OFF = 504;
|
|
2141
|
+
var V12_17_SBF_ENGINE_OI_EFF_SHORT_OFF = 520;
|
|
2134
2142
|
var V12_17_SBF_ENGINE_NEG_PNL_COUNT_OFF = 616;
|
|
2135
2143
|
var V12_17_SBF_ENGINE_LAST_ORACLE_PRICE_OFF = 624;
|
|
2136
2144
|
var V12_17_SBF_ENGINE_FUND_PX_LAST_OFF = 632;
|
|
@@ -3069,15 +3077,18 @@ function buildLayoutV12_17(maxAccounts, dataLen) {
|
|
|
3069
3077
|
engineFundingRateBpsOff: -1,
|
|
3070
3078
|
// no stored funding rate in v12.17
|
|
3071
3079
|
engineMarkPriceOff: -1,
|
|
3072
|
-
|
|
3080
|
+
// v12.17 computes mark from state; no stored field
|
|
3081
|
+
engineLastCrankSlotOff: isSbf ? V12_17_SBF_ENGINE_LAST_CRANK_SLOT_OFF : V12_17_ENGINE_LAST_CRANK_SLOT_OFF,
|
|
3073
3082
|
engineMaxCrankStalenessOff: -1,
|
|
3074
3083
|
engineTotalOiOff: -1,
|
|
3075
|
-
|
|
3076
|
-
|
|
3084
|
+
// parseEngine sums long + short when total offset is -1
|
|
3085
|
+
engineLongOiOff: isSbf ? V12_17_SBF_ENGINE_OI_EFF_LONG_OFF : V12_17_ENGINE_OI_EFF_LONG_OFF,
|
|
3086
|
+
engineShortOiOff: isSbf ? V12_17_SBF_ENGINE_OI_EFF_SHORT_OFF : V12_17_ENGINE_OI_EFF_SHORT_OFF,
|
|
3077
3087
|
engineCTotOff: isSbf ? V12_17_SBF_ENGINE_C_TOT_OFF : V12_17_ENGINE_C_TOT_OFF,
|
|
3078
3088
|
enginePnlPosTotOff: isSbf ? V12_17_SBF_ENGINE_PNL_POS_TOT_OFF : V12_17_ENGINE_PNL_POS_TOT_OFF,
|
|
3079
3089
|
engineLiqCursorOff: -1,
|
|
3080
|
-
|
|
3090
|
+
// removed in v12.17
|
|
3091
|
+
engineGcCursorOff: isSbf ? V12_17_SBF_ENGINE_GC_CURSOR_OFF : V12_17_ENGINE_GC_CURSOR_OFF,
|
|
3081
3092
|
engineLastSweepStartOff: -1,
|
|
3082
3093
|
engineLastSweepCompleteOff: -1,
|
|
3083
3094
|
engineCrankCursorOff: -1,
|
|
@@ -3499,6 +3510,12 @@ function parseEngine(data) {
|
|
|
3499
3510
|
const resolvedKLongOff = isSbf ? 288 : V12_17_ENGINE_RESOLVED_K_LONG_OFF;
|
|
3500
3511
|
const resolvedKShortOff = isSbf ? 304 : V12_17_ENGINE_RESOLVED_K_SHORT_OFF;
|
|
3501
3512
|
const resolvedLivePriceOff = isSbf ? 320 : V12_17_ENGINE_RESOLVED_LIVE_PRICE_OFF;
|
|
3513
|
+
const lastCrankSlotOff = isSbf ? V12_17_SBF_ENGINE_LAST_CRANK_SLOT_OFF : V12_17_ENGINE_LAST_CRANK_SLOT_OFF;
|
|
3514
|
+
const gcCursorOff = isSbf ? V12_17_SBF_ENGINE_GC_CURSOR_OFF : V12_17_ENGINE_GC_CURSOR_OFF;
|
|
3515
|
+
const oiEffLongOff = isSbf ? V12_17_SBF_ENGINE_OI_EFF_LONG_OFF : V12_17_ENGINE_OI_EFF_LONG_OFF;
|
|
3516
|
+
const oiEffShortOff = isSbf ? V12_17_SBF_ENGINE_OI_EFF_SHORT_OFF : V12_17_ENGINE_OI_EFF_SHORT_OFF;
|
|
3517
|
+
const longOi = readU128LE(data, base + oiEffLongOff);
|
|
3518
|
+
const shortOi = readU128LE(data, base + oiEffShortOff);
|
|
3502
3519
|
const bitmapEnd = layout.engineBitmapOff + layout.bitmapWords * 8;
|
|
3503
3520
|
return {
|
|
3504
3521
|
vault: readU128LE(data, base),
|
|
@@ -3517,16 +3534,16 @@ function parseEngine(data) {
|
|
|
3517
3534
|
fundingRateE9: 0n,
|
|
3518
3535
|
// no stored funding rate in v12.17
|
|
3519
3536
|
marketMode: readU8(data, base + marketModeOff) === 1 ? 1 : 0,
|
|
3520
|
-
lastCrankSlot:
|
|
3537
|
+
lastCrankSlot: readU64LE(data, base + lastCrankSlotOff),
|
|
3521
3538
|
maxCrankStalenessSlots: 0n,
|
|
3522
|
-
totalOpenInterest:
|
|
3523
|
-
longOi
|
|
3524
|
-
shortOi
|
|
3539
|
+
totalOpenInterest: longOi + shortOi,
|
|
3540
|
+
longOi,
|
|
3541
|
+
shortOi,
|
|
3525
3542
|
cTot: readU128LE(data, base + cTotOff),
|
|
3526
3543
|
pnlPosTot: readU128LE(data, base + pnlPosTotOff),
|
|
3527
3544
|
pnlMaturedPosTot: readU128LE(data, base + pnlMaturedOff),
|
|
3528
3545
|
liqCursor: 0,
|
|
3529
|
-
gcCursor:
|
|
3546
|
+
gcCursor: readU16LE(data, base + gcCursorOff),
|
|
3530
3547
|
lastSweepStartSlot: 0n,
|
|
3531
3548
|
lastSweepCompleteSlot: 0n,
|
|
3532
3549
|
crankCursor: 0,
|