@drift-labs/sdk 2.10.0-beta.0 → 2.10.0-beta.1
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/lib/accounts/types.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
2
|
import { SpotMarketAccount, PerpMarketAccount, OracleSource, StateAccount, UserAccount, UserStatsAccount } from '../types';
|
|
4
3
|
import StrictEventEmitter from 'strict-event-emitter-types';
|
|
5
4
|
import { EventEmitter } from 'events';
|
package/lib/idl/drift.json
CHANGED
package/lib/math/spotBalance.js
CHANGED
|
@@ -60,7 +60,7 @@ function calculateAssetWeight(balanceAmount, spotMarket, marginCategory) {
|
|
|
60
60
|
assetWeight = (0, margin_1.calculateSizeDiscountAssetWeight)(sizeInAmmReservePrecision, new anchor_1.BN(spotMarket.imfFactor), new anchor_1.BN(spotMarket.initialAssetWeight));
|
|
61
61
|
break;
|
|
62
62
|
case 'Maintenance':
|
|
63
|
-
assetWeight =
|
|
63
|
+
assetWeight = new anchor_1.BN(spotMarket.maintenanceAssetWeight);
|
|
64
64
|
break;
|
|
65
65
|
default:
|
|
66
66
|
assetWeight = new anchor_1.BN(spotMarket.initialAssetWeight);
|
package/package.json
CHANGED
package/src/idl/drift.json
CHANGED
package/src/math/spotBalance.ts
CHANGED
|
@@ -109,11 +109,7 @@ export function calculateAssetWeight(
|
|
|
109
109
|
);
|
|
110
110
|
break;
|
|
111
111
|
case 'Maintenance':
|
|
112
|
-
assetWeight =
|
|
113
|
-
sizeInAmmReservePrecision,
|
|
114
|
-
new BN(spotMarket.imfFactor),
|
|
115
|
-
new BN(spotMarket.maintenanceAssetWeight)
|
|
116
|
-
);
|
|
112
|
+
assetWeight = new BN(spotMarket.maintenanceAssetWeight);
|
|
117
113
|
break;
|
|
118
114
|
default:
|
|
119
115
|
assetWeight = new BN(spotMarket.initialAssetWeight);
|