@crypticdot/defituna-api 1.1.28

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.
@@ -0,0 +1,1712 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const NotificationEntity: {
4
+ readonly POOL_SWAP: "pool_swap";
5
+ readonly POOL_PRICE: "pool_price";
6
+ readonly ORDER_BOOK: "order_book";
7
+ };
8
+ declare const NotificationAction: {
9
+ readonly CREATE: "create";
10
+ readonly UPDATE: "update";
11
+ };
12
+ declare const PoolProvider: {
13
+ readonly ORCA: "orca";
14
+ readonly FUSION: "fusion";
15
+ };
16
+ declare const TunaPositionState: {
17
+ readonly OPEN: "open";
18
+ readonly LIQUIDATED: "liquidated";
19
+ readonly CLOSED_BY_LIMIT_ORDER: "closed_by_limit_order";
20
+ readonly CLOSED: "closed";
21
+ };
22
+ declare const LimitOrderState: {
23
+ readonly OPEN: "open";
24
+ readonly PARTIALLY_FILLED: "partially_filled";
25
+ readonly FILLED: "filled";
26
+ readonly COMPLETE: "complete";
27
+ readonly CANCELLED: "cancelled";
28
+ };
29
+ declare const NotificationEntitySchema: z.ZodEnum<["pool_swap", ...("pool_swap" | "pool_price" | "order_book")[]]>;
30
+ declare const NotificationActionSchema: z.ZodEnum<["create", ...("create" | "update")[]]>;
31
+ declare const PoolProviderSchema: z.ZodEnum<["orca", ...("orca" | "fusion")[]]>;
32
+ declare const TunaPositionStateSchema: z.ZodEnum<["open", ...("open" | "liquidated" | "closed_by_limit_order" | "closed")[]]>;
33
+ declare const LimitOrderStateSchema: z.ZodEnum<["open", ...("open" | "partially_filled" | "filled" | "complete" | "cancelled")[]]>;
34
+ declare const Mint$1: z.ZodObject<{
35
+ symbol: z.ZodString;
36
+ mint: z.ZodString;
37
+ logo: z.ZodString;
38
+ decimals: z.ZodNumber;
39
+ }, "strip", z.ZodTypeAny, {
40
+ symbol: string;
41
+ mint: string;
42
+ logo: string;
43
+ decimals: number;
44
+ }, {
45
+ symbol: string;
46
+ mint: string;
47
+ logo: string;
48
+ decimals: number;
49
+ }>;
50
+ declare const Market$1: z.ZodObject<{
51
+ address: z.ZodString;
52
+ addressLookupTable: z.ZodString;
53
+ poolAddress: z.ZodString;
54
+ poolFeeRate: z.ZodNumber;
55
+ provider: z.ZodEnum<["orca", ...("orca" | "fusion")[]]>;
56
+ maxLeverage: z.ZodNumber;
57
+ protocolFee: z.ZodNumber;
58
+ protocolFeeOnCollateral: z.ZodNumber;
59
+ liquidationFee: z.ZodNumber;
60
+ liquidationThreshold: z.ZodNumber;
61
+ limitOrderExecutionFee: z.ZodNumber;
62
+ borrowedFundsA: z.ZodObject<{
63
+ amount: z.ZodBigInt;
64
+ usd: z.ZodNumber;
65
+ }, "strip", z.ZodTypeAny, {
66
+ amount: bigint;
67
+ usd: number;
68
+ }, {
69
+ amount: bigint;
70
+ usd: number;
71
+ }>;
72
+ borrowedFundsB: z.ZodObject<{
73
+ amount: z.ZodBigInt;
74
+ usd: z.ZodNumber;
75
+ }, "strip", z.ZodTypeAny, {
76
+ amount: bigint;
77
+ usd: number;
78
+ }, {
79
+ amount: bigint;
80
+ usd: number;
81
+ }>;
82
+ availableBorrowA: z.ZodObject<{
83
+ amount: z.ZodBigInt;
84
+ usd: z.ZodNumber;
85
+ }, "strip", z.ZodTypeAny, {
86
+ amount: bigint;
87
+ usd: number;
88
+ }, {
89
+ amount: bigint;
90
+ usd: number;
91
+ }>;
92
+ availableBorrowB: z.ZodObject<{
93
+ amount: z.ZodBigInt;
94
+ usd: z.ZodNumber;
95
+ }, "strip", z.ZodTypeAny, {
96
+ amount: bigint;
97
+ usd: number;
98
+ }, {
99
+ amount: bigint;
100
+ usd: number;
101
+ }>;
102
+ borrowLimitA: z.ZodObject<{
103
+ amount: z.ZodBigInt;
104
+ usd: z.ZodNumber;
105
+ }, "strip", z.ZodTypeAny, {
106
+ amount: bigint;
107
+ usd: number;
108
+ }, {
109
+ amount: bigint;
110
+ usd: number;
111
+ }>;
112
+ borrowLimitB: z.ZodObject<{
113
+ amount: z.ZodBigInt;
114
+ usd: z.ZodNumber;
115
+ }, "strip", z.ZodTypeAny, {
116
+ amount: bigint;
117
+ usd: number;
118
+ }, {
119
+ amount: bigint;
120
+ usd: number;
121
+ }>;
122
+ disabled: z.ZodBoolean;
123
+ }, "strip", z.ZodTypeAny, {
124
+ address: string;
125
+ addressLookupTable: string;
126
+ poolAddress: string;
127
+ poolFeeRate: number;
128
+ provider: "orca" | "fusion";
129
+ maxLeverage: number;
130
+ protocolFee: number;
131
+ protocolFeeOnCollateral: number;
132
+ liquidationFee: number;
133
+ liquidationThreshold: number;
134
+ limitOrderExecutionFee: number;
135
+ borrowedFundsA: {
136
+ amount: bigint;
137
+ usd: number;
138
+ };
139
+ borrowedFundsB: {
140
+ amount: bigint;
141
+ usd: number;
142
+ };
143
+ availableBorrowA: {
144
+ amount: bigint;
145
+ usd: number;
146
+ };
147
+ availableBorrowB: {
148
+ amount: bigint;
149
+ usd: number;
150
+ };
151
+ borrowLimitA: {
152
+ amount: bigint;
153
+ usd: number;
154
+ };
155
+ borrowLimitB: {
156
+ amount: bigint;
157
+ usd: number;
158
+ };
159
+ disabled: boolean;
160
+ }, {
161
+ address: string;
162
+ addressLookupTable: string;
163
+ poolAddress: string;
164
+ poolFeeRate: number;
165
+ provider: "orca" | "fusion";
166
+ maxLeverage: number;
167
+ protocolFee: number;
168
+ protocolFeeOnCollateral: number;
169
+ liquidationFee: number;
170
+ liquidationThreshold: number;
171
+ limitOrderExecutionFee: number;
172
+ borrowedFundsA: {
173
+ amount: bigint;
174
+ usd: number;
175
+ };
176
+ borrowedFundsB: {
177
+ amount: bigint;
178
+ usd: number;
179
+ };
180
+ availableBorrowA: {
181
+ amount: bigint;
182
+ usd: number;
183
+ };
184
+ availableBorrowB: {
185
+ amount: bigint;
186
+ usd: number;
187
+ };
188
+ borrowLimitA: {
189
+ amount: bigint;
190
+ usd: number;
191
+ };
192
+ borrowLimitB: {
193
+ amount: bigint;
194
+ usd: number;
195
+ };
196
+ disabled: boolean;
197
+ }>;
198
+ declare const TokenOraclePrice$1: z.ZodObject<{
199
+ mint: z.ZodString;
200
+ price: z.ZodBigInt;
201
+ decimals: z.ZodNumber;
202
+ time: z.ZodDate;
203
+ }, "strip", z.ZodTypeAny, {
204
+ mint: string;
205
+ decimals: number;
206
+ price: bigint;
207
+ time: Date;
208
+ }, {
209
+ mint: string;
210
+ decimals: number;
211
+ price: bigint;
212
+ time: Date;
213
+ }>;
214
+ declare const Vault$1: z.ZodObject<{
215
+ address: z.ZodString;
216
+ mint: z.ZodString;
217
+ depositedFunds: z.ZodObject<{
218
+ amount: z.ZodBigInt;
219
+ usd: z.ZodNumber;
220
+ }, "strip", z.ZodTypeAny, {
221
+ amount: bigint;
222
+ usd: number;
223
+ }, {
224
+ amount: bigint;
225
+ usd: number;
226
+ }>;
227
+ borrowedFunds: z.ZodObject<{
228
+ amount: z.ZodBigInt;
229
+ usd: z.ZodNumber;
230
+ }, "strip", z.ZodTypeAny, {
231
+ amount: bigint;
232
+ usd: number;
233
+ }, {
234
+ amount: bigint;
235
+ usd: number;
236
+ }>;
237
+ supplyLimit: z.ZodObject<{
238
+ amount: z.ZodBigInt;
239
+ usd: z.ZodNumber;
240
+ }, "strip", z.ZodTypeAny, {
241
+ amount: bigint;
242
+ usd: number;
243
+ }, {
244
+ amount: bigint;
245
+ usd: number;
246
+ }>;
247
+ borrowedShares: z.ZodBigInt;
248
+ depositedShares: z.ZodBigInt;
249
+ supplyApy: z.ZodNumber;
250
+ borrowApy: z.ZodNumber;
251
+ utilization: z.ZodNumber;
252
+ pythOracleFeedId: z.ZodString;
253
+ pythOraclePriceUpdate: z.ZodString;
254
+ }, "strip", z.ZodTypeAny, {
255
+ mint: string;
256
+ address: string;
257
+ depositedFunds: {
258
+ amount: bigint;
259
+ usd: number;
260
+ };
261
+ borrowedFunds: {
262
+ amount: bigint;
263
+ usd: number;
264
+ };
265
+ supplyLimit: {
266
+ amount: bigint;
267
+ usd: number;
268
+ };
269
+ borrowedShares: bigint;
270
+ depositedShares: bigint;
271
+ supplyApy: number;
272
+ borrowApy: number;
273
+ utilization: number;
274
+ pythOracleFeedId: string;
275
+ pythOraclePriceUpdate: string;
276
+ }, {
277
+ mint: string;
278
+ address: string;
279
+ depositedFunds: {
280
+ amount: bigint;
281
+ usd: number;
282
+ };
283
+ borrowedFunds: {
284
+ amount: bigint;
285
+ usd: number;
286
+ };
287
+ supplyLimit: {
288
+ amount: bigint;
289
+ usd: number;
290
+ };
291
+ borrowedShares: bigint;
292
+ depositedShares: bigint;
293
+ supplyApy: number;
294
+ borrowApy: number;
295
+ utilization: number;
296
+ pythOracleFeedId: string;
297
+ pythOraclePriceUpdate: string;
298
+ }>;
299
+ declare const Pool$1: z.ZodObject<{
300
+ address: z.ZodString;
301
+ provider: z.ZodEnum<["orca", ...("orca" | "fusion")[]]>;
302
+ tokenAMint: z.ZodString;
303
+ tokenBMint: z.ZodString;
304
+ tokenAVault: z.ZodString;
305
+ tokenBVault: z.ZodString;
306
+ tvlUsdc: z.ZodNumber;
307
+ tickSpacing: z.ZodNumber;
308
+ feeRate: z.ZodNumber;
309
+ protocolFeeRate: z.ZodNumber;
310
+ liquidity: z.ZodBigInt;
311
+ sqrtPrice: z.ZodBigInt;
312
+ tickCurrentIndex: z.ZodNumber;
313
+ stats: z.ZodObject<{
314
+ "24h": z.ZodObject<{
315
+ volume: z.ZodNumber;
316
+ fees: z.ZodNumber;
317
+ rewards: z.ZodNumber;
318
+ yieldOverTvl: z.ZodNumber;
319
+ }, "strip", z.ZodTypeAny, {
320
+ volume: number;
321
+ fees: number;
322
+ rewards: number;
323
+ yieldOverTvl: number;
324
+ }, {
325
+ volume: number;
326
+ fees: number;
327
+ rewards: number;
328
+ yieldOverTvl: number;
329
+ }>;
330
+ "7d": z.ZodObject<{
331
+ volume: z.ZodNumber;
332
+ fees: z.ZodNumber;
333
+ rewards: z.ZodNumber;
334
+ yieldOverTvl: z.ZodNumber;
335
+ }, "strip", z.ZodTypeAny, {
336
+ volume: number;
337
+ fees: number;
338
+ rewards: number;
339
+ yieldOverTvl: number;
340
+ }, {
341
+ volume: number;
342
+ fees: number;
343
+ rewards: number;
344
+ yieldOverTvl: number;
345
+ }>;
346
+ "30d": z.ZodObject<{
347
+ volume: z.ZodNumber;
348
+ fees: z.ZodNumber;
349
+ rewards: z.ZodNumber;
350
+ yieldOverTvl: z.ZodNumber;
351
+ }, "strip", z.ZodTypeAny, {
352
+ volume: number;
353
+ fees: number;
354
+ rewards: number;
355
+ yieldOverTvl: number;
356
+ }, {
357
+ volume: number;
358
+ fees: number;
359
+ rewards: number;
360
+ yieldOverTvl: number;
361
+ }>;
362
+ }, "strip", z.ZodTypeAny, {
363
+ "24h": {
364
+ volume: number;
365
+ fees: number;
366
+ rewards: number;
367
+ yieldOverTvl: number;
368
+ };
369
+ "7d": {
370
+ volume: number;
371
+ fees: number;
372
+ rewards: number;
373
+ yieldOverTvl: number;
374
+ };
375
+ "30d": {
376
+ volume: number;
377
+ fees: number;
378
+ rewards: number;
379
+ yieldOverTvl: number;
380
+ };
381
+ }, {
382
+ "24h": {
383
+ volume: number;
384
+ fees: number;
385
+ rewards: number;
386
+ yieldOverTvl: number;
387
+ };
388
+ "7d": {
389
+ volume: number;
390
+ fees: number;
391
+ rewards: number;
392
+ yieldOverTvl: number;
393
+ };
394
+ "30d": {
395
+ volume: number;
396
+ fees: number;
397
+ rewards: number;
398
+ yieldOverTvl: number;
399
+ };
400
+ }>;
401
+ }, "strip", z.ZodTypeAny, {
402
+ address: string;
403
+ provider: "orca" | "fusion";
404
+ tokenAMint: string;
405
+ tokenBMint: string;
406
+ tokenAVault: string;
407
+ tokenBVault: string;
408
+ tvlUsdc: number;
409
+ tickSpacing: number;
410
+ feeRate: number;
411
+ protocolFeeRate: number;
412
+ liquidity: bigint;
413
+ sqrtPrice: bigint;
414
+ tickCurrentIndex: number;
415
+ stats: {
416
+ "24h": {
417
+ volume: number;
418
+ fees: number;
419
+ rewards: number;
420
+ yieldOverTvl: number;
421
+ };
422
+ "7d": {
423
+ volume: number;
424
+ fees: number;
425
+ rewards: number;
426
+ yieldOverTvl: number;
427
+ };
428
+ "30d": {
429
+ volume: number;
430
+ fees: number;
431
+ rewards: number;
432
+ yieldOverTvl: number;
433
+ };
434
+ };
435
+ }, {
436
+ address: string;
437
+ provider: "orca" | "fusion";
438
+ tokenAMint: string;
439
+ tokenBMint: string;
440
+ tokenAVault: string;
441
+ tokenBVault: string;
442
+ tvlUsdc: number;
443
+ tickSpacing: number;
444
+ feeRate: number;
445
+ protocolFeeRate: number;
446
+ liquidity: bigint;
447
+ sqrtPrice: bigint;
448
+ tickCurrentIndex: number;
449
+ stats: {
450
+ "24h": {
451
+ volume: number;
452
+ fees: number;
453
+ rewards: number;
454
+ yieldOverTvl: number;
455
+ };
456
+ "7d": {
457
+ volume: number;
458
+ fees: number;
459
+ rewards: number;
460
+ yieldOverTvl: number;
461
+ };
462
+ "30d": {
463
+ volume: number;
464
+ fees: number;
465
+ rewards: number;
466
+ yieldOverTvl: number;
467
+ };
468
+ };
469
+ }>;
470
+ declare const Tick$1: z.ZodObject<{
471
+ index: z.ZodNumber;
472
+ liquidity: z.ZodBigInt;
473
+ }, "strip", z.ZodTypeAny, {
474
+ liquidity: bigint;
475
+ index: number;
476
+ }, {
477
+ liquidity: bigint;
478
+ index: number;
479
+ }>;
480
+ declare const PoolTicks$1: z.ZodObject<{
481
+ tickSpacing: z.ZodNumber;
482
+ ticks: z.ZodArray<z.ZodObject<{
483
+ index: z.ZodNumber;
484
+ liquidity: z.ZodBigInt;
485
+ }, "strip", z.ZodTypeAny, {
486
+ liquidity: bigint;
487
+ index: number;
488
+ }, {
489
+ liquidity: bigint;
490
+ index: number;
491
+ }>, "many">;
492
+ }, "strip", z.ZodTypeAny, {
493
+ tickSpacing: number;
494
+ ticks: {
495
+ liquidity: bigint;
496
+ index: number;
497
+ }[];
498
+ }, {
499
+ tickSpacing: number;
500
+ ticks: {
501
+ liquidity: bigint;
502
+ index: number;
503
+ }[];
504
+ }>;
505
+ declare const LendingPosition$1: z.ZodObject<{
506
+ address: z.ZodString;
507
+ authority: z.ZodString;
508
+ mint: z.ZodString;
509
+ vault: z.ZodString;
510
+ shares: z.ZodBigInt;
511
+ funds: z.ZodObject<{
512
+ amount: z.ZodBigInt;
513
+ usd: z.ZodNumber;
514
+ }, "strip", z.ZodTypeAny, {
515
+ amount: bigint;
516
+ usd: number;
517
+ }, {
518
+ amount: bigint;
519
+ usd: number;
520
+ }>;
521
+ earned: z.ZodObject<{
522
+ amount: z.ZodBigInt;
523
+ usd: z.ZodNumber;
524
+ }, "strip", z.ZodTypeAny, {
525
+ amount: bigint;
526
+ usd: number;
527
+ }, {
528
+ amount: bigint;
529
+ usd: number;
530
+ }>;
531
+ }, "strip", z.ZodTypeAny, {
532
+ mint: string;
533
+ address: string;
534
+ authority: string;
535
+ vault: string;
536
+ shares: bigint;
537
+ funds: {
538
+ amount: bigint;
539
+ usd: number;
540
+ };
541
+ earned: {
542
+ amount: bigint;
543
+ usd: number;
544
+ };
545
+ }, {
546
+ mint: string;
547
+ address: string;
548
+ authority: string;
549
+ vault: string;
550
+ shares: bigint;
551
+ funds: {
552
+ amount: bigint;
553
+ usd: number;
554
+ };
555
+ earned: {
556
+ amount: bigint;
557
+ usd: number;
558
+ };
559
+ }>;
560
+ declare const TunaPosition$1: z.ZodObject<{
561
+ address: z.ZodString;
562
+ authority: z.ZodString;
563
+ version: z.ZodNumber;
564
+ state: z.ZodEnum<["open", ...("open" | "liquidated" | "closed_by_limit_order" | "closed")[]]>;
565
+ positionMint: z.ZodString;
566
+ liquidity: z.ZodBigInt;
567
+ tickLowerIndex: z.ZodNumber;
568
+ tickUpperIndex: z.ZodNumber;
569
+ tickEntryIndex: z.ZodNumber;
570
+ tickStopLossIndex: z.ZodNumber;
571
+ tickTakeProfitIndex: z.ZodNumber;
572
+ swapToTokenOnLimitOrder: z.ZodNumber;
573
+ flags: z.ZodNumber;
574
+ pool: z.ZodString;
575
+ poolSqrtPrice: z.ZodBigInt;
576
+ depositedCollateralA: z.ZodObject<{
577
+ amount: z.ZodBigInt;
578
+ }, "strip", z.ZodTypeAny, {
579
+ amount: bigint;
580
+ }, {
581
+ amount: bigint;
582
+ }>;
583
+ depositedCollateralB: z.ZodObject<{
584
+ amount: z.ZodBigInt;
585
+ }, "strip", z.ZodTypeAny, {
586
+ amount: bigint;
587
+ }, {
588
+ amount: bigint;
589
+ }>;
590
+ depositedCollateralUsd: z.ZodObject<{
591
+ amount: z.ZodNumber;
592
+ }, "strip", z.ZodTypeAny, {
593
+ amount: number;
594
+ }, {
595
+ amount: number;
596
+ }>;
597
+ loanFundsA: z.ZodObject<{
598
+ amount: z.ZodBigInt;
599
+ usd: z.ZodNumber;
600
+ }, "strip", z.ZodTypeAny, {
601
+ amount: bigint;
602
+ usd: number;
603
+ }, {
604
+ amount: bigint;
605
+ usd: number;
606
+ }>;
607
+ loanFundsB: z.ZodObject<{
608
+ amount: z.ZodBigInt;
609
+ usd: z.ZodNumber;
610
+ }, "strip", z.ZodTypeAny, {
611
+ amount: bigint;
612
+ usd: number;
613
+ }, {
614
+ amount: bigint;
615
+ usd: number;
616
+ }>;
617
+ currentLoanA: z.ZodObject<{
618
+ amount: z.ZodBigInt;
619
+ usd: z.ZodNumber;
620
+ }, "strip", z.ZodTypeAny, {
621
+ amount: bigint;
622
+ usd: number;
623
+ }, {
624
+ amount: bigint;
625
+ usd: number;
626
+ }>;
627
+ currentLoanB: z.ZodObject<{
628
+ amount: z.ZodBigInt;
629
+ usd: z.ZodNumber;
630
+ }, "strip", z.ZodTypeAny, {
631
+ amount: bigint;
632
+ usd: number;
633
+ }, {
634
+ amount: bigint;
635
+ usd: number;
636
+ }>;
637
+ leftoversA: z.ZodObject<{
638
+ amount: z.ZodBigInt;
639
+ usd: z.ZodNumber;
640
+ }, "strip", z.ZodTypeAny, {
641
+ amount: bigint;
642
+ usd: number;
643
+ }, {
644
+ amount: bigint;
645
+ usd: number;
646
+ }>;
647
+ leftoversB: z.ZodObject<{
648
+ amount: z.ZodBigInt;
649
+ usd: z.ZodNumber;
650
+ }, "strip", z.ZodTypeAny, {
651
+ amount: bigint;
652
+ usd: number;
653
+ }, {
654
+ amount: bigint;
655
+ usd: number;
656
+ }>;
657
+ yieldA: z.ZodObject<{
658
+ amount: z.ZodBigInt;
659
+ usd: z.ZodNumber;
660
+ }, "strip", z.ZodTypeAny, {
661
+ amount: bigint;
662
+ usd: number;
663
+ }, {
664
+ amount: bigint;
665
+ usd: number;
666
+ }>;
667
+ yieldB: z.ZodObject<{
668
+ amount: z.ZodBigInt;
669
+ usd: z.ZodNumber;
670
+ }, "strip", z.ZodTypeAny, {
671
+ amount: bigint;
672
+ usd: number;
673
+ }, {
674
+ amount: bigint;
675
+ usd: number;
676
+ }>;
677
+ compoundedYieldA: z.ZodObject<{
678
+ amount: z.ZodBigInt;
679
+ usd: z.ZodNumber;
680
+ }, "strip", z.ZodTypeAny, {
681
+ amount: bigint;
682
+ usd: number;
683
+ }, {
684
+ amount: bigint;
685
+ usd: number;
686
+ }>;
687
+ compoundedYieldB: z.ZodObject<{
688
+ amount: z.ZodBigInt;
689
+ usd: z.ZodNumber;
690
+ }, "strip", z.ZodTypeAny, {
691
+ amount: bigint;
692
+ usd: number;
693
+ }, {
694
+ amount: bigint;
695
+ usd: number;
696
+ }>;
697
+ totalA: z.ZodObject<{
698
+ amount: z.ZodBigInt;
699
+ usd: z.ZodNumber;
700
+ }, "strip", z.ZodTypeAny, {
701
+ amount: bigint;
702
+ usd: number;
703
+ }, {
704
+ amount: bigint;
705
+ usd: number;
706
+ }>;
707
+ totalB: z.ZodObject<{
708
+ amount: z.ZodBigInt;
709
+ usd: z.ZodNumber;
710
+ }, "strip", z.ZodTypeAny, {
711
+ amount: bigint;
712
+ usd: number;
713
+ }, {
714
+ amount: bigint;
715
+ usd: number;
716
+ }>;
717
+ pnlA: z.ZodObject<{
718
+ amount: z.ZodBigInt;
719
+ bps: z.ZodNumber;
720
+ }, "strip", z.ZodTypeAny, {
721
+ amount: bigint;
722
+ bps: number;
723
+ }, {
724
+ amount: bigint;
725
+ bps: number;
726
+ }>;
727
+ pnlB: z.ZodObject<{
728
+ amount: z.ZodBigInt;
729
+ bps: z.ZodNumber;
730
+ }, "strip", z.ZodTypeAny, {
731
+ amount: bigint;
732
+ bps: number;
733
+ }, {
734
+ amount: bigint;
735
+ bps: number;
736
+ }>;
737
+ pnlUsd: z.ZodObject<{
738
+ amount: z.ZodNumber;
739
+ bps: z.ZodNumber;
740
+ }, "strip", z.ZodTypeAny, {
741
+ amount: number;
742
+ bps: number;
743
+ }, {
744
+ amount: number;
745
+ bps: number;
746
+ }>;
747
+ openedAt: z.ZodDate;
748
+ updatedAtSlot: z.ZodBigInt;
749
+ }, "strip", z.ZodTypeAny, {
750
+ address: string;
751
+ liquidity: bigint;
752
+ authority: string;
753
+ version: number;
754
+ state: "open" | "liquidated" | "closed_by_limit_order" | "closed";
755
+ positionMint: string;
756
+ tickLowerIndex: number;
757
+ tickUpperIndex: number;
758
+ tickEntryIndex: number;
759
+ tickStopLossIndex: number;
760
+ tickTakeProfitIndex: number;
761
+ swapToTokenOnLimitOrder: number;
762
+ flags: number;
763
+ pool: string;
764
+ poolSqrtPrice: bigint;
765
+ depositedCollateralA: {
766
+ amount: bigint;
767
+ };
768
+ depositedCollateralB: {
769
+ amount: bigint;
770
+ };
771
+ depositedCollateralUsd: {
772
+ amount: number;
773
+ };
774
+ loanFundsA: {
775
+ amount: bigint;
776
+ usd: number;
777
+ };
778
+ loanFundsB: {
779
+ amount: bigint;
780
+ usd: number;
781
+ };
782
+ currentLoanA: {
783
+ amount: bigint;
784
+ usd: number;
785
+ };
786
+ currentLoanB: {
787
+ amount: bigint;
788
+ usd: number;
789
+ };
790
+ leftoversA: {
791
+ amount: bigint;
792
+ usd: number;
793
+ };
794
+ leftoversB: {
795
+ amount: bigint;
796
+ usd: number;
797
+ };
798
+ yieldA: {
799
+ amount: bigint;
800
+ usd: number;
801
+ };
802
+ yieldB: {
803
+ amount: bigint;
804
+ usd: number;
805
+ };
806
+ compoundedYieldA: {
807
+ amount: bigint;
808
+ usd: number;
809
+ };
810
+ compoundedYieldB: {
811
+ amount: bigint;
812
+ usd: number;
813
+ };
814
+ totalA: {
815
+ amount: bigint;
816
+ usd: number;
817
+ };
818
+ totalB: {
819
+ amount: bigint;
820
+ usd: number;
821
+ };
822
+ pnlA: {
823
+ amount: bigint;
824
+ bps: number;
825
+ };
826
+ pnlB: {
827
+ amount: bigint;
828
+ bps: number;
829
+ };
830
+ pnlUsd: {
831
+ amount: number;
832
+ bps: number;
833
+ };
834
+ openedAt: Date;
835
+ updatedAtSlot: bigint;
836
+ }, {
837
+ address: string;
838
+ liquidity: bigint;
839
+ authority: string;
840
+ version: number;
841
+ state: "open" | "liquidated" | "closed_by_limit_order" | "closed";
842
+ positionMint: string;
843
+ tickLowerIndex: number;
844
+ tickUpperIndex: number;
845
+ tickEntryIndex: number;
846
+ tickStopLossIndex: number;
847
+ tickTakeProfitIndex: number;
848
+ swapToTokenOnLimitOrder: number;
849
+ flags: number;
850
+ pool: string;
851
+ poolSqrtPrice: bigint;
852
+ depositedCollateralA: {
853
+ amount: bigint;
854
+ };
855
+ depositedCollateralB: {
856
+ amount: bigint;
857
+ };
858
+ depositedCollateralUsd: {
859
+ amount: number;
860
+ };
861
+ loanFundsA: {
862
+ amount: bigint;
863
+ usd: number;
864
+ };
865
+ loanFundsB: {
866
+ amount: bigint;
867
+ usd: number;
868
+ };
869
+ currentLoanA: {
870
+ amount: bigint;
871
+ usd: number;
872
+ };
873
+ currentLoanB: {
874
+ amount: bigint;
875
+ usd: number;
876
+ };
877
+ leftoversA: {
878
+ amount: bigint;
879
+ usd: number;
880
+ };
881
+ leftoversB: {
882
+ amount: bigint;
883
+ usd: number;
884
+ };
885
+ yieldA: {
886
+ amount: bigint;
887
+ usd: number;
888
+ };
889
+ yieldB: {
890
+ amount: bigint;
891
+ usd: number;
892
+ };
893
+ compoundedYieldA: {
894
+ amount: bigint;
895
+ usd: number;
896
+ };
897
+ compoundedYieldB: {
898
+ amount: bigint;
899
+ usd: number;
900
+ };
901
+ totalA: {
902
+ amount: bigint;
903
+ usd: number;
904
+ };
905
+ totalB: {
906
+ amount: bigint;
907
+ usd: number;
908
+ };
909
+ pnlA: {
910
+ amount: bigint;
911
+ bps: number;
912
+ };
913
+ pnlB: {
914
+ amount: bigint;
915
+ bps: number;
916
+ };
917
+ pnlUsd: {
918
+ amount: number;
919
+ bps: number;
920
+ };
921
+ openedAt: Date;
922
+ updatedAtSlot: bigint;
923
+ }>;
924
+ declare const PoolSwap$1: z.ZodObject<{
925
+ id: z.ZodString;
926
+ amountIn: z.ZodBigInt;
927
+ amountOut: z.ZodBigInt;
928
+ aToB: z.ZodBoolean;
929
+ pool: z.ZodString;
930
+ time: z.ZodDate;
931
+ }, "strip", z.ZodTypeAny, {
932
+ time: Date;
933
+ pool: string;
934
+ id: string;
935
+ amountIn: bigint;
936
+ amountOut: bigint;
937
+ aToB: boolean;
938
+ }, {
939
+ time: Date;
940
+ pool: string;
941
+ id: string;
942
+ amountIn: bigint;
943
+ amountOut: bigint;
944
+ aToB: boolean;
945
+ }>;
946
+ declare const OrderBookEntry$1: z.ZodObject<{
947
+ concentratedAmount: z.ZodBigInt;
948
+ concentratedAmountQuote: z.ZodBigInt;
949
+ concentratedTotal: z.ZodBigInt;
950
+ concentratedTotalQuote: z.ZodBigInt;
951
+ limitAmount: z.ZodBigInt;
952
+ limitAmountQuote: z.ZodBigInt;
953
+ limitTotal: z.ZodBigInt;
954
+ limitTotalQuote: z.ZodBigInt;
955
+ price: z.ZodNumber;
956
+ askSide: z.ZodBoolean;
957
+ }, "strip", z.ZodTypeAny, {
958
+ price: number;
959
+ concentratedAmount: bigint;
960
+ concentratedAmountQuote: bigint;
961
+ concentratedTotal: bigint;
962
+ concentratedTotalQuote: bigint;
963
+ limitAmount: bigint;
964
+ limitAmountQuote: bigint;
965
+ limitTotal: bigint;
966
+ limitTotalQuote: bigint;
967
+ askSide: boolean;
968
+ }, {
969
+ price: number;
970
+ concentratedAmount: bigint;
971
+ concentratedAmountQuote: bigint;
972
+ concentratedTotal: bigint;
973
+ concentratedTotalQuote: bigint;
974
+ limitAmount: bigint;
975
+ limitAmountQuote: bigint;
976
+ limitTotal: bigint;
977
+ limitTotalQuote: bigint;
978
+ askSide: boolean;
979
+ }>;
980
+ declare const PoolPriceUpdate$1: z.ZodObject<{
981
+ pool: z.ZodString;
982
+ price: z.ZodNumber;
983
+ sqrtPrice: z.ZodBigInt;
984
+ time: z.ZodDate;
985
+ }, "strip", z.ZodTypeAny, {
986
+ price: number;
987
+ time: Date;
988
+ sqrtPrice: bigint;
989
+ pool: string;
990
+ }, {
991
+ price: number;
992
+ time: Date;
993
+ sqrtPrice: bigint;
994
+ pool: string;
995
+ }>;
996
+ declare const OrderBook$1: z.ZodObject<{
997
+ entries: z.ZodArray<z.ZodObject<{
998
+ concentratedAmount: z.ZodBigInt;
999
+ concentratedAmountQuote: z.ZodBigInt;
1000
+ concentratedTotal: z.ZodBigInt;
1001
+ concentratedTotalQuote: z.ZodBigInt;
1002
+ limitAmount: z.ZodBigInt;
1003
+ limitAmountQuote: z.ZodBigInt;
1004
+ limitTotal: z.ZodBigInt;
1005
+ limitTotalQuote: z.ZodBigInt;
1006
+ price: z.ZodNumber;
1007
+ askSide: z.ZodBoolean;
1008
+ }, "strip", z.ZodTypeAny, {
1009
+ price: number;
1010
+ concentratedAmount: bigint;
1011
+ concentratedAmountQuote: bigint;
1012
+ concentratedTotal: bigint;
1013
+ concentratedTotalQuote: bigint;
1014
+ limitAmount: bigint;
1015
+ limitAmountQuote: bigint;
1016
+ limitTotal: bigint;
1017
+ limitTotalQuote: bigint;
1018
+ askSide: boolean;
1019
+ }, {
1020
+ price: number;
1021
+ concentratedAmount: bigint;
1022
+ concentratedAmountQuote: bigint;
1023
+ concentratedTotal: bigint;
1024
+ concentratedTotalQuote: bigint;
1025
+ limitAmount: bigint;
1026
+ limitAmountQuote: bigint;
1027
+ limitTotal: bigint;
1028
+ limitTotalQuote: bigint;
1029
+ askSide: boolean;
1030
+ }>, "many">;
1031
+ poolPrice: z.ZodNumber;
1032
+ }, "strip", z.ZodTypeAny, {
1033
+ entries: {
1034
+ price: number;
1035
+ concentratedAmount: bigint;
1036
+ concentratedAmountQuote: bigint;
1037
+ concentratedTotal: bigint;
1038
+ concentratedTotalQuote: bigint;
1039
+ limitAmount: bigint;
1040
+ limitAmountQuote: bigint;
1041
+ limitTotal: bigint;
1042
+ limitTotalQuote: bigint;
1043
+ askSide: boolean;
1044
+ }[];
1045
+ poolPrice: number;
1046
+ }, {
1047
+ entries: {
1048
+ price: number;
1049
+ concentratedAmount: bigint;
1050
+ concentratedAmountQuote: bigint;
1051
+ concentratedTotal: bigint;
1052
+ concentratedTotalQuote: bigint;
1053
+ limitAmount: bigint;
1054
+ limitAmountQuote: bigint;
1055
+ limitTotal: bigint;
1056
+ limitTotalQuote: bigint;
1057
+ askSide: boolean;
1058
+ }[];
1059
+ poolPrice: number;
1060
+ }>;
1061
+ declare const LimitOrder$1: z.ZodObject<{
1062
+ address: z.ZodString;
1063
+ mint: z.ZodString;
1064
+ pool: z.ZodString;
1065
+ state: z.ZodEnum<["open", ...("open" | "partially_filled" | "filled" | "complete" | "cancelled")[]]>;
1066
+ aToB: z.ZodBoolean;
1067
+ tickIndex: z.ZodNumber;
1068
+ fillRatio: z.ZodNumber;
1069
+ openTxSignature: z.ZodString;
1070
+ closeTxSignature: z.ZodNullable<z.ZodString>;
1071
+ amount: z.ZodObject<{
1072
+ amount: z.ZodBigInt;
1073
+ usd: z.ZodNumber;
1074
+ }, "strip", z.ZodTypeAny, {
1075
+ amount: bigint;
1076
+ usd: number;
1077
+ }, {
1078
+ amount: bigint;
1079
+ usd: number;
1080
+ }>;
1081
+ openedAt: z.ZodDate;
1082
+ closedAt: z.ZodNullable<z.ZodDate>;
1083
+ }, "strip", z.ZodTypeAny, {
1084
+ amount: {
1085
+ amount: bigint;
1086
+ usd: number;
1087
+ };
1088
+ mint: string;
1089
+ address: string;
1090
+ state: "open" | "partially_filled" | "filled" | "complete" | "cancelled";
1091
+ pool: string;
1092
+ openedAt: Date;
1093
+ aToB: boolean;
1094
+ tickIndex: number;
1095
+ fillRatio: number;
1096
+ openTxSignature: string;
1097
+ closeTxSignature: string | null;
1098
+ closedAt: Date | null;
1099
+ }, {
1100
+ amount: {
1101
+ amount: bigint;
1102
+ usd: number;
1103
+ };
1104
+ mint: string;
1105
+ address: string;
1106
+ state: "open" | "partially_filled" | "filled" | "complete" | "cancelled";
1107
+ pool: string;
1108
+ openedAt: Date;
1109
+ aToB: boolean;
1110
+ tickIndex: number;
1111
+ fillRatio: number;
1112
+ openTxSignature: string;
1113
+ closeTxSignature: string | null;
1114
+ closedAt: Date | null;
1115
+ }>;
1116
+ declare const PoolPriceCandle$1: z.ZodObject<{
1117
+ time: z.ZodNumber;
1118
+ open: z.ZodNumber;
1119
+ close: z.ZodNumber;
1120
+ high: z.ZodNumber;
1121
+ low: z.ZodNumber;
1122
+ }, "strip", z.ZodTypeAny, {
1123
+ open: number;
1124
+ time: number;
1125
+ close: number;
1126
+ high: number;
1127
+ low: number;
1128
+ }, {
1129
+ open: number;
1130
+ time: number;
1131
+ close: number;
1132
+ high: number;
1133
+ low: number;
1134
+ }>;
1135
+ declare const OrderBookNotificationMeta: z.ZodObject<{
1136
+ pool: z.ZodString;
1137
+ priceStep: z.ZodNumber;
1138
+ inverted: z.ZodBoolean;
1139
+ }, "strip", z.ZodTypeAny, {
1140
+ pool: string;
1141
+ priceStep: number;
1142
+ inverted: boolean;
1143
+ }, {
1144
+ pool: string;
1145
+ priceStep: number;
1146
+ inverted: boolean;
1147
+ }>;
1148
+ declare const PoolSwapNotification: z.ZodObject<{
1149
+ meta: z.ZodTypeAny;
1150
+ entity: z.ZodEnum<["pool_swap", ...("pool_swap" | "pool_price" | "order_book")[]]>;
1151
+ action: z.ZodEnum<["create", ...("create" | "update")[]]>;
1152
+ data: z.ZodObject<{
1153
+ id: z.ZodString;
1154
+ amountIn: z.ZodBigInt;
1155
+ amountOut: z.ZodBigInt;
1156
+ aToB: z.ZodBoolean;
1157
+ pool: z.ZodString;
1158
+ time: z.ZodDate;
1159
+ }, "strip", z.ZodTypeAny, {
1160
+ time: Date;
1161
+ pool: string;
1162
+ id: string;
1163
+ amountIn: bigint;
1164
+ amountOut: bigint;
1165
+ aToB: boolean;
1166
+ }, {
1167
+ time: Date;
1168
+ pool: string;
1169
+ id: string;
1170
+ amountIn: bigint;
1171
+ amountOut: bigint;
1172
+ aToB: boolean;
1173
+ }>;
1174
+ id: z.ZodString;
1175
+ authority: z.ZodNullable<z.ZodString>;
1176
+ } | {
1177
+ meta: z.ZodNullable<z.ZodUndefined>;
1178
+ entity: z.ZodEnum<["pool_swap", ...("pool_swap" | "pool_price" | "order_book")[]]>;
1179
+ action: z.ZodEnum<["create", ...("create" | "update")[]]>;
1180
+ data: z.ZodObject<{
1181
+ id: z.ZodString;
1182
+ amountIn: z.ZodBigInt;
1183
+ amountOut: z.ZodBigInt;
1184
+ aToB: z.ZodBoolean;
1185
+ pool: z.ZodString;
1186
+ time: z.ZodDate;
1187
+ }, "strip", z.ZodTypeAny, {
1188
+ time: Date;
1189
+ pool: string;
1190
+ id: string;
1191
+ amountIn: bigint;
1192
+ amountOut: bigint;
1193
+ aToB: boolean;
1194
+ }, {
1195
+ time: Date;
1196
+ pool: string;
1197
+ id: string;
1198
+ amountIn: bigint;
1199
+ amountOut: bigint;
1200
+ aToB: boolean;
1201
+ }>;
1202
+ id: z.ZodString;
1203
+ authority: z.ZodNullable<z.ZodString>;
1204
+ }, "strip", z.ZodTypeAny, {
1205
+ authority: string | null;
1206
+ id: string;
1207
+ entity: "pool_swap" | "pool_price" | "order_book";
1208
+ action: "create" | "update";
1209
+ data: {
1210
+ time: Date;
1211
+ pool: string;
1212
+ id: string;
1213
+ amountIn: bigint;
1214
+ amountOut: bigint;
1215
+ aToB: boolean;
1216
+ };
1217
+ meta?: any;
1218
+ } | {
1219
+ authority: string | null;
1220
+ id: string;
1221
+ entity: "pool_swap" | "pool_price" | "order_book";
1222
+ action: "create" | "update";
1223
+ data: {
1224
+ time: Date;
1225
+ pool: string;
1226
+ id: string;
1227
+ amountIn: bigint;
1228
+ amountOut: bigint;
1229
+ aToB: boolean;
1230
+ };
1231
+ meta?: any;
1232
+ }, {
1233
+ authority: string | null;
1234
+ id: string;
1235
+ entity: "pool_swap" | "pool_price" | "order_book";
1236
+ action: "create" | "update";
1237
+ data: {
1238
+ time: Date;
1239
+ pool: string;
1240
+ id: string;
1241
+ amountIn: bigint;
1242
+ amountOut: bigint;
1243
+ aToB: boolean;
1244
+ };
1245
+ meta?: any;
1246
+ } | {
1247
+ authority: string | null;
1248
+ id: string;
1249
+ entity: "pool_swap" | "pool_price" | "order_book";
1250
+ action: "create" | "update";
1251
+ data: {
1252
+ time: Date;
1253
+ pool: string;
1254
+ id: string;
1255
+ amountIn: bigint;
1256
+ amountOut: bigint;
1257
+ aToB: boolean;
1258
+ };
1259
+ meta?: any;
1260
+ }>;
1261
+ declare const PoolPriceUpdateNotification: z.ZodObject<{
1262
+ meta: z.ZodTypeAny;
1263
+ entity: z.ZodEnum<["pool_swap", ...("pool_swap" | "pool_price" | "order_book")[]]>;
1264
+ action: z.ZodEnum<["create", ...("create" | "update")[]]>;
1265
+ data: z.ZodObject<{
1266
+ pool: z.ZodString;
1267
+ price: z.ZodNumber;
1268
+ sqrtPrice: z.ZodBigInt;
1269
+ time: z.ZodDate;
1270
+ }, "strip", z.ZodTypeAny, {
1271
+ price: number;
1272
+ time: Date;
1273
+ sqrtPrice: bigint;
1274
+ pool: string;
1275
+ }, {
1276
+ price: number;
1277
+ time: Date;
1278
+ sqrtPrice: bigint;
1279
+ pool: string;
1280
+ }>;
1281
+ id: z.ZodString;
1282
+ authority: z.ZodNullable<z.ZodString>;
1283
+ } | {
1284
+ meta: z.ZodNullable<z.ZodUndefined>;
1285
+ entity: z.ZodEnum<["pool_swap", ...("pool_swap" | "pool_price" | "order_book")[]]>;
1286
+ action: z.ZodEnum<["create", ...("create" | "update")[]]>;
1287
+ data: z.ZodObject<{
1288
+ pool: z.ZodString;
1289
+ price: z.ZodNumber;
1290
+ sqrtPrice: z.ZodBigInt;
1291
+ time: z.ZodDate;
1292
+ }, "strip", z.ZodTypeAny, {
1293
+ price: number;
1294
+ time: Date;
1295
+ sqrtPrice: bigint;
1296
+ pool: string;
1297
+ }, {
1298
+ price: number;
1299
+ time: Date;
1300
+ sqrtPrice: bigint;
1301
+ pool: string;
1302
+ }>;
1303
+ id: z.ZodString;
1304
+ authority: z.ZodNullable<z.ZodString>;
1305
+ }, "strip", z.ZodTypeAny, {
1306
+ authority: string | null;
1307
+ id: string;
1308
+ entity: "pool_swap" | "pool_price" | "order_book";
1309
+ action: "create" | "update";
1310
+ data: {
1311
+ price: number;
1312
+ time: Date;
1313
+ sqrtPrice: bigint;
1314
+ pool: string;
1315
+ };
1316
+ meta?: any;
1317
+ } | {
1318
+ authority: string | null;
1319
+ id: string;
1320
+ entity: "pool_swap" | "pool_price" | "order_book";
1321
+ action: "create" | "update";
1322
+ data: {
1323
+ price: number;
1324
+ time: Date;
1325
+ sqrtPrice: bigint;
1326
+ pool: string;
1327
+ };
1328
+ meta?: any;
1329
+ }, {
1330
+ authority: string | null;
1331
+ id: string;
1332
+ entity: "pool_swap" | "pool_price" | "order_book";
1333
+ action: "create" | "update";
1334
+ data: {
1335
+ price: number;
1336
+ time: Date;
1337
+ sqrtPrice: bigint;
1338
+ pool: string;
1339
+ };
1340
+ meta?: any;
1341
+ } | {
1342
+ authority: string | null;
1343
+ id: string;
1344
+ entity: "pool_swap" | "pool_price" | "order_book";
1345
+ action: "create" | "update";
1346
+ data: {
1347
+ price: number;
1348
+ time: Date;
1349
+ sqrtPrice: bigint;
1350
+ pool: string;
1351
+ };
1352
+ meta?: any;
1353
+ }>;
1354
+ declare const OrderBookNotification: z.ZodObject<{
1355
+ meta: z.ZodObject<{
1356
+ pool: z.ZodString;
1357
+ priceStep: z.ZodNumber;
1358
+ inverted: z.ZodBoolean;
1359
+ }, "strip", z.ZodTypeAny, {
1360
+ pool: string;
1361
+ priceStep: number;
1362
+ inverted: boolean;
1363
+ }, {
1364
+ pool: string;
1365
+ priceStep: number;
1366
+ inverted: boolean;
1367
+ }>;
1368
+ entity: z.ZodEnum<["pool_swap", ...("pool_swap" | "pool_price" | "order_book")[]]>;
1369
+ action: z.ZodEnum<["create", ...("create" | "update")[]]>;
1370
+ data: z.ZodObject<{
1371
+ entries: z.ZodArray<z.ZodObject<{
1372
+ concentratedAmount: z.ZodBigInt;
1373
+ concentratedAmountQuote: z.ZodBigInt;
1374
+ concentratedTotal: z.ZodBigInt;
1375
+ concentratedTotalQuote: z.ZodBigInt;
1376
+ limitAmount: z.ZodBigInt;
1377
+ limitAmountQuote: z.ZodBigInt;
1378
+ limitTotal: z.ZodBigInt;
1379
+ limitTotalQuote: z.ZodBigInt;
1380
+ price: z.ZodNumber;
1381
+ askSide: z.ZodBoolean;
1382
+ }, "strip", z.ZodTypeAny, {
1383
+ price: number;
1384
+ concentratedAmount: bigint;
1385
+ concentratedAmountQuote: bigint;
1386
+ concentratedTotal: bigint;
1387
+ concentratedTotalQuote: bigint;
1388
+ limitAmount: bigint;
1389
+ limitAmountQuote: bigint;
1390
+ limitTotal: bigint;
1391
+ limitTotalQuote: bigint;
1392
+ askSide: boolean;
1393
+ }, {
1394
+ price: number;
1395
+ concentratedAmount: bigint;
1396
+ concentratedAmountQuote: bigint;
1397
+ concentratedTotal: bigint;
1398
+ concentratedTotalQuote: bigint;
1399
+ limitAmount: bigint;
1400
+ limitAmountQuote: bigint;
1401
+ limitTotal: bigint;
1402
+ limitTotalQuote: bigint;
1403
+ askSide: boolean;
1404
+ }>, "many">;
1405
+ poolPrice: z.ZodNumber;
1406
+ }, "strip", z.ZodTypeAny, {
1407
+ entries: {
1408
+ price: number;
1409
+ concentratedAmount: bigint;
1410
+ concentratedAmountQuote: bigint;
1411
+ concentratedTotal: bigint;
1412
+ concentratedTotalQuote: bigint;
1413
+ limitAmount: bigint;
1414
+ limitAmountQuote: bigint;
1415
+ limitTotal: bigint;
1416
+ limitTotalQuote: bigint;
1417
+ askSide: boolean;
1418
+ }[];
1419
+ poolPrice: number;
1420
+ }, {
1421
+ entries: {
1422
+ price: number;
1423
+ concentratedAmount: bigint;
1424
+ concentratedAmountQuote: bigint;
1425
+ concentratedTotal: bigint;
1426
+ concentratedTotalQuote: bigint;
1427
+ limitAmount: bigint;
1428
+ limitAmountQuote: bigint;
1429
+ limitTotal: bigint;
1430
+ limitTotalQuote: bigint;
1431
+ askSide: boolean;
1432
+ }[];
1433
+ poolPrice: number;
1434
+ }>;
1435
+ id: z.ZodString;
1436
+ authority: z.ZodNullable<z.ZodString>;
1437
+ } | {
1438
+ meta: z.ZodNullable<z.ZodUndefined>;
1439
+ entity: z.ZodEnum<["pool_swap", ...("pool_swap" | "pool_price" | "order_book")[]]>;
1440
+ action: z.ZodEnum<["create", ...("create" | "update")[]]>;
1441
+ data: z.ZodObject<{
1442
+ entries: z.ZodArray<z.ZodObject<{
1443
+ concentratedAmount: z.ZodBigInt;
1444
+ concentratedAmountQuote: z.ZodBigInt;
1445
+ concentratedTotal: z.ZodBigInt;
1446
+ concentratedTotalQuote: z.ZodBigInt;
1447
+ limitAmount: z.ZodBigInt;
1448
+ limitAmountQuote: z.ZodBigInt;
1449
+ limitTotal: z.ZodBigInt;
1450
+ limitTotalQuote: z.ZodBigInt;
1451
+ price: z.ZodNumber;
1452
+ askSide: z.ZodBoolean;
1453
+ }, "strip", z.ZodTypeAny, {
1454
+ price: number;
1455
+ concentratedAmount: bigint;
1456
+ concentratedAmountQuote: bigint;
1457
+ concentratedTotal: bigint;
1458
+ concentratedTotalQuote: bigint;
1459
+ limitAmount: bigint;
1460
+ limitAmountQuote: bigint;
1461
+ limitTotal: bigint;
1462
+ limitTotalQuote: bigint;
1463
+ askSide: boolean;
1464
+ }, {
1465
+ price: number;
1466
+ concentratedAmount: bigint;
1467
+ concentratedAmountQuote: bigint;
1468
+ concentratedTotal: bigint;
1469
+ concentratedTotalQuote: bigint;
1470
+ limitAmount: bigint;
1471
+ limitAmountQuote: bigint;
1472
+ limitTotal: bigint;
1473
+ limitTotalQuote: bigint;
1474
+ askSide: boolean;
1475
+ }>, "many">;
1476
+ poolPrice: z.ZodNumber;
1477
+ }, "strip", z.ZodTypeAny, {
1478
+ entries: {
1479
+ price: number;
1480
+ concentratedAmount: bigint;
1481
+ concentratedAmountQuote: bigint;
1482
+ concentratedTotal: bigint;
1483
+ concentratedTotalQuote: bigint;
1484
+ limitAmount: bigint;
1485
+ limitAmountQuote: bigint;
1486
+ limitTotal: bigint;
1487
+ limitTotalQuote: bigint;
1488
+ askSide: boolean;
1489
+ }[];
1490
+ poolPrice: number;
1491
+ }, {
1492
+ entries: {
1493
+ price: number;
1494
+ concentratedAmount: bigint;
1495
+ concentratedAmountQuote: bigint;
1496
+ concentratedTotal: bigint;
1497
+ concentratedTotalQuote: bigint;
1498
+ limitAmount: bigint;
1499
+ limitAmountQuote: bigint;
1500
+ limitTotal: bigint;
1501
+ limitTotalQuote: bigint;
1502
+ askSide: boolean;
1503
+ }[];
1504
+ poolPrice: number;
1505
+ }>;
1506
+ id: z.ZodString;
1507
+ authority: z.ZodNullable<z.ZodString>;
1508
+ }, "strip", z.ZodTypeAny, {
1509
+ authority: string | null;
1510
+ id: string;
1511
+ entity: "pool_swap" | "pool_price" | "order_book";
1512
+ action: "create" | "update";
1513
+ data: {
1514
+ entries: {
1515
+ price: number;
1516
+ concentratedAmount: bigint;
1517
+ concentratedAmountQuote: bigint;
1518
+ concentratedTotal: bigint;
1519
+ concentratedTotalQuote: bigint;
1520
+ limitAmount: bigint;
1521
+ limitAmountQuote: bigint;
1522
+ limitTotal: bigint;
1523
+ limitTotalQuote: bigint;
1524
+ askSide: boolean;
1525
+ }[];
1526
+ poolPrice: number;
1527
+ };
1528
+ meta: {
1529
+ pool: string;
1530
+ priceStep: number;
1531
+ inverted: boolean;
1532
+ } | null | undefined;
1533
+ } | {
1534
+ authority: string | null;
1535
+ id: string;
1536
+ entity: "pool_swap" | "pool_price" | "order_book";
1537
+ action: "create" | "update";
1538
+ data: {
1539
+ entries: {
1540
+ price: number;
1541
+ concentratedAmount: bigint;
1542
+ concentratedAmountQuote: bigint;
1543
+ concentratedTotal: bigint;
1544
+ concentratedTotalQuote: bigint;
1545
+ limitAmount: bigint;
1546
+ limitAmountQuote: bigint;
1547
+ limitTotal: bigint;
1548
+ limitTotalQuote: bigint;
1549
+ askSide: boolean;
1550
+ }[];
1551
+ poolPrice: number;
1552
+ };
1553
+ meta: {
1554
+ pool: string;
1555
+ priceStep: number;
1556
+ inverted: boolean;
1557
+ } | null | undefined;
1558
+ }, {
1559
+ authority: string | null;
1560
+ id: string;
1561
+ entity: "pool_swap" | "pool_price" | "order_book";
1562
+ action: "create" | "update";
1563
+ data: {
1564
+ entries: {
1565
+ price: number;
1566
+ concentratedAmount: bigint;
1567
+ concentratedAmountQuote: bigint;
1568
+ concentratedTotal: bigint;
1569
+ concentratedTotalQuote: bigint;
1570
+ limitAmount: bigint;
1571
+ limitAmountQuote: bigint;
1572
+ limitTotal: bigint;
1573
+ limitTotalQuote: bigint;
1574
+ askSide: boolean;
1575
+ }[];
1576
+ poolPrice: number;
1577
+ };
1578
+ meta: {
1579
+ pool: string;
1580
+ priceStep: number;
1581
+ inverted: boolean;
1582
+ } | null | undefined;
1583
+ } | {
1584
+ authority: string | null;
1585
+ id: string;
1586
+ entity: "pool_swap" | "pool_price" | "order_book";
1587
+ action: "create" | "update";
1588
+ data: {
1589
+ entries: {
1590
+ price: number;
1591
+ concentratedAmount: bigint;
1592
+ concentratedAmountQuote: bigint;
1593
+ concentratedTotal: bigint;
1594
+ concentratedTotalQuote: bigint;
1595
+ limitAmount: bigint;
1596
+ limitAmountQuote: bigint;
1597
+ limitTotal: bigint;
1598
+ limitTotalQuote: bigint;
1599
+ askSide: boolean;
1600
+ }[];
1601
+ poolPrice: number;
1602
+ };
1603
+ meta: {
1604
+ pool: string;
1605
+ priceStep: number;
1606
+ inverted: boolean;
1607
+ } | null | undefined;
1608
+ }>;
1609
+
1610
+ declare const schemas_LimitOrderState: typeof LimitOrderState;
1611
+ declare const schemas_LimitOrderStateSchema: typeof LimitOrderStateSchema;
1612
+ declare const schemas_NotificationAction: typeof NotificationAction;
1613
+ declare const schemas_NotificationActionSchema: typeof NotificationActionSchema;
1614
+ declare const schemas_NotificationEntity: typeof NotificationEntity;
1615
+ declare const schemas_NotificationEntitySchema: typeof NotificationEntitySchema;
1616
+ declare const schemas_OrderBookNotification: typeof OrderBookNotification;
1617
+ declare const schemas_OrderBookNotificationMeta: typeof OrderBookNotificationMeta;
1618
+ declare const schemas_PoolPriceUpdateNotification: typeof PoolPriceUpdateNotification;
1619
+ declare const schemas_PoolProvider: typeof PoolProvider;
1620
+ declare const schemas_PoolProviderSchema: typeof PoolProviderSchema;
1621
+ declare const schemas_PoolSwapNotification: typeof PoolSwapNotification;
1622
+ declare const schemas_TunaPositionState: typeof TunaPositionState;
1623
+ declare const schemas_TunaPositionStateSchema: typeof TunaPositionStateSchema;
1624
+ declare namespace schemas {
1625
+ export { LendingPosition$1 as LendingPosition, LimitOrder$1 as LimitOrder, schemas_LimitOrderState as LimitOrderState, schemas_LimitOrderStateSchema as LimitOrderStateSchema, Market$1 as Market, Mint$1 as Mint, schemas_NotificationAction as NotificationAction, schemas_NotificationActionSchema as NotificationActionSchema, schemas_NotificationEntity as NotificationEntity, schemas_NotificationEntitySchema as NotificationEntitySchema, OrderBook$1 as OrderBook, OrderBookEntry$1 as OrderBookEntry, schemas_OrderBookNotification as OrderBookNotification, schemas_OrderBookNotificationMeta as OrderBookNotificationMeta, Pool$1 as Pool, PoolPriceCandle$1 as PoolPriceCandle, PoolPriceUpdate$1 as PoolPriceUpdate, schemas_PoolPriceUpdateNotification as PoolPriceUpdateNotification, schemas_PoolProvider as PoolProvider, schemas_PoolProviderSchema as PoolProviderSchema, PoolSwap$1 as PoolSwap, schemas_PoolSwapNotification as PoolSwapNotification, PoolTicks$1 as PoolTicks, Tick$1 as Tick, TokenOraclePrice$1 as TokenOraclePrice, TunaPosition$1 as TunaPosition, schemas_TunaPositionState as TunaPositionState, schemas_TunaPositionStateSchema as TunaPositionStateSchema, Vault$1 as Vault };
1626
+ }
1627
+
1628
+ type PoolProviderType = z.infer<typeof PoolProviderSchema>;
1629
+ type TunaPositionStateType = z.infer<typeof TunaPositionStateSchema>;
1630
+ type LimitOrderStateType = z.infer<typeof LimitOrderStateSchema>;
1631
+ type Mint = z.infer<typeof Mint$1>;
1632
+ type Market = z.infer<typeof Market$1>;
1633
+ type TokenOraclePrice = z.infer<typeof TokenOraclePrice$1>;
1634
+ type Vault = z.infer<typeof Vault$1>;
1635
+ type Pool = z.infer<typeof Pool$1>;
1636
+ type Tick = z.infer<typeof Tick$1>;
1637
+ type PoolTicks = z.infer<typeof PoolTicks$1>;
1638
+ type PoolSwap = z.infer<typeof PoolSwap$1>;
1639
+ type OrderBookEntry = z.infer<typeof OrderBookEntry$1>;
1640
+ type OrderBook = z.infer<typeof OrderBook$1>;
1641
+ type LendingPosition = z.infer<typeof LendingPosition$1>;
1642
+ type TunaPosition = z.infer<typeof TunaPosition$1>;
1643
+ type LimitOrder = z.infer<typeof LimitOrder$1>;
1644
+ type PoolPriceCandle = z.infer<typeof PoolPriceCandle$1>;
1645
+ type PoolPriceUpdate = z.infer<typeof PoolPriceUpdate$1>;
1646
+ type DurationInMs = number;
1647
+ declare enum ProviderFilter {
1648
+ ORCA = "orca",
1649
+ FUSION = "fusion",
1650
+ ALL = "all"
1651
+ }
1652
+ type GetPoolPriceCandlesOptions = {
1653
+ from: Date;
1654
+ to: Date;
1655
+ candles: number;
1656
+ interval: string;
1657
+ };
1658
+ type TunaApiClientConfig = {
1659
+ /** Backend API URL */
1660
+ baseURL: string;
1661
+ /** Timeout of each request (for all of retries). Default: 5000ms */
1662
+ timeout?: DurationInMs;
1663
+ /**
1664
+ * Number of times a HTTP request will be retried before the API returns a failure. Default: 3.
1665
+ *
1666
+ * The connection uses exponential back-off for the delay between retries. However,
1667
+ * it will timeout regardless of the retries at the configured `timeout` time.
1668
+ */
1669
+ httpRetries?: number;
1670
+ /**
1671
+ * Optional headers to be included in every request.
1672
+ */
1673
+ headers?: HeadersInit;
1674
+ };
1675
+ declare class TunaApiClient {
1676
+ private _baseURL;
1677
+ get baseURL(): string;
1678
+ private _timeout;
1679
+ get timeout(): DurationInMs;
1680
+ private _httpRetries;
1681
+ get httpRetries(): number;
1682
+ private _headers;
1683
+ get headers(): HeadersInit;
1684
+ constructor(baseURL: string, config?: Partial<Omit<TunaApiClientConfig, "baseURL">>);
1685
+ setConfig(config: Partial<TunaApiClientConfig>): void;
1686
+ private httpRequest;
1687
+ getMints(): Promise<Mint[]>;
1688
+ getMint(mintAddress: string): Promise<Mint>;
1689
+ getMarkets(): Promise<Market[]>;
1690
+ getMarket(marketAddress: string): Promise<Market>;
1691
+ getOraclePrices(): Promise<TokenOraclePrice[]>;
1692
+ getOraclePrice(mintAddress: string): Promise<TokenOraclePrice>;
1693
+ getVaults(): Promise<Vault[]>;
1694
+ getVault(vaultAddress: any): Promise<Vault>;
1695
+ getPools(providerFilter?: ProviderFilter): Promise<Pool[]>;
1696
+ getPool(address: string): Promise<Pool>;
1697
+ getPoolTicks(poolAddress: string): Promise<PoolTicks>;
1698
+ getPoolSwaps(poolAddress: string): Promise<PoolSwap[]>;
1699
+ getPoolOrderBook(poolAddress: string, priceStep: number, inverted: boolean): Promise<OrderBook>;
1700
+ getPoolPriceCandles(poolAddress: string, options: GetPoolPriceCandlesOptions): Promise<PoolPriceCandle[]>;
1701
+ getUserLendingPositions(userAddress: string): Promise<LendingPosition[]>;
1702
+ getUserLendingPositionByAddress(userAddress: string, lendingPositionAddress: string): Promise<LendingPosition>;
1703
+ getUserTunaPositions(userAddress: string): Promise<TunaPosition[]>;
1704
+ getUserTunaPositionByAddress(userAddress: string, tunaPositionAddress: string): Promise<TunaPosition>;
1705
+ getUserLimitOrders(userAddress: string, poolFilter?: string): Promise<LimitOrder[]>;
1706
+ getUserLimitOrderByAddress(userAddress: string, limitOrderAddress: string): Promise<LimitOrder>;
1707
+ getPoolUpdatesStream(poolAddress: string, priceStep?: number, inverted?: boolean): Promise<EventSource>;
1708
+ private buildURL;
1709
+ private appendUrlSearchParams;
1710
+ }
1711
+
1712
+ export { type DurationInMs, type GetPoolPriceCandlesOptions, type LendingPosition, type LimitOrder, type LimitOrderStateType, type Market, type Mint, NotificationAction, NotificationEntity, type OrderBook, type OrderBookEntry, type Pool, type PoolPriceCandle, type PoolPriceUpdate, PoolProvider, type PoolProviderType, type PoolSwap, type PoolTicks, ProviderFilter, type Tick, type TokenOraclePrice, TunaApiClient, type TunaApiClientConfig, type TunaPosition, TunaPositionState, type TunaPositionStateType, type Vault, schemas };