@drift-labs/sdk 2.86.0-beta.26 → 2.86.0-beta.28
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/VERSION +1 -1
- package/lib/types.d.ts +3 -2
- package/lib/types.js +3 -2
- package/lib/user.js +1 -1
- package/package.json +1 -1
- package/src/types.ts +3 -2
- package/src/user.ts +5 -2
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.86.0-beta.
|
|
1
|
+
2.86.0-beta.28
|
package/lib/types.d.ts
CHANGED
|
@@ -55,8 +55,9 @@ export declare enum PerpOperation {
|
|
|
55
55
|
export declare enum SpotOperation {
|
|
56
56
|
UPDATE_CUMULATIVE_INTEREST = 1,
|
|
57
57
|
FILL = 2,
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
DEPOSIT = 4,
|
|
59
|
+
WITHDRAW = 8,
|
|
60
|
+
LIQUIDATION = 16
|
|
60
61
|
}
|
|
61
62
|
export declare enum InsuranceFundOperation {
|
|
62
63
|
INIT = 1,
|
package/lib/types.js
CHANGED
|
@@ -40,8 +40,9 @@ var SpotOperation;
|
|
|
40
40
|
(function (SpotOperation) {
|
|
41
41
|
SpotOperation[SpotOperation["UPDATE_CUMULATIVE_INTEREST"] = 1] = "UPDATE_CUMULATIVE_INTEREST";
|
|
42
42
|
SpotOperation[SpotOperation["FILL"] = 2] = "FILL";
|
|
43
|
-
SpotOperation[SpotOperation["
|
|
44
|
-
SpotOperation[SpotOperation["
|
|
43
|
+
SpotOperation[SpotOperation["DEPOSIT"] = 4] = "DEPOSIT";
|
|
44
|
+
SpotOperation[SpotOperation["WITHDRAW"] = 8] = "WITHDRAW";
|
|
45
|
+
SpotOperation[SpotOperation["LIQUIDATION"] = 16] = "LIQUIDATION";
|
|
45
46
|
})(SpotOperation = exports.SpotOperation || (exports.SpotOperation = {}));
|
|
46
47
|
var InsuranceFundOperation;
|
|
47
48
|
(function (InsuranceFundOperation) {
|
package/lib/user.js
CHANGED
|
@@ -597,7 +597,7 @@ class User {
|
|
|
597
597
|
}
|
|
598
598
|
if (userStats.ifStakedQuoteAssetAmount.gt(numericConstants_1.ZERO)) {
|
|
599
599
|
const spotMarketAccount = this.driftClient.getSpotMarketAccount(numericConstants_1.QUOTE_SPOT_MARKET_INDEX);
|
|
600
|
-
const fuelBonusNumeratorUserStats = now.sub(_1.BN.max(new _1.BN(userStats.lastFuelIfBonusUpdateTs), numericConstants_1.FUEL_START_TS));
|
|
600
|
+
const fuelBonusNumeratorUserStats = _1.BN.max(now.sub(_1.BN.max(new _1.BN(userStats.lastFuelIfBonusUpdateTs), numericConstants_1.FUEL_START_TS)), numericConstants_1.ZERO);
|
|
601
601
|
result.insuranceFuel = result.insuranceFuel.add((0, fuel_1.calculateInsuranceFuelBonus)(spotMarketAccount, userStats.ifStakedQuoteAssetAmount, fuelBonusNumeratorUserStats));
|
|
602
602
|
}
|
|
603
603
|
}
|
package/package.json
CHANGED
package/src/types.ts
CHANGED
package/src/user.ts
CHANGED
|
@@ -1030,8 +1030,11 @@ export class User {
|
|
|
1030
1030
|
const spotMarketAccount: SpotMarketAccount =
|
|
1031
1031
|
this.driftClient.getSpotMarketAccount(QUOTE_SPOT_MARKET_INDEX);
|
|
1032
1032
|
|
|
1033
|
-
const fuelBonusNumeratorUserStats =
|
|
1034
|
-
|
|
1033
|
+
const fuelBonusNumeratorUserStats = BN.max(
|
|
1034
|
+
now.sub(
|
|
1035
|
+
BN.max(new BN(userStats.lastFuelIfBonusUpdateTs), FUEL_START_TS)
|
|
1036
|
+
),
|
|
1037
|
+
ZERO
|
|
1035
1038
|
);
|
|
1036
1039
|
|
|
1037
1040
|
result.insuranceFuel = result.insuranceFuel.add(
|