flash-sdk 1.0.29 → 1.0.30

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.
@@ -47,13 +47,17 @@ export declare class PerpetualsClient {
47
47
  tokenAccount: PublicKey;
48
48
  decimals: number;
49
49
  isStable: boolean;
50
+ isVirtual: boolean;
50
51
  oracle: {
51
52
  oracleAccount: PublicKey;
53
+ customOracleAccount: PublicKey;
52
54
  oracleType: {
53
55
  none?: Record<string, never>;
54
- test?: Record<string, never>;
56
+ custom?: Record<string, never>;
55
57
  pyth?: Record<string, never>;
58
+ backup?: Record<string, never>;
56
59
  };
60
+ maxDifferenceThreshold: BN;
57
61
  maxPriceError: BN;
58
62
  maxPriceAgeSec: number;
59
63
  };
@@ -66,19 +70,12 @@ export declare class PerpetualsClient {
66
70
  minInitialLeverage: BN;
67
71
  maxInitialLeverage: BN;
68
72
  maxLeverage: BN;
73
+ minCollateralUsd: BN;
74
+ minTimeSeconds: BN;
69
75
  maxPayoffMult: BN;
70
76
  maxUtilization: BN;
71
77
  maxPositionLockedUsd: BN;
72
78
  maxTotalLockedUsd: BN;
73
- } | {
74
- useEma: boolean;
75
- useUnrealizedPnlInAum: boolean;
76
- tradeSpreadLong: BN;
77
- tradeSpreadShort: BN;
78
- swapSpread: BN;
79
- minInitialLeverage: BN;
80
- maxLeverage: BN;
81
- maxPayoffMult: BN;
82
79
  };
83
80
  permissions: {
84
81
  allowSwap: boolean;
@@ -97,14 +94,45 @@ export declare class PerpetualsClient {
97
94
  };
98
95
  ratioMult: BN;
99
96
  utilizationMult: BN;
100
- swapIn: BN;
101
- swapOut: BN;
102
- stableSwapIn: BN;
103
- stableSwapOut: BN;
104
- addLiquidity: BN;
105
- removeLiquidity: BN;
97
+ swapIn: {
98
+ baseRate: BN;
99
+ slope1: BN;
100
+ constant1: BN;
101
+ slope2: BN;
102
+ constant2: BN;
103
+ minFee: BN;
104
+ maxFee: BN;
105
+ };
106
+ swapOut: {
107
+ baseRate: BN;
108
+ slope1: BN;
109
+ constant1: BN;
110
+ slope2: BN;
111
+ constant2: BN;
112
+ minFee: BN;
113
+ maxFee: BN;
114
+ };
115
+ addLiquidity: {
116
+ baseRate: BN;
117
+ slope1: BN;
118
+ constant1: BN;
119
+ slope2: BN;
120
+ constant2: BN;
121
+ minFee: BN;
122
+ maxFee: BN;
123
+ };
124
+ removeLiquidity: {
125
+ baseRate: BN;
126
+ slope1: BN;
127
+ constant1: BN;
128
+ slope2: BN;
129
+ constant2: BN;
130
+ minFee: BN;
131
+ maxFee: BN;
132
+ };
106
133
  openPosition: BN;
107
134
  closePosition: BN;
135
+ removeCollateral: BN;
108
136
  liquidation: BN;
109
137
  protocolShare: BN;
110
138
  };
@@ -139,28 +167,32 @@ export declare class PerpetualsClient {
139
167
  tradeStats: {
140
168
  profitUsd: BN;
141
169
  lossUsd: BN;
142
- oiLongUsd: BN;
143
- oiShortUsd: BN;
170
+ oiLong: BN;
171
+ oiShort: BN;
144
172
  };
145
173
  longPositions: {
146
174
  openPositions: BN;
147
175
  collateralUsd: BN;
148
176
  sizeUsd: BN;
177
+ borrowSizeUsd: BN;
149
178
  lockedAmount: BN;
150
179
  weightedPrice: BN;
151
180
  totalQuantity: BN;
152
181
  cumulativeInterestUsd: BN;
153
182
  cumulativeInterestSnapshot: BN;
183
+ collateralAmount: BN;
154
184
  };
155
185
  shortPositions: {
156
186
  openPositions: BN;
157
187
  collateralUsd: BN;
158
188
  sizeUsd: BN;
189
+ borrowSizeUsd: BN;
159
190
  lockedAmount: BN;
160
191
  weightedPrice: BN;
161
192
  totalQuantity: BN;
162
193
  cumulativeInterestUsd: BN;
163
194
  cumulativeInterestSnapshot: BN;
195
+ collateralAmount: BN;
164
196
  };
165
197
  borrowRateState: {
166
198
  currentRate: BN;
@@ -176,10 +208,11 @@ export declare class PerpetualsClient {
176
208
  instructionDataLen: number;
177
209
  instructionHash: BN;
178
210
  signers: PublicKey[];
179
- signed: boolean[];
211
+ signed: number[];
180
212
  price: BN;
181
213
  expo: number;
182
214
  conf: BN;
215
+ ema: BN;
183
216
  publishTime: BN;
184
217
  pools: PublicKey[];
185
218
  transferAuthorityBump: number;
@@ -195,7 +228,9 @@ export declare class PerpetualsClient {
195
228
  aumUsd: BN;
196
229
  lpTokenBump: number;
197
230
  owner: PublicKey;
231
+ payer: PublicKey;
198
232
  custody: PublicKey;
233
+ collateralCustody: PublicKey;
199
234
  openTime: BN;
200
235
  updateTime: BN;
201
236
  side: {
@@ -204,6 +239,7 @@ export declare class PerpetualsClient {
204
239
  short?: Record<string, never>;
205
240
  };
206
241
  sizeUsd: BN;
242
+ borrowSizeUsd: BN;
207
243
  collateralUsd: BN;
208
244
  unrealizedProfitUsd: BN;
209
245
  unrealizedLossUsd: BN;
@@ -218,13 +254,17 @@ export declare class PerpetualsClient {
218
254
  tokenAccount: PublicKey;
219
255
  decimals: number;
220
256
  isStable: boolean;
257
+ isVirtual: boolean;
221
258
  oracle: {
222
259
  oracleAccount: PublicKey;
260
+ customOracleAccount: PublicKey;
223
261
  oracleType: {
224
262
  none?: Record<string, never>;
225
- test?: Record<string, never>;
263
+ custom?: Record<string, never>;
226
264
  pyth?: Record<string, never>;
265
+ backup?: Record<string, never>;
227
266
  };
267
+ maxDifferenceThreshold: BN;
228
268
  maxPriceError: BN;
229
269
  maxPriceAgeSec: number;
230
270
  };
@@ -237,19 +277,12 @@ export declare class PerpetualsClient {
237
277
  minInitialLeverage: BN;
238
278
  maxInitialLeverage: BN;
239
279
  maxLeverage: BN;
280
+ minCollateralUsd: BN;
281
+ minTimeSeconds: BN;
240
282
  maxPayoffMult: BN;
241
283
  maxUtilization: BN;
242
284
  maxPositionLockedUsd: BN;
243
285
  maxTotalLockedUsd: BN;
244
- } | {
245
- useEma: boolean;
246
- useUnrealizedPnlInAum: boolean;
247
- tradeSpreadLong: BN;
248
- tradeSpreadShort: BN;
249
- swapSpread: BN;
250
- minInitialLeverage: BN;
251
- maxLeverage: BN;
252
- maxPayoffMult: BN;
253
286
  };
254
287
  permissions: {
255
288
  allowSwap: boolean;
@@ -268,14 +301,45 @@ export declare class PerpetualsClient {
268
301
  };
269
302
  ratioMult: BN;
270
303
  utilizationMult: BN;
271
- swapIn: BN;
272
- swapOut: BN;
273
- stableSwapIn: BN;
274
- stableSwapOut: BN;
275
- addLiquidity: BN;
276
- removeLiquidity: BN;
304
+ swapIn: {
305
+ baseRate: BN;
306
+ slope1: BN;
307
+ constant1: BN;
308
+ slope2: BN;
309
+ constant2: BN;
310
+ minFee: BN;
311
+ maxFee: BN;
312
+ };
313
+ swapOut: {
314
+ baseRate: BN;
315
+ slope1: BN;
316
+ constant1: BN;
317
+ slope2: BN;
318
+ constant2: BN;
319
+ minFee: BN;
320
+ maxFee: BN;
321
+ };
322
+ addLiquidity: {
323
+ baseRate: BN;
324
+ slope1: BN;
325
+ constant1: BN;
326
+ slope2: BN;
327
+ constant2: BN;
328
+ minFee: BN;
329
+ maxFee: BN;
330
+ };
331
+ removeLiquidity: {
332
+ baseRate: BN;
333
+ slope1: BN;
334
+ constant1: BN;
335
+ slope2: BN;
336
+ constant2: BN;
337
+ minFee: BN;
338
+ maxFee: BN;
339
+ };
277
340
  openPosition: BN;
278
341
  closePosition: BN;
342
+ removeCollateral: BN;
279
343
  liquidation: BN;
280
344
  protocolShare: BN;
281
345
  };
@@ -310,28 +374,32 @@ export declare class PerpetualsClient {
310
374
  tradeStats: {
311
375
  profitUsd: BN;
312
376
  lossUsd: BN;
313
- oiLongUsd: BN;
314
- oiShortUsd: BN;
377
+ oiLong: BN;
378
+ oiShort: BN;
315
379
  };
316
380
  longPositions: {
317
381
  openPositions: BN;
318
382
  collateralUsd: BN;
319
383
  sizeUsd: BN;
384
+ borrowSizeUsd: BN;
320
385
  lockedAmount: BN;
321
386
  weightedPrice: BN;
322
387
  totalQuantity: BN;
323
388
  cumulativeInterestUsd: BN;
324
389
  cumulativeInterestSnapshot: BN;
390
+ collateralAmount: BN;
325
391
  };
326
392
  shortPositions: {
327
393
  openPositions: BN;
328
394
  collateralUsd: BN;
329
395
  sizeUsd: BN;
396
+ borrowSizeUsd: BN;
330
397
  lockedAmount: BN;
331
398
  weightedPrice: BN;
332
399
  totalQuantity: BN;
333
400
  cumulativeInterestUsd: BN;
334
401
  cumulativeInterestSnapshot: BN;
402
+ collateralAmount: BN;
335
403
  };
336
404
  borrowRateState: {
337
405
  currentRate: BN;
@@ -347,10 +415,11 @@ export declare class PerpetualsClient {
347
415
  instructionDataLen: number;
348
416
  instructionHash: BN;
349
417
  signers: PublicKey[];
350
- signed: boolean[];
418
+ signed: number[];
351
419
  price: BN;
352
420
  expo: number;
353
421
  conf: BN;
422
+ ema: BN;
354
423
  publishTime: BN;
355
424
  pools: PublicKey[];
356
425
  transferAuthorityBump: number;
@@ -366,7 +435,9 @@ export declare class PerpetualsClient {
366
435
  aumUsd: BN;
367
436
  lpTokenBump: number;
368
437
  owner: PublicKey;
438
+ payer: PublicKey;
369
439
  custody: PublicKey;
440
+ collateralCustody: PublicKey;
370
441
  openTime: BN;
371
442
  updateTime: BN;
372
443
  side: {
@@ -375,6 +446,7 @@ export declare class PerpetualsClient {
375
446
  short?: Record<string, never>;
376
447
  };
377
448
  sizeUsd: BN;
449
+ borrowSizeUsd: BN;
378
450
  collateralUsd: BN;
379
451
  unrealizedProfitUsd: BN;
380
452
  unrealizedLossUsd: BN;
@@ -388,13 +460,17 @@ export declare class PerpetualsClient {
388
460
  tokenAccount: PublicKey;
389
461
  decimals: number;
390
462
  isStable: boolean;
463
+ isVirtual: boolean;
391
464
  oracle: {
392
465
  oracleAccount: PublicKey;
466
+ customOracleAccount: PublicKey;
393
467
  oracleType: {
394
468
  none?: Record<string, never>;
395
- test?: Record<string, never>;
469
+ custom?: Record<string, never>;
396
470
  pyth?: Record<string, never>;
471
+ backup?: Record<string, never>;
397
472
  };
473
+ maxDifferenceThreshold: BN;
398
474
  maxPriceError: BN;
399
475
  maxPriceAgeSec: number;
400
476
  };
@@ -407,19 +483,12 @@ export declare class PerpetualsClient {
407
483
  minInitialLeverage: BN;
408
484
  maxInitialLeverage: BN;
409
485
  maxLeverage: BN;
486
+ minCollateralUsd: BN;
487
+ minTimeSeconds: BN;
410
488
  maxPayoffMult: BN;
411
489
  maxUtilization: BN;
412
490
  maxPositionLockedUsd: BN;
413
491
  maxTotalLockedUsd: BN;
414
- } | {
415
- useEma: boolean;
416
- useUnrealizedPnlInAum: boolean;
417
- tradeSpreadLong: BN;
418
- tradeSpreadShort: BN;
419
- swapSpread: BN;
420
- minInitialLeverage: BN;
421
- maxLeverage: BN;
422
- maxPayoffMult: BN;
423
492
  };
424
493
  permissions: {
425
494
  allowSwap: boolean;
@@ -438,14 +507,45 @@ export declare class PerpetualsClient {
438
507
  };
439
508
  ratioMult: BN;
440
509
  utilizationMult: BN;
441
- swapIn: BN;
442
- swapOut: BN;
443
- stableSwapIn: BN;
444
- stableSwapOut: BN;
445
- addLiquidity: BN;
446
- removeLiquidity: BN;
510
+ swapIn: {
511
+ baseRate: BN;
512
+ slope1: BN;
513
+ constant1: BN;
514
+ slope2: BN;
515
+ constant2: BN;
516
+ minFee: BN;
517
+ maxFee: BN;
518
+ };
519
+ swapOut: {
520
+ baseRate: BN;
521
+ slope1: BN;
522
+ constant1: BN;
523
+ slope2: BN;
524
+ constant2: BN;
525
+ minFee: BN;
526
+ maxFee: BN;
527
+ };
528
+ addLiquidity: {
529
+ baseRate: BN;
530
+ slope1: BN;
531
+ constant1: BN;
532
+ slope2: BN;
533
+ constant2: BN;
534
+ minFee: BN;
535
+ maxFee: BN;
536
+ };
537
+ removeLiquidity: {
538
+ baseRate: BN;
539
+ slope1: BN;
540
+ constant1: BN;
541
+ slope2: BN;
542
+ constant2: BN;
543
+ minFee: BN;
544
+ maxFee: BN;
545
+ };
447
546
  openPosition: BN;
448
547
  closePosition: BN;
548
+ removeCollateral: BN;
449
549
  liquidation: BN;
450
550
  protocolShare: BN;
451
551
  };
@@ -480,28 +580,32 @@ export declare class PerpetualsClient {
480
580
  tradeStats: {
481
581
  profitUsd: BN;
482
582
  lossUsd: BN;
483
- oiLongUsd: BN;
484
- oiShortUsd: BN;
583
+ oiLong: BN;
584
+ oiShort: BN;
485
585
  };
486
586
  longPositions: {
487
587
  openPositions: BN;
488
588
  collateralUsd: BN;
489
589
  sizeUsd: BN;
590
+ borrowSizeUsd: BN;
490
591
  lockedAmount: BN;
491
592
  weightedPrice: BN;
492
593
  totalQuantity: BN;
493
594
  cumulativeInterestUsd: BN;
494
595
  cumulativeInterestSnapshot: BN;
596
+ collateralAmount: BN;
495
597
  };
496
598
  shortPositions: {
497
599
  openPositions: BN;
498
600
  collateralUsd: BN;
499
601
  sizeUsd: BN;
602
+ borrowSizeUsd: BN;
500
603
  lockedAmount: BN;
501
604
  weightedPrice: BN;
502
605
  totalQuantity: BN;
503
606
  cumulativeInterestUsd: BN;
504
607
  cumulativeInterestSnapshot: BN;
608
+ collateralAmount: BN;
505
609
  };
506
610
  borrowRateState: {
507
611
  currentRate: BN;
@@ -517,10 +621,11 @@ export declare class PerpetualsClient {
517
621
  instructionDataLen: number;
518
622
  instructionHash: BN;
519
623
  signers: PublicKey[];
520
- signed: boolean[];
624
+ signed: number[];
521
625
  price: BN;
522
626
  expo: number;
523
627
  conf: BN;
628
+ ema: BN;
524
629
  publishTime: BN;
525
630
  pools: PublicKey[];
526
631
  transferAuthorityBump: number;
@@ -536,7 +641,9 @@ export declare class PerpetualsClient {
536
641
  aumUsd: BN;
537
642
  lpTokenBump: number;
538
643
  owner: PublicKey;
644
+ payer: PublicKey;
539
645
  custody: PublicKey;
646
+ collateralCustody: PublicKey;
540
647
  openTime: BN;
541
648
  updateTime: BN;
542
649
  side: {
@@ -545,6 +652,7 @@ export declare class PerpetualsClient {
545
652
  short?: Record<string, never>;
546
653
  };
547
654
  sizeUsd: BN;
655
+ borrowSizeUsd: BN;
548
656
  collateralUsd: BN;
549
657
  unrealizedProfitUsd: BN;
550
658
  unrealizedLossUsd: BN;
@@ -563,13 +671,17 @@ export declare class PerpetualsClient {
563
671
  tokenAccount: PublicKey;
564
672
  decimals: number;
565
673
  isStable: boolean;
674
+ isVirtual: boolean;
566
675
  oracle: {
567
676
  oracleAccount: PublicKey;
677
+ customOracleAccount: PublicKey;
568
678
  oracleType: {
569
679
  none?: Record<string, never>;
570
- test?: Record<string, never>;
680
+ custom?: Record<string, never>;
571
681
  pyth?: Record<string, never>;
682
+ backup?: Record<string, never>;
572
683
  };
684
+ maxDifferenceThreshold: BN;
573
685
  maxPriceError: BN;
574
686
  maxPriceAgeSec: number;
575
687
  };
@@ -582,19 +694,12 @@ export declare class PerpetualsClient {
582
694
  minInitialLeverage: BN;
583
695
  maxInitialLeverage: BN;
584
696
  maxLeverage: BN;
697
+ minCollateralUsd: BN;
698
+ minTimeSeconds: BN;
585
699
  maxPayoffMult: BN;
586
700
  maxUtilization: BN;
587
701
  maxPositionLockedUsd: BN;
588
702
  maxTotalLockedUsd: BN;
589
- } | {
590
- useEma: boolean;
591
- useUnrealizedPnlInAum: boolean;
592
- tradeSpreadLong: BN;
593
- tradeSpreadShort: BN;
594
- swapSpread: BN;
595
- minInitialLeverage: BN;
596
- maxLeverage: BN;
597
- maxPayoffMult: BN;
598
703
  };
599
704
  permissions: {
600
705
  allowSwap: boolean;
@@ -613,14 +718,45 @@ export declare class PerpetualsClient {
613
718
  };
614
719
  ratioMult: BN;
615
720
  utilizationMult: BN;
616
- swapIn: BN;
617
- swapOut: BN;
618
- stableSwapIn: BN;
619
- stableSwapOut: BN;
620
- addLiquidity: BN;
621
- removeLiquidity: BN;
721
+ swapIn: {
722
+ baseRate: BN;
723
+ slope1: BN;
724
+ constant1: BN;
725
+ slope2: BN;
726
+ constant2: BN;
727
+ minFee: BN;
728
+ maxFee: BN;
729
+ };
730
+ swapOut: {
731
+ baseRate: BN;
732
+ slope1: BN;
733
+ constant1: BN;
734
+ slope2: BN;
735
+ constant2: BN;
736
+ minFee: BN;
737
+ maxFee: BN;
738
+ };
739
+ addLiquidity: {
740
+ baseRate: BN;
741
+ slope1: BN;
742
+ constant1: BN;
743
+ slope2: BN;
744
+ constant2: BN;
745
+ minFee: BN;
746
+ maxFee: BN;
747
+ };
748
+ removeLiquidity: {
749
+ baseRate: BN;
750
+ slope1: BN;
751
+ constant1: BN;
752
+ slope2: BN;
753
+ constant2: BN;
754
+ minFee: BN;
755
+ maxFee: BN;
756
+ };
622
757
  openPosition: BN;
623
758
  closePosition: BN;
759
+ removeCollateral: BN;
624
760
  liquidation: BN;
625
761
  protocolShare: BN;
626
762
  };
@@ -655,28 +791,32 @@ export declare class PerpetualsClient {
655
791
  tradeStats: {
656
792
  profitUsd: BN;
657
793
  lossUsd: BN;
658
- oiLongUsd: BN;
659
- oiShortUsd: BN;
794
+ oiLong: BN;
795
+ oiShort: BN;
660
796
  };
661
797
  longPositions: {
662
798
  openPositions: BN;
663
799
  collateralUsd: BN;
664
800
  sizeUsd: BN;
801
+ borrowSizeUsd: BN;
665
802
  lockedAmount: BN;
666
803
  weightedPrice: BN;
667
804
  totalQuantity: BN;
668
805
  cumulativeInterestUsd: BN;
669
806
  cumulativeInterestSnapshot: BN;
807
+ collateralAmount: BN;
670
808
  };
671
809
  shortPositions: {
672
810
  openPositions: BN;
673
811
  collateralUsd: BN;
674
812
  sizeUsd: BN;
813
+ borrowSizeUsd: BN;
675
814
  lockedAmount: BN;
676
815
  weightedPrice: BN;
677
816
  totalQuantity: BN;
678
817
  cumulativeInterestUsd: BN;
679
818
  cumulativeInterestSnapshot: BN;
819
+ collateralAmount: BN;
680
820
  };
681
821
  borrowRateState: {
682
822
  currentRate: BN;
@@ -692,10 +832,11 @@ export declare class PerpetualsClient {
692
832
  instructionDataLen: number;
693
833
  instructionHash: BN;
694
834
  signers: PublicKey[];
695
- signed: boolean[];
835
+ signed: number[];
696
836
  price: BN;
697
837
  expo: number;
698
838
  conf: BN;
839
+ ema: BN;
699
840
  publishTime: BN;
700
841
  pools: PublicKey[];
701
842
  transferAuthorityBump: number;
@@ -711,7 +852,9 @@ export declare class PerpetualsClient {
711
852
  aumUsd: BN;
712
853
  lpTokenBump: number;
713
854
  owner: PublicKey;
855
+ payer: PublicKey;
714
856
  custody: PublicKey;
857
+ collateralCustody: PublicKey;
715
858
  openTime: BN;
716
859
  updateTime: BN;
717
860
  side: {
@@ -720,6 +863,7 @@ export declare class PerpetualsClient {
720
863
  short?: Record<string, never>;
721
864
  };
722
865
  sizeUsd: BN;
866
+ borrowSizeUsd: BN;
723
867
  collateralUsd: BN;
724
868
  unrealizedProfitUsd: BN;
725
869
  unrealizedLossUsd: BN;
@@ -733,13 +877,17 @@ export declare class PerpetualsClient {
733
877
  tokenAccount: PublicKey;
734
878
  decimals: number;
735
879
  isStable: boolean;
880
+ isVirtual: boolean;
736
881
  oracle: {
737
882
  oracleAccount: PublicKey;
883
+ customOracleAccount: PublicKey;
738
884
  oracleType: {
739
885
  none?: Record<string, never>;
740
- test?: Record<string, never>;
886
+ custom?: Record<string, never>;
741
887
  pyth?: Record<string, never>;
888
+ backup?: Record<string, never>;
742
889
  };
890
+ maxDifferenceThreshold: BN;
743
891
  maxPriceError: BN;
744
892
  maxPriceAgeSec: number;
745
893
  };
@@ -752,19 +900,12 @@ export declare class PerpetualsClient {
752
900
  minInitialLeverage: BN;
753
901
  maxInitialLeverage: BN;
754
902
  maxLeverage: BN;
903
+ minCollateralUsd: BN;
904
+ minTimeSeconds: BN;
755
905
  maxPayoffMult: BN;
756
906
  maxUtilization: BN;
757
907
  maxPositionLockedUsd: BN;
758
908
  maxTotalLockedUsd: BN;
759
- } | {
760
- useEma: boolean;
761
- useUnrealizedPnlInAum: boolean;
762
- tradeSpreadLong: BN;
763
- tradeSpreadShort: BN;
764
- swapSpread: BN;
765
- minInitialLeverage: BN;
766
- maxLeverage: BN;
767
- maxPayoffMult: BN;
768
909
  };
769
910
  permissions: {
770
911
  allowSwap: boolean;
@@ -783,14 +924,45 @@ export declare class PerpetualsClient {
783
924
  };
784
925
  ratioMult: BN;
785
926
  utilizationMult: BN;
786
- swapIn: BN;
787
- swapOut: BN;
788
- stableSwapIn: BN;
789
- stableSwapOut: BN;
790
- addLiquidity: BN;
791
- removeLiquidity: BN;
927
+ swapIn: {
928
+ baseRate: BN;
929
+ slope1: BN;
930
+ constant1: BN;
931
+ slope2: BN;
932
+ constant2: BN;
933
+ minFee: BN;
934
+ maxFee: BN;
935
+ };
936
+ swapOut: {
937
+ baseRate: BN;
938
+ slope1: BN;
939
+ constant1: BN;
940
+ slope2: BN;
941
+ constant2: BN;
942
+ minFee: BN;
943
+ maxFee: BN;
944
+ };
945
+ addLiquidity: {
946
+ baseRate: BN;
947
+ slope1: BN;
948
+ constant1: BN;
949
+ slope2: BN;
950
+ constant2: BN;
951
+ minFee: BN;
952
+ maxFee: BN;
953
+ };
954
+ removeLiquidity: {
955
+ baseRate: BN;
956
+ slope1: BN;
957
+ constant1: BN;
958
+ slope2: BN;
959
+ constant2: BN;
960
+ minFee: BN;
961
+ maxFee: BN;
962
+ };
792
963
  openPosition: BN;
793
964
  closePosition: BN;
965
+ removeCollateral: BN;
794
966
  liquidation: BN;
795
967
  protocolShare: BN;
796
968
  };
@@ -825,28 +997,32 @@ export declare class PerpetualsClient {
825
997
  tradeStats: {
826
998
  profitUsd: BN;
827
999
  lossUsd: BN;
828
- oiLongUsd: BN;
829
- oiShortUsd: BN;
1000
+ oiLong: BN;
1001
+ oiShort: BN;
830
1002
  };
831
1003
  longPositions: {
832
1004
  openPositions: BN;
833
1005
  collateralUsd: BN;
834
1006
  sizeUsd: BN;
1007
+ borrowSizeUsd: BN;
835
1008
  lockedAmount: BN;
836
1009
  weightedPrice: BN;
837
1010
  totalQuantity: BN;
838
1011
  cumulativeInterestUsd: BN;
839
1012
  cumulativeInterestSnapshot: BN;
1013
+ collateralAmount: BN;
840
1014
  };
841
1015
  shortPositions: {
842
1016
  openPositions: BN;
843
1017
  collateralUsd: BN;
844
1018
  sizeUsd: BN;
1019
+ borrowSizeUsd: BN;
845
1020
  lockedAmount: BN;
846
1021
  weightedPrice: BN;
847
1022
  totalQuantity: BN;
848
1023
  cumulativeInterestUsd: BN;
849
1024
  cumulativeInterestSnapshot: BN;
1025
+ collateralAmount: BN;
850
1026
  };
851
1027
  borrowRateState: {
852
1028
  currentRate: BN;
@@ -862,10 +1038,11 @@ export declare class PerpetualsClient {
862
1038
  instructionDataLen: number;
863
1039
  instructionHash: BN;
864
1040
  signers: PublicKey[];
865
- signed: boolean[];
1041
+ signed: number[];
866
1042
  price: BN;
867
1043
  expo: number;
868
1044
  conf: BN;
1045
+ ema: BN;
869
1046
  publishTime: BN;
870
1047
  pools: PublicKey[];
871
1048
  transferAuthorityBump: number;
@@ -881,7 +1058,9 @@ export declare class PerpetualsClient {
881
1058
  aumUsd: BN;
882
1059
  lpTokenBump: number;
883
1060
  owner: PublicKey;
1061
+ payer: PublicKey;
884
1062
  custody: PublicKey;
1063
+ collateralCustody: PublicKey;
885
1064
  openTime: BN;
886
1065
  updateTime: BN;
887
1066
  side: {
@@ -890,6 +1069,7 @@ export declare class PerpetualsClient {
890
1069
  short?: Record<string, never>;
891
1070
  };
892
1071
  sizeUsd: BN;
1072
+ borrowSizeUsd: BN;
893
1073
  collateralUsd: BN;
894
1074
  unrealizedProfitUsd: BN;
895
1075
  unrealizedLossUsd: BN;
@@ -904,13 +1084,17 @@ export declare class PerpetualsClient {
904
1084
  tokenAccount: PublicKey;
905
1085
  decimals: number;
906
1086
  isStable: boolean;
1087
+ isVirtual: boolean;
907
1088
  oracle: {
908
1089
  oracleAccount: PublicKey;
1090
+ customOracleAccount: PublicKey;
909
1091
  oracleType: {
910
1092
  none?: Record<string, never>;
911
- test?: Record<string, never>;
1093
+ custom?: Record<string, never>;
912
1094
  pyth?: Record<string, never>;
1095
+ backup?: Record<string, never>;
913
1096
  };
1097
+ maxDifferenceThreshold: BN;
914
1098
  maxPriceError: BN;
915
1099
  maxPriceAgeSec: number;
916
1100
  };
@@ -923,19 +1107,12 @@ export declare class PerpetualsClient {
923
1107
  minInitialLeverage: BN;
924
1108
  maxInitialLeverage: BN;
925
1109
  maxLeverage: BN;
1110
+ minCollateralUsd: BN;
1111
+ minTimeSeconds: BN;
926
1112
  maxPayoffMult: BN;
927
1113
  maxUtilization: BN;
928
1114
  maxPositionLockedUsd: BN;
929
1115
  maxTotalLockedUsd: BN;
930
- } | {
931
- useEma: boolean;
932
- useUnrealizedPnlInAum: boolean;
933
- tradeSpreadLong: BN;
934
- tradeSpreadShort: BN;
935
- swapSpread: BN;
936
- minInitialLeverage: BN;
937
- maxLeverage: BN;
938
- maxPayoffMult: BN;
939
1116
  };
940
1117
  permissions: {
941
1118
  allowSwap: boolean;
@@ -954,14 +1131,45 @@ export declare class PerpetualsClient {
954
1131
  };
955
1132
  ratioMult: BN;
956
1133
  utilizationMult: BN;
957
- swapIn: BN;
958
- swapOut: BN;
959
- stableSwapIn: BN;
960
- stableSwapOut: BN;
961
- addLiquidity: BN;
962
- removeLiquidity: BN;
1134
+ swapIn: {
1135
+ baseRate: BN;
1136
+ slope1: BN;
1137
+ constant1: BN;
1138
+ slope2: BN;
1139
+ constant2: BN;
1140
+ minFee: BN;
1141
+ maxFee: BN;
1142
+ };
1143
+ swapOut: {
1144
+ baseRate: BN;
1145
+ slope1: BN;
1146
+ constant1: BN;
1147
+ slope2: BN;
1148
+ constant2: BN;
1149
+ minFee: BN;
1150
+ maxFee: BN;
1151
+ };
1152
+ addLiquidity: {
1153
+ baseRate: BN;
1154
+ slope1: BN;
1155
+ constant1: BN;
1156
+ slope2: BN;
1157
+ constant2: BN;
1158
+ minFee: BN;
1159
+ maxFee: BN;
1160
+ };
1161
+ removeLiquidity: {
1162
+ baseRate: BN;
1163
+ slope1: BN;
1164
+ constant1: BN;
1165
+ slope2: BN;
1166
+ constant2: BN;
1167
+ minFee: BN;
1168
+ maxFee: BN;
1169
+ };
963
1170
  openPosition: BN;
964
1171
  closePosition: BN;
1172
+ removeCollateral: BN;
965
1173
  liquidation: BN;
966
1174
  protocolShare: BN;
967
1175
  };
@@ -996,28 +1204,32 @@ export declare class PerpetualsClient {
996
1204
  tradeStats: {
997
1205
  profitUsd: BN;
998
1206
  lossUsd: BN;
999
- oiLongUsd: BN;
1000
- oiShortUsd: BN;
1207
+ oiLong: BN;
1208
+ oiShort: BN;
1001
1209
  };
1002
1210
  longPositions: {
1003
1211
  openPositions: BN;
1004
1212
  collateralUsd: BN;
1005
1213
  sizeUsd: BN;
1214
+ borrowSizeUsd: BN;
1006
1215
  lockedAmount: BN;
1007
1216
  weightedPrice: BN;
1008
1217
  totalQuantity: BN;
1009
1218
  cumulativeInterestUsd: BN;
1010
1219
  cumulativeInterestSnapshot: BN;
1220
+ collateralAmount: BN;
1011
1221
  };
1012
1222
  shortPositions: {
1013
1223
  openPositions: BN;
1014
1224
  collateralUsd: BN;
1015
1225
  sizeUsd: BN;
1226
+ borrowSizeUsd: BN;
1016
1227
  lockedAmount: BN;
1017
1228
  weightedPrice: BN;
1018
1229
  totalQuantity: BN;
1019
1230
  cumulativeInterestUsd: BN;
1020
1231
  cumulativeInterestSnapshot: BN;
1232
+ collateralAmount: BN;
1021
1233
  };
1022
1234
  borrowRateState: {
1023
1235
  currentRate: BN;
@@ -1033,10 +1245,11 @@ export declare class PerpetualsClient {
1033
1245
  instructionDataLen: number;
1034
1246
  instructionHash: BN;
1035
1247
  signers: PublicKey[];
1036
- signed: boolean[];
1248
+ signed: number[];
1037
1249
  price: BN;
1038
1250
  expo: number;
1039
1251
  conf: BN;
1252
+ ema: BN;
1040
1253
  publishTime: BN;
1041
1254
  pools: PublicKey[];
1042
1255
  transferAuthorityBump: number;
@@ -1052,7 +1265,9 @@ export declare class PerpetualsClient {
1052
1265
  aumUsd: BN;
1053
1266
  lpTokenBump: number;
1054
1267
  owner: PublicKey;
1268
+ payer: PublicKey;
1055
1269
  custody: PublicKey;
1270
+ collateralCustody: PublicKey;
1056
1271
  openTime: BN;
1057
1272
  updateTime: BN;
1058
1273
  side: {
@@ -1061,6 +1276,7 @@ export declare class PerpetualsClient {
1061
1276
  short?: Record<string, never>;
1062
1277
  };
1063
1278
  sizeUsd: BN;
1279
+ borrowSizeUsd: BN;
1064
1280
  collateralUsd: BN;
1065
1281
  unrealizedProfitUsd: BN;
1066
1282
  unrealizedLossUsd: BN;
@@ -1075,13 +1291,17 @@ export declare class PerpetualsClient {
1075
1291
  tokenAccount: PublicKey;
1076
1292
  decimals: number;
1077
1293
  isStable: boolean;
1294
+ isVirtual: boolean;
1078
1295
  oracle: {
1079
1296
  oracleAccount: PublicKey;
1297
+ customOracleAccount: PublicKey;
1080
1298
  oracleType: {
1081
1299
  none?: Record<string, never>;
1082
- test?: Record<string, never>;
1300
+ custom?: Record<string, never>;
1083
1301
  pyth?: Record<string, never>;
1302
+ backup?: Record<string, never>;
1084
1303
  };
1304
+ maxDifferenceThreshold: BN;
1085
1305
  maxPriceError: BN;
1086
1306
  maxPriceAgeSec: number;
1087
1307
  };
@@ -1094,19 +1314,12 @@ export declare class PerpetualsClient {
1094
1314
  minInitialLeverage: BN;
1095
1315
  maxInitialLeverage: BN;
1096
1316
  maxLeverage: BN;
1317
+ minCollateralUsd: BN;
1318
+ minTimeSeconds: BN;
1097
1319
  maxPayoffMult: BN;
1098
1320
  maxUtilization: BN;
1099
1321
  maxPositionLockedUsd: BN;
1100
1322
  maxTotalLockedUsd: BN;
1101
- } | {
1102
- useEma: boolean;
1103
- useUnrealizedPnlInAum: boolean;
1104
- tradeSpreadLong: BN;
1105
- tradeSpreadShort: BN;
1106
- swapSpread: BN;
1107
- minInitialLeverage: BN;
1108
- maxLeverage: BN;
1109
- maxPayoffMult: BN;
1110
1323
  };
1111
1324
  permissions: {
1112
1325
  allowSwap: boolean;
@@ -1125,14 +1338,45 @@ export declare class PerpetualsClient {
1125
1338
  };
1126
1339
  ratioMult: BN;
1127
1340
  utilizationMult: BN;
1128
- swapIn: BN;
1129
- swapOut: BN;
1130
- stableSwapIn: BN;
1131
- stableSwapOut: BN;
1132
- addLiquidity: BN;
1133
- removeLiquidity: BN;
1341
+ swapIn: {
1342
+ baseRate: BN;
1343
+ slope1: BN;
1344
+ constant1: BN;
1345
+ slope2: BN;
1346
+ constant2: BN;
1347
+ minFee: BN;
1348
+ maxFee: BN;
1349
+ };
1350
+ swapOut: {
1351
+ baseRate: BN;
1352
+ slope1: BN;
1353
+ constant1: BN;
1354
+ slope2: BN;
1355
+ constant2: BN;
1356
+ minFee: BN;
1357
+ maxFee: BN;
1358
+ };
1359
+ addLiquidity: {
1360
+ baseRate: BN;
1361
+ slope1: BN;
1362
+ constant1: BN;
1363
+ slope2: BN;
1364
+ constant2: BN;
1365
+ minFee: BN;
1366
+ maxFee: BN;
1367
+ };
1368
+ removeLiquidity: {
1369
+ baseRate: BN;
1370
+ slope1: BN;
1371
+ constant1: BN;
1372
+ slope2: BN;
1373
+ constant2: BN;
1374
+ minFee: BN;
1375
+ maxFee: BN;
1376
+ };
1134
1377
  openPosition: BN;
1135
1378
  closePosition: BN;
1379
+ removeCollateral: BN;
1136
1380
  liquidation: BN;
1137
1381
  protocolShare: BN;
1138
1382
  };
@@ -1167,28 +1411,32 @@ export declare class PerpetualsClient {
1167
1411
  tradeStats: {
1168
1412
  profitUsd: BN;
1169
1413
  lossUsd: BN;
1170
- oiLongUsd: BN;
1171
- oiShortUsd: BN;
1414
+ oiLong: BN;
1415
+ oiShort: BN;
1172
1416
  };
1173
1417
  longPositions: {
1174
1418
  openPositions: BN;
1175
1419
  collateralUsd: BN;
1176
1420
  sizeUsd: BN;
1421
+ borrowSizeUsd: BN;
1177
1422
  lockedAmount: BN;
1178
1423
  weightedPrice: BN;
1179
1424
  totalQuantity: BN;
1180
1425
  cumulativeInterestUsd: BN;
1181
1426
  cumulativeInterestSnapshot: BN;
1427
+ collateralAmount: BN;
1182
1428
  };
1183
1429
  shortPositions: {
1184
1430
  openPositions: BN;
1185
1431
  collateralUsd: BN;
1186
1432
  sizeUsd: BN;
1433
+ borrowSizeUsd: BN;
1187
1434
  lockedAmount: BN;
1188
1435
  weightedPrice: BN;
1189
1436
  totalQuantity: BN;
1190
1437
  cumulativeInterestUsd: BN;
1191
1438
  cumulativeInterestSnapshot: BN;
1439
+ collateralAmount: BN;
1192
1440
  };
1193
1441
  borrowRateState: {
1194
1442
  currentRate: BN;
@@ -1204,10 +1452,11 @@ export declare class PerpetualsClient {
1204
1452
  instructionDataLen: number;
1205
1453
  instructionHash: BN;
1206
1454
  signers: PublicKey[];
1207
- signed: boolean[];
1455
+ signed: number[];
1208
1456
  price: BN;
1209
1457
  expo: number;
1210
1458
  conf: BN;
1459
+ ema: BN;
1211
1460
  publishTime: BN;
1212
1461
  pools: PublicKey[];
1213
1462
  transferAuthorityBump: number;
@@ -1223,7 +1472,9 @@ export declare class PerpetualsClient {
1223
1472
  aumUsd: BN;
1224
1473
  lpTokenBump: number;
1225
1474
  owner: PublicKey;
1475
+ payer: PublicKey;
1226
1476
  custody: PublicKey;
1477
+ collateralCustody: PublicKey;
1227
1478
  openTime: BN;
1228
1479
  updateTime: BN;
1229
1480
  side: {
@@ -1232,6 +1483,7 @@ export declare class PerpetualsClient {
1232
1483
  short?: Record<string, never>;
1233
1484
  };
1234
1485
  sizeUsd: BN;
1486
+ borrowSizeUsd: BN;
1235
1487
  collateralUsd: BN;
1236
1488
  unrealizedProfitUsd: BN;
1237
1489
  unrealizedLossUsd: BN;
@@ -1245,13 +1497,17 @@ export declare class PerpetualsClient {
1245
1497
  tokenAccount: PublicKey;
1246
1498
  decimals: number;
1247
1499
  isStable: boolean;
1500
+ isVirtual: boolean;
1248
1501
  oracle: {
1249
1502
  oracleAccount: PublicKey;
1503
+ customOracleAccount: PublicKey;
1250
1504
  oracleType: {
1251
1505
  none?: Record<string, never>;
1252
- test?: Record<string, never>;
1506
+ custom?: Record<string, never>;
1253
1507
  pyth?: Record<string, never>;
1508
+ backup?: Record<string, never>;
1254
1509
  };
1510
+ maxDifferenceThreshold: BN;
1255
1511
  maxPriceError: BN;
1256
1512
  maxPriceAgeSec: number;
1257
1513
  };
@@ -1264,19 +1520,12 @@ export declare class PerpetualsClient {
1264
1520
  minInitialLeverage: BN;
1265
1521
  maxInitialLeverage: BN;
1266
1522
  maxLeverage: BN;
1523
+ minCollateralUsd: BN;
1524
+ minTimeSeconds: BN;
1267
1525
  maxPayoffMult: BN;
1268
1526
  maxUtilization: BN;
1269
1527
  maxPositionLockedUsd: BN;
1270
1528
  maxTotalLockedUsd: BN;
1271
- } | {
1272
- useEma: boolean;
1273
- useUnrealizedPnlInAum: boolean;
1274
- tradeSpreadLong: BN;
1275
- tradeSpreadShort: BN;
1276
- swapSpread: BN;
1277
- minInitialLeverage: BN;
1278
- maxLeverage: BN;
1279
- maxPayoffMult: BN;
1280
1529
  };
1281
1530
  permissions: {
1282
1531
  allowSwap: boolean;
@@ -1295,14 +1544,45 @@ export declare class PerpetualsClient {
1295
1544
  };
1296
1545
  ratioMult: BN;
1297
1546
  utilizationMult: BN;
1298
- swapIn: BN;
1299
- swapOut: BN;
1300
- stableSwapIn: BN;
1301
- stableSwapOut: BN;
1302
- addLiquidity: BN;
1303
- removeLiquidity: BN;
1547
+ swapIn: {
1548
+ baseRate: BN;
1549
+ slope1: BN;
1550
+ constant1: BN;
1551
+ slope2: BN;
1552
+ constant2: BN;
1553
+ minFee: BN;
1554
+ maxFee: BN;
1555
+ };
1556
+ swapOut: {
1557
+ baseRate: BN;
1558
+ slope1: BN;
1559
+ constant1: BN;
1560
+ slope2: BN;
1561
+ constant2: BN;
1562
+ minFee: BN;
1563
+ maxFee: BN;
1564
+ };
1565
+ addLiquidity: {
1566
+ baseRate: BN;
1567
+ slope1: BN;
1568
+ constant1: BN;
1569
+ slope2: BN;
1570
+ constant2: BN;
1571
+ minFee: BN;
1572
+ maxFee: BN;
1573
+ };
1574
+ removeLiquidity: {
1575
+ baseRate: BN;
1576
+ slope1: BN;
1577
+ constant1: BN;
1578
+ slope2: BN;
1579
+ constant2: BN;
1580
+ minFee: BN;
1581
+ maxFee: BN;
1582
+ };
1304
1583
  openPosition: BN;
1305
1584
  closePosition: BN;
1585
+ removeCollateral: BN;
1306
1586
  liquidation: BN;
1307
1587
  protocolShare: BN;
1308
1588
  };
@@ -1337,28 +1617,32 @@ export declare class PerpetualsClient {
1337
1617
  tradeStats: {
1338
1618
  profitUsd: BN;
1339
1619
  lossUsd: BN;
1340
- oiLongUsd: BN;
1341
- oiShortUsd: BN;
1620
+ oiLong: BN;
1621
+ oiShort: BN;
1342
1622
  };
1343
1623
  longPositions: {
1344
1624
  openPositions: BN;
1345
1625
  collateralUsd: BN;
1346
1626
  sizeUsd: BN;
1627
+ borrowSizeUsd: BN;
1347
1628
  lockedAmount: BN;
1348
1629
  weightedPrice: BN;
1349
1630
  totalQuantity: BN;
1350
1631
  cumulativeInterestUsd: BN;
1351
1632
  cumulativeInterestSnapshot: BN;
1633
+ collateralAmount: BN;
1352
1634
  };
1353
1635
  shortPositions: {
1354
1636
  openPositions: BN;
1355
1637
  collateralUsd: BN;
1356
1638
  sizeUsd: BN;
1639
+ borrowSizeUsd: BN;
1357
1640
  lockedAmount: BN;
1358
1641
  weightedPrice: BN;
1359
1642
  totalQuantity: BN;
1360
1643
  cumulativeInterestUsd: BN;
1361
1644
  cumulativeInterestSnapshot: BN;
1645
+ collateralAmount: BN;
1362
1646
  };
1363
1647
  borrowRateState: {
1364
1648
  currentRate: BN;
@@ -1374,10 +1658,11 @@ export declare class PerpetualsClient {
1374
1658
  instructionDataLen: number;
1375
1659
  instructionHash: BN;
1376
1660
  signers: PublicKey[];
1377
- signed: boolean[];
1661
+ signed: number[];
1378
1662
  price: BN;
1379
1663
  expo: number;
1380
1664
  conf: BN;
1665
+ ema: BN;
1381
1666
  publishTime: BN;
1382
1667
  pools: PublicKey[];
1383
1668
  transferAuthorityBump: number;
@@ -1393,7 +1678,9 @@ export declare class PerpetualsClient {
1393
1678
  aumUsd: BN;
1394
1679
  lpTokenBump: number;
1395
1680
  owner: PublicKey;
1681
+ payer: PublicKey;
1396
1682
  custody: PublicKey;
1683
+ collateralCustody: PublicKey;
1397
1684
  openTime: BN;
1398
1685
  updateTime: BN;
1399
1686
  side: {
@@ -1402,6 +1689,7 @@ export declare class PerpetualsClient {
1402
1689
  short?: Record<string, never>;
1403
1690
  };
1404
1691
  sizeUsd: BN;
1692
+ borrowSizeUsd: BN;
1405
1693
  collateralUsd: BN;
1406
1694
  unrealizedProfitUsd: BN;
1407
1695
  unrealizedLossUsd: BN;
@@ -1415,13 +1703,17 @@ export declare class PerpetualsClient {
1415
1703
  tokenAccount: PublicKey;
1416
1704
  decimals: number;
1417
1705
  isStable: boolean;
1706
+ isVirtual: boolean;
1418
1707
  oracle: {
1419
1708
  oracleAccount: PublicKey;
1709
+ customOracleAccount: PublicKey;
1420
1710
  oracleType: {
1421
1711
  none?: Record<string, never>;
1422
- test?: Record<string, never>;
1712
+ custom?: Record<string, never>;
1423
1713
  pyth?: Record<string, never>;
1714
+ backup?: Record<string, never>;
1424
1715
  };
1716
+ maxDifferenceThreshold: BN;
1425
1717
  maxPriceError: BN;
1426
1718
  maxPriceAgeSec: number;
1427
1719
  };
@@ -1434,19 +1726,12 @@ export declare class PerpetualsClient {
1434
1726
  minInitialLeverage: BN;
1435
1727
  maxInitialLeverage: BN;
1436
1728
  maxLeverage: BN;
1729
+ minCollateralUsd: BN;
1730
+ minTimeSeconds: BN;
1437
1731
  maxPayoffMult: BN;
1438
1732
  maxUtilization: BN;
1439
1733
  maxPositionLockedUsd: BN;
1440
1734
  maxTotalLockedUsd: BN;
1441
- } | {
1442
- useEma: boolean;
1443
- useUnrealizedPnlInAum: boolean;
1444
- tradeSpreadLong: BN;
1445
- tradeSpreadShort: BN;
1446
- swapSpread: BN;
1447
- minInitialLeverage: BN;
1448
- maxLeverage: BN;
1449
- maxPayoffMult: BN;
1450
1735
  };
1451
1736
  permissions: {
1452
1737
  allowSwap: boolean;
@@ -1465,14 +1750,45 @@ export declare class PerpetualsClient {
1465
1750
  };
1466
1751
  ratioMult: BN;
1467
1752
  utilizationMult: BN;
1468
- swapIn: BN;
1469
- swapOut: BN;
1470
- stableSwapIn: BN;
1471
- stableSwapOut: BN;
1472
- addLiquidity: BN;
1473
- removeLiquidity: BN;
1753
+ swapIn: {
1754
+ baseRate: BN;
1755
+ slope1: BN;
1756
+ constant1: BN;
1757
+ slope2: BN;
1758
+ constant2: BN;
1759
+ minFee: BN;
1760
+ maxFee: BN;
1761
+ };
1762
+ swapOut: {
1763
+ baseRate: BN;
1764
+ slope1: BN;
1765
+ constant1: BN;
1766
+ slope2: BN;
1767
+ constant2: BN;
1768
+ minFee: BN;
1769
+ maxFee: BN;
1770
+ };
1771
+ addLiquidity: {
1772
+ baseRate: BN;
1773
+ slope1: BN;
1774
+ constant1: BN;
1775
+ slope2: BN;
1776
+ constant2: BN;
1777
+ minFee: BN;
1778
+ maxFee: BN;
1779
+ };
1780
+ removeLiquidity: {
1781
+ baseRate: BN;
1782
+ slope1: BN;
1783
+ constant1: BN;
1784
+ slope2: BN;
1785
+ constant2: BN;
1786
+ minFee: BN;
1787
+ maxFee: BN;
1788
+ };
1474
1789
  openPosition: BN;
1475
1790
  closePosition: BN;
1791
+ removeCollateral: BN;
1476
1792
  liquidation: BN;
1477
1793
  protocolShare: BN;
1478
1794
  };
@@ -1507,28 +1823,32 @@ export declare class PerpetualsClient {
1507
1823
  tradeStats: {
1508
1824
  profitUsd: BN;
1509
1825
  lossUsd: BN;
1510
- oiLongUsd: BN;
1511
- oiShortUsd: BN;
1826
+ oiLong: BN;
1827
+ oiShort: BN;
1512
1828
  };
1513
1829
  longPositions: {
1514
1830
  openPositions: BN;
1515
1831
  collateralUsd: BN;
1516
1832
  sizeUsd: BN;
1833
+ borrowSizeUsd: BN;
1517
1834
  lockedAmount: BN;
1518
1835
  weightedPrice: BN;
1519
1836
  totalQuantity: BN;
1520
1837
  cumulativeInterestUsd: BN;
1521
1838
  cumulativeInterestSnapshot: BN;
1839
+ collateralAmount: BN;
1522
1840
  };
1523
1841
  shortPositions: {
1524
1842
  openPositions: BN;
1525
1843
  collateralUsd: BN;
1526
1844
  sizeUsd: BN;
1845
+ borrowSizeUsd: BN;
1527
1846
  lockedAmount: BN;
1528
1847
  weightedPrice: BN;
1529
1848
  totalQuantity: BN;
1530
1849
  cumulativeInterestUsd: BN;
1531
1850
  cumulativeInterestSnapshot: BN;
1851
+ collateralAmount: BN;
1532
1852
  };
1533
1853
  borrowRateState: {
1534
1854
  currentRate: BN;
@@ -1544,10 +1864,11 @@ export declare class PerpetualsClient {
1544
1864
  instructionDataLen: number;
1545
1865
  instructionHash: BN;
1546
1866
  signers: PublicKey[];
1547
- signed: boolean[];
1867
+ signed: number[];
1548
1868
  price: BN;
1549
1869
  expo: number;
1550
1870
  conf: BN;
1871
+ ema: BN;
1551
1872
  publishTime: BN;
1552
1873
  pools: PublicKey[];
1553
1874
  transferAuthorityBump: number;
@@ -1563,7 +1884,9 @@ export declare class PerpetualsClient {
1563
1884
  aumUsd: BN;
1564
1885
  lpTokenBump: number;
1565
1886
  owner: PublicKey;
1887
+ payer: PublicKey;
1566
1888
  custody: PublicKey;
1889
+ collateralCustody: PublicKey;
1567
1890
  openTime: BN;
1568
1891
  updateTime: BN;
1569
1892
  side: {
@@ -1572,6 +1895,7 @@ export declare class PerpetualsClient {
1572
1895
  short?: Record<string, never>;
1573
1896
  };
1574
1897
  sizeUsd: BN;
1898
+ borrowSizeUsd: BN;
1575
1899
  collateralUsd: BN;
1576
1900
  unrealizedProfitUsd: BN;
1577
1901
  unrealizedLossUsd: BN;
@@ -1586,13 +1910,17 @@ export declare class PerpetualsClient {
1586
1910
  tokenAccount: PublicKey;
1587
1911
  decimals: number;
1588
1912
  isStable: boolean;
1913
+ isVirtual: boolean;
1589
1914
  oracle: {
1590
1915
  oracleAccount: PublicKey;
1916
+ customOracleAccount: PublicKey;
1591
1917
  oracleType: {
1592
1918
  none?: Record<string, never>;
1593
- test?: Record<string, never>;
1919
+ custom?: Record<string, never>;
1594
1920
  pyth?: Record<string, never>;
1921
+ backup?: Record<string, never>;
1595
1922
  };
1923
+ maxDifferenceThreshold: BN;
1596
1924
  maxPriceError: BN;
1597
1925
  maxPriceAgeSec: number;
1598
1926
  };
@@ -1605,19 +1933,12 @@ export declare class PerpetualsClient {
1605
1933
  minInitialLeverage: BN;
1606
1934
  maxInitialLeverage: BN;
1607
1935
  maxLeverage: BN;
1936
+ minCollateralUsd: BN;
1937
+ minTimeSeconds: BN;
1608
1938
  maxPayoffMult: BN;
1609
1939
  maxUtilization: BN;
1610
1940
  maxPositionLockedUsd: BN;
1611
1941
  maxTotalLockedUsd: BN;
1612
- } | {
1613
- useEma: boolean;
1614
- useUnrealizedPnlInAum: boolean;
1615
- tradeSpreadLong: BN;
1616
- tradeSpreadShort: BN;
1617
- swapSpread: BN;
1618
- minInitialLeverage: BN;
1619
- maxLeverage: BN;
1620
- maxPayoffMult: BN;
1621
1942
  };
1622
1943
  permissions: {
1623
1944
  allowSwap: boolean;
@@ -1636,14 +1957,45 @@ export declare class PerpetualsClient {
1636
1957
  };
1637
1958
  ratioMult: BN;
1638
1959
  utilizationMult: BN;
1639
- swapIn: BN;
1640
- swapOut: BN;
1641
- stableSwapIn: BN;
1642
- stableSwapOut: BN;
1643
- addLiquidity: BN;
1644
- removeLiquidity: BN;
1960
+ swapIn: {
1961
+ baseRate: BN;
1962
+ slope1: BN;
1963
+ constant1: BN;
1964
+ slope2: BN;
1965
+ constant2: BN;
1966
+ minFee: BN;
1967
+ maxFee: BN;
1968
+ };
1969
+ swapOut: {
1970
+ baseRate: BN;
1971
+ slope1: BN;
1972
+ constant1: BN;
1973
+ slope2: BN;
1974
+ constant2: BN;
1975
+ minFee: BN;
1976
+ maxFee: BN;
1977
+ };
1978
+ addLiquidity: {
1979
+ baseRate: BN;
1980
+ slope1: BN;
1981
+ constant1: BN;
1982
+ slope2: BN;
1983
+ constant2: BN;
1984
+ minFee: BN;
1985
+ maxFee: BN;
1986
+ };
1987
+ removeLiquidity: {
1988
+ baseRate: BN;
1989
+ slope1: BN;
1990
+ constant1: BN;
1991
+ slope2: BN;
1992
+ constant2: BN;
1993
+ minFee: BN;
1994
+ maxFee: BN;
1995
+ };
1645
1996
  openPosition: BN;
1646
1997
  closePosition: BN;
1998
+ removeCollateral: BN;
1647
1999
  liquidation: BN;
1648
2000
  protocolShare: BN;
1649
2001
  };
@@ -1678,28 +2030,32 @@ export declare class PerpetualsClient {
1678
2030
  tradeStats: {
1679
2031
  profitUsd: BN;
1680
2032
  lossUsd: BN;
1681
- oiLongUsd: BN;
1682
- oiShortUsd: BN;
2033
+ oiLong: BN;
2034
+ oiShort: BN;
1683
2035
  };
1684
2036
  longPositions: {
1685
2037
  openPositions: BN;
1686
2038
  collateralUsd: BN;
1687
2039
  sizeUsd: BN;
2040
+ borrowSizeUsd: BN;
1688
2041
  lockedAmount: BN;
1689
2042
  weightedPrice: BN;
1690
2043
  totalQuantity: BN;
1691
2044
  cumulativeInterestUsd: BN;
1692
2045
  cumulativeInterestSnapshot: BN;
2046
+ collateralAmount: BN;
1693
2047
  };
1694
2048
  shortPositions: {
1695
2049
  openPositions: BN;
1696
2050
  collateralUsd: BN;
1697
2051
  sizeUsd: BN;
2052
+ borrowSizeUsd: BN;
1698
2053
  lockedAmount: BN;
1699
2054
  weightedPrice: BN;
1700
2055
  totalQuantity: BN;
1701
2056
  cumulativeInterestUsd: BN;
1702
2057
  cumulativeInterestSnapshot: BN;
2058
+ collateralAmount: BN;
1703
2059
  };
1704
2060
  borrowRateState: {
1705
2061
  currentRate: BN;
@@ -1715,10 +2071,11 @@ export declare class PerpetualsClient {
1715
2071
  instructionDataLen: number;
1716
2072
  instructionHash: BN;
1717
2073
  signers: PublicKey[];
1718
- signed: boolean[];
2074
+ signed: number[];
1719
2075
  price: BN;
1720
2076
  expo: number;
1721
2077
  conf: BN;
2078
+ ema: BN;
1722
2079
  publishTime: BN;
1723
2080
  pools: PublicKey[];
1724
2081
  transferAuthorityBump: number;
@@ -1734,7 +2091,9 @@ export declare class PerpetualsClient {
1734
2091
  aumUsd: BN;
1735
2092
  lpTokenBump: number;
1736
2093
  owner: PublicKey;
2094
+ payer: PublicKey;
1737
2095
  custody: PublicKey;
2096
+ collateralCustody: PublicKey;
1738
2097
  openTime: BN;
1739
2098
  updateTime: BN;
1740
2099
  side: {
@@ -1743,6 +2102,7 @@ export declare class PerpetualsClient {
1743
2102
  short?: Record<string, never>;
1744
2103
  };
1745
2104
  sizeUsd: BN;
2105
+ borrowSizeUsd: BN;
1746
2106
  collateralUsd: BN;
1747
2107
  unrealizedProfitUsd: BN;
1748
2108
  unrealizedLossUsd: BN;
@@ -1756,13 +2116,17 @@ export declare class PerpetualsClient {
1756
2116
  tokenAccount: PublicKey;
1757
2117
  decimals: number;
1758
2118
  isStable: boolean;
2119
+ isVirtual: boolean;
1759
2120
  oracle: {
1760
2121
  oracleAccount: PublicKey;
2122
+ customOracleAccount: PublicKey;
1761
2123
  oracleType: {
1762
2124
  none?: Record<string, never>;
1763
- test?: Record<string, never>;
2125
+ custom?: Record<string, never>;
1764
2126
  pyth?: Record<string, never>;
2127
+ backup?: Record<string, never>;
1765
2128
  };
2129
+ maxDifferenceThreshold: BN;
1766
2130
  maxPriceError: BN;
1767
2131
  maxPriceAgeSec: number;
1768
2132
  };
@@ -1775,19 +2139,12 @@ export declare class PerpetualsClient {
1775
2139
  minInitialLeverage: BN;
1776
2140
  maxInitialLeverage: BN;
1777
2141
  maxLeverage: BN;
2142
+ minCollateralUsd: BN;
2143
+ minTimeSeconds: BN;
1778
2144
  maxPayoffMult: BN;
1779
2145
  maxUtilization: BN;
1780
2146
  maxPositionLockedUsd: BN;
1781
2147
  maxTotalLockedUsd: BN;
1782
- } | {
1783
- useEma: boolean;
1784
- useUnrealizedPnlInAum: boolean;
1785
- tradeSpreadLong: BN;
1786
- tradeSpreadShort: BN;
1787
- swapSpread: BN;
1788
- minInitialLeverage: BN;
1789
- maxLeverage: BN;
1790
- maxPayoffMult: BN;
1791
2148
  };
1792
2149
  permissions: {
1793
2150
  allowSwap: boolean;
@@ -1806,14 +2163,45 @@ export declare class PerpetualsClient {
1806
2163
  };
1807
2164
  ratioMult: BN;
1808
2165
  utilizationMult: BN;
1809
- swapIn: BN;
1810
- swapOut: BN;
1811
- stableSwapIn: BN;
1812
- stableSwapOut: BN;
1813
- addLiquidity: BN;
1814
- removeLiquidity: BN;
2166
+ swapIn: {
2167
+ baseRate: BN;
2168
+ slope1: BN;
2169
+ constant1: BN;
2170
+ slope2: BN;
2171
+ constant2: BN;
2172
+ minFee: BN;
2173
+ maxFee: BN;
2174
+ };
2175
+ swapOut: {
2176
+ baseRate: BN;
2177
+ slope1: BN;
2178
+ constant1: BN;
2179
+ slope2: BN;
2180
+ constant2: BN;
2181
+ minFee: BN;
2182
+ maxFee: BN;
2183
+ };
2184
+ addLiquidity: {
2185
+ baseRate: BN;
2186
+ slope1: BN;
2187
+ constant1: BN;
2188
+ slope2: BN;
2189
+ constant2: BN;
2190
+ minFee: BN;
2191
+ maxFee: BN;
2192
+ };
2193
+ removeLiquidity: {
2194
+ baseRate: BN;
2195
+ slope1: BN;
2196
+ constant1: BN;
2197
+ slope2: BN;
2198
+ constant2: BN;
2199
+ minFee: BN;
2200
+ maxFee: BN;
2201
+ };
1815
2202
  openPosition: BN;
1816
2203
  closePosition: BN;
2204
+ removeCollateral: BN;
1817
2205
  liquidation: BN;
1818
2206
  protocolShare: BN;
1819
2207
  };
@@ -1848,28 +2236,32 @@ export declare class PerpetualsClient {
1848
2236
  tradeStats: {
1849
2237
  profitUsd: BN;
1850
2238
  lossUsd: BN;
1851
- oiLongUsd: BN;
1852
- oiShortUsd: BN;
2239
+ oiLong: BN;
2240
+ oiShort: BN;
1853
2241
  };
1854
2242
  longPositions: {
1855
2243
  openPositions: BN;
1856
2244
  collateralUsd: BN;
1857
2245
  sizeUsd: BN;
2246
+ borrowSizeUsd: BN;
1858
2247
  lockedAmount: BN;
1859
2248
  weightedPrice: BN;
1860
2249
  totalQuantity: BN;
1861
2250
  cumulativeInterestUsd: BN;
1862
2251
  cumulativeInterestSnapshot: BN;
2252
+ collateralAmount: BN;
1863
2253
  };
1864
2254
  shortPositions: {
1865
2255
  openPositions: BN;
1866
2256
  collateralUsd: BN;
1867
2257
  sizeUsd: BN;
2258
+ borrowSizeUsd: BN;
1868
2259
  lockedAmount: BN;
1869
2260
  weightedPrice: BN;
1870
2261
  totalQuantity: BN;
1871
2262
  cumulativeInterestUsd: BN;
1872
2263
  cumulativeInterestSnapshot: BN;
2264
+ collateralAmount: BN;
1873
2265
  };
1874
2266
  borrowRateState: {
1875
2267
  currentRate: BN;
@@ -1885,10 +2277,11 @@ export declare class PerpetualsClient {
1885
2277
  instructionDataLen: number;
1886
2278
  instructionHash: BN;
1887
2279
  signers: PublicKey[];
1888
- signed: boolean[];
2280
+ signed: number[];
1889
2281
  price: BN;
1890
2282
  expo: number;
1891
2283
  conf: BN;
2284
+ ema: BN;
1892
2285
  publishTime: BN;
1893
2286
  pools: PublicKey[];
1894
2287
  transferAuthorityBump: number;
@@ -1904,7 +2297,9 @@ export declare class PerpetualsClient {
1904
2297
  aumUsd: BN;
1905
2298
  lpTokenBump: number;
1906
2299
  owner: PublicKey;
2300
+ payer: PublicKey;
1907
2301
  custody: PublicKey;
2302
+ collateralCustody: PublicKey;
1908
2303
  openTime: BN;
1909
2304
  updateTime: BN;
1910
2305
  side: {
@@ -1913,6 +2308,7 @@ export declare class PerpetualsClient {
1913
2308
  short?: Record<string, never>;
1914
2309
  };
1915
2310
  sizeUsd: BN;
2311
+ borrowSizeUsd: BN;
1916
2312
  collateralUsd: BN;
1917
2313
  unrealizedProfitUsd: BN;
1918
2314
  unrealizedLossUsd: BN;
@@ -1931,7 +2327,7 @@ export declare class PerpetualsClient {
1931
2327
  editCustody: (poolName: string, tokenMint: PublicKey, isStable: boolean, oracle: OracleParams, pricing: PricingParams, permissions: Permissions, fees: Fees, borrowRate: BorrowRateParams, ratios: TokenRatios[]) => Promise<void>;
1932
2328
  removeCustody: (poolName: string, tokenMint: PublicKey, ratios: TokenRatios[]) => Promise<void>;
1933
2329
  upgradeCustody: (poolName: string, tokenMint: PublicKey) => Promise<void>;
1934
- liquidate: (wallet: PublicKey, poolName: string, tokenMint: PublicKey, side: PositionSide, receivingAccount: PublicKey, rewardsReceivingAccount: PublicKey) => Promise<string>;
2330
+ liquidate: (wallet: PublicKey, poolName: string, tokenMint: PublicKey, collateralMint: PublicKey, side: PositionSide, receivingAccount: PublicKey, rewardsReceivingAccount: PublicKey) => Promise<string>;
1935
2331
  getOraclePrice: (poolName: string, tokenMint: PublicKey, ema: boolean) => Promise<any>;
1936
2332
  getAddLiquidityAmountAndFee: (poolName: string, tokenMint: PublicKey, amount: BN) => Promise<any>;
1937
2333
  getRemoveLiquidityAmountAndFee: (poolName: string, tokenMint: PublicKey, lpAmount: BN) => Promise<any>;
@@ -1951,19 +2347,17 @@ export declare class PerpetualsClient {
1951
2347
  getAumView: (poolName: string) => Promise<any>;
1952
2348
  getAumTrx: (poolName: string) => Promise<string>;
1953
2349
  getAumSdk: (poolAccount: PoolAccount, token_prices: OraclePrice[], token_ema_prices: OraclePrice[], custodies: CustodyAccount[], aum_calc_mode: AumCalcMode, currentTime: BN) => BN;
1954
- openPosition: (payTokenSymbol: string, priceAfterSlippage: BN, collateralWithfee: BN, fee: BN, size: BN, side: Side, poolConfig: PoolConfig, createUserWSOLATA?: boolean, skipBalanceChecks?: boolean) => Promise<{
2350
+ openPosition: (marketSymbol: string, collateralSymbol: string, priceAfterSlippage: BN, collateralWithfee: BN, fee: BN, size: BN, side: Side, poolConfig: PoolConfig, createUserWSOLATA?: boolean, skipBalanceChecks?: boolean) => Promise<{
1955
2351
  instructions: TransactionInstruction[];
1956
2352
  additionalSigners: Signer[];
1957
2353
  }>;
1958
- closePosition: (receivingTokenSymbol: string, priceAfterSlippage: BN, side: Side, poolConfig: PoolConfig, createUserATA?: boolean, closeUsersWSOLATA?: boolean) => Promise<{
2354
+ closePosition: (marketSymbol: string, collateralSymbol: string, priceAfterSlippage: BN, side: Side, poolConfig: PoolConfig, createUserATA?: boolean, closeUsersWSOLATA?: boolean) => Promise<{
1959
2355
  instructions: TransactionInstruction[];
1960
2356
  additionalSigners: Signer[];
1961
2357
  }>;
1962
- openPositionOld: (payTokenSymbol: string, priceAfterSlippage: BN, collateral: BN, fee: BN, size: BN, side: Side, poolConfig: PoolConfig, createUserWSOLATA?: boolean) => Promise<TransactionInstruction[]>;
1963
- closePositionOld: (receivingTokenSymbol: string, priceAfterSlippage: BN, side: Side, poolConfig: PoolConfig) => Promise<TransactionInstruction[]>;
1964
2358
  swap: (poolReceivingTokenSymbol: string, poolDispensingTokenSymbol: string, amountIn: BN, minAmountOut: BN, poolConfig: PoolConfig, unWrapSol?: boolean) => Promise<TransactionInstruction[]>;
1965
- addCollateral: (collateralWithoutFee: BN, fee: BN, collateralSymbol: string, positionPubKey: PublicKey, poolConfig: PoolConfig) => Promise<TransactionInstruction[]>;
1966
- removeCollateral: (collateralWithoutFee: BN, collateralSymbol: string, positionPubKey: PublicKey, poolConfig: PoolConfig) => Promise<TransactionInstruction[]>;
2359
+ addCollateral: (collateralWithoutFee: BN, fee: BN, marketSymbol: string, collateralSymbol: string, positionPubKey: PublicKey, poolConfig: PoolConfig) => Promise<TransactionInstruction[]>;
2360
+ removeCollateral: (collateralWithoutFee: BN, marketSymbol: string, collateralSymbol: string, positionPubKey: PublicKey, poolConfig: PoolConfig) => Promise<TransactionInstruction[]>;
1967
2361
  addLiquidity: (payTokenSymbol: string, tokenAmountIn: BN, minLpAmountOut: BN, poolConfig: PoolConfig) => Promise<TransactionInstruction[]>;
1968
2362
  removeLiquidity: (recieveTokenSymbol: string, liquidityAmountIn: BN, minTokenAmountOut: BN, poolConfig: PoolConfig, closeLpATA?: boolean) => Promise<TransactionInstruction[]>;
1969
2363
  sendTransaction(ixs: TransactionInstruction[], opts?: any): Promise<string>;