flash-sdk 11.4.4 → 11.4.7

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.
@@ -6,9 +6,6 @@ import { AddLiquidityAmountAndFee, InternalPrice, BorrowRateParams, ExitPriceAnd
6
6
  import { OraclePrice } from "./OraclePrice";
7
7
  import { CustodyAccount } from "./CustodyAccount";
8
8
  import { Perpetuals } from "./idl/perpetuals";
9
- import { PerpComposability } from "./idl/perp_composability";
10
- import { FbnftRewards } from "./idl/fbnft_rewards";
11
- import { RewardDistribution } from "./idl/reward_distribution";
12
9
  import { SendTransactionOpts } from "./utils/rpc";
13
10
  import { MarketConfig, PoolConfig, Token } from "./PoolConfig";
14
11
  import { MarketAccount } from "./MarketAccount";
@@ -22,12 +19,8 @@ export type PerpClientOptions = {
22
19
  export declare class PerpetualsClient {
23
20
  provider: AnchorProvider;
24
21
  program: Program<Perpetuals>;
25
- programPerpComposability: Program<PerpComposability>;
26
- programFbnftReward: Program<FbnftRewards>;
27
- programRewardDistribution: Program<RewardDistribution>;
28
22
  admin: PublicKey;
29
23
  programId: PublicKey;
30
- composabilityProgramId: PublicKey;
31
24
  multisig: {
32
25
  publicKey: PublicKey;
33
26
  bump: number;
@@ -48,10 +41,6 @@ export declare class PerpetualsClient {
48
41
  publicKey: PublicKey;
49
42
  bump: number;
50
43
  };
51
- eventAuthorityRewardDistribution: {
52
- publicKey: PublicKey;
53
- bump: number;
54
- };
55
44
  prioritizationFee: number;
56
45
  minimumBalanceForRentExemptAccountLamports: number;
57
46
  private postSendTxCallback?;
@@ -69,9 +69,6 @@ var PositionAccount_1 = require("./PositionAccount");
69
69
  var types_1 = require("./types");
70
70
  var OraclePrice_1 = require("./OraclePrice");
71
71
  var perpetuals_1 = require("./idl/perpetuals");
72
- var perp_composability_1 = require("./idl/perp_composability");
73
- var fbnft_rewards_1 = require("./idl/fbnft_rewards");
74
- var reward_distribution_1 = require("./idl/reward_distribution");
75
72
  var rpc_1 = require("./utils/rpc");
76
73
  var utils_1 = require("./utils");
77
74
  var constants_1 = require("./constants");
@@ -7125,12 +7122,12 @@ var PerpetualsClient = (function () {
7125
7122
  });
7126
7123
  }); };
7127
7124
  this.moveProtocolFees = function (rewardSymbol, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
7128
- var publicKey, custodyConfig, instructions, additionalSigners, moveProtocolFeesIx, err_45;
7125
+ var publicKey, rewardCustodyConfig, instructions, additionalSigners, moveProtocolFeesIx, err_45;
7129
7126
  return __generator(this, function (_a) {
7130
7127
  switch (_a.label) {
7131
7128
  case 0:
7132
7129
  publicKey = this.provider.wallet.publicKey;
7133
- custodyConfig = poolConfig.custodies.find(function (i) { return i.mintKey.equals(poolConfig.getTokenFromSymbol(rewardSymbol).mintKey); });
7130
+ rewardCustodyConfig = poolConfig.custodies.find(function (i) { return i.mintKey.equals(poolConfig.getTokenFromSymbol(rewardSymbol).mintKey); });
7134
7131
  instructions = [];
7135
7132
  additionalSigners = [];
7136
7133
  _a.label = 1;
@@ -7143,15 +7140,15 @@ var PerpetualsClient = (function () {
7143
7140
  perpetuals: this.perpetuals.publicKey,
7144
7141
  tokenVault: poolConfig.tokenVault,
7145
7142
  pool: poolConfig.poolAddress,
7146
- custody: custodyConfig.custodyAccount,
7147
- custodyTokenAccount: custodyConfig.tokenAccount,
7143
+ rewardCustody: rewardCustodyConfig.custodyAccount,
7144
+ rewardCustodyTokenAccount: rewardCustodyConfig.tokenAccount,
7148
7145
  revenueTokenAccount: poolConfig.revenueTokenAccount,
7149
7146
  protocolVault: poolConfig.protocolVault,
7150
7147
  protocolTokenAccount: poolConfig.protocolTokenAccount,
7151
7148
  tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
7152
7149
  eventAuthority: this.eventAuthority.publicKey,
7153
7150
  program: this.program.programId,
7154
- tokenMint: custodyConfig.mintKey,
7151
+ tokenMint: rewardCustodyConfig.mintKey,
7155
7152
  })
7156
7153
  .instruction()];
7157
7154
  case 2:
@@ -8164,17 +8161,12 @@ var PerpetualsClient = (function () {
8164
8161
  this.provider = provider;
8165
8162
  (0, anchor_1.setProvider)(provider);
8166
8163
  this.program = new anchor_1.Program(perpetuals_1.IDL, programId);
8167
- this.programPerpComposability = new anchor_1.Program(perp_composability_1.IDL, composabilityProgramId);
8168
- this.programFbnftReward = new anchor_1.Program(fbnft_rewards_1.IDL, fbNftRewardProgramId);
8169
- this.programRewardDistribution = new anchor_1.Program(reward_distribution_1.IDL, rewardDistributionProgramId);
8170
8164
  this.programId = programId;
8171
- this.composabilityProgramId = composabilityProgramId;
8172
8165
  this.admin = this.provider.wallet.publicKey;
8173
8166
  this.multisig = this.findProgramAddress("multisig");
8174
8167
  this.authority = this.findProgramAddress("transfer_authority");
8175
8168
  this.perpetuals = this.findProgramAddress("perpetuals");
8176
8169
  this.eventAuthority = this.findProgramAddress("__event_authority");
8177
- this.eventAuthorityRewardDistribution = this.findProgramAddressFromProgramId("__event_authority", null, this.programRewardDistribution.programId);
8178
8170
  this.minimumBalanceForRentExemptAccountLamports = 2039280;
8179
8171
  this.prioritizationFee = (opts === null || opts === void 0 ? void 0 : opts.prioritizationFee) || 0;
8180
8172
  this.useExtOracleAccount = useExtOracleAccount;
@@ -387,24 +387,6 @@
387
387
  "targetMint": "A7bdiYdS5GjqGFtxf17ppRHtDKPkkRqbKtR27dxvQXaS",
388
388
  "collateralMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
389
389
  }
390
- ],
391
- "marketsDeprecated": [
392
- {
393
- "marketId": 0,
394
- "marketAccount": "88zawd3Rw6tknWvgEm8QBgBuf5Y2GTeA18S788qUrSnM",
395
- "marketCorrelation": false,
396
- "pool": "KwhpybQPe9xuZFmAfcjLHj3ukownWex1ratyascAC1X",
397
- "targetCustody": "3j1xiP6GckKCzsTm6sni5iy6zrpZX5BWZGbKCq5buk4d",
398
- "collateralCustody": "9yANuRkTRxb9jjxnG1h3xcUz2kM8fJgDbdYJV4PfZ7dy",
399
- "side": "long",
400
- "maxLev": 100,
401
- "degenMinLev": 1,
402
- "degenMaxLev": 100,
403
- "targetCustodyId": 1,
404
- "collateralCustodyId": 0,
405
- "targetMint": "XAUfcdPHmEBnj78YnZ5YxqdwBmgbwoY5VfrRwETnKuQ",
406
- "collateralMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
407
- }
408
390
  ]
409
391
  },
410
392
  {
@@ -661,22 +643,6 @@
661
643
  }
662
644
  ],
663
645
  "markets": [
664
- {
665
- "marketId": 0,
666
- "marketAccount": "88zawd3Rw6tknWvgEm8QBgBuf5Y2GTeA18S788qUrSnM",
667
- "marketCorrelation": false,
668
- "pool": "KwhpybQPe9xuZFmAfcjLHj3ukownWex1ratyascAC1X",
669
- "targetCustody": "3j1xiP6GckKCzsTm6sni5iy6zrpZX5BWZGbKCq5buk4d",
670
- "collateralCustody": "9yANuRkTRxb9jjxnG1h3xcUz2kM8fJgDbdYJV4PfZ7dy",
671
- "side": "long",
672
- "maxLev": 100,
673
- "degenMinLev": 1,
674
- "degenMaxLev": 100,
675
- "targetCustodyId": 1,
676
- "collateralCustodyId": 0,
677
- "targetMint": "XAUfcdPHmEBnj78YnZ5YxqdwBmgbwoY5VfrRwETnKuQ",
678
- "collateralMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
679
- },
680
646
  {
681
647
  "marketId": 1,
682
648
  "marketAccount": "G2rj5artQzevbsQtCJ1rkDt3Pd5b6ZYAf8e9AjZPipui",
@@ -820,6 +786,40 @@
820
786
  "collateralCustodyId": 0,
821
787
  "targetMint": "o1Lw5djE8o6wMbPXU7U8Us8a6DJhWJc9WrWWUc1LHAo",
822
788
  "collateralMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
789
+ },
790
+ {
791
+ "marketId": 12,
792
+ "marketAccount": "AKD5nCQRH2NvBbCD9eGhhu7w1auX1cG8x9XAUNrwQMm1",
793
+ "marketCorrelation": true,
794
+ "pool": "KwhpybQPe9xuZFmAfcjLHj3ukownWex1ratyascAC1X",
795
+ "targetCustody": "3j1xiP6GckKCzsTm6sni5iy6zrpZX5BWZGbKCq5buk4d",
796
+ "collateralCustody": "HymsKV4bGdSbf4AyaBqCrK1438jZu6ubCqcws516vRXx",
797
+ "side": "long",
798
+ "maxLev": 100,
799
+ "degenMinLev": 1,
800
+ "degenMaxLev": 100,
801
+ "targetCustodyId": 1,
802
+ "collateralCustodyId": 7,
803
+ "targetMint": "XAUfcdPHmEBnj78YnZ5YxqdwBmgbwoY5VfrRwETnKuQ",
804
+ "collateralMint": "AymATz4TCL9sWNEEV9Kvyz45CHVhDZ6kUgjTJPzLpU9P"
805
+ }
806
+ ],
807
+ "marketsDeprecated": [
808
+ {
809
+ "marketId": 0,
810
+ "marketAccount": "88zawd3Rw6tknWvgEm8QBgBuf5Y2GTeA18S788qUrSnM",
811
+ "marketCorrelation": false,
812
+ "pool": "KwhpybQPe9xuZFmAfcjLHj3ukownWex1ratyascAC1X",
813
+ "targetCustody": "3j1xiP6GckKCzsTm6sni5iy6zrpZX5BWZGbKCq5buk4d",
814
+ "collateralCustody": "9yANuRkTRxb9jjxnG1h3xcUz2kM8fJgDbdYJV4PfZ7dy",
815
+ "side": "long",
816
+ "maxLev": 100,
817
+ "degenMinLev": 1,
818
+ "degenMaxLev": 100,
819
+ "targetCustodyId": 1,
820
+ "collateralCustodyId": 0,
821
+ "targetMint": "XAUfcdPHmEBnj78YnZ5YxqdwBmgbwoY5VfrRwETnKuQ",
822
+ "collateralMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
823
823
  }
824
824
  ]
825
825
  },
@@ -2957,6 +2957,19 @@
2957
2957
  "pythTicker": "Commodities.WTIG6/USD",
2958
2958
  "pythPriceId": "0x7e91242dfd2cea64715b26edaa3e51bafc712a56ac4228a77bd53b51fd66db52",
2959
2959
  "isToken2022": false
2960
+ },
2961
+ {
2962
+ "symbol": "XAUt",
2963
+ "mintKey": "xaut1dB1uihYCwjReVgwZ4mBBJzwkXn4picqqmk4v2H",
2964
+ "decimals": 6,
2965
+ "usdPrecision": 4,
2966
+ "tokenPrecision": 4,
2967
+ "isStable": false,
2968
+ "isVirtual": false,
2969
+ "lazerId": 172,
2970
+ "pythTicker": "Crypto.XAUT/USD",
2971
+ "pythPriceId": "0x44465e17d2e9d390e70c999d5a11fda4f092847fcd2e3e5aa089d96c98a30e67",
2972
+ "isToken2022": false
2960
2973
  }
2961
2974
  ],
2962
2975
  "custodies": [
@@ -3061,25 +3074,26 @@
3061
3074
  "lazerId": 2691,
3062
3075
  "pythTicker": "Commodities.WTIG6/USD",
3063
3076
  "pythPriceId": "0x7e91242dfd2cea64715b26edaa3e51bafc712a56ac4228a77bd53b51fd66db52"
3077
+ },
3078
+ {
3079
+ "custodyId": 7,
3080
+ "custodyAccount": "8sriDinQT789N7AJrEtQ2Q1jvVm7jGHhkdw4zTLKZxGe",
3081
+ "tokenAccount": "DpnfaMR5kJhVyy5SGk6yB1JHXYuqJhsm53wdewd8gNd1",
3082
+ "symbol": "XAUt",
3083
+ "mintKey": "xaut1dB1uihYCwjReVgwZ4mBBJzwkXn4picqqmk4v2H",
3084
+ "decimals": 6,
3085
+ "usdPrecision": 4,
3086
+ "tokenPrecision": 4,
3087
+ "isStable": false,
3088
+ "isVirtual": false,
3089
+ "intOracleAddress": "6fCDXgCYMnY29RENXKE2yGxvtMVUCMU59kkmS212MjMc",
3090
+ "extOracleAddress": "2uPQGpm8X4ZkxMHxrAW1QuhXcse1AHEgPih6Xp9NuEWW",
3091
+ "lazerId": 172,
3092
+ "pythTicker": "Crypto.XAUT/USD",
3093
+ "pythPriceId": "0x44465e17d2e9d390e70c999d5a11fda4f092847fcd2e3e5aa089d96c98a30e67"
3064
3094
  }
3065
3095
  ],
3066
3096
  "markets": [
3067
- {
3068
- "marketId": 0,
3069
- "marketAccount": "6VaKMhU9mtWUVXSj73VMj5RAXfLiE7mRn1myyWEwBC6S",
3070
- "marketCorrelation": false,
3071
- "pool": "Ar7yp9PJkRpvXasLB4NYdbDHnuvAZ1gDA8ALnkPKivbb",
3072
- "targetCustody": "EXumu4qqjXYpv1RUzTGiVJAvjvL3BWzn592SSwxrtZwW",
3073
- "collateralCustody": "4nkiPSMJb4hpLhpaXbebkYF73Ub5vjeked8mWkPafMBm",
3074
- "side": "long",
3075
- "maxLev": 100,
3076
- "degenMinLev": 1,
3077
- "degenMaxLev": 100,
3078
- "targetCustodyId": 1,
3079
- "collateralCustodyId": 0,
3080
- "targetMint": "xaucSYSxjZF4EbsLqAGRvPcuD1uXAj9awmsxYkUAavx",
3081
- "collateralMint": "Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr"
3082
- },
3083
3097
  {
3084
3098
  "marketId": 1,
3085
3099
  "marketAccount": "HH56JHJojhexo4eAE6dCC8XAKKoHiUzEg5fkFRmVGh2S",
@@ -3096,22 +3110,6 @@
3096
3110
  "targetMint": "xaucSYSxjZF4EbsLqAGRvPcuD1uXAj9awmsxYkUAavx",
3097
3111
  "collateralMint": "Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr"
3098
3112
  },
3099
- {
3100
- "marketId": 2,
3101
- "marketAccount": "F2ro3DdrYJB59JS18wekPKU8yKG5YKFejypPkEX7wYzK",
3102
- "marketCorrelation": false,
3103
- "pool": "Ar7yp9PJkRpvXasLB4NYdbDHnuvAZ1gDA8ALnkPKivbb",
3104
- "targetCustody": "H9KvJwG7qB5hcuqdx5Ac3mVFiSdTsms92NLQnGC9eGkx",
3105
- "collateralCustody": "4nkiPSMJb4hpLhpaXbebkYF73Ub5vjeked8mWkPafMBm",
3106
- "side": "long",
3107
- "maxLev": 100,
3108
- "degenMinLev": 1,
3109
- "degenMaxLev": 100,
3110
- "targetCustodyId": 2,
3111
- "collateralCustodyId": 0,
3112
- "targetMint": "xagGMhSCG8WDsf3zFep6sGtvyY1D78roKCHTJtEWg4Z",
3113
- "collateralMint": "Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr"
3114
- },
3115
3113
  {
3116
3114
  "marketId": 3,
3117
3115
  "marketAccount": "GofqHEVEZDEEzLtsGzHszvQAjEuByXR2jK5d7Y94ioQ3",
@@ -3223,6 +3221,38 @@
3223
3221
  "collateralCustodyId": 0,
3224
3222
  "targetMint": "oi1DkCGa5CVm379ZuznLMevqjg7KGWnDDFB96JXAi7a",
3225
3223
  "collateralMint": "Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr"
3224
+ },
3225
+ {
3226
+ "marketId": 12,
3227
+ "marketAccount": "HCHwtnbLgZPPkYqrbXF1oF688dxHW6cbhfU7yFLgfCpY",
3228
+ "marketCorrelation": true,
3229
+ "pool": "Ar7yp9PJkRpvXasLB4NYdbDHnuvAZ1gDA8ALnkPKivbb",
3230
+ "targetCustody": "EXumu4qqjXYpv1RUzTGiVJAvjvL3BWzn592SSwxrtZwW",
3231
+ "collateralCustody": "8sriDinQT789N7AJrEtQ2Q1jvVm7jGHhkdw4zTLKZxGe",
3232
+ "side": "long",
3233
+ "maxLev": 50,
3234
+ "degenMinLev": 1,
3235
+ "degenMaxLev": 50,
3236
+ "targetCustodyId": 1,
3237
+ "collateralCustodyId": 7,
3238
+ "targetMint": "xaucSYSxjZF4EbsLqAGRvPcuD1uXAj9awmsxYkUAavx",
3239
+ "collateralMint": "xaut1dB1uihYCwjReVgwZ4mBBJzwkXn4picqqmk4v2H"
3240
+ },
3241
+ {
3242
+ "marketId": 13,
3243
+ "marketAccount": "6L3TrWrCSVq46N6zyTufVV6hpmMaLQgohkXntkf2fkzc",
3244
+ "marketCorrelation": false,
3245
+ "pool": "Ar7yp9PJkRpvXasLB4NYdbDHnuvAZ1gDA8ALnkPKivbb",
3246
+ "targetCustody": "H9KvJwG7qB5hcuqdx5Ac3mVFiSdTsms92NLQnGC9eGkx",
3247
+ "collateralCustody": "8sriDinQT789N7AJrEtQ2Q1jvVm7jGHhkdw4zTLKZxGe",
3248
+ "side": "long",
3249
+ "maxLev": 50,
3250
+ "degenMinLev": 1,
3251
+ "degenMaxLev": 50,
3252
+ "targetCustodyId": 2,
3253
+ "collateralCustodyId": 7,
3254
+ "targetMint": "xagGMhSCG8WDsf3zFep6sGtvyY1D78roKCHTJtEWg4Z",
3255
+ "collateralMint": "xaut1dB1uihYCwjReVgwZ4mBBJzwkXn4picqqmk4v2H"
3226
3256
  }
3227
3257
  ]
3228
3258
  },