@drift-labs/sdk 2.71.0-beta.2 → 2.71.0-beta.4

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 CHANGED
@@ -1 +1 @@
1
- 2.71.0-beta.2
1
+ 2.71.0-beta.4
@@ -23,6 +23,7 @@ export declare class AdminClient extends DriftClient {
23
23
  updatePerpMarketCurveUpdateIntensity(perpMarketIndex: number, curveUpdateIntensity: number): Promise<TransactionSignature>;
24
24
  updatePerpMarketTargetBaseAssetAmountPerLp(perpMarketIndex: number, targetBaseAssetAmountPerLP: number): Promise<TransactionSignature>;
25
25
  updatePerpMarketMarginRatio(perpMarketIndex: number, marginRatioInitial: number, marginRatioMaintenance: number): Promise<TransactionSignature>;
26
+ updatePerpMarketFundingPeriod(perpMarketIndex: number, fundingPeriod: BN): Promise<TransactionSignature>;
26
27
  updatePerpMarketImfFactor(perpMarketIndex: number, imfFactor: number, unrealizedPnlImfFactor: number): Promise<TransactionSignature>;
27
28
  updatePerpMarketBaseSpread(perpMarketIndex: number, baseSpread: number): Promise<TransactionSignature>;
28
29
  updateAmmJitIntensity(perpMarketIndex: number, ammJitIntensity: number): Promise<TransactionSignature>;
@@ -341,6 +341,18 @@ class AdminClient extends driftClient_1.DriftClient {
341
341
  const { txSig } = await this.sendTransaction(tx, [], this.opts);
342
342
  return txSig;
343
343
  }
344
+ async updatePerpMarketFundingPeriod(perpMarketIndex, fundingPeriod) {
345
+ const updatePerpMarketMarginRatioIx = await this.program.instruction.updatePerpMarketFundingRate(fundingPeriod, {
346
+ accounts: {
347
+ admin: this.wallet.publicKey,
348
+ state: await this.getStatePublicKey(),
349
+ perpMarket: await (0, pda_1.getPerpMarketPublicKey)(this.program.programId, perpMarketIndex),
350
+ },
351
+ });
352
+ const tx = await this.buildTransaction(updatePerpMarketMarginRatioIx);
353
+ const { txSig } = await this.sendTransaction(tx, [], this.opts);
354
+ return txSig;
355
+ }
344
356
  async updatePerpMarketImfFactor(perpMarketIndex, imfFactor, unrealizedPnlImfFactor) {
345
357
  return await this.program.rpc.updatePerpMarketImfFactor(imfFactor, unrealizedPnlImfFactor, {
346
358
  accounts: {
@@ -7,6 +7,7 @@ const pythClient_1 = require("../oracles/pythClient");
7
7
  const quoteAssetOracleClient_1 = require("../oracles/quoteAssetOracleClient");
8
8
  const anchor_1 = require("@coral-xyz/anchor");
9
9
  const prelaunchOracleClient_1 = require("../oracles/prelaunchOracleClient");
10
+ const switchboardClient_1 = require("../oracles/switchboardClient");
10
11
  function getOracleClient(oracleSource, connection, program) {
11
12
  if ((0, types_1.isVariant)(oracleSource, 'pyth')) {
12
13
  return new pythClient_1.PythClient(connection);
@@ -20,9 +21,9 @@ function getOracleClient(oracleSource, connection, program) {
20
21
  if ((0, types_1.isVariant)(oracleSource, 'pythStableCoin')) {
21
22
  return new pythClient_1.PythClient(connection, undefined, true);
22
23
  }
23
- // if (isVariant(oracleSource, 'switchboard')) {
24
- // return new SwitchboardClient(connection);
25
- // }
24
+ if ((0, types_1.isVariant)(oracleSource, 'switchboard')) {
25
+ return new switchboardClient_1.SwitchboardClient(connection);
26
+ }
26
27
  if ((0, types_1.isVariant)(oracleSource, 'prelaunch')) {
27
28
  return new prelaunchOracleClient_1.PrelaunchOracleClient(connection, program);
28
29
  }
@@ -3336,6 +3336,32 @@
3336
3336
  }
3337
3337
  ]
3338
3338
  },
3339
+ {
3340
+ "name": "updatePerpMarketFundingPeriod",
3341
+ "accounts": [
3342
+ {
3343
+ "name": "admin",
3344
+ "isMut": false,
3345
+ "isSigner": true
3346
+ },
3347
+ {
3348
+ "name": "state",
3349
+ "isMut": false,
3350
+ "isSigner": false
3351
+ },
3352
+ {
3353
+ "name": "perpMarket",
3354
+ "isMut": true,
3355
+ "isSigner": false
3356
+ }
3357
+ ],
3358
+ "args": [
3359
+ {
3360
+ "name": "fundingPeriod",
3361
+ "type": "i64"
3362
+ }
3363
+ ]
3364
+ },
3339
3365
  {
3340
3366
  "name": "updatePerpMarketMaxImbalances",
3341
3367
  "accounts": [
@@ -8560,6 +8586,9 @@
8560
8586
  },
8561
8587
  {
8562
8588
  "name": "UpdateAMMCurve"
8589
+ },
8590
+ {
8591
+ "name": "OracleOrderPrice"
8563
8592
  }
8564
8593
  ]
8565
8594
  }