@drift-labs/sdk 2.41.0-beta.2 → 2.41.0-beta.3
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/adminClient.d.ts +1 -0
- package/lib/adminClient.js +9 -0
- package/lib/types.d.ts +1 -0
- package/package.json +1 -1
- package/src/adminClient.ts +16 -0
- package/src/types.ts +1 -0
- package/tests/dlob/helpers.ts +3 -0
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.41.0-beta.
|
|
1
|
+
2.41.0-beta.3
|
package/lib/adminClient.d.ts
CHANGED
|
@@ -67,6 +67,7 @@ export declare class AdminClient extends DriftClient {
|
|
|
67
67
|
updatePerpMarketUnrealizedAssetWeight(perpMarketIndex: number, unrealizedInitialAssetWeight: number, unrealizedMaintenanceAssetWeight: number): Promise<TransactionSignature>;
|
|
68
68
|
updatePerpMarketMaxImbalances(perpMarketIndex: number, unrealizedMaxImbalance: BN, maxRevenueWithdrawPerPeriod: BN, quoteMaxInsurance: BN): Promise<TransactionSignature>;
|
|
69
69
|
updatePerpMarketMaxOpenInterest(perpMarketIndex: number, maxOpenInterest: BN): Promise<TransactionSignature>;
|
|
70
|
+
updatePerpMarketFeeAdjustment(perpMarketIndex: number, feeAdjustment: number): Promise<TransactionSignature>;
|
|
70
71
|
updateSerumVault(srmVault: PublicKey): Promise<TransactionSignature>;
|
|
71
72
|
updatePerpMarketLiquidationFee(perpMarketIndex: number, liquidatorFee: number, ifLiquidationFee: number): Promise<TransactionSignature>;
|
|
72
73
|
updateSpotMarketLiquidationFee(spotMarketIndex: number, liquidatorFee: number, ifLiquidationFee: number): Promise<TransactionSignature>;
|
package/lib/adminClient.js
CHANGED
|
@@ -764,6 +764,15 @@ class AdminClient extends driftClient_1.DriftClient {
|
|
|
764
764
|
},
|
|
765
765
|
});
|
|
766
766
|
}
|
|
767
|
+
async updatePerpMarketFeeAdjustment(perpMarketIndex, feeAdjustment) {
|
|
768
|
+
return await this.program.rpc.updatePerpMarketFeeAdjustment(feeAdjustment, {
|
|
769
|
+
accounts: {
|
|
770
|
+
admin: this.wallet.publicKey,
|
|
771
|
+
state: await this.getStatePublicKey(),
|
|
772
|
+
perpMarket: await (0, pda_1.getPerpMarketPublicKey)(this.program.programId, perpMarketIndex),
|
|
773
|
+
},
|
|
774
|
+
});
|
|
775
|
+
}
|
|
767
776
|
async updateSerumVault(srmVault) {
|
|
768
777
|
return await this.program.rpc.updateSerumVault({
|
|
769
778
|
accounts: {
|
package/lib/types.d.ts
CHANGED
package/package.json
CHANGED
package/src/adminClient.ts
CHANGED
|
@@ -1464,6 +1464,22 @@ export class AdminClient extends DriftClient {
|
|
|
1464
1464
|
);
|
|
1465
1465
|
}
|
|
1466
1466
|
|
|
1467
|
+
public async updatePerpMarketFeeAdjustment(
|
|
1468
|
+
perpMarketIndex: number,
|
|
1469
|
+
feeAdjustment: number
|
|
1470
|
+
): Promise<TransactionSignature> {
|
|
1471
|
+
return await this.program.rpc.updatePerpMarketFeeAdjustment(feeAdjustment, {
|
|
1472
|
+
accounts: {
|
|
1473
|
+
admin: this.wallet.publicKey,
|
|
1474
|
+
state: await this.getStatePublicKey(),
|
|
1475
|
+
perpMarket: await getPerpMarketPublicKey(
|
|
1476
|
+
this.program.programId,
|
|
1477
|
+
perpMarketIndex
|
|
1478
|
+
),
|
|
1479
|
+
},
|
|
1480
|
+
});
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1467
1483
|
public async updateSerumVault(
|
|
1468
1484
|
srmVault: PublicKey
|
|
1469
1485
|
): Promise<TransactionSignature> {
|
package/src/types.ts
CHANGED
package/tests/dlob/helpers.ts
CHANGED
|
@@ -178,6 +178,7 @@ export const mockPerpMarkets: Array<PerpMarketAccount> = [
|
|
|
178
178
|
quoteMaxInsurance: new BN(0),
|
|
179
179
|
},
|
|
180
180
|
quoteSpotMarketIndex: 0,
|
|
181
|
+
feeAdjustment: 0,
|
|
181
182
|
},
|
|
182
183
|
{
|
|
183
184
|
status: MarketStatus.INITIALIZED,
|
|
@@ -215,6 +216,7 @@ export const mockPerpMarkets: Array<PerpMarketAccount> = [
|
|
|
215
216
|
quoteMaxInsurance: new BN(0),
|
|
216
217
|
},
|
|
217
218
|
quoteSpotMarketIndex: 0,
|
|
219
|
+
feeAdjustment: 0,
|
|
218
220
|
},
|
|
219
221
|
{
|
|
220
222
|
status: MarketStatus.INITIALIZED,
|
|
@@ -252,6 +254,7 @@ export const mockPerpMarkets: Array<PerpMarketAccount> = [
|
|
|
252
254
|
quoteMaxInsurance: new BN(0),
|
|
253
255
|
},
|
|
254
256
|
quoteSpotMarketIndex: 0,
|
|
257
|
+
feeAdjustment: 0,
|
|
255
258
|
},
|
|
256
259
|
];
|
|
257
260
|
|