@steerprotocol/sdk 1.18.4 → 1.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,937 @@
1
+ "use strict";
2
+ /**
3
+ * @fileoverview Pool Query Adapter - Provides GraphQL queries for different DEX protocols
4
+ * @module PoolQueryAdapter
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.getPoolDetailsQuery = exports.getTokenPoolsQueryByAddress = exports.FETCH_TOKEN_POOLS_KYO = exports.FETCH_TOKEN_POOLS_THRUSTER_TOKEN1 = exports.FETCH_TOKEN_POOLS_THRUSTER_TOKEN0 = exports.FETCH_TOKEN_POOLS_LYNEX_TOKEN1 = exports.FETCH_TOKEN_POOLS_LYNEX_TOKEN0 = exports.FETCH_TOKEN_POOLS_POOLSHARK = exports.FETCH_TOKEN_POOLS_SHADOW = exports.FETCH_TOKEN_POOLS_UNISWAP = exports.FETCH_TOKEN_POOLS_ARTHSWAP = exports.FETCH_TOKEN_POOLS_OCELEX = exports.FETCH_TOKEN_POOLS_ALGEBRA = exports.getTopPoolsQuery = void 0;
8
+ const const_1 = require("../const");
9
+ /**
10
+ * GraphQL query to fetch top pools from Shadow protocol by volume
11
+ * Returns pools ordered by volumeUSD in descending order
12
+ * @internal
13
+ */
14
+ const FETCH_TOP_POOLS_SHADOW = `
15
+ query {
16
+ clPools(first: $limit, orderBy: volumeUSD, orderDirection: desc, subgraphError: allow){
17
+ id
18
+ volumeUSD
19
+ token0 {
20
+ id
21
+ name
22
+ symbol
23
+ decimals
24
+ }
25
+ token1 {
26
+ id
27
+ name
28
+ symbol
29
+ decimals
30
+ }
31
+ feeTier
32
+ volumeToken0
33
+ volumeToken1
34
+ tick
35
+ liquidity
36
+ }
37
+ }
38
+ `;
39
+ /**
40
+ * GraphQL query to fetch top pools from Uniswap V3 protocol by volume
41
+ * Returns pools ordered by volumeUSD in descending order
42
+ * @internal
43
+ */
44
+ const FETCH_TOP_POOLS_UNISWAP = `
45
+ query {
46
+ pools(first: $limit, orderBy: volumeUSD, orderDirection: desc, subgraphError: allow){
47
+ id
48
+ volumeUSD
49
+ token0 {
50
+ id
51
+ name
52
+ symbol
53
+ decimals
54
+ }
55
+ token1 {
56
+ id
57
+ name
58
+ symbol
59
+ decimals
60
+ }
61
+ feeTier
62
+ volumeToken0
63
+ volumeToken1
64
+ tick
65
+ liquidity
66
+ }
67
+ }
68
+ `;
69
+ /**
70
+ * GraphQL query to fetch top pools from Thruster protocol by TVL
71
+ * Returns pools ordered by totalValueLockedETH in descending order
72
+ * @internal
73
+ */
74
+ const FETCH_TOP_POOLS_THRUSTER = `
75
+ query {
76
+ pools(first: 500, orderBy: totalValueLockedETH, orderDirection: desc, subgraphError: allow){
77
+ id
78
+ volumeUSD
79
+ totalValueLockedETH
80
+ token0 {
81
+ id
82
+ name
83
+ symbol
84
+ decimals
85
+ }
86
+ token1 {
87
+ id
88
+ name
89
+ symbol
90
+ decimals
91
+ }
92
+ feeTier
93
+ volumeToken0
94
+ volumeToken1
95
+ tick
96
+ liquidity
97
+ }
98
+ }
99
+ `;
100
+ /**
101
+ * GraphQL query to fetch top pools from PoolShark protocol by volume
102
+ * Returns limit pools ordered by volumeUsd in descending order
103
+ * @internal
104
+ */
105
+ const FETCH_POOLSHARK_TOP_POOLS = `
106
+ {
107
+ limitPools(first: 500, orderBy: volumeUsd, orderDirection: desc, subgraphError: allow) {
108
+ id
109
+ volumeUsd
110
+ totalValueLockedEth
111
+ token0 {
112
+ id
113
+ name
114
+ symbol
115
+ decimals
116
+ }
117
+ token1 {
118
+ id
119
+ name
120
+ symbol
121
+ decimals
122
+ }
123
+ feeTier {
124
+ id
125
+ }
126
+ }
127
+ }
128
+ `;
129
+ /**
130
+ * GraphQL query to fetch top pools from Algebra-based protocols by volume
131
+ * Returns pools ordered by volumeUSD in descending order
132
+ * @internal
133
+ */
134
+ const FETCH_TOP_POOLS_ALGEBRA = `
135
+ query {
136
+ pools(first: 500, orderBy: volumeUSD, orderDirection: desc, subgraphError: allow){
137
+ id
138
+ volumeUSD
139
+ token0 {
140
+ id
141
+ name
142
+ symbol
143
+ decimals
144
+ }
145
+ token1 {
146
+ id
147
+ name
148
+ symbol
149
+ decimals
150
+ }
151
+ tick
152
+ liquidity
153
+ }
154
+ }
155
+ `;
156
+ /**
157
+ * GraphQL query to fetch top pools from Ocelex protocol
158
+ * Returns first 500 pools with basic volume and liquidity data
159
+ * @internal
160
+ */
161
+ const FETCH_TOP_POOLS_OCELEX = `
162
+ query {
163
+ pools(first: 500){
164
+ id
165
+ volumeUSD
166
+ token0 {
167
+ id
168
+ name
169
+ symbol
170
+ decimals
171
+ }
172
+ token1 {
173
+ id
174
+ name
175
+ symbol
176
+ decimals
177
+ }
178
+ tick
179
+ liquidity
180
+ }
181
+ }
182
+ `;
183
+ /**
184
+ * GraphQL query to fetch top pools from Kyo protocol by volume
185
+ * Returns pools ordered by volumeUSD in descending order with fee information
186
+ * @internal
187
+ */
188
+ const FETCH_TOP_POOLS_KYO = `
189
+ query {
190
+ pools(first: 500, orderBy: volumeUSD, orderDirection: desc, subgraphError: allow){
191
+ id
192
+ volumeUSD
193
+ token0 {
194
+ id
195
+ name
196
+ symbol
197
+ decimals
198
+ }
199
+ token1 {
200
+ id
201
+ name
202
+ symbol
203
+ decimals
204
+ }
205
+ fee
206
+ volumeToken0
207
+ volumeToken1
208
+ tick
209
+ liquidity
210
+ }
211
+ }
212
+ `;
213
+ /**
214
+ * GraphQL query to fetch top pools from ArthSwap protocol by volume
215
+ * Returns pools ordered by volumeUSD_DESC with fee tier information
216
+ * @internal
217
+ */
218
+ const FETCH_ARTHSWAP_TOP_POOLS = `
219
+ {
220
+ pools(limit:500, orderBy: volumeUSD_DESC) {
221
+ id
222
+ volumeUSD
223
+ token0 {
224
+ id
225
+ name
226
+ symbol
227
+ decimals
228
+ }
229
+ token1 {
230
+ id
231
+ name
232
+ symbol
233
+ decimals
234
+ }
235
+ feeTier
236
+ tick
237
+ liquidity
238
+ }
239
+ }
240
+ `;
241
+ /**
242
+ * Returns the appropriate GraphQL query for fetching top pools based on protocol type
243
+ *
244
+ * @param protocol - The DEX protocol to fetch pools from
245
+ * @param isAlgebraPool - Whether the protocol is based on Algebra
246
+ * @returns GraphQL query string for fetching top pools
247
+ *
248
+ * @example
249
+ * ```typescript
250
+ * const query = getTopPoolsQuery(Protocol.UniswapV3, false);
251
+ * // Returns FETCH_TOP_POOLS_UNISWAP query
252
+ * ```
253
+ */
254
+ const getTopPoolsQuery = (protocol, isAlgebraPool) => {
255
+ if (protocol === const_1.Protocol.ArthSwap || protocol === const_1.Protocol.ThickV2) {
256
+ return FETCH_ARTHSWAP_TOP_POOLS;
257
+ }
258
+ else if (protocol === const_1.Protocol.Thruster) {
259
+ return FETCH_TOP_POOLS_THRUSTER;
260
+ }
261
+ else if (protocol === const_1.Protocol.Ocelex) {
262
+ return FETCH_TOP_POOLS_OCELEX;
263
+ }
264
+ else if (protocol === const_1.Protocol.PoolShark) {
265
+ return FETCH_POOLSHARK_TOP_POOLS;
266
+ }
267
+ else if (protocol === const_1.Protocol.Kyo) {
268
+ return FETCH_TOP_POOLS_KYO;
269
+ }
270
+ else if ((0, const_1.isShadowProtocol)(protocol)) {
271
+ return FETCH_TOP_POOLS_SHADOW;
272
+ }
273
+ else if (isAlgebraPool) {
274
+ return FETCH_TOP_POOLS_ALGEBRA;
275
+ }
276
+ else {
277
+ return FETCH_TOP_POOLS_UNISWAP;
278
+ }
279
+ };
280
+ exports.getTopPoolsQuery = getTopPoolsQuery;
281
+ // --- Token Pool Queries for fetchPoolsForTokens ---
282
+ /**
283
+ * GraphQL query to fetch pools containing a specific token from Algebra-based protocols
284
+ * Returns up to 50 pools ordered by volume that contain the specified token
285
+ * @internal
286
+ */
287
+ exports.FETCH_TOKEN_POOLS_ALGEBRA = `
288
+ query pools($token: String!) {
289
+ pools(first: 50, orderBy: volumeUSD, orderDirection: desc, where: {
290
+ or: [
291
+ {
292
+ token0: $token
293
+ }
294
+ {
295
+ token1: $token
296
+ }
297
+ ]
298
+ }, subgraphError: allow){
299
+ id
300
+ volumeUSD
301
+ token0 {
302
+ id
303
+ name
304
+ symbol
305
+ decimals
306
+ }
307
+ token1 {
308
+ id
309
+ name
310
+ symbol
311
+ decimals
312
+ }
313
+ tick
314
+ liquidity
315
+ }
316
+ }
317
+ `;
318
+ /**
319
+ * GraphQL query to fetch pools containing a specific token from Ocelex protocol
320
+ * Returns up to 50 pools that contain the specified token
321
+ * @internal
322
+ */
323
+ exports.FETCH_TOKEN_POOLS_OCELEX = `
324
+ query pools($token: ID!) {
325
+ pools(first: 50, where: {
326
+ or: [
327
+ {
328
+ token0: $token
329
+ }
330
+ {
331
+ token1: $token
332
+ }
333
+ ]
334
+ }){
335
+ id
336
+ volumeUSD
337
+ token0 {
338
+ id
339
+ name
340
+ symbol
341
+ }
342
+ token1 {
343
+ id
344
+ name
345
+ symbol
346
+ }
347
+ tick
348
+ liquidity
349
+ }
350
+ }
351
+ `;
352
+ /**
353
+ * GraphQL query to fetch pools containing a specific token from ArthSwap protocol
354
+ * Returns up to 50 pools ordered by volume that contain the specified token
355
+ * @internal
356
+ */
357
+ exports.FETCH_TOKEN_POOLS_ARTHSWAP = `
358
+ query pools($token: String!) {
359
+ pools(limit: 50, orderBy: volumeUSD_DESC, where: {
360
+ OR: [
361
+ {
362
+ token0Id_eq: $token
363
+ }
364
+ {
365
+ token1Id_eq: $token
366
+ }
367
+ ]
368
+ }){
369
+ id
370
+ volumeUSD
371
+ token0 {
372
+ id
373
+ name
374
+ symbol
375
+ decimals
376
+ }
377
+ token1 {
378
+ id
379
+ name
380
+ symbol
381
+ decimals
382
+ }
383
+ feeTier
384
+ tick
385
+ liquidity
386
+ }
387
+ }
388
+ `;
389
+ /**
390
+ * GraphQL query to fetch pools containing a specific token from Uniswap V3 protocol
391
+ * Returns up to 50 pools ordered by volume that contain the specified token
392
+ * @internal
393
+ */
394
+ exports.FETCH_TOKEN_POOLS_UNISWAP = `
395
+ query pools($token: String!) {
396
+ pools(first: 50, orderBy: volumeUSD, orderDirection: desc, where: {
397
+ or: [
398
+ {
399
+ token0: $token
400
+ }
401
+ {
402
+ token1: $token
403
+ }
404
+ ]
405
+ }, subgraphError: allow){
406
+ id
407
+ volumeUSD
408
+ token0 {
409
+ id
410
+ name
411
+ symbol
412
+ decimals
413
+ }
414
+ token1 {
415
+ id
416
+ name
417
+ symbol
418
+ decimals
419
+ }
420
+ feeTier
421
+ volumeToken0
422
+ volumeToken1
423
+ tick
424
+ liquidity
425
+ }
426
+ }
427
+ `;
428
+ /**
429
+ * GraphQL query to fetch pools containing a specific token from Shadow protocol
430
+ * Returns up to 50 CL pools ordered by volume that contain the specified token
431
+ * @internal
432
+ */
433
+ exports.FETCH_TOKEN_POOLS_SHADOW = `
434
+ query pools($token: String!) {
435
+ clPools(first: 50, orderBy: volumeUSD, orderDirection: desc, where: {
436
+ or: [
437
+ {
438
+ token0: $token
439
+ }
440
+ {
441
+ token1: $token
442
+ }
443
+ ]
444
+ }, subgraphError: allow){
445
+ id
446
+ volumeUSD
447
+ token0 {
448
+ id
449
+ name
450
+ symbol
451
+ decimals
452
+ }
453
+ token1 {
454
+ id
455
+ name
456
+ symbol
457
+ decimals
458
+ }
459
+ feeTier
460
+ volumeToken0
461
+ volumeToken1
462
+ tick
463
+ liquidity
464
+ }
465
+ }
466
+ `;
467
+ /**
468
+ * GraphQL query to fetch pools containing a specific token from PoolShark protocol
469
+ * Returns up to 50 limit pools ordered by TVL that contain the specified token
470
+ * @internal
471
+ */
472
+ exports.FETCH_TOKEN_POOLS_POOLSHARK = `
473
+ query pools($token: String!) {
474
+ limitPools(first: 50, orderBy: totalValueLockedEth, orderDirection: desc, where: {
475
+ or: [
476
+ {
477
+ token0: $token
478
+ }
479
+ {
480
+ token1: $token
481
+ }
482
+ ]
483
+ }, subgraphError: allow){
484
+ id
485
+ volumeUsd
486
+ totalValueLockedEth
487
+ token0 {
488
+ id
489
+ name
490
+ symbol
491
+ decimals
492
+ }
493
+ token1 {
494
+ id
495
+ name
496
+ symbol
497
+ decimals
498
+ }
499
+ feeTier {
500
+ id
501
+ }
502
+ volumeToken0
503
+ volumeToken1
504
+ tick
505
+ liquidity
506
+ }
507
+ }
508
+ `;
509
+ /**
510
+ * GraphQL query to fetch pools where specified token is token0 from Lynex protocol
511
+ * Returns up to 50 pools ordered by volume where token is the first token
512
+ * @internal
513
+ */
514
+ exports.FETCH_TOKEN_POOLS_LYNEX_TOKEN0 = `
515
+ query pools($token: String!) {
516
+ pools(first: 50, orderBy: volumeUSD, orderDirection: desc, where: {
517
+ token0: $token
518
+ }, subgraphError: allow){
519
+ id
520
+ volumeUSD
521
+ token0 {
522
+ id
523
+ name
524
+ symbol
525
+ decimals
526
+ }
527
+ token1 {
528
+ id
529
+ name
530
+ symbol
531
+ decimals
532
+ }
533
+ tick
534
+ liquidity
535
+ }
536
+ }
537
+ `;
538
+ /**
539
+ * GraphQL query to fetch pools where specified token is token1 from Lynex protocol
540
+ * Returns up to 50 pools ordered by volume where token is the second token
541
+ * @internal
542
+ */
543
+ exports.FETCH_TOKEN_POOLS_LYNEX_TOKEN1 = `
544
+ query pools($token: String!) {
545
+ pools(first: 50, orderBy: volumeUSD, orderDirection: desc, where: {
546
+ token1: $token
547
+ }, subgraphError: allow){
548
+ id
549
+ volumeUSD
550
+ token0 {
551
+ id
552
+ name
553
+ symbol
554
+ decimals
555
+ }
556
+ token1 {
557
+ id
558
+ name
559
+ symbol
560
+ decimals
561
+ }
562
+ tick
563
+ liquidity
564
+ }
565
+ }
566
+ `;
567
+ /**
568
+ * GraphQL query to fetch pools where specified token is token0 from Thruster protocol
569
+ * Returns up to 50 pools ordered by TVL where token is the first token
570
+ * @internal
571
+ */
572
+ exports.FETCH_TOKEN_POOLS_THRUSTER_TOKEN0 = `
573
+ query pools($token: String!) {
574
+ pools(first: 50, orderBy: totalValueLockedETH, orderDirection: desc, where: {
575
+ token0: $token
576
+ }, subgraphError: allow){
577
+ id
578
+ volumeUSD
579
+ totalValueLockedETH
580
+ token0 {
581
+ id
582
+ name
583
+ symbol
584
+ decimals
585
+ }
586
+ token1 {
587
+ id
588
+ name
589
+ symbol
590
+ decimals
591
+ }
592
+ feeTier
593
+ volumeToken0
594
+ volumeToken1
595
+ tick
596
+ liquidity
597
+ }
598
+ }
599
+ `;
600
+ /**
601
+ * GraphQL query to fetch pools where specified token is token1 from Thruster protocol
602
+ * Returns up to 50 pools ordered by TVL where token is the second token
603
+ * @internal
604
+ */
605
+ exports.FETCH_TOKEN_POOLS_THRUSTER_TOKEN1 = `
606
+ query pools($token: String!) {
607
+ pools(first: 50, orderBy: totalValueLockedETH, orderDirection: desc, where: {
608
+ token1: $token
609
+ }, subgraphError: allow){
610
+ id
611
+ volumeUSD
612
+ totalValueLockedETH
613
+ token0 {
614
+ id
615
+ name
616
+ symbol
617
+ decimals
618
+ }
619
+ token1 {
620
+ id
621
+ name
622
+ symbol
623
+ decimals
624
+ }
625
+ feeTier
626
+ volumeToken0
627
+ volumeToken1
628
+ tick
629
+ liquidity
630
+ }
631
+ }
632
+ `;
633
+ /**
634
+ * GraphQL query to fetch pools containing a specific token from Kyo protocol
635
+ * Returns up to 50 pools ordered by volume that contain the specified token
636
+ * @internal
637
+ */
638
+ exports.FETCH_TOKEN_POOLS_KYO = `
639
+ query pools($token: String!) {
640
+ pools(first: 50, orderBy: volumeUSD, orderDirection: desc, where: {
641
+ or: [
642
+ {
643
+ token0: $token
644
+ }
645
+ {
646
+ token1: $token
647
+ }
648
+ ]
649
+ }, subgraphError: allow){
650
+ id
651
+ volumeUSD
652
+ token0 {
653
+ id
654
+ name
655
+ symbol
656
+ decimals
657
+ }
658
+ token1 {
659
+ id
660
+ name
661
+ symbol
662
+ decimals
663
+ }
664
+ fee
665
+ volumeToken0
666
+ volumeToken1
667
+ tick
668
+ liquidity
669
+ }
670
+ }
671
+ `;
672
+ /**
673
+ * Returns the appropriate GraphQL query for fetching pools containing a specific token
674
+ *
675
+ * @param isAlgebraPool - Whether the protocol is based on Algebra
676
+ * @param protocol - The DEX protocol to fetch pools from
677
+ * @returns GraphQL query string for fetching token pools
678
+ *
679
+ * @example
680
+ * ```typescript
681
+ * const query = getTokenPoolsQueryByAddress(false, Protocol.UniswapV3);
682
+ * // Returns FETCH_TOKEN_POOLS_UNISWAP query
683
+ * ```
684
+ */
685
+ const getTokenPoolsQueryByAddress = (isAlgebraPool, protocol) => {
686
+ if (isAlgebraPool) {
687
+ if (protocol === const_1.Protocol.Ocelex) {
688
+ return exports.FETCH_TOKEN_POOLS_OCELEX;
689
+ }
690
+ return exports.FETCH_TOKEN_POOLS_ALGEBRA;
691
+ }
692
+ else if (protocol === const_1.Protocol.ArthSwap || protocol === const_1.Protocol.ThickV2) {
693
+ return exports.FETCH_TOKEN_POOLS_ARTHSWAP;
694
+ }
695
+ else if (protocol === const_1.Protocol.PoolShark) {
696
+ return exports.FETCH_TOKEN_POOLS_POOLSHARK;
697
+ }
698
+ else if (protocol === const_1.Protocol.Kyo) {
699
+ return exports.FETCH_TOKEN_POOLS_KYO;
700
+ }
701
+ else if ((0, const_1.isShadowProtocol)(protocol)) {
702
+ return exports.FETCH_TOKEN_POOLS_SHADOW;
703
+ }
704
+ else {
705
+ return exports.FETCH_TOKEN_POOLS_UNISWAP;
706
+ }
707
+ };
708
+ exports.getTokenPoolsQueryByAddress = getTokenPoolsQueryByAddress;
709
+ /**
710
+ * GraphQL query to fetch detailed information for a specific pool from Algebra-based protocols
711
+ * Returns pool details including tokens, volume, tick, and liquidity
712
+ * @internal
713
+ */
714
+ const FETCH_POOL_DETAILS_ALGEBRA = `
715
+ query pools($pool: String! ) {
716
+ pool(id: $pool, subgraphError: allow){
717
+ id
718
+ volumeUSD
719
+ token0 {
720
+ id
721
+ name
722
+ symbol
723
+ }
724
+ token1 {
725
+ id
726
+ name
727
+ symbol
728
+ }
729
+ tick
730
+ liquidity
731
+ }
732
+ }
733
+ `;
734
+ /**
735
+ * GraphQL query to fetch detailed information for a specific pool from Ocelex protocol
736
+ * Returns pool details including tokens, volume, tick, and liquidity
737
+ * @internal
738
+ */
739
+ const FETCH_POOL_DETAILS_OCELEX = `
740
+ query pools($pool: ID!) {
741
+ pool(id: $pool){
742
+ id
743
+ volumeUSD
744
+ token0 {
745
+ id
746
+ name
747
+ symbol
748
+ }
749
+ token1 {
750
+ id
751
+ name
752
+ symbol
753
+ }
754
+ tick
755
+ liquidity
756
+ }
757
+ }
758
+ `;
759
+ /**
760
+ * GraphQL query to fetch detailed information for a specific pool from Uniswap V3 protocol
761
+ * Returns comprehensive pool details including fees, TVL, and volume data
762
+ * @internal
763
+ */
764
+ const FETCH_POOL_DETAILS_UNISWAP = `
765
+ query pools($pool: String! ) {
766
+ pool(id: $pool, subgraphError: allow){
767
+ id
768
+ volumeUSD
769
+ token0 {
770
+ id
771
+ name
772
+ symbol
773
+ }
774
+ token1 {
775
+ id
776
+ name
777
+ symbol
778
+ }
779
+ feeTier
780
+ totalValueLockedETH
781
+ volumeToken0
782
+ volumeToken1
783
+ tick
784
+ liquidity
785
+ }
786
+ }
787
+ `;
788
+ /**
789
+ * GraphQL query to fetch detailed information for a specific pool from Shadow protocol
790
+ * Returns CL pool details including tokens, volume, tick, and liquidity
791
+ * @internal
792
+ */
793
+ const FETCH_POOL_DETAILS_SHADOW = `
794
+ query pools($pool: String! ) {
795
+ clPool(id: $pool, subgraphError: allow){
796
+ id
797
+ volumeUSD
798
+ token0 {
799
+ id
800
+ name
801
+ symbol
802
+ }
803
+ token1 {
804
+ id
805
+ name
806
+ symbol
807
+ }
808
+ feeTier
809
+ volumeToken0
810
+ volumeToken1
811
+ tick
812
+ liquidity
813
+ }
814
+ }
815
+ `;
816
+ /**
817
+ * GraphQL query to fetch detailed information for a specific pool from PoolShark protocol
818
+ * Returns limit pool details including tokens, volume, and fee information
819
+ * @internal
820
+ */
821
+ const FETCH_POOL_DETAILS_POOLSHARK = `
822
+ query pools($pool: String! ) {
823
+ limitPools(where: {id: $pool}){
824
+ id
825
+ volumeUsd
826
+ token0 {
827
+ id
828
+ name
829
+ symbol
830
+ }
831
+ token1 {
832
+ id
833
+ name
834
+ symbol
835
+ }
836
+ feeTier {
837
+ id
838
+ }
839
+ tick
840
+ liquidity
841
+ }
842
+ }
843
+ `;
844
+ /**
845
+ * GraphQL query to fetch detailed information for a specific pool from ArthSwap protocol
846
+ * Returns pool details including tokens, volume, fee tier, and liquidity
847
+ * @internal
848
+ */
849
+ const FETCH_POOL_DETAILS_ARTHSWAP = `
850
+ query pools($pool: String! ) {
851
+ pools(where: {id_eq: $pool}){
852
+ id
853
+ volumeUSD
854
+ token0 {
855
+ id
856
+ name
857
+ symbol
858
+ }
859
+ token1 {
860
+ id
861
+ name
862
+ symbol
863
+ }
864
+ feeTier
865
+ tick
866
+ liquidity
867
+ }
868
+ }
869
+ `;
870
+ /**
871
+ * GraphQL query to fetch detailed information for a specific pool from Kyo protocol
872
+ * Returns pool details including tokens, volume, fee, and liquidity with decimals
873
+ * @internal
874
+ */
875
+ const FETCH_POOL_DETAILS_KYO = `
876
+ query pools($pool: String! ) {
877
+ pool(id: $pool, subgraphError: allow){
878
+ id
879
+ volumeUSD
880
+ token0 {
881
+ id
882
+ name
883
+ symbol
884
+ decimals
885
+ }
886
+ token1 {
887
+ id
888
+ name
889
+ symbol
890
+ decimals
891
+ }
892
+ fee
893
+ volumeToken0
894
+ volumeToken1
895
+ tick
896
+ liquidity
897
+ }
898
+ }
899
+ `;
900
+ /**
901
+ * Returns the appropriate GraphQL query for fetching detailed pool information
902
+ *
903
+ * @param isAlgebraPool - Whether the protocol is based on Algebra
904
+ * @param protocol - The DEX protocol to fetch pool details from (optional)
905
+ * @returns GraphQL query string for fetching pool details
906
+ *
907
+ * @example
908
+ * ```typescript
909
+ * const query = getPoolDetailsQuery(false, Protocol.UniswapV3);
910
+ * // Returns FETCH_POOL_DETAILS_UNISWAP query
911
+ * ```
912
+ */
913
+ const getPoolDetailsQuery = (isAlgebraPool, protocol) => {
914
+ if (protocol === const_1.Protocol.ArthSwap || protocol === const_1.Protocol.ThickV2) {
915
+ return FETCH_POOL_DETAILS_ARTHSWAP;
916
+ }
917
+ else if (protocol === const_1.Protocol.Ocelex) {
918
+ return FETCH_POOL_DETAILS_OCELEX;
919
+ }
920
+ else if (protocol === const_1.Protocol.PoolShark) {
921
+ return FETCH_POOL_DETAILS_POOLSHARK;
922
+ }
923
+ else if (protocol === const_1.Protocol.Kyo) {
924
+ return FETCH_POOL_DETAILS_KYO;
925
+ }
926
+ else if (protocol && (0, const_1.isShadowProtocol)(protocol)) {
927
+ return FETCH_POOL_DETAILS_SHADOW;
928
+ }
929
+ else if (isAlgebraPool) {
930
+ return FETCH_POOL_DETAILS_ALGEBRA;
931
+ }
932
+ else {
933
+ return FETCH_POOL_DETAILS_UNISWAP;
934
+ }
935
+ };
936
+ exports.getPoolDetailsQuery = getPoolDetailsQuery;
937
+ //# sourceMappingURL=PoolQueryAdapter.js.map