flash-sdk 1.0.134 → 2.0.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.
@@ -3,14 +3,15 @@ import { Program, AnchorProvider, BN } from "@coral-xyz/anchor";
3
3
  import { PublicKey, TransactionInstruction, Commitment, Signer, AddressLookupTableAccount } from "@solana/web3.js";
4
4
  import { PoolAccount } from "./PoolAccount";
5
5
  import { PositionAccount } from "./PositionAccount";
6
- import { AddLiquidityAmountAndFee, AumCalcMode, BorrowRateParams, EntryPriceAndFee, ExitPriceAndFee, Fees, OracleParams, Permissions, PositionSide, PricingParams, RemoveCollateralData, RemoveLiquidityAmountAndFee, Side, TokenRatios, MinAndMaxPrice, FeesAction } from "./types";
6
+ import { AddLiquidityAmountAndFee, AumCalcMode, BorrowRateParams, EntryPriceAndFee, ExitPriceAndFee, Fees, OracleParams, Permissions, PositionSide, PricingParams, RemoveCollateralData, RemoveLiquidityAmountAndFee, Side, TokenRatios, MinAndMaxPrice, FeesAction, ContractOraclePrice, Privilege } from "./types";
7
7
  import { OraclePrice } from "./OraclePrice";
8
8
  import { CustodyAccount } from "./CustodyAccount";
9
9
  import { Perpetuals } from "./idl/perpetuals";
10
10
  import { PerpComposability } from "./idl/perp_composability";
11
11
  import { SendTransactionOpts } from "./utils/rpc";
12
- import { PoolConfig, Token } from "./PoolConfig";
12
+ import { MarketConfig, PoolConfig, Token } from "./PoolConfig";
13
13
  import { max } from "bn.js";
14
+ import { MarketAccount } from "./MarketAccount";
14
15
  export type PerpClientOptions = {
15
16
  postSendTxCallback?: ({ txid }: {
16
17
  txid: string;
@@ -63,7 +64,9 @@ export declare class PerpetualsClient {
63
64
  tokenAccount: PublicKey;
64
65
  decimals: number;
65
66
  isStable: boolean;
67
+ depegAdjustment: boolean;
66
68
  isVirtual: boolean;
69
+ distributeRewards: boolean;
67
70
  oracle: {
68
71
  oracleAccount: PublicKey;
69
72
  customOracleAccount: PublicKey;
@@ -71,15 +74,12 @@ export declare class PerpetualsClient {
71
74
  none?: Record<string, never>;
72
75
  custom?: Record<string, never>;
73
76
  pyth?: Record<string, never>;
74
- backup?: Record<string, never>;
75
77
  };
76
- maxDeviationThreshold: BN;
77
- maxPriceError: BN;
78
- maxPriceAgeSec: number;
78
+ maxDivergenceBps: BN;
79
+ maxConfBps: BN;
80
+ maxPriceAgeSec: BN;
79
81
  };
80
82
  pricing: {
81
- useEma: boolean;
82
- useUnrealizedPnlInAum: boolean;
83
83
  tradeSpreadLong: BN;
84
84
  tradeSpreadShort: BN;
85
85
  swapSpread: BN;
@@ -87,8 +87,7 @@ export declare class PerpetualsClient {
87
87
  maxInitialLeverage: BN;
88
88
  maxLeverage: BN;
89
89
  minCollateralUsd: BN;
90
- minTimeSeconds: BN;
91
- maxPayoffMult: BN;
90
+ delaySeconds: BN;
92
91
  maxUtilization: BN;
93
92
  maxPositionLockedUsd: BN;
94
93
  maxTotalLockedUsd: BN;
@@ -99,7 +98,17 @@ export declare class PerpetualsClient {
99
98
  allowRemoveLiquidity: boolean;
100
99
  allowOpenPosition: boolean;
101
100
  allowClosePosition: boolean;
102
- allowPnlWithdrawal: boolean;
101
+ allowCollateralWithdrawal: boolean;
102
+ allowSizeChange: boolean;
103
+ allowLiquidation: boolean;
104
+ allowFlpStaking: boolean;
105
+ allowFeeDistribution: boolean;
106
+ allowUngatedTrading: boolean;
107
+ allowFeeDiscounts: boolean;
108
+ allowReferralRebates: boolean;
109
+ } | {
110
+ allowOpenPosition: boolean;
111
+ allowClosePosition: boolean;
103
112
  allowCollateralWithdrawal: boolean;
104
113
  allowSizeChange: boolean;
105
114
  };
@@ -108,8 +117,6 @@ export declare class PerpetualsClient {
108
117
  fixed?: Record<string, never>;
109
118
  linear?: Record<string, never>;
110
119
  };
111
- ratioMult: BN;
112
- utilizationMult: BN;
113
120
  swapIn: {
114
121
  minFee: BN;
115
122
  targetFee: BN;
@@ -120,6 +127,16 @@ export declare class PerpetualsClient {
120
127
  targetFee: BN;
121
128
  maxFee: BN;
122
129
  };
130
+ stableSwapIn: {
131
+ minFee: BN;
132
+ targetFee: BN;
133
+ maxFee: BN;
134
+ };
135
+ stableSwapOut: {
136
+ minFee: BN;
137
+ targetFee: BN;
138
+ maxFee: BN;
139
+ };
123
140
  addLiquidity: {
124
141
  minFee: BN;
125
142
  targetFee: BN;
@@ -133,8 +150,6 @@ export declare class PerpetualsClient {
133
150
  openPosition: BN;
134
151
  closePosition: BN;
135
152
  removeCollateral: BN;
136
- liquidation: BN;
137
- protocolShare: BN;
138
153
  };
139
154
  borrowRate: {
140
155
  baseRate: BN;
@@ -142,65 +157,68 @@ export declare class PerpetualsClient {
142
157
  slope2: BN;
143
158
  optimalUtilization: BN;
144
159
  };
160
+ rewardThreshold: BN;
145
161
  assets: {
146
162
  collateral: BN;
147
- protocolFees: BN;
148
163
  owned: BN;
149
164
  locked: BN;
150
165
  };
151
- collectedFees: {
152
- swapUsd: BN;
153
- addLiquidityUsd: BN;
154
- removeLiquidityUsd: BN;
155
- openPositionUsd: BN;
156
- closePositionUsd: BN;
157
- liquidationUsd: BN;
158
- };
159
- volumeStats: {
160
- swapUsd: BN;
161
- addLiquidityUsd: BN;
162
- removeLiquidityUsd: BN;
163
- openPositionUsd: BN;
164
- closePositionUsd: BN;
165
- liquidationUsd: BN;
166
- };
167
- tradeStats: {
168
- profitUsd: BN;
169
- lossUsd: BN;
170
- oiLong: BN;
171
- oiShort: BN;
172
- };
173
- longPositions: {
174
- openPositions: BN;
175
- collateralUsd: BN;
176
- sizeUsd: BN;
177
- borrowSizeUsd: BN;
178
- lockedAmount: BN;
179
- averagePrice: BN;
180
- totalQuantity: BN;
181
- cumulativeInterestUsd: BN;
182
- cumulativeInterestSnapshot: BN;
183
- collateralAmount: BN;
184
- };
185
- shortPositions: {
186
- openPositions: BN;
187
- collateralUsd: BN;
188
- sizeUsd: BN;
189
- borrowSizeUsd: BN;
190
- lockedAmount: BN;
191
- averagePrice: BN;
192
- totalQuantity: BN;
193
- cumulativeInterestUsd: BN;
194
- cumulativeInterestSnapshot: BN;
195
- collateralAmount: BN;
166
+ feesStats: {
167
+ accrued: BN;
168
+ distributed: BN;
169
+ paid: BN;
170
+ rewardPerLpStaked: BN;
171
+ protocolFee: BN;
196
172
  };
197
173
  borrowRateState: {
198
174
  currentRate: BN;
199
- cumulativeInterest: BN;
175
+ cumulativeLockFee: BN;
200
176
  lastUpdate: BN;
201
177
  };
202
178
  bump: number;
203
179
  tokenAccountBump: number;
180
+ owner: PublicKey;
181
+ stakeStats: {
182
+ pendingActivation: BN;
183
+ activeAmount: BN;
184
+ pendingDeactivation: BN;
185
+ deactivatedAmount: BN;
186
+ };
187
+ rewardSnapshot: BN;
188
+ unclaimedRewards: BN;
189
+ feeShareBps: BN;
190
+ isInitialized: boolean;
191
+ targetCustody: PublicKey;
192
+ collateralCustody: PublicKey;
193
+ side: {
194
+ none?: Record<string, never>;
195
+ long?: Record<string, never>;
196
+ short?: Record<string, never>;
197
+ };
198
+ correlation: boolean;
199
+ maxPayoffBps: BN;
200
+ openInterest: BN;
201
+ collectivePosition: {
202
+ openPositions: BN;
203
+ updateTime: BN;
204
+ averageEntryPrice: {
205
+ price: BN;
206
+ exponent: number;
207
+ };
208
+ sizeAmount: BN;
209
+ sizeUsd: BN;
210
+ lockedAmount: BN;
211
+ lockedUsd: BN;
212
+ collateralAmount: BN;
213
+ collateralUsd: BN;
214
+ unsettledFeeUsd: BN;
215
+ cumulativeLockFeeSnapshot: BN;
216
+ sizeDecimals: number;
217
+ lockedDecimals: number;
218
+ collateralDecimals: number;
219
+ };
220
+ targetCustodyId: BN;
221
+ collateralCustodyId: BN;
204
222
  numSigners: number;
205
223
  numSigned: number;
206
224
  minSignatures: number;
@@ -215,38 +233,84 @@ export declare class PerpetualsClient {
215
233
  ema: BN;
216
234
  publishTime: BN;
217
235
  pools: PublicKey[];
236
+ collections: PublicKey[];
237
+ voltageMultiplier: {
238
+ volume: BN;
239
+ rewards: BN;
240
+ rebates: BN;
241
+ };
242
+ tradingDiscount: BN[];
243
+ referralRebate: BN[];
244
+ referralDiscount: BN;
245
+ inceptionTime: BN;
218
246
  transferAuthorityBump: number;
219
247
  perpetualsBump: number;
220
- inceptionTime: BN;
221
248
  name: string;
249
+ flpMint: PublicKey;
250
+ oracleAuthority: PublicKey;
251
+ flpTokenAccount: PublicKey;
252
+ rewardCustody: PublicKey;
222
253
  custodies: PublicKey[];
223
254
  ratios: {
224
255
  target: BN;
225
256
  min: BN;
226
257
  max: BN;
227
258
  }[];
259
+ markets: PublicKey[];
260
+ maxAumUsd: BN;
228
261
  aumUsd: BN;
229
- lpTokenBump: number;
230
- owner: PublicKey;
262
+ totalStaked: {
263
+ pendingActivation: BN;
264
+ activeAmount: BN;
265
+ pendingDeactivation: BN;
266
+ deactivatedAmount: BN;
267
+ };
268
+ stakingFeeShareBps: BN;
269
+ flpMintBump: number;
270
+ flpTokenAccountBump: number;
271
+ market: PublicKey;
231
272
  delegate: PublicKey;
232
- custody: PublicKey;
233
- collateralCustody: PublicKey;
234
273
  openTime: BN;
235
274
  updateTime: BN;
236
- side: {
237
- none?: Record<string, never>;
238
- long?: Record<string, never>;
239
- short?: Record<string, never>;
275
+ entryPrice: {
276
+ price: BN;
277
+ exponent: number;
240
278
  };
279
+ sizeAmount: BN;
241
280
  sizeUsd: BN;
242
- borrowSizeUsd: BN;
243
- collateralUsd: BN;
244
- unsettledAmount: BN;
245
- unrealizedLossUsd: BN;
246
- cumulativeInterestSnapshot: BN;
247
281
  lockedAmount: BN;
282
+ lockedUsd: BN;
248
283
  collateralAmount: BN;
249
- sizeAmount: BN;
284
+ collateralUsd: BN;
285
+ unsettledAmount: BN;
286
+ unsettledFeesUsd: BN;
287
+ cumulativeLockFeeSnapshot: BN;
288
+ takeProfitPrice: {
289
+ price: BN;
290
+ exponent: number;
291
+ };
292
+ stopLossPrice: {
293
+ price: BN;
294
+ exponent: number;
295
+ };
296
+ sizeDecimals: number;
297
+ lockedDecimals: number;
298
+ collateralDecimals: number;
299
+ refererTradingAccount: PublicKey;
300
+ padding: BN[] | BN[];
301
+ nftMint: PublicKey;
302
+ level: number;
303
+ voltagePoints: BN;
304
+ stats: {
305
+ volumeUsd: BN;
306
+ lpRewardsUsd: BN;
307
+ referralRebateUsd: BN;
308
+ };
309
+ snapshot: {
310
+ volumeUsd: BN;
311
+ lpRewardsUsd: BN;
312
+ referralRebateUsd: BN;
313
+ };
250
314
  }>;
251
315
  getPoolKey: (name: string) => PublicKey;
252
316
  getPool: (name: string) => Promise<{
@@ -255,7 +319,9 @@ export declare class PerpetualsClient {
255
319
  tokenAccount: PublicKey;
256
320
  decimals: number;
257
321
  isStable: boolean;
322
+ depegAdjustment: boolean;
258
323
  isVirtual: boolean;
324
+ distributeRewards: boolean;
259
325
  oracle: {
260
326
  oracleAccount: PublicKey;
261
327
  customOracleAccount: PublicKey;
@@ -263,15 +329,12 @@ export declare class PerpetualsClient {
263
329
  none?: Record<string, never>;
264
330
  custom?: Record<string, never>;
265
331
  pyth?: Record<string, never>;
266
- backup?: Record<string, never>;
267
332
  };
268
- maxDeviationThreshold: BN;
269
- maxPriceError: BN;
270
- maxPriceAgeSec: number;
333
+ maxDivergenceBps: BN;
334
+ maxConfBps: BN;
335
+ maxPriceAgeSec: BN;
271
336
  };
272
337
  pricing: {
273
- useEma: boolean;
274
- useUnrealizedPnlInAum: boolean;
275
338
  tradeSpreadLong: BN;
276
339
  tradeSpreadShort: BN;
277
340
  swapSpread: BN;
@@ -279,8 +342,7 @@ export declare class PerpetualsClient {
279
342
  maxInitialLeverage: BN;
280
343
  maxLeverage: BN;
281
344
  minCollateralUsd: BN;
282
- minTimeSeconds: BN;
283
- maxPayoffMult: BN;
345
+ delaySeconds: BN;
284
346
  maxUtilization: BN;
285
347
  maxPositionLockedUsd: BN;
286
348
  maxTotalLockedUsd: BN;
@@ -291,7 +353,17 @@ export declare class PerpetualsClient {
291
353
  allowRemoveLiquidity: boolean;
292
354
  allowOpenPosition: boolean;
293
355
  allowClosePosition: boolean;
294
- allowPnlWithdrawal: boolean;
356
+ allowCollateralWithdrawal: boolean;
357
+ allowSizeChange: boolean;
358
+ allowLiquidation: boolean;
359
+ allowFlpStaking: boolean;
360
+ allowFeeDistribution: boolean;
361
+ allowUngatedTrading: boolean;
362
+ allowFeeDiscounts: boolean;
363
+ allowReferralRebates: boolean;
364
+ } | {
365
+ allowOpenPosition: boolean;
366
+ allowClosePosition: boolean;
295
367
  allowCollateralWithdrawal: boolean;
296
368
  allowSizeChange: boolean;
297
369
  };
@@ -300,8 +372,6 @@ export declare class PerpetualsClient {
300
372
  fixed?: Record<string, never>;
301
373
  linear?: Record<string, never>;
302
374
  };
303
- ratioMult: BN;
304
- utilizationMult: BN;
305
375
  swapIn: {
306
376
  minFee: BN;
307
377
  targetFee: BN;
@@ -312,6 +382,16 @@ export declare class PerpetualsClient {
312
382
  targetFee: BN;
313
383
  maxFee: BN;
314
384
  };
385
+ stableSwapIn: {
386
+ minFee: BN;
387
+ targetFee: BN;
388
+ maxFee: BN;
389
+ };
390
+ stableSwapOut: {
391
+ minFee: BN;
392
+ targetFee: BN;
393
+ maxFee: BN;
394
+ };
315
395
  addLiquidity: {
316
396
  minFee: BN;
317
397
  targetFee: BN;
@@ -325,8 +405,6 @@ export declare class PerpetualsClient {
325
405
  openPosition: BN;
326
406
  closePosition: BN;
327
407
  removeCollateral: BN;
328
- liquidation: BN;
329
- protocolShare: BN;
330
408
  };
331
409
  borrowRate: {
332
410
  baseRate: BN;
@@ -334,65 +412,68 @@ export declare class PerpetualsClient {
334
412
  slope2: BN;
335
413
  optimalUtilization: BN;
336
414
  };
415
+ rewardThreshold: BN;
337
416
  assets: {
338
417
  collateral: BN;
339
- protocolFees: BN;
340
418
  owned: BN;
341
419
  locked: BN;
342
420
  };
343
- collectedFees: {
344
- swapUsd: BN;
345
- addLiquidityUsd: BN;
346
- removeLiquidityUsd: BN;
347
- openPositionUsd: BN;
348
- closePositionUsd: BN;
349
- liquidationUsd: BN;
350
- };
351
- volumeStats: {
352
- swapUsd: BN;
353
- addLiquidityUsd: BN;
354
- removeLiquidityUsd: BN;
355
- openPositionUsd: BN;
356
- closePositionUsd: BN;
357
- liquidationUsd: BN;
358
- };
359
- tradeStats: {
360
- profitUsd: BN;
361
- lossUsd: BN;
362
- oiLong: BN;
363
- oiShort: BN;
364
- };
365
- longPositions: {
366
- openPositions: BN;
367
- collateralUsd: BN;
368
- sizeUsd: BN;
369
- borrowSizeUsd: BN;
370
- lockedAmount: BN;
371
- averagePrice: BN;
372
- totalQuantity: BN;
373
- cumulativeInterestUsd: BN;
374
- cumulativeInterestSnapshot: BN;
375
- collateralAmount: BN;
376
- };
377
- shortPositions: {
378
- openPositions: BN;
379
- collateralUsd: BN;
380
- sizeUsd: BN;
381
- borrowSizeUsd: BN;
382
- lockedAmount: BN;
383
- averagePrice: BN;
384
- totalQuantity: BN;
385
- cumulativeInterestUsd: BN;
386
- cumulativeInterestSnapshot: BN;
387
- collateralAmount: BN;
421
+ feesStats: {
422
+ accrued: BN;
423
+ distributed: BN;
424
+ paid: BN;
425
+ rewardPerLpStaked: BN;
426
+ protocolFee: BN;
388
427
  };
389
428
  borrowRateState: {
390
429
  currentRate: BN;
391
- cumulativeInterest: BN;
430
+ cumulativeLockFee: BN;
392
431
  lastUpdate: BN;
393
432
  };
394
433
  bump: number;
395
434
  tokenAccountBump: number;
435
+ owner: PublicKey;
436
+ stakeStats: {
437
+ pendingActivation: BN;
438
+ activeAmount: BN;
439
+ pendingDeactivation: BN;
440
+ deactivatedAmount: BN;
441
+ };
442
+ rewardSnapshot: BN;
443
+ unclaimedRewards: BN;
444
+ feeShareBps: BN;
445
+ isInitialized: boolean;
446
+ targetCustody: PublicKey;
447
+ collateralCustody: PublicKey;
448
+ side: {
449
+ none?: Record<string, never>;
450
+ long?: Record<string, never>;
451
+ short?: Record<string, never>;
452
+ };
453
+ correlation: boolean;
454
+ maxPayoffBps: BN;
455
+ openInterest: BN;
456
+ collectivePosition: {
457
+ openPositions: BN;
458
+ updateTime: BN;
459
+ averageEntryPrice: {
460
+ price: BN;
461
+ exponent: number;
462
+ };
463
+ sizeAmount: BN;
464
+ sizeUsd: BN;
465
+ lockedAmount: BN;
466
+ lockedUsd: BN;
467
+ collateralAmount: BN;
468
+ collateralUsd: BN;
469
+ unsettledFeeUsd: BN;
470
+ cumulativeLockFeeSnapshot: BN;
471
+ sizeDecimals: number;
472
+ lockedDecimals: number;
473
+ collateralDecimals: number;
474
+ };
475
+ targetCustodyId: BN;
476
+ collateralCustodyId: BN;
396
477
  numSigners: number;
397
478
  numSigned: number;
398
479
  minSignatures: number;
@@ -407,38 +488,84 @@ export declare class PerpetualsClient {
407
488
  ema: BN;
408
489
  publishTime: BN;
409
490
  pools: PublicKey[];
491
+ collections: PublicKey[];
492
+ voltageMultiplier: {
493
+ volume: BN;
494
+ rewards: BN;
495
+ rebates: BN;
496
+ };
497
+ tradingDiscount: BN[];
498
+ referralRebate: BN[];
499
+ referralDiscount: BN;
500
+ inceptionTime: BN;
410
501
  transferAuthorityBump: number;
411
502
  perpetualsBump: number;
412
- inceptionTime: BN;
413
503
  name: string;
504
+ flpMint: PublicKey;
505
+ oracleAuthority: PublicKey;
506
+ flpTokenAccount: PublicKey;
507
+ rewardCustody: PublicKey;
414
508
  custodies: PublicKey[];
415
509
  ratios: {
416
510
  target: BN;
417
511
  min: BN;
418
512
  max: BN;
419
513
  }[];
514
+ markets: PublicKey[];
515
+ maxAumUsd: BN;
420
516
  aumUsd: BN;
421
- lpTokenBump: number;
422
- owner: PublicKey;
517
+ totalStaked: {
518
+ pendingActivation: BN;
519
+ activeAmount: BN;
520
+ pendingDeactivation: BN;
521
+ deactivatedAmount: BN;
522
+ };
523
+ stakingFeeShareBps: BN;
524
+ flpMintBump: number;
525
+ flpTokenAccountBump: number;
526
+ market: PublicKey;
423
527
  delegate: PublicKey;
424
- custody: PublicKey;
425
- collateralCustody: PublicKey;
426
528
  openTime: BN;
427
529
  updateTime: BN;
428
- side: {
429
- none?: Record<string, never>;
430
- long?: Record<string, never>;
431
- short?: Record<string, never>;
530
+ entryPrice: {
531
+ price: BN;
532
+ exponent: number;
432
533
  };
534
+ sizeAmount: BN;
433
535
  sizeUsd: BN;
434
- borrowSizeUsd: BN;
435
- collateralUsd: BN;
436
- unsettledAmount: BN;
437
- unrealizedLossUsd: BN;
438
- cumulativeInterestSnapshot: BN;
439
536
  lockedAmount: BN;
537
+ lockedUsd: BN;
440
538
  collateralAmount: BN;
441
- sizeAmount: BN;
539
+ collateralUsd: BN;
540
+ unsettledAmount: BN;
541
+ unsettledFeesUsd: BN;
542
+ cumulativeLockFeeSnapshot: BN;
543
+ takeProfitPrice: {
544
+ price: BN;
545
+ exponent: number;
546
+ };
547
+ stopLossPrice: {
548
+ price: BN;
549
+ exponent: number;
550
+ };
551
+ sizeDecimals: number;
552
+ lockedDecimals: number;
553
+ collateralDecimals: number;
554
+ refererTradingAccount: PublicKey;
555
+ padding: BN[] | BN[];
556
+ nftMint: PublicKey;
557
+ level: number;
558
+ voltagePoints: BN;
559
+ stats: {
560
+ volumeUsd: BN;
561
+ lpRewardsUsd: BN;
562
+ referralRebateUsd: BN;
563
+ };
564
+ snapshot: {
565
+ volumeUsd: BN;
566
+ lpRewardsUsd: BN;
567
+ referralRebateUsd: BN;
568
+ };
442
569
  }>;
443
570
  getPools: () => Promise<{
444
571
  pool: PublicKey;
@@ -446,7 +573,9 @@ export declare class PerpetualsClient {
446
573
  tokenAccount: PublicKey;
447
574
  decimals: number;
448
575
  isStable: boolean;
576
+ depegAdjustment: boolean;
449
577
  isVirtual: boolean;
578
+ distributeRewards: boolean;
450
579
  oracle: {
451
580
  oracleAccount: PublicKey;
452
581
  customOracleAccount: PublicKey;
@@ -454,15 +583,12 @@ export declare class PerpetualsClient {
454
583
  none?: Record<string, never>;
455
584
  custom?: Record<string, never>;
456
585
  pyth?: Record<string, never>;
457
- backup?: Record<string, never>;
458
586
  };
459
- maxDeviationThreshold: BN;
460
- maxPriceError: BN;
461
- maxPriceAgeSec: number;
587
+ maxDivergenceBps: BN;
588
+ maxConfBps: BN;
589
+ maxPriceAgeSec: BN;
462
590
  };
463
591
  pricing: {
464
- useEma: boolean;
465
- useUnrealizedPnlInAum: boolean;
466
592
  tradeSpreadLong: BN;
467
593
  tradeSpreadShort: BN;
468
594
  swapSpread: BN;
@@ -470,8 +596,7 @@ export declare class PerpetualsClient {
470
596
  maxInitialLeverage: BN;
471
597
  maxLeverage: BN;
472
598
  minCollateralUsd: BN;
473
- minTimeSeconds: BN;
474
- maxPayoffMult: BN;
599
+ delaySeconds: BN;
475
600
  maxUtilization: BN;
476
601
  maxPositionLockedUsd: BN;
477
602
  maxTotalLockedUsd: BN;
@@ -482,7 +607,17 @@ export declare class PerpetualsClient {
482
607
  allowRemoveLiquidity: boolean;
483
608
  allowOpenPosition: boolean;
484
609
  allowClosePosition: boolean;
485
- allowPnlWithdrawal: boolean;
610
+ allowCollateralWithdrawal: boolean;
611
+ allowSizeChange: boolean;
612
+ allowLiquidation: boolean;
613
+ allowFlpStaking: boolean;
614
+ allowFeeDistribution: boolean;
615
+ allowUngatedTrading: boolean;
616
+ allowFeeDiscounts: boolean;
617
+ allowReferralRebates: boolean;
618
+ } | {
619
+ allowOpenPosition: boolean;
620
+ allowClosePosition: boolean;
486
621
  allowCollateralWithdrawal: boolean;
487
622
  allowSizeChange: boolean;
488
623
  };
@@ -491,8 +626,6 @@ export declare class PerpetualsClient {
491
626
  fixed?: Record<string, never>;
492
627
  linear?: Record<string, never>;
493
628
  };
494
- ratioMult: BN;
495
- utilizationMult: BN;
496
629
  swapIn: {
497
630
  minFee: BN;
498
631
  targetFee: BN;
@@ -503,6 +636,16 @@ export declare class PerpetualsClient {
503
636
  targetFee: BN;
504
637
  maxFee: BN;
505
638
  };
639
+ stableSwapIn: {
640
+ minFee: BN;
641
+ targetFee: BN;
642
+ maxFee: BN;
643
+ };
644
+ stableSwapOut: {
645
+ minFee: BN;
646
+ targetFee: BN;
647
+ maxFee: BN;
648
+ };
506
649
  addLiquidity: {
507
650
  minFee: BN;
508
651
  targetFee: BN;
@@ -516,8 +659,6 @@ export declare class PerpetualsClient {
516
659
  openPosition: BN;
517
660
  closePosition: BN;
518
661
  removeCollateral: BN;
519
- liquidation: BN;
520
- protocolShare: BN;
521
662
  };
522
663
  borrowRate: {
523
664
  baseRate: BN;
@@ -525,65 +666,68 @@ export declare class PerpetualsClient {
525
666
  slope2: BN;
526
667
  optimalUtilization: BN;
527
668
  };
669
+ rewardThreshold: BN;
528
670
  assets: {
529
671
  collateral: BN;
530
- protocolFees: BN;
531
672
  owned: BN;
532
673
  locked: BN;
533
674
  };
534
- collectedFees: {
535
- swapUsd: BN;
536
- addLiquidityUsd: BN;
537
- removeLiquidityUsd: BN;
538
- openPositionUsd: BN;
539
- closePositionUsd: BN;
540
- liquidationUsd: BN;
541
- };
542
- volumeStats: {
543
- swapUsd: BN;
544
- addLiquidityUsd: BN;
545
- removeLiquidityUsd: BN;
546
- openPositionUsd: BN;
547
- closePositionUsd: BN;
548
- liquidationUsd: BN;
549
- };
550
- tradeStats: {
551
- profitUsd: BN;
552
- lossUsd: BN;
553
- oiLong: BN;
554
- oiShort: BN;
555
- };
556
- longPositions: {
557
- openPositions: BN;
558
- collateralUsd: BN;
559
- sizeUsd: BN;
560
- borrowSizeUsd: BN;
561
- lockedAmount: BN;
562
- averagePrice: BN;
563
- totalQuantity: BN;
564
- cumulativeInterestUsd: BN;
565
- cumulativeInterestSnapshot: BN;
566
- collateralAmount: BN;
567
- };
568
- shortPositions: {
569
- openPositions: BN;
570
- collateralUsd: BN;
571
- sizeUsd: BN;
572
- borrowSizeUsd: BN;
573
- lockedAmount: BN;
574
- averagePrice: BN;
575
- totalQuantity: BN;
576
- cumulativeInterestUsd: BN;
577
- cumulativeInterestSnapshot: BN;
578
- collateralAmount: BN;
675
+ feesStats: {
676
+ accrued: BN;
677
+ distributed: BN;
678
+ paid: BN;
679
+ rewardPerLpStaked: BN;
680
+ protocolFee: BN;
579
681
  };
580
682
  borrowRateState: {
581
683
  currentRate: BN;
582
- cumulativeInterest: BN;
684
+ cumulativeLockFee: BN;
583
685
  lastUpdate: BN;
584
686
  };
585
687
  bump: number;
586
688
  tokenAccountBump: number;
689
+ owner: PublicKey;
690
+ stakeStats: {
691
+ pendingActivation: BN;
692
+ activeAmount: BN;
693
+ pendingDeactivation: BN;
694
+ deactivatedAmount: BN;
695
+ };
696
+ rewardSnapshot: BN;
697
+ unclaimedRewards: BN;
698
+ feeShareBps: BN;
699
+ isInitialized: boolean;
700
+ targetCustody: PublicKey;
701
+ collateralCustody: PublicKey;
702
+ side: {
703
+ none?: Record<string, never>;
704
+ long?: Record<string, never>;
705
+ short?: Record<string, never>;
706
+ };
707
+ correlation: boolean;
708
+ maxPayoffBps: BN;
709
+ openInterest: BN;
710
+ collectivePosition: {
711
+ openPositions: BN;
712
+ updateTime: BN;
713
+ averageEntryPrice: {
714
+ price: BN;
715
+ exponent: number;
716
+ };
717
+ sizeAmount: BN;
718
+ sizeUsd: BN;
719
+ lockedAmount: BN;
720
+ lockedUsd: BN;
721
+ collateralAmount: BN;
722
+ collateralUsd: BN;
723
+ unsettledFeeUsd: BN;
724
+ cumulativeLockFeeSnapshot: BN;
725
+ sizeDecimals: number;
726
+ lockedDecimals: number;
727
+ collateralDecimals: number;
728
+ };
729
+ targetCustodyId: BN;
730
+ collateralCustodyId: BN;
587
731
  numSigners: number;
588
732
  numSigned: number;
589
733
  minSignatures: number;
@@ -598,38 +742,84 @@ export declare class PerpetualsClient {
598
742
  ema: BN;
599
743
  publishTime: BN;
600
744
  pools: PublicKey[];
745
+ collections: PublicKey[];
746
+ voltageMultiplier: {
747
+ volume: BN;
748
+ rewards: BN;
749
+ rebates: BN;
750
+ };
751
+ tradingDiscount: BN[];
752
+ referralRebate: BN[];
753
+ referralDiscount: BN;
754
+ inceptionTime: BN;
601
755
  transferAuthorityBump: number;
602
756
  perpetualsBump: number;
603
- inceptionTime: BN;
604
757
  name: string;
758
+ flpMint: PublicKey;
759
+ oracleAuthority: PublicKey;
760
+ flpTokenAccount: PublicKey;
761
+ rewardCustody: PublicKey;
605
762
  custodies: PublicKey[];
606
763
  ratios: {
607
764
  target: BN;
608
765
  min: BN;
609
766
  max: BN;
610
767
  }[];
768
+ markets: PublicKey[];
769
+ maxAumUsd: BN;
611
770
  aumUsd: BN;
612
- lpTokenBump: number;
613
- owner: PublicKey;
771
+ totalStaked: {
772
+ pendingActivation: BN;
773
+ activeAmount: BN;
774
+ pendingDeactivation: BN;
775
+ deactivatedAmount: BN;
776
+ };
777
+ stakingFeeShareBps: BN;
778
+ flpMintBump: number;
779
+ flpTokenAccountBump: number;
780
+ market: PublicKey;
614
781
  delegate: PublicKey;
615
- custody: PublicKey;
616
- collateralCustody: PublicKey;
617
782
  openTime: BN;
618
783
  updateTime: BN;
619
- side: {
620
- none?: Record<string, never>;
621
- long?: Record<string, never>;
622
- short?: Record<string, never>;
784
+ entryPrice: {
785
+ price: BN;
786
+ exponent: number;
623
787
  };
788
+ sizeAmount: BN;
624
789
  sizeUsd: BN;
625
- borrowSizeUsd: BN;
626
- collateralUsd: BN;
627
- unsettledAmount: BN;
628
- unrealizedLossUsd: BN;
629
- cumulativeInterestSnapshot: BN;
630
790
  lockedAmount: BN;
791
+ lockedUsd: BN;
631
792
  collateralAmount: BN;
632
- sizeAmount: BN;
793
+ collateralUsd: BN;
794
+ unsettledAmount: BN;
795
+ unsettledFeesUsd: BN;
796
+ cumulativeLockFeeSnapshot: BN;
797
+ takeProfitPrice: {
798
+ price: BN;
799
+ exponent: number;
800
+ };
801
+ stopLossPrice: {
802
+ price: BN;
803
+ exponent: number;
804
+ };
805
+ sizeDecimals: number;
806
+ lockedDecimals: number;
807
+ collateralDecimals: number;
808
+ refererTradingAccount: PublicKey;
809
+ padding: BN[] | BN[];
810
+ nftMint: PublicKey;
811
+ level: number;
812
+ voltagePoints: BN;
813
+ stats: {
814
+ volumeUsd: BN;
815
+ lpRewardsUsd: BN;
816
+ referralRebateUsd: BN;
817
+ };
818
+ snapshot: {
819
+ volumeUsd: BN;
820
+ lpRewardsUsd: BN;
821
+ referralRebateUsd: BN;
822
+ };
633
823
  }[]>;
634
824
  getPoolLpTokenKey: (name: string) => PublicKey;
635
825
  getCustodyKey: (poolName: string, tokenMint: PublicKey) => PublicKey;
@@ -642,7 +832,9 @@ export declare class PerpetualsClient {
642
832
  tokenAccount: PublicKey;
643
833
  decimals: number;
644
834
  isStable: boolean;
835
+ depegAdjustment: boolean;
645
836
  isVirtual: boolean;
837
+ distributeRewards: boolean;
646
838
  oracle: {
647
839
  oracleAccount: PublicKey;
648
840
  customOracleAccount: PublicKey;
@@ -650,15 +842,12 @@ export declare class PerpetualsClient {
650
842
  none?: Record<string, never>;
651
843
  custom?: Record<string, never>;
652
844
  pyth?: Record<string, never>;
653
- backup?: Record<string, never>;
654
845
  };
655
- maxDeviationThreshold: BN;
656
- maxPriceError: BN;
657
- maxPriceAgeSec: number;
846
+ maxDivergenceBps: BN;
847
+ maxConfBps: BN;
848
+ maxPriceAgeSec: BN;
658
849
  };
659
850
  pricing: {
660
- useEma: boolean;
661
- useUnrealizedPnlInAum: boolean;
662
851
  tradeSpreadLong: BN;
663
852
  tradeSpreadShort: BN;
664
853
  swapSpread: BN;
@@ -666,8 +855,7 @@ export declare class PerpetualsClient {
666
855
  maxInitialLeverage: BN;
667
856
  maxLeverage: BN;
668
857
  minCollateralUsd: BN;
669
- minTimeSeconds: BN;
670
- maxPayoffMult: BN;
858
+ delaySeconds: BN;
671
859
  maxUtilization: BN;
672
860
  maxPositionLockedUsd: BN;
673
861
  maxTotalLockedUsd: BN;
@@ -678,7 +866,17 @@ export declare class PerpetualsClient {
678
866
  allowRemoveLiquidity: boolean;
679
867
  allowOpenPosition: boolean;
680
868
  allowClosePosition: boolean;
681
- allowPnlWithdrawal: boolean;
869
+ allowCollateralWithdrawal: boolean;
870
+ allowSizeChange: boolean;
871
+ allowLiquidation: boolean;
872
+ allowFlpStaking: boolean;
873
+ allowFeeDistribution: boolean;
874
+ allowUngatedTrading: boolean;
875
+ allowFeeDiscounts: boolean;
876
+ allowReferralRebates: boolean;
877
+ } | {
878
+ allowOpenPosition: boolean;
879
+ allowClosePosition: boolean;
682
880
  allowCollateralWithdrawal: boolean;
683
881
  allowSizeChange: boolean;
684
882
  };
@@ -687,8 +885,6 @@ export declare class PerpetualsClient {
687
885
  fixed?: Record<string, never>;
688
886
  linear?: Record<string, never>;
689
887
  };
690
- ratioMult: BN;
691
- utilizationMult: BN;
692
888
  swapIn: {
693
889
  minFee: BN;
694
890
  targetFee: BN;
@@ -699,6 +895,16 @@ export declare class PerpetualsClient {
699
895
  targetFee: BN;
700
896
  maxFee: BN;
701
897
  };
898
+ stableSwapIn: {
899
+ minFee: BN;
900
+ targetFee: BN;
901
+ maxFee: BN;
902
+ };
903
+ stableSwapOut: {
904
+ minFee: BN;
905
+ targetFee: BN;
906
+ maxFee: BN;
907
+ };
702
908
  addLiquidity: {
703
909
  minFee: BN;
704
910
  targetFee: BN;
@@ -712,8 +918,6 @@ export declare class PerpetualsClient {
712
918
  openPosition: BN;
713
919
  closePosition: BN;
714
920
  removeCollateral: BN;
715
- liquidation: BN;
716
- protocolShare: BN;
717
921
  };
718
922
  borrowRate: {
719
923
  baseRate: BN;
@@ -721,65 +925,68 @@ export declare class PerpetualsClient {
721
925
  slope2: BN;
722
926
  optimalUtilization: BN;
723
927
  };
928
+ rewardThreshold: BN;
724
929
  assets: {
725
930
  collateral: BN;
726
- protocolFees: BN;
727
931
  owned: BN;
728
932
  locked: BN;
729
933
  };
730
- collectedFees: {
731
- swapUsd: BN;
732
- addLiquidityUsd: BN;
733
- removeLiquidityUsd: BN;
734
- openPositionUsd: BN;
735
- closePositionUsd: BN;
736
- liquidationUsd: BN;
737
- };
738
- volumeStats: {
739
- swapUsd: BN;
740
- addLiquidityUsd: BN;
741
- removeLiquidityUsd: BN;
742
- openPositionUsd: BN;
743
- closePositionUsd: BN;
744
- liquidationUsd: BN;
745
- };
746
- tradeStats: {
747
- profitUsd: BN;
748
- lossUsd: BN;
749
- oiLong: BN;
750
- oiShort: BN;
751
- };
752
- longPositions: {
753
- openPositions: BN;
754
- collateralUsd: BN;
755
- sizeUsd: BN;
756
- borrowSizeUsd: BN;
757
- lockedAmount: BN;
758
- averagePrice: BN;
759
- totalQuantity: BN;
760
- cumulativeInterestUsd: BN;
761
- cumulativeInterestSnapshot: BN;
762
- collateralAmount: BN;
763
- };
764
- shortPositions: {
765
- openPositions: BN;
766
- collateralUsd: BN;
767
- sizeUsd: BN;
768
- borrowSizeUsd: BN;
769
- lockedAmount: BN;
770
- averagePrice: BN;
771
- totalQuantity: BN;
772
- cumulativeInterestUsd: BN;
773
- cumulativeInterestSnapshot: BN;
774
- collateralAmount: BN;
934
+ feesStats: {
935
+ accrued: BN;
936
+ distributed: BN;
937
+ paid: BN;
938
+ rewardPerLpStaked: BN;
939
+ protocolFee: BN;
775
940
  };
776
941
  borrowRateState: {
777
942
  currentRate: BN;
778
- cumulativeInterest: BN;
943
+ cumulativeLockFee: BN;
779
944
  lastUpdate: BN;
780
945
  };
781
946
  bump: number;
782
947
  tokenAccountBump: number;
948
+ owner: PublicKey;
949
+ stakeStats: {
950
+ pendingActivation: BN;
951
+ activeAmount: BN;
952
+ pendingDeactivation: BN;
953
+ deactivatedAmount: BN;
954
+ };
955
+ rewardSnapshot: BN;
956
+ unclaimedRewards: BN;
957
+ feeShareBps: BN;
958
+ isInitialized: boolean;
959
+ targetCustody: PublicKey;
960
+ collateralCustody: PublicKey;
961
+ side: {
962
+ none?: Record<string, never>;
963
+ long?: Record<string, never>;
964
+ short?: Record<string, never>;
965
+ };
966
+ correlation: boolean;
967
+ maxPayoffBps: BN;
968
+ openInterest: BN;
969
+ collectivePosition: {
970
+ openPositions: BN;
971
+ updateTime: BN;
972
+ averageEntryPrice: {
973
+ price: BN;
974
+ exponent: number;
975
+ };
976
+ sizeAmount: BN;
977
+ sizeUsd: BN;
978
+ lockedAmount: BN;
979
+ lockedUsd: BN;
980
+ collateralAmount: BN;
981
+ collateralUsd: BN;
982
+ unsettledFeeUsd: BN;
983
+ cumulativeLockFeeSnapshot: BN;
984
+ sizeDecimals: number;
985
+ lockedDecimals: number;
986
+ collateralDecimals: number;
987
+ };
988
+ targetCustodyId: BN;
989
+ collateralCustodyId: BN;
783
990
  numSigners: number;
784
991
  numSigned: number;
785
992
  minSignatures: number;
@@ -794,38 +1001,84 @@ export declare class PerpetualsClient {
794
1001
  ema: BN;
795
1002
  publishTime: BN;
796
1003
  pools: PublicKey[];
1004
+ collections: PublicKey[];
1005
+ voltageMultiplier: {
1006
+ volume: BN;
1007
+ rewards: BN;
1008
+ rebates: BN;
1009
+ };
1010
+ tradingDiscount: BN[];
1011
+ referralRebate: BN[];
1012
+ referralDiscount: BN;
1013
+ inceptionTime: BN;
797
1014
  transferAuthorityBump: number;
798
1015
  perpetualsBump: number;
799
- inceptionTime: BN;
800
1016
  name: string;
1017
+ flpMint: PublicKey;
1018
+ oracleAuthority: PublicKey;
1019
+ flpTokenAccount: PublicKey;
1020
+ rewardCustody: PublicKey;
801
1021
  custodies: PublicKey[];
802
1022
  ratios: {
803
1023
  target: BN;
804
1024
  min: BN;
805
1025
  max: BN;
806
1026
  }[];
1027
+ markets: PublicKey[];
1028
+ maxAumUsd: BN;
807
1029
  aumUsd: BN;
808
- lpTokenBump: number;
809
- owner: PublicKey;
1030
+ totalStaked: {
1031
+ pendingActivation: BN;
1032
+ activeAmount: BN;
1033
+ pendingDeactivation: BN;
1034
+ deactivatedAmount: BN;
1035
+ };
1036
+ stakingFeeShareBps: BN;
1037
+ flpMintBump: number;
1038
+ flpTokenAccountBump: number;
1039
+ market: PublicKey;
810
1040
  delegate: PublicKey;
811
- custody: PublicKey;
812
- collateralCustody: PublicKey;
813
1041
  openTime: BN;
814
1042
  updateTime: BN;
815
- side: {
816
- none?: Record<string, never>;
817
- long?: Record<string, never>;
818
- short?: Record<string, never>;
1043
+ entryPrice: {
1044
+ price: BN;
1045
+ exponent: number;
819
1046
  };
1047
+ sizeAmount: BN;
820
1048
  sizeUsd: BN;
821
- borrowSizeUsd: BN;
822
- collateralUsd: BN;
823
- unsettledAmount: BN;
824
- unrealizedLossUsd: BN;
825
- cumulativeInterestSnapshot: BN;
826
1049
  lockedAmount: BN;
1050
+ lockedUsd: BN;
827
1051
  collateralAmount: BN;
828
- sizeAmount: BN;
1052
+ collateralUsd: BN;
1053
+ unsettledAmount: BN;
1054
+ unsettledFeesUsd: BN;
1055
+ cumulativeLockFeeSnapshot: BN;
1056
+ takeProfitPrice: {
1057
+ price: BN;
1058
+ exponent: number;
1059
+ };
1060
+ stopLossPrice: {
1061
+ price: BN;
1062
+ exponent: number;
1063
+ };
1064
+ sizeDecimals: number;
1065
+ lockedDecimals: number;
1066
+ collateralDecimals: number;
1067
+ refererTradingAccount: PublicKey;
1068
+ padding: BN[] | BN[];
1069
+ nftMint: PublicKey;
1070
+ level: number;
1071
+ voltagePoints: BN;
1072
+ stats: {
1073
+ volumeUsd: BN;
1074
+ lpRewardsUsd: BN;
1075
+ referralRebateUsd: BN;
1076
+ };
1077
+ snapshot: {
1078
+ volumeUsd: BN;
1079
+ lpRewardsUsd: BN;
1080
+ referralRebateUsd: BN;
1081
+ };
829
1082
  }>;
830
1083
  getCustodies: (poolName: string) => Promise<{
831
1084
  pool: PublicKey;
@@ -833,7 +1086,9 @@ export declare class PerpetualsClient {
833
1086
  tokenAccount: PublicKey;
834
1087
  decimals: number;
835
1088
  isStable: boolean;
1089
+ depegAdjustment: boolean;
836
1090
  isVirtual: boolean;
1091
+ distributeRewards: boolean;
837
1092
  oracle: {
838
1093
  oracleAccount: PublicKey;
839
1094
  customOracleAccount: PublicKey;
@@ -841,15 +1096,12 @@ export declare class PerpetualsClient {
841
1096
  none?: Record<string, never>;
842
1097
  custom?: Record<string, never>;
843
1098
  pyth?: Record<string, never>;
844
- backup?: Record<string, never>;
845
1099
  };
846
- maxDeviationThreshold: BN;
847
- maxPriceError: BN;
848
- maxPriceAgeSec: number;
1100
+ maxDivergenceBps: BN;
1101
+ maxConfBps: BN;
1102
+ maxPriceAgeSec: BN;
849
1103
  };
850
1104
  pricing: {
851
- useEma: boolean;
852
- useUnrealizedPnlInAum: boolean;
853
1105
  tradeSpreadLong: BN;
854
1106
  tradeSpreadShort: BN;
855
1107
  swapSpread: BN;
@@ -857,8 +1109,7 @@ export declare class PerpetualsClient {
857
1109
  maxInitialLeverage: BN;
858
1110
  maxLeverage: BN;
859
1111
  minCollateralUsd: BN;
860
- minTimeSeconds: BN;
861
- maxPayoffMult: BN;
1112
+ delaySeconds: BN;
862
1113
  maxUtilization: BN;
863
1114
  maxPositionLockedUsd: BN;
864
1115
  maxTotalLockedUsd: BN;
@@ -869,7 +1120,17 @@ export declare class PerpetualsClient {
869
1120
  allowRemoveLiquidity: boolean;
870
1121
  allowOpenPosition: boolean;
871
1122
  allowClosePosition: boolean;
872
- allowPnlWithdrawal: boolean;
1123
+ allowCollateralWithdrawal: boolean;
1124
+ allowSizeChange: boolean;
1125
+ allowLiquidation: boolean;
1126
+ allowFlpStaking: boolean;
1127
+ allowFeeDistribution: boolean;
1128
+ allowUngatedTrading: boolean;
1129
+ allowFeeDiscounts: boolean;
1130
+ allowReferralRebates: boolean;
1131
+ } | {
1132
+ allowOpenPosition: boolean;
1133
+ allowClosePosition: boolean;
873
1134
  allowCollateralWithdrawal: boolean;
874
1135
  allowSizeChange: boolean;
875
1136
  };
@@ -878,8 +1139,6 @@ export declare class PerpetualsClient {
878
1139
  fixed?: Record<string, never>;
879
1140
  linear?: Record<string, never>;
880
1141
  };
881
- ratioMult: BN;
882
- utilizationMult: BN;
883
1142
  swapIn: {
884
1143
  minFee: BN;
885
1144
  targetFee: BN;
@@ -890,6 +1149,16 @@ export declare class PerpetualsClient {
890
1149
  targetFee: BN;
891
1150
  maxFee: BN;
892
1151
  };
1152
+ stableSwapIn: {
1153
+ minFee: BN;
1154
+ targetFee: BN;
1155
+ maxFee: BN;
1156
+ };
1157
+ stableSwapOut: {
1158
+ minFee: BN;
1159
+ targetFee: BN;
1160
+ maxFee: BN;
1161
+ };
893
1162
  addLiquidity: {
894
1163
  minFee: BN;
895
1164
  targetFee: BN;
@@ -903,8 +1172,6 @@ export declare class PerpetualsClient {
903
1172
  openPosition: BN;
904
1173
  closePosition: BN;
905
1174
  removeCollateral: BN;
906
- liquidation: BN;
907
- protocolShare: BN;
908
1175
  };
909
1176
  borrowRate: {
910
1177
  baseRate: BN;
@@ -912,65 +1179,68 @@ export declare class PerpetualsClient {
912
1179
  slope2: BN;
913
1180
  optimalUtilization: BN;
914
1181
  };
1182
+ rewardThreshold: BN;
915
1183
  assets: {
916
1184
  collateral: BN;
917
- protocolFees: BN;
918
1185
  owned: BN;
919
1186
  locked: BN;
920
1187
  };
921
- collectedFees: {
922
- swapUsd: BN;
923
- addLiquidityUsd: BN;
924
- removeLiquidityUsd: BN;
925
- openPositionUsd: BN;
926
- closePositionUsd: BN;
927
- liquidationUsd: BN;
928
- };
929
- volumeStats: {
930
- swapUsd: BN;
931
- addLiquidityUsd: BN;
932
- removeLiquidityUsd: BN;
933
- openPositionUsd: BN;
934
- closePositionUsd: BN;
935
- liquidationUsd: BN;
936
- };
937
- tradeStats: {
938
- profitUsd: BN;
939
- lossUsd: BN;
940
- oiLong: BN;
941
- oiShort: BN;
942
- };
943
- longPositions: {
944
- openPositions: BN;
945
- collateralUsd: BN;
946
- sizeUsd: BN;
947
- borrowSizeUsd: BN;
948
- lockedAmount: BN;
949
- averagePrice: BN;
950
- totalQuantity: BN;
951
- cumulativeInterestUsd: BN;
952
- cumulativeInterestSnapshot: BN;
953
- collateralAmount: BN;
954
- };
955
- shortPositions: {
956
- openPositions: BN;
957
- collateralUsd: BN;
958
- sizeUsd: BN;
959
- borrowSizeUsd: BN;
960
- lockedAmount: BN;
961
- averagePrice: BN;
962
- totalQuantity: BN;
963
- cumulativeInterestUsd: BN;
964
- cumulativeInterestSnapshot: BN;
965
- collateralAmount: BN;
1188
+ feesStats: {
1189
+ accrued: BN;
1190
+ distributed: BN;
1191
+ paid: BN;
1192
+ rewardPerLpStaked: BN;
1193
+ protocolFee: BN;
966
1194
  };
967
1195
  borrowRateState: {
968
1196
  currentRate: BN;
969
- cumulativeInterest: BN;
1197
+ cumulativeLockFee: BN;
970
1198
  lastUpdate: BN;
971
1199
  };
972
1200
  bump: number;
973
1201
  tokenAccountBump: number;
1202
+ owner: PublicKey;
1203
+ stakeStats: {
1204
+ pendingActivation: BN;
1205
+ activeAmount: BN;
1206
+ pendingDeactivation: BN;
1207
+ deactivatedAmount: BN;
1208
+ };
1209
+ rewardSnapshot: BN;
1210
+ unclaimedRewards: BN;
1211
+ feeShareBps: BN;
1212
+ isInitialized: boolean;
1213
+ targetCustody: PublicKey;
1214
+ collateralCustody: PublicKey;
1215
+ side: {
1216
+ none?: Record<string, never>;
1217
+ long?: Record<string, never>;
1218
+ short?: Record<string, never>;
1219
+ };
1220
+ correlation: boolean;
1221
+ maxPayoffBps: BN;
1222
+ openInterest: BN;
1223
+ collectivePosition: {
1224
+ openPositions: BN;
1225
+ updateTime: BN;
1226
+ averageEntryPrice: {
1227
+ price: BN;
1228
+ exponent: number;
1229
+ };
1230
+ sizeAmount: BN;
1231
+ sizeUsd: BN;
1232
+ lockedAmount: BN;
1233
+ lockedUsd: BN;
1234
+ collateralAmount: BN;
1235
+ collateralUsd: BN;
1236
+ unsettledFeeUsd: BN;
1237
+ cumulativeLockFeeSnapshot: BN;
1238
+ sizeDecimals: number;
1239
+ lockedDecimals: number;
1240
+ collateralDecimals: number;
1241
+ };
1242
+ targetCustodyId: BN;
1243
+ collateralCustodyId: BN;
974
1244
  numSigners: number;
975
1245
  numSigned: number;
976
1246
  minSignatures: number;
@@ -985,38 +1255,84 @@ export declare class PerpetualsClient {
985
1255
  ema: BN;
986
1256
  publishTime: BN;
987
1257
  pools: PublicKey[];
1258
+ collections: PublicKey[];
1259
+ voltageMultiplier: {
1260
+ volume: BN;
1261
+ rewards: BN;
1262
+ rebates: BN;
1263
+ };
1264
+ tradingDiscount: BN[];
1265
+ referralRebate: BN[];
1266
+ referralDiscount: BN;
1267
+ inceptionTime: BN;
988
1268
  transferAuthorityBump: number;
989
1269
  perpetualsBump: number;
990
- inceptionTime: BN;
991
1270
  name: string;
1271
+ flpMint: PublicKey;
1272
+ oracleAuthority: PublicKey;
1273
+ flpTokenAccount: PublicKey;
1274
+ rewardCustody: PublicKey;
992
1275
  custodies: PublicKey[];
993
1276
  ratios: {
994
1277
  target: BN;
995
1278
  min: BN;
996
1279
  max: BN;
997
1280
  }[];
1281
+ markets: PublicKey[];
1282
+ maxAumUsd: BN;
998
1283
  aumUsd: BN;
999
- lpTokenBump: number;
1000
- owner: PublicKey;
1284
+ totalStaked: {
1285
+ pendingActivation: BN;
1286
+ activeAmount: BN;
1287
+ pendingDeactivation: BN;
1288
+ deactivatedAmount: BN;
1289
+ };
1290
+ stakingFeeShareBps: BN;
1291
+ flpMintBump: number;
1292
+ flpTokenAccountBump: number;
1293
+ market: PublicKey;
1001
1294
  delegate: PublicKey;
1002
- custody: PublicKey;
1003
- collateralCustody: PublicKey;
1004
1295
  openTime: BN;
1005
1296
  updateTime: BN;
1006
- side: {
1007
- none?: Record<string, never>;
1008
- long?: Record<string, never>;
1009
- short?: Record<string, never>;
1297
+ entryPrice: {
1298
+ price: BN;
1299
+ exponent: number;
1010
1300
  };
1301
+ sizeAmount: BN;
1011
1302
  sizeUsd: BN;
1012
- borrowSizeUsd: BN;
1013
- collateralUsd: BN;
1014
- unsettledAmount: BN;
1015
- unrealizedLossUsd: BN;
1016
- cumulativeInterestSnapshot: BN;
1017
1303
  lockedAmount: BN;
1304
+ lockedUsd: BN;
1018
1305
  collateralAmount: BN;
1019
- sizeAmount: BN;
1306
+ collateralUsd: BN;
1307
+ unsettledAmount: BN;
1308
+ unsettledFeesUsd: BN;
1309
+ cumulativeLockFeeSnapshot: BN;
1310
+ takeProfitPrice: {
1311
+ price: BN;
1312
+ exponent: number;
1313
+ };
1314
+ stopLossPrice: {
1315
+ price: BN;
1316
+ exponent: number;
1317
+ };
1318
+ sizeDecimals: number;
1319
+ lockedDecimals: number;
1320
+ collateralDecimals: number;
1321
+ refererTradingAccount: PublicKey;
1322
+ padding: BN[] | BN[];
1323
+ nftMint: PublicKey;
1324
+ level: number;
1325
+ voltagePoints: BN;
1326
+ stats: {
1327
+ volumeUsd: BN;
1328
+ lpRewardsUsd: BN;
1329
+ referralRebateUsd: BN;
1330
+ };
1331
+ snapshot: {
1332
+ volumeUsd: BN;
1333
+ lpRewardsUsd: BN;
1334
+ referralRebateUsd: BN;
1335
+ };
1020
1336
  }[]>;
1021
1337
  getCustodyMetas: (poolName: string) => Promise<any[]>;
1022
1338
  getMultisig: () => Promise<{
@@ -1025,7 +1341,9 @@ export declare class PerpetualsClient {
1025
1341
  tokenAccount: PublicKey;
1026
1342
  decimals: number;
1027
1343
  isStable: boolean;
1344
+ depegAdjustment: boolean;
1028
1345
  isVirtual: boolean;
1346
+ distributeRewards: boolean;
1029
1347
  oracle: {
1030
1348
  oracleAccount: PublicKey;
1031
1349
  customOracleAccount: PublicKey;
@@ -1033,15 +1351,12 @@ export declare class PerpetualsClient {
1033
1351
  none?: Record<string, never>;
1034
1352
  custom?: Record<string, never>;
1035
1353
  pyth?: Record<string, never>;
1036
- backup?: Record<string, never>;
1037
1354
  };
1038
- maxDeviationThreshold: BN;
1039
- maxPriceError: BN;
1040
- maxPriceAgeSec: number;
1355
+ maxDivergenceBps: BN;
1356
+ maxConfBps: BN;
1357
+ maxPriceAgeSec: BN;
1041
1358
  };
1042
1359
  pricing: {
1043
- useEma: boolean;
1044
- useUnrealizedPnlInAum: boolean;
1045
1360
  tradeSpreadLong: BN;
1046
1361
  tradeSpreadShort: BN;
1047
1362
  swapSpread: BN;
@@ -1049,8 +1364,7 @@ export declare class PerpetualsClient {
1049
1364
  maxInitialLeverage: BN;
1050
1365
  maxLeverage: BN;
1051
1366
  minCollateralUsd: BN;
1052
- minTimeSeconds: BN;
1053
- maxPayoffMult: BN;
1367
+ delaySeconds: BN;
1054
1368
  maxUtilization: BN;
1055
1369
  maxPositionLockedUsd: BN;
1056
1370
  maxTotalLockedUsd: BN;
@@ -1061,17 +1375,25 @@ export declare class PerpetualsClient {
1061
1375
  allowRemoveLiquidity: boolean;
1062
1376
  allowOpenPosition: boolean;
1063
1377
  allowClosePosition: boolean;
1064
- allowPnlWithdrawal: boolean;
1065
1378
  allowCollateralWithdrawal: boolean;
1066
1379
  allowSizeChange: boolean;
1067
- };
1380
+ allowLiquidation: boolean;
1381
+ allowFlpStaking: boolean;
1382
+ allowFeeDistribution: boolean;
1383
+ allowUngatedTrading: boolean;
1384
+ allowFeeDiscounts: boolean;
1385
+ allowReferralRebates: boolean;
1386
+ } | {
1387
+ allowOpenPosition: boolean;
1388
+ allowClosePosition: boolean;
1389
+ allowCollateralWithdrawal: boolean;
1390
+ allowSizeChange: boolean;
1391
+ };
1068
1392
  fees: {
1069
1393
  mode: {
1070
1394
  fixed?: Record<string, never>;
1071
1395
  linear?: Record<string, never>;
1072
1396
  };
1073
- ratioMult: BN;
1074
- utilizationMult: BN;
1075
1397
  swapIn: {
1076
1398
  minFee: BN;
1077
1399
  targetFee: BN;
@@ -1082,6 +1404,16 @@ export declare class PerpetualsClient {
1082
1404
  targetFee: BN;
1083
1405
  maxFee: BN;
1084
1406
  };
1407
+ stableSwapIn: {
1408
+ minFee: BN;
1409
+ targetFee: BN;
1410
+ maxFee: BN;
1411
+ };
1412
+ stableSwapOut: {
1413
+ minFee: BN;
1414
+ targetFee: BN;
1415
+ maxFee: BN;
1416
+ };
1085
1417
  addLiquidity: {
1086
1418
  minFee: BN;
1087
1419
  targetFee: BN;
@@ -1095,8 +1427,6 @@ export declare class PerpetualsClient {
1095
1427
  openPosition: BN;
1096
1428
  closePosition: BN;
1097
1429
  removeCollateral: BN;
1098
- liquidation: BN;
1099
- protocolShare: BN;
1100
1430
  };
1101
1431
  borrowRate: {
1102
1432
  baseRate: BN;
@@ -1104,65 +1434,68 @@ export declare class PerpetualsClient {
1104
1434
  slope2: BN;
1105
1435
  optimalUtilization: BN;
1106
1436
  };
1437
+ rewardThreshold: BN;
1107
1438
  assets: {
1108
1439
  collateral: BN;
1109
- protocolFees: BN;
1110
1440
  owned: BN;
1111
1441
  locked: BN;
1112
1442
  };
1113
- collectedFees: {
1114
- swapUsd: BN;
1115
- addLiquidityUsd: BN;
1116
- removeLiquidityUsd: BN;
1117
- openPositionUsd: BN;
1118
- closePositionUsd: BN;
1119
- liquidationUsd: BN;
1120
- };
1121
- volumeStats: {
1122
- swapUsd: BN;
1123
- addLiquidityUsd: BN;
1124
- removeLiquidityUsd: BN;
1125
- openPositionUsd: BN;
1126
- closePositionUsd: BN;
1127
- liquidationUsd: BN;
1128
- };
1129
- tradeStats: {
1130
- profitUsd: BN;
1131
- lossUsd: BN;
1132
- oiLong: BN;
1133
- oiShort: BN;
1134
- };
1135
- longPositions: {
1136
- openPositions: BN;
1137
- collateralUsd: BN;
1138
- sizeUsd: BN;
1139
- borrowSizeUsd: BN;
1140
- lockedAmount: BN;
1141
- averagePrice: BN;
1142
- totalQuantity: BN;
1143
- cumulativeInterestUsd: BN;
1144
- cumulativeInterestSnapshot: BN;
1145
- collateralAmount: BN;
1146
- };
1147
- shortPositions: {
1148
- openPositions: BN;
1149
- collateralUsd: BN;
1150
- sizeUsd: BN;
1151
- borrowSizeUsd: BN;
1152
- lockedAmount: BN;
1153
- averagePrice: BN;
1154
- totalQuantity: BN;
1155
- cumulativeInterestUsd: BN;
1156
- cumulativeInterestSnapshot: BN;
1157
- collateralAmount: BN;
1443
+ feesStats: {
1444
+ accrued: BN;
1445
+ distributed: BN;
1446
+ paid: BN;
1447
+ rewardPerLpStaked: BN;
1448
+ protocolFee: BN;
1158
1449
  };
1159
1450
  borrowRateState: {
1160
1451
  currentRate: BN;
1161
- cumulativeInterest: BN;
1452
+ cumulativeLockFee: BN;
1162
1453
  lastUpdate: BN;
1163
1454
  };
1164
1455
  bump: number;
1165
1456
  tokenAccountBump: number;
1457
+ owner: PublicKey;
1458
+ stakeStats: {
1459
+ pendingActivation: BN;
1460
+ activeAmount: BN;
1461
+ pendingDeactivation: BN;
1462
+ deactivatedAmount: BN;
1463
+ };
1464
+ rewardSnapshot: BN;
1465
+ unclaimedRewards: BN;
1466
+ feeShareBps: BN;
1467
+ isInitialized: boolean;
1468
+ targetCustody: PublicKey;
1469
+ collateralCustody: PublicKey;
1470
+ side: {
1471
+ none?: Record<string, never>;
1472
+ long?: Record<string, never>;
1473
+ short?: Record<string, never>;
1474
+ };
1475
+ correlation: boolean;
1476
+ maxPayoffBps: BN;
1477
+ openInterest: BN;
1478
+ collectivePosition: {
1479
+ openPositions: BN;
1480
+ updateTime: BN;
1481
+ averageEntryPrice: {
1482
+ price: BN;
1483
+ exponent: number;
1484
+ };
1485
+ sizeAmount: BN;
1486
+ sizeUsd: BN;
1487
+ lockedAmount: BN;
1488
+ lockedUsd: BN;
1489
+ collateralAmount: BN;
1490
+ collateralUsd: BN;
1491
+ unsettledFeeUsd: BN;
1492
+ cumulativeLockFeeSnapshot: BN;
1493
+ sizeDecimals: number;
1494
+ lockedDecimals: number;
1495
+ collateralDecimals: number;
1496
+ };
1497
+ targetCustodyId: BN;
1498
+ collateralCustodyId: BN;
1166
1499
  numSigners: number;
1167
1500
  numSigned: number;
1168
1501
  minSignatures: number;
@@ -1177,47 +1510,96 @@ export declare class PerpetualsClient {
1177
1510
  ema: BN;
1178
1511
  publishTime: BN;
1179
1512
  pools: PublicKey[];
1513
+ collections: PublicKey[];
1514
+ voltageMultiplier: {
1515
+ volume: BN;
1516
+ rewards: BN;
1517
+ rebates: BN;
1518
+ };
1519
+ tradingDiscount: BN[];
1520
+ referralRebate: BN[];
1521
+ referralDiscount: BN;
1522
+ inceptionTime: BN;
1180
1523
  transferAuthorityBump: number;
1181
1524
  perpetualsBump: number;
1182
- inceptionTime: BN;
1183
1525
  name: string;
1526
+ flpMint: PublicKey;
1527
+ oracleAuthority: PublicKey;
1528
+ flpTokenAccount: PublicKey;
1529
+ rewardCustody: PublicKey;
1184
1530
  custodies: PublicKey[];
1185
1531
  ratios: {
1186
1532
  target: BN;
1187
1533
  min: BN;
1188
1534
  max: BN;
1189
1535
  }[];
1536
+ markets: PublicKey[];
1537
+ maxAumUsd: BN;
1190
1538
  aumUsd: BN;
1191
- lpTokenBump: number;
1192
- owner: PublicKey;
1539
+ totalStaked: {
1540
+ pendingActivation: BN;
1541
+ activeAmount: BN;
1542
+ pendingDeactivation: BN;
1543
+ deactivatedAmount: BN;
1544
+ };
1545
+ stakingFeeShareBps: BN;
1546
+ flpMintBump: number;
1547
+ flpTokenAccountBump: number;
1548
+ market: PublicKey;
1193
1549
  delegate: PublicKey;
1194
- custody: PublicKey;
1195
- collateralCustody: PublicKey;
1196
1550
  openTime: BN;
1197
1551
  updateTime: BN;
1198
- side: {
1199
- none?: Record<string, never>;
1200
- long?: Record<string, never>;
1201
- short?: Record<string, never>;
1552
+ entryPrice: {
1553
+ price: BN;
1554
+ exponent: number;
1202
1555
  };
1556
+ sizeAmount: BN;
1203
1557
  sizeUsd: BN;
1204
- borrowSizeUsd: BN;
1205
- collateralUsd: BN;
1206
- unsettledAmount: BN;
1207
- unrealizedLossUsd: BN;
1208
- cumulativeInterestSnapshot: BN;
1209
1558
  lockedAmount: BN;
1559
+ lockedUsd: BN;
1210
1560
  collateralAmount: BN;
1211
- sizeAmount: BN;
1561
+ collateralUsd: BN;
1562
+ unsettledAmount: BN;
1563
+ unsettledFeesUsd: BN;
1564
+ cumulativeLockFeeSnapshot: BN;
1565
+ takeProfitPrice: {
1566
+ price: BN;
1567
+ exponent: number;
1568
+ };
1569
+ stopLossPrice: {
1570
+ price: BN;
1571
+ exponent: number;
1572
+ };
1573
+ sizeDecimals: number;
1574
+ lockedDecimals: number;
1575
+ collateralDecimals: number;
1576
+ refererTradingAccount: PublicKey;
1577
+ padding: BN[] | BN[];
1578
+ nftMint: PublicKey;
1579
+ level: number;
1580
+ voltagePoints: BN;
1581
+ stats: {
1582
+ volumeUsd: BN;
1583
+ lpRewardsUsd: BN;
1584
+ referralRebateUsd: BN;
1585
+ };
1586
+ snapshot: {
1587
+ volumeUsd: BN;
1588
+ lpRewardsUsd: BN;
1589
+ referralRebateUsd: BN;
1590
+ };
1212
1591
  }>;
1213
- getPositionKey: (wallet: PublicKey, poolName: string, tokenMint: PublicKey, side: PositionSide) => PublicKey;
1592
+ getMarketPk(targetCustody: PublicKey, collateralCustody: PublicKey, side: Side): PublicKey;
1593
+ getPositionKey(owner: PublicKey, targetCustody: PublicKey, collateralCustody: PublicKey, side: Side): PublicKey;
1214
1594
  getPosition: (postionKey: PublicKey) => Promise<{
1215
1595
  pool: PublicKey;
1216
1596
  mint: PublicKey;
1217
1597
  tokenAccount: PublicKey;
1218
1598
  decimals: number;
1219
1599
  isStable: boolean;
1600
+ depegAdjustment: boolean;
1220
1601
  isVirtual: boolean;
1602
+ distributeRewards: boolean;
1221
1603
  oracle: {
1222
1604
  oracleAccount: PublicKey;
1223
1605
  customOracleAccount: PublicKey;
@@ -1225,15 +1607,12 @@ export declare class PerpetualsClient {
1225
1607
  none?: Record<string, never>;
1226
1608
  custom?: Record<string, never>;
1227
1609
  pyth?: Record<string, never>;
1228
- backup?: Record<string, never>;
1229
1610
  };
1230
- maxDeviationThreshold: BN;
1231
- maxPriceError: BN;
1232
- maxPriceAgeSec: number;
1611
+ maxDivergenceBps: BN;
1612
+ maxConfBps: BN;
1613
+ maxPriceAgeSec: BN;
1233
1614
  };
1234
1615
  pricing: {
1235
- useEma: boolean;
1236
- useUnrealizedPnlInAum: boolean;
1237
1616
  tradeSpreadLong: BN;
1238
1617
  tradeSpreadShort: BN;
1239
1618
  swapSpread: BN;
@@ -1241,8 +1620,7 @@ export declare class PerpetualsClient {
1241
1620
  maxInitialLeverage: BN;
1242
1621
  maxLeverage: BN;
1243
1622
  minCollateralUsd: BN;
1244
- minTimeSeconds: BN;
1245
- maxPayoffMult: BN;
1623
+ delaySeconds: BN;
1246
1624
  maxUtilization: BN;
1247
1625
  maxPositionLockedUsd: BN;
1248
1626
  maxTotalLockedUsd: BN;
@@ -1253,7 +1631,17 @@ export declare class PerpetualsClient {
1253
1631
  allowRemoveLiquidity: boolean;
1254
1632
  allowOpenPosition: boolean;
1255
1633
  allowClosePosition: boolean;
1256
- allowPnlWithdrawal: boolean;
1634
+ allowCollateralWithdrawal: boolean;
1635
+ allowSizeChange: boolean;
1636
+ allowLiquidation: boolean;
1637
+ allowFlpStaking: boolean;
1638
+ allowFeeDistribution: boolean;
1639
+ allowUngatedTrading: boolean;
1640
+ allowFeeDiscounts: boolean;
1641
+ allowReferralRebates: boolean;
1642
+ } | {
1643
+ allowOpenPosition: boolean;
1644
+ allowClosePosition: boolean;
1257
1645
  allowCollateralWithdrawal: boolean;
1258
1646
  allowSizeChange: boolean;
1259
1647
  };
@@ -1262,8 +1650,6 @@ export declare class PerpetualsClient {
1262
1650
  fixed?: Record<string, never>;
1263
1651
  linear?: Record<string, never>;
1264
1652
  };
1265
- ratioMult: BN;
1266
- utilizationMult: BN;
1267
1653
  swapIn: {
1268
1654
  minFee: BN;
1269
1655
  targetFee: BN;
@@ -1274,6 +1660,16 @@ export declare class PerpetualsClient {
1274
1660
  targetFee: BN;
1275
1661
  maxFee: BN;
1276
1662
  };
1663
+ stableSwapIn: {
1664
+ minFee: BN;
1665
+ targetFee: BN;
1666
+ maxFee: BN;
1667
+ };
1668
+ stableSwapOut: {
1669
+ minFee: BN;
1670
+ targetFee: BN;
1671
+ maxFee: BN;
1672
+ };
1277
1673
  addLiquidity: {
1278
1674
  minFee: BN;
1279
1675
  targetFee: BN;
@@ -1287,8 +1683,6 @@ export declare class PerpetualsClient {
1287
1683
  openPosition: BN;
1288
1684
  closePosition: BN;
1289
1685
  removeCollateral: BN;
1290
- liquidation: BN;
1291
- protocolShare: BN;
1292
1686
  };
1293
1687
  borrowRate: {
1294
1688
  baseRate: BN;
@@ -1296,256 +1690,68 @@ export declare class PerpetualsClient {
1296
1690
  slope2: BN;
1297
1691
  optimalUtilization: BN;
1298
1692
  };
1693
+ rewardThreshold: BN;
1299
1694
  assets: {
1300
1695
  collateral: BN;
1301
- protocolFees: BN;
1302
1696
  owned: BN;
1303
1697
  locked: BN;
1304
1698
  };
1305
- collectedFees: {
1306
- swapUsd: BN;
1307
- addLiquidityUsd: BN;
1308
- removeLiquidityUsd: BN;
1309
- openPositionUsd: BN;
1310
- closePositionUsd: BN;
1311
- liquidationUsd: BN;
1312
- };
1313
- volumeStats: {
1314
- swapUsd: BN;
1315
- addLiquidityUsd: BN;
1316
- removeLiquidityUsd: BN;
1317
- openPositionUsd: BN;
1318
- closePositionUsd: BN;
1319
- liquidationUsd: BN;
1320
- };
1321
- tradeStats: {
1322
- profitUsd: BN;
1323
- lossUsd: BN;
1324
- oiLong: BN;
1325
- oiShort: BN;
1326
- };
1327
- longPositions: {
1328
- openPositions: BN;
1329
- collateralUsd: BN;
1330
- sizeUsd: BN;
1331
- borrowSizeUsd: BN;
1332
- lockedAmount: BN;
1333
- averagePrice: BN;
1334
- totalQuantity: BN;
1335
- cumulativeInterestUsd: BN;
1336
- cumulativeInterestSnapshot: BN;
1337
- collateralAmount: BN;
1338
- };
1339
- shortPositions: {
1340
- openPositions: BN;
1341
- collateralUsd: BN;
1342
- sizeUsd: BN;
1343
- borrowSizeUsd: BN;
1344
- lockedAmount: BN;
1345
- averagePrice: BN;
1346
- totalQuantity: BN;
1347
- cumulativeInterestUsd: BN;
1348
- cumulativeInterestSnapshot: BN;
1349
- collateralAmount: BN;
1699
+ feesStats: {
1700
+ accrued: BN;
1701
+ distributed: BN;
1702
+ paid: BN;
1703
+ rewardPerLpStaked: BN;
1704
+ protocolFee: BN;
1350
1705
  };
1351
1706
  borrowRateState: {
1352
1707
  currentRate: BN;
1353
- cumulativeInterest: BN;
1708
+ cumulativeLockFee: BN;
1354
1709
  lastUpdate: BN;
1355
1710
  };
1356
1711
  bump: number;
1357
1712
  tokenAccountBump: number;
1358
- numSigners: number;
1359
- numSigned: number;
1360
- minSignatures: number;
1361
- instructionAccountsLen: number;
1362
- instructionDataLen: number;
1363
- instructionHash: BN;
1364
- signers: PublicKey[];
1365
- signed: number[];
1366
- price: BN;
1367
- expo: number;
1368
- conf: BN;
1369
- ema: BN;
1370
- publishTime: BN;
1371
- pools: PublicKey[];
1372
- transferAuthorityBump: number;
1373
- perpetualsBump: number;
1374
- inceptionTime: BN;
1375
- name: string;
1376
- custodies: PublicKey[];
1377
- ratios: {
1378
- target: BN;
1379
- min: BN;
1380
- max: BN;
1381
- }[];
1382
- aumUsd: BN;
1383
- lpTokenBump: number;
1384
1713
  owner: PublicKey;
1385
- delegate: PublicKey;
1386
- custody: PublicKey;
1714
+ stakeStats: {
1715
+ pendingActivation: BN;
1716
+ activeAmount: BN;
1717
+ pendingDeactivation: BN;
1718
+ deactivatedAmount: BN;
1719
+ };
1720
+ rewardSnapshot: BN;
1721
+ unclaimedRewards: BN;
1722
+ feeShareBps: BN;
1723
+ isInitialized: boolean;
1724
+ targetCustody: PublicKey;
1387
1725
  collateralCustody: PublicKey;
1388
- openTime: BN;
1389
- updateTime: BN;
1390
1726
  side: {
1391
1727
  none?: Record<string, never>;
1392
1728
  long?: Record<string, never>;
1393
1729
  short?: Record<string, never>;
1394
1730
  };
1395
- sizeUsd: BN;
1396
- borrowSizeUsd: BN;
1397
- collateralUsd: BN;
1398
- unsettledAmount: BN;
1399
- unrealizedLossUsd: BN;
1400
- cumulativeInterestSnapshot: BN;
1401
- lockedAmount: BN;
1402
- collateralAmount: BN;
1403
- sizeAmount: BN;
1404
- }>;
1405
- getUserPosition: (wallet: PublicKey, poolName: string, tokenMint: PublicKey, side: PositionSide) => Promise<{
1406
- pool: PublicKey;
1407
- mint: PublicKey;
1408
- tokenAccount: PublicKey;
1409
- decimals: number;
1410
- isStable: boolean;
1411
- isVirtual: boolean;
1412
- oracle: {
1413
- oracleAccount: PublicKey;
1414
- customOracleAccount: PublicKey;
1415
- oracleType: {
1416
- none?: Record<string, never>;
1417
- custom?: Record<string, never>;
1418
- pyth?: Record<string, never>;
1419
- backup?: Record<string, never>;
1420
- };
1421
- maxDeviationThreshold: BN;
1422
- maxPriceError: BN;
1423
- maxPriceAgeSec: number;
1424
- };
1425
- pricing: {
1426
- useEma: boolean;
1427
- useUnrealizedPnlInAum: boolean;
1428
- tradeSpreadLong: BN;
1429
- tradeSpreadShort: BN;
1430
- swapSpread: BN;
1431
- minInitialLeverage: BN;
1432
- maxInitialLeverage: BN;
1433
- maxLeverage: BN;
1434
- minCollateralUsd: BN;
1435
- minTimeSeconds: BN;
1436
- maxPayoffMult: BN;
1437
- maxUtilization: BN;
1438
- maxPositionLockedUsd: BN;
1439
- maxTotalLockedUsd: BN;
1440
- };
1441
- permissions: {
1442
- allowSwap: boolean;
1443
- allowAddLiquidity: boolean;
1444
- allowRemoveLiquidity: boolean;
1445
- allowOpenPosition: boolean;
1446
- allowClosePosition: boolean;
1447
- allowPnlWithdrawal: boolean;
1448
- allowCollateralWithdrawal: boolean;
1449
- allowSizeChange: boolean;
1450
- };
1451
- fees: {
1452
- mode: {
1453
- fixed?: Record<string, never>;
1454
- linear?: Record<string, never>;
1455
- };
1456
- ratioMult: BN;
1457
- utilizationMult: BN;
1458
- swapIn: {
1459
- minFee: BN;
1460
- targetFee: BN;
1461
- maxFee: BN;
1462
- };
1463
- swapOut: {
1464
- minFee: BN;
1465
- targetFee: BN;
1466
- maxFee: BN;
1467
- };
1468
- addLiquidity: {
1469
- minFee: BN;
1470
- targetFee: BN;
1471
- maxFee: BN;
1472
- };
1473
- removeLiquidity: {
1474
- minFee: BN;
1475
- targetFee: BN;
1476
- maxFee: BN;
1477
- };
1478
- openPosition: BN;
1479
- closePosition: BN;
1480
- removeCollateral: BN;
1481
- liquidation: BN;
1482
- protocolShare: BN;
1483
- };
1484
- borrowRate: {
1485
- baseRate: BN;
1486
- slope1: BN;
1487
- slope2: BN;
1488
- optimalUtilization: BN;
1489
- };
1490
- assets: {
1491
- collateral: BN;
1492
- protocolFees: BN;
1493
- owned: BN;
1494
- locked: BN;
1495
- };
1496
- collectedFees: {
1497
- swapUsd: BN;
1498
- addLiquidityUsd: BN;
1499
- removeLiquidityUsd: BN;
1500
- openPositionUsd: BN;
1501
- closePositionUsd: BN;
1502
- liquidationUsd: BN;
1503
- };
1504
- volumeStats: {
1505
- swapUsd: BN;
1506
- addLiquidityUsd: BN;
1507
- removeLiquidityUsd: BN;
1508
- openPositionUsd: BN;
1509
- closePositionUsd: BN;
1510
- liquidationUsd: BN;
1511
- };
1512
- tradeStats: {
1513
- profitUsd: BN;
1514
- lossUsd: BN;
1515
- oiLong: BN;
1516
- oiShort: BN;
1517
- };
1518
- longPositions: {
1731
+ correlation: boolean;
1732
+ maxPayoffBps: BN;
1733
+ openInterest: BN;
1734
+ collectivePosition: {
1519
1735
  openPositions: BN;
1520
- collateralUsd: BN;
1736
+ updateTime: BN;
1737
+ averageEntryPrice: {
1738
+ price: BN;
1739
+ exponent: number;
1740
+ };
1741
+ sizeAmount: BN;
1521
1742
  sizeUsd: BN;
1522
- borrowSizeUsd: BN;
1523
1743
  lockedAmount: BN;
1524
- averagePrice: BN;
1525
- totalQuantity: BN;
1526
- cumulativeInterestUsd: BN;
1527
- cumulativeInterestSnapshot: BN;
1744
+ lockedUsd: BN;
1528
1745
  collateralAmount: BN;
1529
- };
1530
- shortPositions: {
1531
- openPositions: BN;
1532
1746
  collateralUsd: BN;
1533
- sizeUsd: BN;
1534
- borrowSizeUsd: BN;
1535
- lockedAmount: BN;
1536
- averagePrice: BN;
1537
- totalQuantity: BN;
1538
- cumulativeInterestUsd: BN;
1539
- cumulativeInterestSnapshot: BN;
1540
- collateralAmount: BN;
1541
- };
1542
- borrowRateState: {
1543
- currentRate: BN;
1544
- cumulativeInterest: BN;
1545
- lastUpdate: BN;
1546
- };
1547
- bump: number;
1548
- tokenAccountBump: number;
1747
+ unsettledFeeUsd: BN;
1748
+ cumulativeLockFeeSnapshot: BN;
1749
+ sizeDecimals: number;
1750
+ lockedDecimals: number;
1751
+ collateralDecimals: number;
1752
+ };
1753
+ targetCustodyId: BN;
1754
+ collateralCustodyId: BN;
1549
1755
  numSigners: number;
1550
1756
  numSigned: number;
1551
1757
  minSignatures: number;
@@ -1560,46 +1766,94 @@ export declare class PerpetualsClient {
1560
1766
  ema: BN;
1561
1767
  publishTime: BN;
1562
1768
  pools: PublicKey[];
1769
+ collections: PublicKey[];
1770
+ voltageMultiplier: {
1771
+ volume: BN;
1772
+ rewards: BN;
1773
+ rebates: BN;
1774
+ };
1775
+ tradingDiscount: BN[];
1776
+ referralRebate: BN[];
1777
+ referralDiscount: BN;
1778
+ inceptionTime: BN;
1563
1779
  transferAuthorityBump: number;
1564
1780
  perpetualsBump: number;
1565
- inceptionTime: BN;
1566
1781
  name: string;
1782
+ flpMint: PublicKey;
1783
+ oracleAuthority: PublicKey;
1784
+ flpTokenAccount: PublicKey;
1785
+ rewardCustody: PublicKey;
1567
1786
  custodies: PublicKey[];
1568
1787
  ratios: {
1569
1788
  target: BN;
1570
1789
  min: BN;
1571
1790
  max: BN;
1572
1791
  }[];
1792
+ markets: PublicKey[];
1793
+ maxAumUsd: BN;
1573
1794
  aumUsd: BN;
1574
- lpTokenBump: number;
1575
- owner: PublicKey;
1795
+ totalStaked: {
1796
+ pendingActivation: BN;
1797
+ activeAmount: BN;
1798
+ pendingDeactivation: BN;
1799
+ deactivatedAmount: BN;
1800
+ };
1801
+ stakingFeeShareBps: BN;
1802
+ flpMintBump: number;
1803
+ flpTokenAccountBump: number;
1804
+ market: PublicKey;
1576
1805
  delegate: PublicKey;
1577
- custody: PublicKey;
1578
- collateralCustody: PublicKey;
1579
1806
  openTime: BN;
1580
1807
  updateTime: BN;
1581
- side: {
1582
- none?: Record<string, never>;
1583
- long?: Record<string, never>;
1584
- short?: Record<string, never>;
1808
+ entryPrice: {
1809
+ price: BN;
1810
+ exponent: number;
1585
1811
  };
1812
+ sizeAmount: BN;
1586
1813
  sizeUsd: BN;
1587
- borrowSizeUsd: BN;
1588
- collateralUsd: BN;
1589
- unsettledAmount: BN;
1590
- unrealizedLossUsd: BN;
1591
- cumulativeInterestSnapshot: BN;
1592
1814
  lockedAmount: BN;
1815
+ lockedUsd: BN;
1593
1816
  collateralAmount: BN;
1594
- sizeAmount: BN;
1817
+ collateralUsd: BN;
1818
+ unsettledAmount: BN;
1819
+ unsettledFeesUsd: BN;
1820
+ cumulativeLockFeeSnapshot: BN;
1821
+ takeProfitPrice: {
1822
+ price: BN;
1823
+ exponent: number;
1824
+ };
1825
+ stopLossPrice: {
1826
+ price: BN;
1827
+ exponent: number;
1828
+ };
1829
+ sizeDecimals: number;
1830
+ lockedDecimals: number;
1831
+ collateralDecimals: number;
1832
+ refererTradingAccount: PublicKey;
1833
+ padding: BN[] | BN[];
1834
+ nftMint: PublicKey;
1835
+ level: number;
1836
+ voltagePoints: BN;
1837
+ stats: {
1838
+ volumeUsd: BN;
1839
+ lpRewardsUsd: BN;
1840
+ referralRebateUsd: BN;
1841
+ };
1842
+ snapshot: {
1843
+ volumeUsd: BN;
1844
+ lpRewardsUsd: BN;
1845
+ referralRebateUsd: BN;
1846
+ };
1595
1847
  }>;
1596
- getUserPositions: (wallet: PublicKey, poolConfig: PoolConfig) => Promise<{
1848
+ getUserPosition: (owner: PublicKey, targetCustody: PublicKey, collateralCustody: PublicKey, side: Side) => Promise<{
1597
1849
  pool: PublicKey;
1598
1850
  mint: PublicKey;
1599
1851
  tokenAccount: PublicKey;
1600
1852
  decimals: number;
1601
1853
  isStable: boolean;
1854
+ depegAdjustment: boolean;
1602
1855
  isVirtual: boolean;
1856
+ distributeRewards: boolean;
1603
1857
  oracle: {
1604
1858
  oracleAccount: PublicKey;
1605
1859
  customOracleAccount: PublicKey;
@@ -1607,15 +1861,12 @@ export declare class PerpetualsClient {
1607
1861
  none?: Record<string, never>;
1608
1862
  custom?: Record<string, never>;
1609
1863
  pyth?: Record<string, never>;
1610
- backup?: Record<string, never>;
1611
1864
  };
1612
- maxDeviationThreshold: BN;
1613
- maxPriceError: BN;
1614
- maxPriceAgeSec: number;
1865
+ maxDivergenceBps: BN;
1866
+ maxConfBps: BN;
1867
+ maxPriceAgeSec: BN;
1615
1868
  };
1616
1869
  pricing: {
1617
- useEma: boolean;
1618
- useUnrealizedPnlInAum: boolean;
1619
1870
  tradeSpreadLong: BN;
1620
1871
  tradeSpreadShort: BN;
1621
1872
  swapSpread: BN;
@@ -1623,8 +1874,7 @@ export declare class PerpetualsClient {
1623
1874
  maxInitialLeverage: BN;
1624
1875
  maxLeverage: BN;
1625
1876
  minCollateralUsd: BN;
1626
- minTimeSeconds: BN;
1627
- maxPayoffMult: BN;
1877
+ delaySeconds: BN;
1628
1878
  maxUtilization: BN;
1629
1879
  maxPositionLockedUsd: BN;
1630
1880
  maxTotalLockedUsd: BN;
@@ -1635,7 +1885,17 @@ export declare class PerpetualsClient {
1635
1885
  allowRemoveLiquidity: boolean;
1636
1886
  allowOpenPosition: boolean;
1637
1887
  allowClosePosition: boolean;
1638
- allowPnlWithdrawal: boolean;
1888
+ allowCollateralWithdrawal: boolean;
1889
+ allowSizeChange: boolean;
1890
+ allowLiquidation: boolean;
1891
+ allowFlpStaking: boolean;
1892
+ allowFeeDistribution: boolean;
1893
+ allowUngatedTrading: boolean;
1894
+ allowFeeDiscounts: boolean;
1895
+ allowReferralRebates: boolean;
1896
+ } | {
1897
+ allowOpenPosition: boolean;
1898
+ allowClosePosition: boolean;
1639
1899
  allowCollateralWithdrawal: boolean;
1640
1900
  allowSizeChange: boolean;
1641
1901
  };
@@ -1644,8 +1904,6 @@ export declare class PerpetualsClient {
1644
1904
  fixed?: Record<string, never>;
1645
1905
  linear?: Record<string, never>;
1646
1906
  };
1647
- ratioMult: BN;
1648
- utilizationMult: BN;
1649
1907
  swapIn: {
1650
1908
  minFee: BN;
1651
1909
  targetFee: BN;
@@ -1656,6 +1914,16 @@ export declare class PerpetualsClient {
1656
1914
  targetFee: BN;
1657
1915
  maxFee: BN;
1658
1916
  };
1917
+ stableSwapIn: {
1918
+ minFee: BN;
1919
+ targetFee: BN;
1920
+ maxFee: BN;
1921
+ };
1922
+ stableSwapOut: {
1923
+ minFee: BN;
1924
+ targetFee: BN;
1925
+ maxFee: BN;
1926
+ };
1659
1927
  addLiquidity: {
1660
1928
  minFee: BN;
1661
1929
  targetFee: BN;
@@ -1669,8 +1937,6 @@ export declare class PerpetualsClient {
1669
1937
  openPosition: BN;
1670
1938
  closePosition: BN;
1671
1939
  removeCollateral: BN;
1672
- liquidation: BN;
1673
- protocolShare: BN;
1674
1940
  };
1675
1941
  borrowRate: {
1676
1942
  baseRate: BN;
@@ -1678,65 +1944,68 @@ export declare class PerpetualsClient {
1678
1944
  slope2: BN;
1679
1945
  optimalUtilization: BN;
1680
1946
  };
1947
+ rewardThreshold: BN;
1681
1948
  assets: {
1682
1949
  collateral: BN;
1683
- protocolFees: BN;
1684
1950
  owned: BN;
1685
1951
  locked: BN;
1686
1952
  };
1687
- collectedFees: {
1688
- swapUsd: BN;
1689
- addLiquidityUsd: BN;
1690
- removeLiquidityUsd: BN;
1691
- openPositionUsd: BN;
1692
- closePositionUsd: BN;
1693
- liquidationUsd: BN;
1694
- };
1695
- volumeStats: {
1696
- swapUsd: BN;
1697
- addLiquidityUsd: BN;
1698
- removeLiquidityUsd: BN;
1699
- openPositionUsd: BN;
1700
- closePositionUsd: BN;
1701
- liquidationUsd: BN;
1702
- };
1703
- tradeStats: {
1704
- profitUsd: BN;
1705
- lossUsd: BN;
1706
- oiLong: BN;
1707
- oiShort: BN;
1708
- };
1709
- longPositions: {
1710
- openPositions: BN;
1711
- collateralUsd: BN;
1712
- sizeUsd: BN;
1713
- borrowSizeUsd: BN;
1714
- lockedAmount: BN;
1715
- averagePrice: BN;
1716
- totalQuantity: BN;
1717
- cumulativeInterestUsd: BN;
1718
- cumulativeInterestSnapshot: BN;
1719
- collateralAmount: BN;
1720
- };
1721
- shortPositions: {
1722
- openPositions: BN;
1723
- collateralUsd: BN;
1724
- sizeUsd: BN;
1725
- borrowSizeUsd: BN;
1726
- lockedAmount: BN;
1727
- averagePrice: BN;
1728
- totalQuantity: BN;
1729
- cumulativeInterestUsd: BN;
1730
- cumulativeInterestSnapshot: BN;
1731
- collateralAmount: BN;
1953
+ feesStats: {
1954
+ accrued: BN;
1955
+ distributed: BN;
1956
+ paid: BN;
1957
+ rewardPerLpStaked: BN;
1958
+ protocolFee: BN;
1732
1959
  };
1733
1960
  borrowRateState: {
1734
1961
  currentRate: BN;
1735
- cumulativeInterest: BN;
1962
+ cumulativeLockFee: BN;
1736
1963
  lastUpdate: BN;
1737
1964
  };
1738
1965
  bump: number;
1739
1966
  tokenAccountBump: number;
1967
+ owner: PublicKey;
1968
+ stakeStats: {
1969
+ pendingActivation: BN;
1970
+ activeAmount: BN;
1971
+ pendingDeactivation: BN;
1972
+ deactivatedAmount: BN;
1973
+ };
1974
+ rewardSnapshot: BN;
1975
+ unclaimedRewards: BN;
1976
+ feeShareBps: BN;
1977
+ isInitialized: boolean;
1978
+ targetCustody: PublicKey;
1979
+ collateralCustody: PublicKey;
1980
+ side: {
1981
+ none?: Record<string, never>;
1982
+ long?: Record<string, never>;
1983
+ short?: Record<string, never>;
1984
+ };
1985
+ correlation: boolean;
1986
+ maxPayoffBps: BN;
1987
+ openInterest: BN;
1988
+ collectivePosition: {
1989
+ openPositions: BN;
1990
+ updateTime: BN;
1991
+ averageEntryPrice: {
1992
+ price: BN;
1993
+ exponent: number;
1994
+ };
1995
+ sizeAmount: BN;
1996
+ sizeUsd: BN;
1997
+ lockedAmount: BN;
1998
+ lockedUsd: BN;
1999
+ collateralAmount: BN;
2000
+ collateralUsd: BN;
2001
+ unsettledFeeUsd: BN;
2002
+ cumulativeLockFeeSnapshot: BN;
2003
+ sizeDecimals: number;
2004
+ lockedDecimals: number;
2005
+ collateralDecimals: number;
2006
+ };
2007
+ targetCustodyId: BN;
2008
+ collateralCustodyId: BN;
1740
2009
  numSigners: number;
1741
2010
  numSigned: number;
1742
2011
  minSignatures: number;
@@ -1751,38 +2020,116 @@ export declare class PerpetualsClient {
1751
2020
  ema: BN;
1752
2021
  publishTime: BN;
1753
2022
  pools: PublicKey[];
2023
+ collections: PublicKey[];
2024
+ voltageMultiplier: {
2025
+ volume: BN;
2026
+ rewards: BN;
2027
+ rebates: BN;
2028
+ };
2029
+ tradingDiscount: BN[];
2030
+ referralRebate: BN[];
2031
+ referralDiscount: BN;
2032
+ inceptionTime: BN;
1754
2033
  transferAuthorityBump: number;
1755
2034
  perpetualsBump: number;
1756
- inceptionTime: BN;
1757
2035
  name: string;
2036
+ flpMint: PublicKey;
2037
+ oracleAuthority: PublicKey;
2038
+ flpTokenAccount: PublicKey;
2039
+ rewardCustody: PublicKey;
1758
2040
  custodies: PublicKey[];
1759
2041
  ratios: {
1760
2042
  target: BN;
1761
2043
  min: BN;
1762
2044
  max: BN;
1763
2045
  }[];
2046
+ markets: PublicKey[];
2047
+ maxAumUsd: BN;
1764
2048
  aumUsd: BN;
1765
- lpTokenBump: number;
1766
- owner: PublicKey;
2049
+ totalStaked: {
2050
+ pendingActivation: BN;
2051
+ activeAmount: BN;
2052
+ pendingDeactivation: BN;
2053
+ deactivatedAmount: BN;
2054
+ };
2055
+ stakingFeeShareBps: BN;
2056
+ flpMintBump: number;
2057
+ flpTokenAccountBump: number;
2058
+ market: PublicKey;
1767
2059
  delegate: PublicKey;
1768
- custody: PublicKey;
1769
- collateralCustody: PublicKey;
1770
2060
  openTime: BN;
1771
2061
  updateTime: BN;
1772
- side: {
1773
- none?: Record<string, never>;
1774
- long?: Record<string, never>;
1775
- short?: Record<string, never>;
2062
+ entryPrice: {
2063
+ price: BN;
2064
+ exponent: number;
1776
2065
  };
2066
+ sizeAmount: BN;
1777
2067
  sizeUsd: BN;
1778
- borrowSizeUsd: BN;
2068
+ lockedAmount: BN;
2069
+ lockedUsd: BN;
2070
+ collateralAmount: BN;
1779
2071
  collateralUsd: BN;
1780
2072
  unsettledAmount: BN;
1781
- unrealizedLossUsd: BN;
1782
- cumulativeInterestSnapshot: BN;
2073
+ unsettledFeesUsd: BN;
2074
+ cumulativeLockFeeSnapshot: BN;
2075
+ takeProfitPrice: {
2076
+ price: BN;
2077
+ exponent: number;
2078
+ };
2079
+ stopLossPrice: {
2080
+ price: BN;
2081
+ exponent: number;
2082
+ };
2083
+ sizeDecimals: number;
2084
+ lockedDecimals: number;
2085
+ collateralDecimals: number;
2086
+ refererTradingAccount: PublicKey;
2087
+ padding: BN[] | BN[];
2088
+ nftMint: PublicKey;
2089
+ level: number;
2090
+ voltagePoints: BN;
2091
+ stats: {
2092
+ volumeUsd: BN;
2093
+ lpRewardsUsd: BN;
2094
+ referralRebateUsd: BN;
2095
+ };
2096
+ snapshot: {
2097
+ volumeUsd: BN;
2098
+ lpRewardsUsd: BN;
2099
+ referralRebateUsd: BN;
2100
+ };
2101
+ }>;
2102
+ getUserPositions: (wallet: PublicKey, poolConfig: PoolConfig) => Promise<{
2103
+ owner: PublicKey;
2104
+ market: PublicKey;
2105
+ delegate: PublicKey;
2106
+ openTime: BN;
2107
+ updateTime: BN;
2108
+ entryPrice: {
2109
+ price: BN;
2110
+ exponent: number;
2111
+ };
2112
+ sizeAmount: BN;
2113
+ sizeUsd: BN;
1783
2114
  lockedAmount: BN;
2115
+ lockedUsd: BN;
1784
2116
  collateralAmount: BN;
1785
- sizeAmount: BN;
2117
+ collateralUsd: BN;
2118
+ unsettledAmount: BN;
2119
+ unsettledFeesUsd: BN;
2120
+ cumulativeLockFeeSnapshot: BN;
2121
+ takeProfitPrice: {
2122
+ price: BN;
2123
+ exponent: number;
2124
+ };
2125
+ stopLossPrice: {
2126
+ price: BN;
2127
+ exponent: number;
2128
+ };
2129
+ sizeDecimals: number;
2130
+ lockedDecimals: number;
2131
+ collateralDecimals: number;
2132
+ bump: number;
1786
2133
  pubkey: PublicKey;
1787
2134
  }[]>;
1788
2135
  getPoolTokenPositions: (poolName: string, tokenMint: PublicKey, collateralMint: PublicKey) => Promise<import("@coral-xyz/anchor").ProgramAccount<{
@@ -1791,7 +2138,9 @@ export declare class PerpetualsClient {
1791
2138
  tokenAccount: PublicKey;
1792
2139
  decimals: number;
1793
2140
  isStable: boolean;
2141
+ depegAdjustment: boolean;
1794
2142
  isVirtual: boolean;
2143
+ distributeRewards: boolean;
1795
2144
  oracle: {
1796
2145
  oracleAccount: PublicKey;
1797
2146
  customOracleAccount: PublicKey;
@@ -1799,15 +2148,12 @@ export declare class PerpetualsClient {
1799
2148
  none?: Record<string, never>;
1800
2149
  custom?: Record<string, never>;
1801
2150
  pyth?: Record<string, never>;
1802
- backup?: Record<string, never>;
1803
2151
  };
1804
- maxDeviationThreshold: BN;
1805
- maxPriceError: BN;
1806
- maxPriceAgeSec: number;
2152
+ maxDivergenceBps: BN;
2153
+ maxConfBps: BN;
2154
+ maxPriceAgeSec: BN;
1807
2155
  };
1808
2156
  pricing: {
1809
- useEma: boolean;
1810
- useUnrealizedPnlInAum: boolean;
1811
2157
  tradeSpreadLong: BN;
1812
2158
  tradeSpreadShort: BN;
1813
2159
  swapSpread: BN;
@@ -1815,8 +2161,7 @@ export declare class PerpetualsClient {
1815
2161
  maxInitialLeverage: BN;
1816
2162
  maxLeverage: BN;
1817
2163
  minCollateralUsd: BN;
1818
- minTimeSeconds: BN;
1819
- maxPayoffMult: BN;
2164
+ delaySeconds: BN;
1820
2165
  maxUtilization: BN;
1821
2166
  maxPositionLockedUsd: BN;
1822
2167
  maxTotalLockedUsd: BN;
@@ -1827,7 +2172,17 @@ export declare class PerpetualsClient {
1827
2172
  allowRemoveLiquidity: boolean;
1828
2173
  allowOpenPosition: boolean;
1829
2174
  allowClosePosition: boolean;
1830
- allowPnlWithdrawal: boolean;
2175
+ allowCollateralWithdrawal: boolean;
2176
+ allowSizeChange: boolean;
2177
+ allowLiquidation: boolean;
2178
+ allowFlpStaking: boolean;
2179
+ allowFeeDistribution: boolean;
2180
+ allowUngatedTrading: boolean;
2181
+ allowFeeDiscounts: boolean;
2182
+ allowReferralRebates: boolean;
2183
+ } | {
2184
+ allowOpenPosition: boolean;
2185
+ allowClosePosition: boolean;
1831
2186
  allowCollateralWithdrawal: boolean;
1832
2187
  allowSizeChange: boolean;
1833
2188
  };
@@ -1836,8 +2191,6 @@ export declare class PerpetualsClient {
1836
2191
  fixed?: Record<string, never>;
1837
2192
  linear?: Record<string, never>;
1838
2193
  };
1839
- ratioMult: BN;
1840
- utilizationMult: BN;
1841
2194
  swapIn: {
1842
2195
  minFee: BN;
1843
2196
  targetFee: BN;
@@ -1848,6 +2201,16 @@ export declare class PerpetualsClient {
1848
2201
  targetFee: BN;
1849
2202
  maxFee: BN;
1850
2203
  };
2204
+ stableSwapIn: {
2205
+ minFee: BN;
2206
+ targetFee: BN;
2207
+ maxFee: BN;
2208
+ };
2209
+ stableSwapOut: {
2210
+ minFee: BN;
2211
+ targetFee: BN;
2212
+ maxFee: BN;
2213
+ };
1851
2214
  addLiquidity: {
1852
2215
  minFee: BN;
1853
2216
  targetFee: BN;
@@ -1861,8 +2224,6 @@ export declare class PerpetualsClient {
1861
2224
  openPosition: BN;
1862
2225
  closePosition: BN;
1863
2226
  removeCollateral: BN;
1864
- liquidation: BN;
1865
- protocolShare: BN;
1866
2227
  };
1867
2228
  borrowRate: {
1868
2229
  baseRate: BN;
@@ -1870,65 +2231,68 @@ export declare class PerpetualsClient {
1870
2231
  slope2: BN;
1871
2232
  optimalUtilization: BN;
1872
2233
  };
2234
+ rewardThreshold: BN;
1873
2235
  assets: {
1874
2236
  collateral: BN;
1875
- protocolFees: BN;
1876
2237
  owned: BN;
1877
2238
  locked: BN;
1878
2239
  };
1879
- collectedFees: {
1880
- swapUsd: BN;
1881
- addLiquidityUsd: BN;
1882
- removeLiquidityUsd: BN;
1883
- openPositionUsd: BN;
1884
- closePositionUsd: BN;
1885
- liquidationUsd: BN;
1886
- };
1887
- volumeStats: {
1888
- swapUsd: BN;
1889
- addLiquidityUsd: BN;
1890
- removeLiquidityUsd: BN;
1891
- openPositionUsd: BN;
1892
- closePositionUsd: BN;
1893
- liquidationUsd: BN;
1894
- };
1895
- tradeStats: {
1896
- profitUsd: BN;
1897
- lossUsd: BN;
1898
- oiLong: BN;
1899
- oiShort: BN;
1900
- };
1901
- longPositions: {
1902
- openPositions: BN;
1903
- collateralUsd: BN;
1904
- sizeUsd: BN;
1905
- borrowSizeUsd: BN;
1906
- lockedAmount: BN;
1907
- averagePrice: BN;
1908
- totalQuantity: BN;
1909
- cumulativeInterestUsd: BN;
1910
- cumulativeInterestSnapshot: BN;
1911
- collateralAmount: BN;
1912
- };
1913
- shortPositions: {
1914
- openPositions: BN;
1915
- collateralUsd: BN;
1916
- sizeUsd: BN;
1917
- borrowSizeUsd: BN;
1918
- lockedAmount: BN;
1919
- averagePrice: BN;
1920
- totalQuantity: BN;
1921
- cumulativeInterestUsd: BN;
1922
- cumulativeInterestSnapshot: BN;
1923
- collateralAmount: BN;
2240
+ feesStats: {
2241
+ accrued: BN;
2242
+ distributed: BN;
2243
+ paid: BN;
2244
+ rewardPerLpStaked: BN;
2245
+ protocolFee: BN;
1924
2246
  };
1925
2247
  borrowRateState: {
1926
2248
  currentRate: BN;
1927
- cumulativeInterest: BN;
2249
+ cumulativeLockFee: BN;
1928
2250
  lastUpdate: BN;
1929
2251
  };
1930
2252
  bump: number;
1931
2253
  tokenAccountBump: number;
2254
+ owner: PublicKey;
2255
+ stakeStats: {
2256
+ pendingActivation: BN;
2257
+ activeAmount: BN;
2258
+ pendingDeactivation: BN;
2259
+ deactivatedAmount: BN;
2260
+ };
2261
+ rewardSnapshot: BN;
2262
+ unclaimedRewards: BN;
2263
+ feeShareBps: BN;
2264
+ isInitialized: boolean;
2265
+ targetCustody: PublicKey;
2266
+ collateralCustody: PublicKey;
2267
+ side: {
2268
+ none?: Record<string, never>;
2269
+ long?: Record<string, never>;
2270
+ short?: Record<string, never>;
2271
+ };
2272
+ correlation: boolean;
2273
+ maxPayoffBps: BN;
2274
+ openInterest: BN;
2275
+ collectivePosition: {
2276
+ openPositions: BN;
2277
+ updateTime: BN;
2278
+ averageEntryPrice: {
2279
+ price: BN;
2280
+ exponent: number;
2281
+ };
2282
+ sizeAmount: BN;
2283
+ sizeUsd: BN;
2284
+ lockedAmount: BN;
2285
+ lockedUsd: BN;
2286
+ collateralAmount: BN;
2287
+ collateralUsd: BN;
2288
+ unsettledFeeUsd: BN;
2289
+ cumulativeLockFeeSnapshot: BN;
2290
+ sizeDecimals: number;
2291
+ lockedDecimals: number;
2292
+ collateralDecimals: number;
2293
+ };
2294
+ targetCustodyId: BN;
2295
+ collateralCustodyId: BN;
1932
2296
  numSigners: number;
1933
2297
  numSigned: number;
1934
2298
  minSignatures: number;
@@ -1943,38 +2307,84 @@ export declare class PerpetualsClient {
1943
2307
  ema: BN;
1944
2308
  publishTime: BN;
1945
2309
  pools: PublicKey[];
2310
+ collections: PublicKey[];
2311
+ voltageMultiplier: {
2312
+ volume: BN;
2313
+ rewards: BN;
2314
+ rebates: BN;
2315
+ };
2316
+ tradingDiscount: BN[];
2317
+ referralRebate: BN[];
2318
+ referralDiscount: BN;
2319
+ inceptionTime: BN;
1946
2320
  transferAuthorityBump: number;
1947
2321
  perpetualsBump: number;
1948
- inceptionTime: BN;
1949
2322
  name: string;
2323
+ flpMint: PublicKey;
2324
+ oracleAuthority: PublicKey;
2325
+ flpTokenAccount: PublicKey;
2326
+ rewardCustody: PublicKey;
1950
2327
  custodies: PublicKey[];
1951
2328
  ratios: {
1952
2329
  target: BN;
1953
2330
  min: BN;
1954
2331
  max: BN;
1955
2332
  }[];
2333
+ markets: PublicKey[];
2334
+ maxAumUsd: BN;
1956
2335
  aumUsd: BN;
1957
- lpTokenBump: number;
1958
- owner: PublicKey;
2336
+ totalStaked: {
2337
+ pendingActivation: BN;
2338
+ activeAmount: BN;
2339
+ pendingDeactivation: BN;
2340
+ deactivatedAmount: BN;
2341
+ };
2342
+ stakingFeeShareBps: BN;
2343
+ flpMintBump: number;
2344
+ flpTokenAccountBump: number;
2345
+ market: PublicKey;
1959
2346
  delegate: PublicKey;
1960
- custody: PublicKey;
1961
- collateralCustody: PublicKey;
1962
2347
  openTime: BN;
1963
2348
  updateTime: BN;
1964
- side: {
1965
- none?: Record<string, never>;
1966
- long?: Record<string, never>;
1967
- short?: Record<string, never>;
2349
+ entryPrice: {
2350
+ price: BN;
2351
+ exponent: number;
1968
2352
  };
2353
+ sizeAmount: BN;
1969
2354
  sizeUsd: BN;
1970
- borrowSizeUsd: BN;
1971
- collateralUsd: BN;
1972
- unsettledAmount: BN;
1973
- unrealizedLossUsd: BN;
1974
- cumulativeInterestSnapshot: BN;
1975
2355
  lockedAmount: BN;
2356
+ lockedUsd: BN;
1976
2357
  collateralAmount: BN;
1977
- sizeAmount: BN;
2358
+ collateralUsd: BN;
2359
+ unsettledAmount: BN;
2360
+ unsettledFeesUsd: BN;
2361
+ cumulativeLockFeeSnapshot: BN;
2362
+ takeProfitPrice: {
2363
+ price: BN;
2364
+ exponent: number;
2365
+ };
2366
+ stopLossPrice: {
2367
+ price: BN;
2368
+ exponent: number;
2369
+ };
2370
+ sizeDecimals: number;
2371
+ lockedDecimals: number;
2372
+ collateralDecimals: number;
2373
+ refererTradingAccount: PublicKey;
2374
+ padding: BN[] | BN[];
2375
+ nftMint: PublicKey;
2376
+ level: number;
2377
+ voltagePoints: BN;
2378
+ stats: {
2379
+ volumeUsd: BN;
2380
+ lpRewardsUsd: BN;
2381
+ referralRebateUsd: BN;
2382
+ };
2383
+ snapshot: {
2384
+ volumeUsd: BN;
2385
+ lpRewardsUsd: BN;
2386
+ referralRebateUsd: BN;
2387
+ };
1978
2388
  }>[]>;
1979
2389
  getAllPositions: () => Promise<import("@coral-xyz/anchor").ProgramAccount<{
1980
2390
  pool: PublicKey;
@@ -1982,7 +2392,9 @@ export declare class PerpetualsClient {
1982
2392
  tokenAccount: PublicKey;
1983
2393
  decimals: number;
1984
2394
  isStable: boolean;
2395
+ depegAdjustment: boolean;
1985
2396
  isVirtual: boolean;
2397
+ distributeRewards: boolean;
1986
2398
  oracle: {
1987
2399
  oracleAccount: PublicKey;
1988
2400
  customOracleAccount: PublicKey;
@@ -1990,15 +2402,12 @@ export declare class PerpetualsClient {
1990
2402
  none?: Record<string, never>;
1991
2403
  custom?: Record<string, never>;
1992
2404
  pyth?: Record<string, never>;
1993
- backup?: Record<string, never>;
1994
2405
  };
1995
- maxDeviationThreshold: BN;
1996
- maxPriceError: BN;
1997
- maxPriceAgeSec: number;
2406
+ maxDivergenceBps: BN;
2407
+ maxConfBps: BN;
2408
+ maxPriceAgeSec: BN;
1998
2409
  };
1999
2410
  pricing: {
2000
- useEma: boolean;
2001
- useUnrealizedPnlInAum: boolean;
2002
2411
  tradeSpreadLong: BN;
2003
2412
  tradeSpreadShort: BN;
2004
2413
  swapSpread: BN;
@@ -2006,8 +2415,7 @@ export declare class PerpetualsClient {
2006
2415
  maxInitialLeverage: BN;
2007
2416
  maxLeverage: BN;
2008
2417
  minCollateralUsd: BN;
2009
- minTimeSeconds: BN;
2010
- maxPayoffMult: BN;
2418
+ delaySeconds: BN;
2011
2419
  maxUtilization: BN;
2012
2420
  maxPositionLockedUsd: BN;
2013
2421
  maxTotalLockedUsd: BN;
@@ -2018,7 +2426,17 @@ export declare class PerpetualsClient {
2018
2426
  allowRemoveLiquidity: boolean;
2019
2427
  allowOpenPosition: boolean;
2020
2428
  allowClosePosition: boolean;
2021
- allowPnlWithdrawal: boolean;
2429
+ allowCollateralWithdrawal: boolean;
2430
+ allowSizeChange: boolean;
2431
+ allowLiquidation: boolean;
2432
+ allowFlpStaking: boolean;
2433
+ allowFeeDistribution: boolean;
2434
+ allowUngatedTrading: boolean;
2435
+ allowFeeDiscounts: boolean;
2436
+ allowReferralRebates: boolean;
2437
+ } | {
2438
+ allowOpenPosition: boolean;
2439
+ allowClosePosition: boolean;
2022
2440
  allowCollateralWithdrawal: boolean;
2023
2441
  allowSizeChange: boolean;
2024
2442
  };
@@ -2027,8 +2445,6 @@ export declare class PerpetualsClient {
2027
2445
  fixed?: Record<string, never>;
2028
2446
  linear?: Record<string, never>;
2029
2447
  };
2030
- ratioMult: BN;
2031
- utilizationMult: BN;
2032
2448
  swapIn: {
2033
2449
  minFee: BN;
2034
2450
  targetFee: BN;
@@ -2039,6 +2455,16 @@ export declare class PerpetualsClient {
2039
2455
  targetFee: BN;
2040
2456
  maxFee: BN;
2041
2457
  };
2458
+ stableSwapIn: {
2459
+ minFee: BN;
2460
+ targetFee: BN;
2461
+ maxFee: BN;
2462
+ };
2463
+ stableSwapOut: {
2464
+ minFee: BN;
2465
+ targetFee: BN;
2466
+ maxFee: BN;
2467
+ };
2042
2468
  addLiquidity: {
2043
2469
  minFee: BN;
2044
2470
  targetFee: BN;
@@ -2052,8 +2478,6 @@ export declare class PerpetualsClient {
2052
2478
  openPosition: BN;
2053
2479
  closePosition: BN;
2054
2480
  removeCollateral: BN;
2055
- liquidation: BN;
2056
- protocolShare: BN;
2057
2481
  };
2058
2482
  borrowRate: {
2059
2483
  baseRate: BN;
@@ -2061,65 +2485,68 @@ export declare class PerpetualsClient {
2061
2485
  slope2: BN;
2062
2486
  optimalUtilization: BN;
2063
2487
  };
2488
+ rewardThreshold: BN;
2064
2489
  assets: {
2065
2490
  collateral: BN;
2066
- protocolFees: BN;
2067
2491
  owned: BN;
2068
2492
  locked: BN;
2069
2493
  };
2070
- collectedFees: {
2071
- swapUsd: BN;
2072
- addLiquidityUsd: BN;
2073
- removeLiquidityUsd: BN;
2074
- openPositionUsd: BN;
2075
- closePositionUsd: BN;
2076
- liquidationUsd: BN;
2077
- };
2078
- volumeStats: {
2079
- swapUsd: BN;
2080
- addLiquidityUsd: BN;
2081
- removeLiquidityUsd: BN;
2082
- openPositionUsd: BN;
2083
- closePositionUsd: BN;
2084
- liquidationUsd: BN;
2085
- };
2086
- tradeStats: {
2087
- profitUsd: BN;
2088
- lossUsd: BN;
2089
- oiLong: BN;
2090
- oiShort: BN;
2091
- };
2092
- longPositions: {
2093
- openPositions: BN;
2094
- collateralUsd: BN;
2095
- sizeUsd: BN;
2096
- borrowSizeUsd: BN;
2097
- lockedAmount: BN;
2098
- averagePrice: BN;
2099
- totalQuantity: BN;
2100
- cumulativeInterestUsd: BN;
2101
- cumulativeInterestSnapshot: BN;
2102
- collateralAmount: BN;
2103
- };
2104
- shortPositions: {
2105
- openPositions: BN;
2106
- collateralUsd: BN;
2107
- sizeUsd: BN;
2108
- borrowSizeUsd: BN;
2109
- lockedAmount: BN;
2110
- averagePrice: BN;
2111
- totalQuantity: BN;
2112
- cumulativeInterestUsd: BN;
2113
- cumulativeInterestSnapshot: BN;
2114
- collateralAmount: BN;
2494
+ feesStats: {
2495
+ accrued: BN;
2496
+ distributed: BN;
2497
+ paid: BN;
2498
+ rewardPerLpStaked: BN;
2499
+ protocolFee: BN;
2115
2500
  };
2116
2501
  borrowRateState: {
2117
2502
  currentRate: BN;
2118
- cumulativeInterest: BN;
2503
+ cumulativeLockFee: BN;
2119
2504
  lastUpdate: BN;
2120
2505
  };
2121
2506
  bump: number;
2122
2507
  tokenAccountBump: number;
2508
+ owner: PublicKey;
2509
+ stakeStats: {
2510
+ pendingActivation: BN;
2511
+ activeAmount: BN;
2512
+ pendingDeactivation: BN;
2513
+ deactivatedAmount: BN;
2514
+ };
2515
+ rewardSnapshot: BN;
2516
+ unclaimedRewards: BN;
2517
+ feeShareBps: BN;
2518
+ isInitialized: boolean;
2519
+ targetCustody: PublicKey;
2520
+ collateralCustody: PublicKey;
2521
+ side: {
2522
+ none?: Record<string, never>;
2523
+ long?: Record<string, never>;
2524
+ short?: Record<string, never>;
2525
+ };
2526
+ correlation: boolean;
2527
+ maxPayoffBps: BN;
2528
+ openInterest: BN;
2529
+ collectivePosition: {
2530
+ openPositions: BN;
2531
+ updateTime: BN;
2532
+ averageEntryPrice: {
2533
+ price: BN;
2534
+ exponent: number;
2535
+ };
2536
+ sizeAmount: BN;
2537
+ sizeUsd: BN;
2538
+ lockedAmount: BN;
2539
+ lockedUsd: BN;
2540
+ collateralAmount: BN;
2541
+ collateralUsd: BN;
2542
+ unsettledFeeUsd: BN;
2543
+ cumulativeLockFeeSnapshot: BN;
2544
+ sizeDecimals: number;
2545
+ lockedDecimals: number;
2546
+ collateralDecimals: number;
2547
+ };
2548
+ targetCustodyId: BN;
2549
+ collateralCustodyId: BN;
2123
2550
  numSigners: number;
2124
2551
  numSigned: number;
2125
2552
  minSignatures: number;
@@ -2134,60 +2561,104 @@ export declare class PerpetualsClient {
2134
2561
  ema: BN;
2135
2562
  publishTime: BN;
2136
2563
  pools: PublicKey[];
2564
+ collections: PublicKey[];
2565
+ voltageMultiplier: {
2566
+ volume: BN;
2567
+ rewards: BN;
2568
+ rebates: BN;
2569
+ };
2570
+ tradingDiscount: BN[];
2571
+ referralRebate: BN[];
2572
+ referralDiscount: BN;
2573
+ inceptionTime: BN;
2137
2574
  transferAuthorityBump: number;
2138
2575
  perpetualsBump: number;
2139
- inceptionTime: BN;
2140
2576
  name: string;
2577
+ flpMint: PublicKey;
2578
+ oracleAuthority: PublicKey;
2579
+ flpTokenAccount: PublicKey;
2580
+ rewardCustody: PublicKey;
2141
2581
  custodies: PublicKey[];
2142
2582
  ratios: {
2143
2583
  target: BN;
2144
2584
  min: BN;
2145
2585
  max: BN;
2146
2586
  }[];
2587
+ markets: PublicKey[];
2588
+ maxAumUsd: BN;
2147
2589
  aumUsd: BN;
2148
- lpTokenBump: number;
2149
- owner: PublicKey;
2590
+ totalStaked: {
2591
+ pendingActivation: BN;
2592
+ activeAmount: BN;
2593
+ pendingDeactivation: BN;
2594
+ deactivatedAmount: BN;
2595
+ };
2596
+ stakingFeeShareBps: BN;
2597
+ flpMintBump: number;
2598
+ flpTokenAccountBump: number;
2599
+ market: PublicKey;
2150
2600
  delegate: PublicKey;
2151
- custody: PublicKey;
2152
- collateralCustody: PublicKey;
2153
2601
  openTime: BN;
2154
2602
  updateTime: BN;
2155
- side: {
2156
- none?: Record<string, never>;
2157
- long?: Record<string, never>;
2158
- short?: Record<string, never>;
2603
+ entryPrice: {
2604
+ price: BN;
2605
+ exponent: number;
2159
2606
  };
2607
+ sizeAmount: BN;
2160
2608
  sizeUsd: BN;
2161
- borrowSizeUsd: BN;
2162
- collateralUsd: BN;
2163
- unsettledAmount: BN;
2164
- unrealizedLossUsd: BN;
2165
- cumulativeInterestSnapshot: BN;
2166
2609
  lockedAmount: BN;
2610
+ lockedUsd: BN;
2167
2611
  collateralAmount: BN;
2168
- sizeAmount: BN;
2612
+ collateralUsd: BN;
2613
+ unsettledAmount: BN;
2614
+ unsettledFeesUsd: BN;
2615
+ cumulativeLockFeeSnapshot: BN;
2616
+ takeProfitPrice: {
2617
+ price: BN;
2618
+ exponent: number;
2619
+ };
2620
+ stopLossPrice: {
2621
+ price: BN;
2622
+ exponent: number;
2623
+ };
2624
+ sizeDecimals: number;
2625
+ lockedDecimals: number;
2626
+ collateralDecimals: number;
2627
+ refererTradingAccount: PublicKey;
2628
+ padding: BN[] | BN[];
2629
+ nftMint: PublicKey;
2630
+ level: number;
2631
+ voltagePoints: BN;
2632
+ stats: {
2633
+ volumeUsd: BN;
2634
+ lpRewardsUsd: BN;
2635
+ referralRebateUsd: BN;
2636
+ };
2637
+ snapshot: {
2638
+ volumeUsd: BN;
2639
+ lpRewardsUsd: BN;
2640
+ referralRebateUsd: BN;
2641
+ };
2169
2642
  }>[]>;
2170
2643
  getAccountDiscriminator: (name: string) => Buffer;
2171
2644
  log: (...message: string[]) => void;
2172
2645
  prettyPrint: (object: object) => void;
2173
2646
  init: (admins: PublicKey[], config: any) => Promise<void>;
2174
2647
  setAdminSigners: (admins: PublicKey[], minSignatures: number) => Promise<void>;
2175
- addPool: (name: string) => Promise<void>;
2648
+ addPool: (name: string, maxAumUsd: BN, permissions: Permissions, metadataSymbol: string, metadataTitle: string, metadataUri: string) => Promise<void>;
2176
2649
  removePool: (name: string) => Promise<void>;
2177
- addCustody: (poolName: string, tokenMint: PublicKey, isStable: boolean, isVirtual: boolean, oracle: OracleParams, pricing: PricingParams, permissions: Permissions, fees: Fees, borrowRate: BorrowRateParams, ratios: TokenRatios[]) => Promise<void>;
2650
+ addCustody: (poolName: string, tokenMint: PublicKey, isStable: boolean, isVirtual: boolean, oracle: OracleParams, pricing: PricingParams, permissions: Permissions, fees: Fees, borrowRate: BorrowRateParams, ratios: TokenRatios[], depegAdjustment: boolean) => Promise<void>;
2178
2651
  editCustody: (poolName: string, tokenMint: PublicKey, isStable: boolean, oracle: OracleParams, pricing: PricingParams, permissions: Permissions, fees: Fees, borrowRate: BorrowRateParams, ratios: TokenRatios[]) => Promise<void>;
2179
2652
  removeCustody: (poolName: string, tokenMint: PublicKey, ratios: TokenRatios[]) => Promise<void>;
2180
2653
  getLiquidationState: (wallet: PublicKey, poolName: string, tokenMint: PublicKey, collateralMint: PublicKey, side: PositionSide, poolConfig: PoolConfig) => Promise<any>;
2181
- validateCollectivePnl: (marketSymbol: string, collateralSymbol: string, poolConfig: PoolConfig, poolName: string, side: Side) => Promise<void>;
2182
- liquidate: (wallet: PublicKey, poolConfig: PoolConfig, tokenMint: PublicKey, collateralMint: PublicKey, side: PositionSide, receivingAccount: PublicKey, rewardsReceivingAccount: PublicKey) => Promise<string>;
2654
+ liquidate: (wallet: PublicKey, poolConfig: PoolConfig, tokenMint: PublicKey, collateralMint: PublicKey, side: PositionSide) => Promise<string>;
2183
2655
  getOraclePriceView: (poolName: string, tokenMint: PublicKey, ema: boolean) => Promise<any>;
2184
2656
  getAddLiquidityAmountAndFeeView: (poolName: string, tokenMint: PublicKey, amount: BN) => Promise<any>;
2185
2657
  getRemoveLiquidityAmountAndFeeView: (poolName: string, tokenMint: PublicKey, lpAmount: BN) => Promise<any>;
2186
- getEntryPriceAndFeeView: (poolName: string, tokenMint: PublicKey, collateral: BN, size: BN, side: PositionSide) => Promise<any>;
2187
- getExitPriceAndFeeView: (wallet: PublicKey, poolName: string, tokenMint: PublicKey, side: PositionSide) => Promise<any>;
2188
- getLiquidationPriceView: (wallet: PublicKey, poolName: string, tokenMint: PublicKey, side: PositionSide, addCollateral?: BN, removeCollateral?: BN) => Promise<any>;
2189
- getPnlView: (wallet: PublicKey, poolName: string, tokenMint: PublicKey, side: PositionSide) => Promise<any>;
2190
- getSwapAmountAndFeesView: (poolName: string, tokenMintIn: PublicKey, tokenMintOut: PublicKey, amountIn: BN) => Promise<any>;
2658
+ getEntryPriceAndFeeView: (tokenMint: PublicKey, collateralMint: PublicKey, collateral: BN, size: BN, side: PositionSide, poolConfig: PoolConfig) => Promise<any>;
2659
+ getExitPriceAndFeeView: (wallet: PublicKey, tokenMint: PublicKey, collateralMint: PublicKey, side: PositionSide, poolConfig: PoolConfig) => Promise<any>;
2660
+ getPnlView: (wallet: PublicKey, tokenMint: PublicKey, collateralMint: PublicKey, side: PositionSide, poolConfig: PoolConfig) => Promise<any>;
2661
+ getSwapAmountAndFeesView: (poolName: string, tokenMintIn: PublicKey, tokenMintOut: PublicKey, amountIn: BN, useFeePool: boolean) => Promise<any>;
2191
2662
  getAumView: (poolName: string) => Promise<any>;
2192
2663
  getAddLiquidityAmountAndFeeSync: (amountIn: BN, poolAccount: PoolAccount, inputTokenPrice: OraclePrice, inputTokenEmaPrice: OraclePrice, inputTokenCustodyAccount: CustodyAccount, lpTokenSupplyAmount: BN, poolAumUsdMax: BN, poolConfig: PoolConfig) => AddLiquidityAmountAndFee;
2193
2664
  getRemoveLiquidityAmountAndFeeSync: (lpAmountIn: BN, poolAccount: PoolAccount, outputTokenPrice: OraclePrice, outputTokenEmaPrice: OraclePrice, outputTokenCustodyAccount: CustodyAccount, lpTokenSupply: BN, poolAumUsdMax: BN, poolConfig: PoolConfig) => RemoveLiquidityAmountAndFee;
@@ -2204,32 +2675,34 @@ export declare class PerpetualsClient {
2204
2675
  checkIfPriceStaleOrCustom: (price: OraclePrice, emaPrice: OraclePrice, custodyAccount: CustodyAccount, timestampInSeconds: BN) => boolean;
2205
2676
  getAveragePriceSync: (price1: BN, size1: BN, price2: BN, size2: BN) => BN;
2206
2677
  getLeverageSync: (sizeUsd: BN, collateralAmount: BN, collateralMinOraclePrice: OraclePrice, collateralTokenDecimals: number, pnlUsd: BN) => BN;
2207
- getLeverageAtAmountEntryWithSwapSync: (positionAccount: PositionAccount | null, inputDeltaAmount: BN, sizeDeltaAmount: BN, side: Side, poolAccount: PoolAccount, inputTokenPrice: OraclePrice, inputTokenEmaPrice: OraclePrice, inputTokenCustodyAccount: CustodyAccount, collateralTokenPrice: OraclePrice, collateralTokenEmaPrice: OraclePrice, collateralTokenCustodyAccount: CustodyAccount, marketTokenPrice: OraclePrice, marketTokenEmaPrice: OraclePrice, marketTokenCustodyAccount: CustodyAccount, poolAumUsdMax: BN, poolConfig: PoolConfig, pnlUsd: BN) => BN;
2208
- getEntryPriceAndFeeSync: (positionAccount: PositionAccount | null, collateralDeltaAmount: BN, sizeDeltaAmount: BN, side: Side, marketPrice: OraclePrice, marketEmaPrice: OraclePrice, marketCustodyAccount: CustodyAccount, collateralPrice: OraclePrice, collateralEmaPrice: OraclePrice, collateralCustodyAccount: CustodyAccount, currentTimestamp: BN) => EntryPriceAndFee;
2209
- getEntryPriceSync: (side: Side, marketPrice: OraclePrice, marketEmaPrice: OraclePrice, marketCustodyAccount: CustodyAccount) => BN;
2210
- getPriceAfterSlippage(isEntry: boolean, slippageBps: BN, marketPrice: OraclePrice, marketEmaPrice: OraclePrice, side: Side, custody: CustodyAccount): BN;
2211
- getExitPriceAndFeeSync: (positionAccount: PositionAccount, collateralDeltaAmount: BN, sizeDeltaAmount: BN, side: Side, marketPrice: OraclePrice, marketEmaPrice: OraclePrice, marketCustodyAccount: CustodyAccount, collateralPrice: OraclePrice, collateralEmaPrice: OraclePrice, collateralCustodyAccount: CustodyAccount, currentTimestamp: BN) => ExitPriceAndFee;
2212
- getExitPriceSync: (side: Side, marketPrice: OraclePrice, marketEmaPrice: OraclePrice, marketCustodyAccount: CustodyAccount) => BN;
2213
- getSizeAmountFromLeverageAndCollateral: (collateralAmtWithFee: BN, leverage: string, marketToken: Token, collateralToken: Token, side: Side, marketPrice: OraclePrice, marketEmaPrice: OraclePrice, marketCustodyAccount: CustodyAccount, collateralPrice: OraclePrice, collateralEmaPrice: OraclePrice, collateralCustodyAccount: CustodyAccount) => BN;
2214
- getSizeAmountWithSwapSync: (amountIn: BN, leverage: string, side: Side, poolAccount: PoolAccount, inputTokenPrice: OraclePrice, inputTokenEmaPrice: OraclePrice, inputTokenCustodyAccount: CustodyAccount, collateralTokenPrice: OraclePrice, collateralTokenEmaPrice: OraclePrice, collateralTokenCustodyAccount: CustodyAccount, marketTokenPrice: OraclePrice, marketTokenEmaPrice: OraclePrice, marketTokenCustodyAccount: CustodyAccount, poolAumUsdMax: BN, poolConfig: PoolConfig) => BN;
2215
- getCollateralAmountWithFeeFromLeverageAndSize: (sizeAmount: BN, leverage: string, marketToken: Token, collateralToken: Token, side: Side, marketPrice: OraclePrice, marketEmaPrice: OraclePrice, marketCustodyAccount: CustodyAccount, collateralPrice: OraclePrice, collateralEmaPrice: OraclePrice, collateralCustodyAccount: CustodyAccount) => BN;
2216
- getCollateralAmountWithSwapSync: (sizeAmount: BN, leverage: string, side: Side, poolAccount: PoolAccount, inputTokenPrice: OraclePrice, inputTokenEmaPrice: OraclePrice, inputTokenCustodyAccount: CustodyAccount, collateralTokenPrice: OraclePrice, collateralTokenEmaPrice: OraclePrice, collateralTokenCustodyAccount: CustodyAccount, marketTokenPrice: OraclePrice, marketTokenEmaPrice: OraclePrice, marketTokenCustodyAccount: CustodyAccount, poolAumUsdMax: BN, poolConfig: PoolConfig) => BN;
2217
- getDecreaseSizeCollateralAndFeeSync: (positionAccount: PositionAccount, sizeDeltaUsd: BN, keepLevSame: boolean, marketPrice: OraclePrice, marketEmaPrice: OraclePrice, marketCustodyAccount: CustodyAccount, collateralPrice: OraclePrice, collateralEmaPrice: OraclePrice, collateralCustodyAccount: CustodyAccount, currentTimestamp: BN) => RemoveCollateralData;
2218
- getFinalCloseAmountSync: (positionAccount: PositionAccount, marketPrice: OraclePrice, marketEmaPrice: OraclePrice, marketCustodyAccount: CustodyAccount, collateralPrice: OraclePrice, collateralEmaPrice: OraclePrice, collateralCustodyAccount: CustodyAccount, currentTimestamp: BN) => {
2219
- finalAmount: BN;
2220
- feeUsd: BN;
2678
+ getLeverageAtAmountEntryWithSwapSync: (positionAccount: PositionAccount | null, inputDeltaAmount: BN, sizeDeltaAmount: BN, side: Side, poolAccount: PoolAccount, inputTokenPrice: OraclePrice, inputTokenEmaPrice: OraclePrice, inputTokenCustodyAccount: CustodyAccount, collateralTokenPrice: OraclePrice, collateralTokenEmaPrice: OraclePrice, collateralTokenCustodyAccount: CustodyAccount, targetTokenPrice: OraclePrice, targetTokenEmaPrice: OraclePrice, targetTokenCustodyAccount: CustodyAccount, poolAumUsdMax: BN, poolConfig: PoolConfig, pnlUsd: BN) => BN;
2679
+ getEntryPriceAndFeeSync: (positionAccount: PositionAccount | null, marketCorrelation: boolean, collateralDeltaAmount: BN, sizeDeltaAmount: BN, side: Side, targetPrice: OraclePrice, targetEmaPrice: OraclePrice, targetCustodyAccount: CustodyAccount, collateralPrice: OraclePrice, collateralEmaPrice: OraclePrice, collateralCustodyAccount: CustodyAccount, currentTimestamp: BN, discountBps?: BN) => EntryPriceAndFee;
2680
+ getEntryPriceUsdSync: (side: Side, targetPrice: OraclePrice, targetEmaPrice: OraclePrice, targetCustodyAccount: CustodyAccount) => BN;
2681
+ getPriceAfterSlippageOld(isEntry: boolean, slippageBps: BN, targetPrice: OraclePrice, targetEmaPrice: OraclePrice, side: Side, custody: CustodyAccount): ContractOraclePrice;
2682
+ getPriceAfterSlippage(isEntry: boolean, slippageBps: BN, targetPrice: OraclePrice, side: Side): ContractOraclePrice;
2683
+ getExitFeeSync: (positionAccount: PositionAccount, targetCustody: CustodyAccount, collateralCustodyAccount: CustodyAccount, collateralPrice: OraclePrice, collateralEmaPrice: OraclePrice) => {
2684
+ exitFeeAmount: BN;
2685
+ exitFeeUsd: BN;
2686
+ };
2687
+ getExitPriceAndFeeSync: (positionAccount: PositionAccount, marketCorrelation: boolean, collateralDeltaAmount: BN, sizeDeltaAmount: BN, side: Side, targetPrice: OraclePrice, targetEmaPrice: OraclePrice, targetCustodyAccount: CustodyAccount, collateralPrice: OraclePrice, collateralEmaPrice: OraclePrice, collateralCustodyAccount: CustodyAccount, currentTimestamp: BN, discountBps?: BN) => ExitPriceAndFee;
2688
+ getExitPriceSync: (side: Side, targetPrice: OraclePrice, targetEmaPrice: OraclePrice, targetCustodyAccount: CustodyAccount) => BN;
2689
+ getExitOraclePriceSync: (side: Side, targetPrice: OraclePrice, targetEmaPrice: OraclePrice, targetCustodyAccount: CustodyAccount) => OraclePrice;
2690
+ getSizeAmountFromLeverageAndCollateral: (collateralAmtWithFee: BN, leverage: string, marketToken: Token, collateralToken: Token, side: Side, targetPrice: OraclePrice, targetEmaPrice: OraclePrice, targetCustodyAccount: CustodyAccount, collateralPrice: OraclePrice, collateralEmaPrice: OraclePrice, collateralCustodyAccount: CustodyAccount, discountBps?: BN) => BN;
2691
+ getSizeAmountWithSwapSync: (amountIn: BN, leverage: string, side: Side, poolAccount: PoolAccount, inputTokenPrice: OraclePrice, inputTokenEmaPrice: OraclePrice, inputTokenCustodyAccount: CustodyAccount, collateralTokenPrice: OraclePrice, collateralTokenEmaPrice: OraclePrice, collateralTokenCustodyAccount: CustodyAccount, targetTokenPrice: OraclePrice, targetTokenEmaPrice: OraclePrice, targetTokenCustodyAccount: CustodyAccount, poolAumUsdMax: BN, poolConfig: PoolConfig, discountBps?: BN) => BN;
2692
+ getCollateralAmountWithFeeFromLeverageAndSize: (sizeAmount: BN, leverage: string, marketToken: Token, collateralToken: Token, side: Side, targetPrice: OraclePrice, targetEmaPrice: OraclePrice, targetCustodyAccount: CustodyAccount, collateralPrice: OraclePrice, collateralEmaPrice: OraclePrice, collateralCustodyAccount: CustodyAccount, discountBps?: BN) => BN;
2693
+ getCollateralAmountWithSwapSync: (sizeAmount: BN, leverage: string, side: Side, poolAccount: PoolAccount, inputTokenPrice: OraclePrice, inputTokenEmaPrice: OraclePrice, inputTokenCustodyAccount: CustodyAccount, collateralTokenPrice: OraclePrice, collateralTokenEmaPrice: OraclePrice, collateralTokenCustodyAccount: CustodyAccount, targetTokenPrice: OraclePrice, targetTokenEmaPrice: OraclePrice, targetTokenCustodyAccount: CustodyAccount, poolAumUsdMax: BN, poolConfig: PoolConfig) => BN;
2694
+ getDecreaseSizeCollateralAndFeeSync: (positionAccount: PositionAccount, marketCorrelation: boolean, sizeDeltaUsd: BN, keepLevSame: boolean, targetPrice: OraclePrice, targetEmaPrice: OraclePrice, marketConfig: MarketConfig, targetCustodyAccount: CustodyAccount, collateralPrice: OraclePrice, collateralEmaPrice: OraclePrice, collateralCustodyAccount: CustodyAccount, currentTimestamp: BN, side: Side, poolConfig: PoolConfig, discountBps?: BN) => RemoveCollateralData;
2695
+ getFinalCloseAmountSync: (positionAccount: PositionAccount, marketCorrelation: boolean, side: Side, targetPrice: OraclePrice, targetEmaPrice: OraclePrice, targetCustodyAccount: CustodyAccount, collateralPrice: OraclePrice, collateralEmaPrice: OraclePrice, collateralCustodyAccount: CustodyAccount, currentTimestamp: BN, poolConfig: PoolConfig) => {
2696
+ closeAmount: BN;
2697
+ feesAmount: BN;
2221
2698
  };
2222
- getMaxWithdrawableAmountSync: (positionAccount: PositionAccount, marketPrice: OraclePrice, marketEmaPrice: OraclePrice, marketCustodyAccount: CustodyAccount, collateralPrice: OraclePrice, collateralEmaPrice: OraclePrice, collateralCustodyAccount: CustodyAccount, currentTimestamp: BN, errorBandwidthPercentageUi?: number) => BN;
2223
- getCumulativeInterestSync: (custodyAccount: CustodyAccount, currentTimestamp: BN) => BN;
2224
- getInterestAmountUsdForPosition: (position: PositionAccount, collateralCustodyAccount: CustodyAccount, currentTimestamp: BN) => BN;
2225
- getLiquidationPriceSync: (collateralAmount: BN, sizeAmount: BN, entryPrice: BN, interestAmountUsd: BN, unrealizedLossUsd: BN, side: Side, custodyAccount: CustodyAccount, collateralPrice: OraclePrice, collateralEmaPrice: OraclePrice, collateralCustodyAccount: CustodyAccount) => BN;
2226
- getPnlSync: (positionAccount: PositionAccount, marketTokenPrice: OraclePrice, marketTokenEmaPrice: OraclePrice, marketCustodyAccount: CustodyAccount, collateralPrice: OraclePrice, collateralEmaPrice: OraclePrice, collateralCustodyAccount: CustodyAccount, currentTimestamp: BN) => {
2699
+ getMaxWithdrawableAmountSync: (positionAccount: PositionAccount, targetPrice: OraclePrice, targetEmaPrice: OraclePrice, targetCustodyAccount: CustodyAccount, collateralPrice: OraclePrice, collateralEmaPrice: OraclePrice, collateralCustodyAccount: CustodyAccount, currentTimestamp: BN, poolConfig: PoolConfig, errorBandwidthPercentageUi?: number) => BN;
2700
+ getCumulativeLockFeeSync: (custodyAccount: CustodyAccount, currentTimestamp: BN) => BN;
2701
+ getLockFeeUsdForPosition: (position: PositionAccount, collateralCustodyAccount: CustodyAccount, currentTimestamp: BN) => BN;
2702
+ getLiquidationPriceSync: (collateralAmount: BN, sizeAmount: BN, entryPriceUsd: BN, lockFeeUsd: BN, unsettledFeesUsd: BN, marketCorrelation: boolean, side: Side, custodyAccount: CustodyAccount, collateralPrice: OraclePrice, collateralEmaPrice: OraclePrice, collateralCustodyAccount: CustodyAccount, positionAccount: PositionAccount) => BN;
2703
+ getPnlSync: (positionAccount: PositionAccount, targetTokenPrice: OraclePrice, targetTokenEmaPrice: OraclePrice, targetCustodyAccount: CustodyAccount, collateralPrice: OraclePrice, collateralEmaPrice: OraclePrice, collateralCustodyAccount: CustodyAccount, currentTimestamp: BN, delay: BN, poolConfig: PoolConfig) => {
2227
2704
  profitUsd: BN;
2228
2705
  lossUsd: BN;
2229
- exitFeeUsd: BN;
2230
- borrowFeeUsd: BN;
2231
- exitFeeAmount: BN;
2232
- borrowFeeAmount: BN;
2233
2706
  };
2234
2707
  getSwapAmountAndFeesSync: (amountIn: BN, amountOut: BN, poolAccount: PoolAccount, inputTokenPrice: OraclePrice, inputTokenEmaPrice: OraclePrice, inputTokenCustodyAccount: CustodyAccount, outputTokenPrice: OraclePrice, outputTokenEmaPrice: OraclePrice, outputTokenCustodyAccount: CustodyAccount, poolAumUsdMax: BN, poolConfig: PoolConfig) => {
2235
2708
  minAmountOut: BN;
@@ -2237,48 +2710,51 @@ export declare class PerpetualsClient {
2237
2710
  feeIn: BN;
2238
2711
  feeOut: BN;
2239
2712
  };
2240
- getAssetsUnderManagementUsdSync: (poolAccount: PoolAccount, tokenPrices: OraclePrice[], tokenEmaPrices: OraclePrice[], custodies: CustodyAccount[], aum_calc_mode: AumCalcMode, currentTime: BN) => BN;
2241
- openPosition: (marketSymbol: string, collateralSymbol: string, priceAfterSlippage: BN, collateralWithfee: BN, size: BN, side: Side, poolConfig: PoolConfig, skipBalanceChecks?: boolean) => Promise<{
2713
+ getAssetsUnderManagementUsdSync: (poolAccount: PoolAccount, tokenPrices: OraclePrice[], tokenEmaPrices: OraclePrice[], custodies: CustodyAccount[], markets: MarketAccount[], aumCalcMode: AumCalcMode, currentTime: BN, poolConfig: PoolConfig) => {
2714
+ poolAmountUsd: BN;
2715
+ poolEquityUsd: BN;
2716
+ };
2717
+ openPosition: (targetSymbol: string, collateralSymbol: string, priceWithSlippage: ContractOraclePrice, collateralWithfee: BN, size: BN, side: Side, poolConfig: PoolConfig, nftTradingAccount: PublicKey, nftReferralAccount: PublicKey, nftRebateTokenAccount: PublicKey, privilege: Privilege, skipBalanceChecks?: boolean) => Promise<{
2242
2718
  instructions: TransactionInstruction[];
2243
2719
  additionalSigners: Signer[];
2244
2720
  }>;
2245
- openPositionWithSwap: (marketSymbol: string, inputSymbol: string, collateralSymbol: string, amountIn: BN, minAmountOut: BN, priceAfterSlippage: BN, size: BN, side: Side, poolConfig: PoolConfig, skipBalanceChecks?: boolean) => Promise<{
2721
+ openPositionWithSwap: (targetSymbol: string, collateralSymbol: string, inputSymbol: string, amountIn: BN, minAmountOut: BN, priceWithSlippage: ContractOraclePrice, size: BN, side: Side, swapPoolConfig: PoolConfig, positionPoolConfig: PoolConfig, nftTradingAccount: PublicKey, nftReferralAccount: PublicKey, nftRebateTokenAccount: PublicKey, privilege: Privilege, skipBalanceChecks?: boolean) => Promise<{
2246
2722
  instructions: TransactionInstruction[];
2247
2723
  additionalSigners: Signer[];
2248
2724
  }>;
2249
- closePosition: (marketSymbol: string, collateralSymbol: string, priceAfterSlippage: BN, side: Side, poolConfig: PoolConfig, createUserATA?: boolean, closeUsersWSOLATA?: boolean) => Promise<{
2725
+ closePosition: (marketSymbol: string, collateralSymbol: string, priceWithSlippage: ContractOraclePrice, side: Side, poolConfig: PoolConfig, nftTradingAccount: PublicKey, nftReferralAccount: PublicKey, nftRebateTokenAccount: PublicKey, privilege: Privilege, createUserATA?: boolean, closeUsersWSOLATA?: boolean) => Promise<{
2250
2726
  instructions: TransactionInstruction[];
2251
2727
  additionalSigners: Signer[];
2252
2728
  }>;
2253
- closePositionWithSwap: (marketSymbol: string, outputSymbol: string, collateralSymbol: string, minAmountOut: BN, priceAfterSlippage: BN, side: Side, poolConfig: PoolConfig) => Promise<{
2729
+ closePositionWithSwap: (targetSymbol: string, outputSymbol: string, collateralSymbol: string, minAmountOut: BN, priceAfterSlippage: ContractOraclePrice, side: Side, swapPoolConfig: PoolConfig, positionPoolConfig: PoolConfig, nftTradingAccount: PublicKey, nftReferralAccount: PublicKey, nftRebateTokenAccount: PublicKey, privilege: Privilege) => Promise<{
2254
2730
  instructions: TransactionInstruction[];
2255
2731
  additionalSigners: Signer[];
2256
2732
  }>;
2257
- swap: (userInputTokenSymbol: string, userOutputTokenSymbol: string, amountIn: BN, minAmountOut: BN, poolConfig: PoolConfig, createUserATA?: boolean, unWrapSol?: boolean, skipBalanceChecks?: boolean) => Promise<{
2733
+ swap: (userInputTokenSymbol: string, userOutputTokenSymbol: string, amountIn: BN, minAmountOut: BN, poolConfig: PoolConfig, useFeesPool?: boolean, createUserATA?: boolean, unWrapSol?: boolean, skipBalanceChecks?: boolean) => Promise<{
2258
2734
  instructions: TransactionInstruction[];
2259
2735
  additionalSigners: Signer[];
2260
2736
  }>;
2261
- addCollateral: (collateralWithFee: BN, marketSymbol: string, collateralSymbol: string, positionPubKey: PublicKey, poolConfig: PoolConfig, skipBalanceChecks?: boolean) => Promise<{
2737
+ addCollateral: (collateralWithFee: BN, targetSymbol: string, collateralSymbol: string, side: Side, positionPubKey: PublicKey, poolConfig: PoolConfig, skipBalanceChecks?: boolean) => Promise<{
2262
2738
  instructions: TransactionInstruction[];
2263
2739
  additionalSigners: Signer[];
2264
2740
  }>;
2265
- addCollateralWithSwap: (marketSymbol: string, inputSymbol: string, collateralSymbol: string, amountIn: BN, minAmountOut: BN, positionPubKey: PublicKey, poolConfig: PoolConfig, skipBalanceChecks?: boolean) => Promise<{
2741
+ addCollateralWithSwap: (targetSymbol: string, inputSymbol: string, collateralSymbol: string, amountIn: BN, minAmountOut: BN, side: Side, positionPubKey: PublicKey, swapPoolConfig: PoolConfig, positionPoolConfig: PoolConfig, skipBalanceChecks?: boolean) => Promise<{
2266
2742
  instructions: TransactionInstruction[];
2267
2743
  additionalSigners: Signer[];
2268
2744
  }>;
2269
- removeCollateral: (collateralWithFee: BN, marketSymbol: string, collateralSymbol: string, positionPubKey: PublicKey, poolConfig: PoolConfig, createUserATA?: boolean, closeUsersWSOLATA?: boolean) => Promise<{
2745
+ removeCollateral: (collateralWithFee: BN, marketSymbol: string, collateralSymbol: string, side: Side, positionPubKey: PublicKey, poolConfig: PoolConfig, createUserATA?: boolean, closeUsersWSOLATA?: boolean) => Promise<{
2270
2746
  instructions: TransactionInstruction[];
2271
2747
  additionalSigners: Signer[];
2272
2748
  }>;
2273
- RemoveCollateralWithSwap: (marketSymbol: string, collateralSymbol: string, outputSymbol: string, minAmountOut: BN, collateralDelta: BN, side: Side, poolConfig: PoolConfig) => Promise<{
2749
+ removeCollateralWithSwap: (targetSymbol: string, collateralSymbol: string, outputSymbol: string, minAmountOut: BN, collateralDelta: BN, side: Side, swapPoolConfig: PoolConfig, positionPoolConfig: PoolConfig) => Promise<{
2274
2750
  instructions: TransactionInstruction[];
2275
2751
  additionalSigners: Signer[];
2276
2752
  }>;
2277
- increaseSize: (marketSymbol: string, collateralSymbol: string, positionPubKey: PublicKey, poolConfig: PoolConfig, price: BN, sizeDelta: BN) => Promise<{
2753
+ increaseSize: (targetSymbol: string, collateralSymbol: string, positionPubKey: PublicKey, side: Side, poolConfig: PoolConfig, priceWithSlippage: ContractOraclePrice, sizeDelta: BN, nftTradingAccount: PublicKey, nftReferralAccount: PublicKey, nftRebateTokenAccount: PublicKey, privilege: Privilege) => Promise<{
2278
2754
  instructions: TransactionInstruction[];
2279
2755
  additionalSigners: Signer[];
2280
2756
  }>;
2281
- decreaseSize: (marketSymbol: string, collateralSymbol: string, positionPubKey: PublicKey, poolConfig: PoolConfig, priceAfterSlippage: BN, sizeDelta: BN) => Promise<{
2757
+ decreaseSize: (targetSymbol: string, collateralSymbol: string, side: Side, positionPubKey: PublicKey, poolConfig: PoolConfig, priceWithSlippage: ContractOraclePrice, sizeDelta: BN, nftTradingAccount: PublicKey, nftReferralAccount: PublicKey, nftRebateTokenAccount: PublicKey, privilege: Privilege) => Promise<{
2282
2758
  instructions: TransactionInstruction[];
2283
2759
  additionalSigners: Signer[];
2284
2760
  }>;
@@ -2290,5 +2766,53 @@ export declare class PerpetualsClient {
2290
2766
  instructions: TransactionInstruction[];
2291
2767
  additionalSigners: Signer[];
2292
2768
  }>;
2769
+ addReferral: (nftTradingAccount: PublicKey, nftReferralAccount: PublicKey) => Promise<{
2770
+ instructions: TransactionInstruction[];
2771
+ additionalSigners: Signer[];
2772
+ }>;
2773
+ createNftTradingAccount: (nftMint: PublicKey, poolConfig: PoolConfig) => Promise<{
2774
+ instructions: TransactionInstruction[];
2775
+ additionalSigners: Signer[];
2776
+ }>;
2777
+ updateNftAccount: (nftMint: PublicKey) => Promise<{
2778
+ instructions: TransactionInstruction[];
2779
+ additionalSigners: Signer[];
2780
+ }>;
2781
+ levelUp: (poolConfig: PoolConfig, nftMint: PublicKey) => Promise<{
2782
+ instructions: TransactionInstruction[];
2783
+ additionalSigners: Signer[];
2784
+ }>;
2785
+ initStake: (rewardSymbol: string, poolConfig: PoolConfig) => Promise<{
2786
+ instructions: TransactionInstruction[];
2787
+ additionalSigners: Signer[];
2788
+ }>;
2789
+ depositStake: (depositAmount: BN, poolConfig: PoolConfig) => Promise<{
2790
+ instructions: TransactionInstruction[];
2791
+ additionalSigners: Signer[];
2792
+ }>;
2793
+ activeStake: (rewardSymbol: string, poolName: string, poolConfig: PoolConfig) => Promise<{
2794
+ instructions: TransactionInstruction[];
2795
+ additionalSigners: Signer[];
2796
+ }>;
2797
+ unstakeRequest: (unstakeAmount: BN, poolName: string, poolConfig: PoolConfig) => Promise<{
2798
+ instructions: TransactionInstruction[];
2799
+ additionalSigners: Signer[];
2800
+ }>;
2801
+ deactiveStake: (rewardSymbol: string, poolName: string, poolConfig: PoolConfig) => Promise<{
2802
+ instructions: TransactionInstruction[];
2803
+ additionalSigners: Signer[];
2804
+ }>;
2805
+ withdrawStake: (withdrawAmount: BN, poolName: string, poolConfig: PoolConfig) => Promise<{
2806
+ instructions: TransactionInstruction[];
2807
+ additionalSigners: Signer[];
2808
+ }>;
2809
+ setPoolConfig: (permissions: Permissions, oracleAuthority: PublicKey, maxAumUsd: BN, stakingFeeShareBps: BN, poolConfig: PoolConfig) => Promise<{
2810
+ instructions: TransactionInstruction[];
2811
+ additionalSigners: Signer[];
2812
+ }>;
2813
+ setPermissions: (permissions: Permissions) => Promise<{
2814
+ instructions: TransactionInstruction[];
2815
+ additionalSigners: Signer[];
2816
+ }>;
2293
2817
  sendTransaction(ixs: TransactionInstruction[], opts?: SendTransactionOpts): Promise<string>;
2294
2818
  }