@drift-labs/sdk 2.0.13 → 2.0.15

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.
@@ -606,6 +606,34 @@ export class AdminClient extends DriftClient {
606
606
  });
607
607
  }
608
608
 
609
+ public async updateInitialPctToLiquidate(
610
+ initialPctToLiquidate: number
611
+ ): Promise<TransactionSignature> {
612
+ return await this.program.rpc.updateInitialPctToLiquidate(
613
+ initialPctToLiquidate,
614
+ {
615
+ accounts: {
616
+ admin: this.wallet.publicKey,
617
+ state: await this.getStatePublicKey(),
618
+ },
619
+ }
620
+ );
621
+ }
622
+
623
+ public async updateLiquidationDuration(
624
+ liquidationDuration: number
625
+ ): Promise<TransactionSignature> {
626
+ return await this.program.rpc.updateLiquidationDuration(
627
+ liquidationDuration,
628
+ {
629
+ accounts: {
630
+ admin: this.wallet.publicKey,
631
+ state: await this.getStatePublicKey(),
632
+ },
633
+ }
634
+ );
635
+ }
636
+
609
637
  public async updateOracleGuardRails(
610
638
  oracleGuardRails: OracleGuardRails
611
639
  ): Promise<TransactionSignature> {
@@ -81,6 +81,7 @@ export const AMM_TIMES_PEG_TO_QUOTE_PRECISION_RATIO =
81
81
  AMM_RESERVE_PRECISION.mul(PEG_PRECISION).div(QUOTE_PRECISION); // 10^9
82
82
  export const MARGIN_PRECISION = TEN_THOUSAND;
83
83
  export const BID_ASK_SPREAD_PRECISION = new BN(1000000); // 10^6
84
+ export const LIQUIDATION_PCT_PRECISION = TEN_THOUSAND;
84
85
 
85
86
  export const ONE_YEAR = new BN(31536000);
86
87
 
@@ -88,3 +89,5 @@ export const QUOTE_SPOT_MARKET_INDEX = 0;
88
89
 
89
90
  export const LAMPORTS_PRECISION = new BN(LAMPORTS_PER_SOL);
90
91
  export const LAMPORTS_EXP = new BN(Math.log10(LAMPORTS_PER_SOL));
92
+
93
+ export const OPEN_ORDER_MARGIN_REQUIREMENT = QUOTE_PRECISION.div(new BN(100));