-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathzap_service.yaml
1294 lines (1290 loc) · 57.4 KB
/
zap_service.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.1
info:
title: Zap Service
description: Zap Service for quickly zapping pool liquidity in a single transaction
contact:
url: https://discord.gg/kyberswap
email: bd@kyber.network
version: 1.2.0
servers:
- url: "https://zap-api.kyberswap.com/{chain}"
description: production
variables:
chain:
enum:
- arbitrum
- avalanche
- base
- bsc
- ethereum
- linea
- optimism
- polygon
- polygon-zkevm
default: arbitrum
tags:
- name: Service
paths:
/api/v1/in/route:
get:
tags:
- Service
summary: Get the best zap-in route.
operationId: Service_GetInRoute
parameters:
- name: dex
in: query
description: |-
which dex to use zap with
- DEX_UNSPECIFIED: Unspecified value.
- DEX_UNISWAPV3: For UniSwap V3.
- DEX_PANCAKESWAPV3: For PancakeSwap V3.
- DEX_UNISWAPV2: For Uniswap V2.
- DEX_SUSHISWAPV2: For SushiSwap V2.
- DEX_CURVE: For Curve
required: false
style: form
explode: true
schema:
type: string
default: DEX_UNSPECIFIED
enum:
- DEX_UNSPECIFIED
- DEX_UNISWAPV3
- DEX_PANCAKESWAPV3
- DEX_UNISWAPV2
- DEX_SUSHISWAPV2
- DEX_CURVE
example: "DEX_UNISWAPV3"
- name: pool.id
in: query
description: id of the pool to zap into.
required: false
style: form
explode: true
schema:
type: string
example: "0x2f5e87c9312fa29aed5c179e456625d79015299c"
- name: position.id
in: query
description: id of the position to add liquidity to; omit to create a new uniswapV3 position. for uniswapV2 this is user address
required: false
style: form
explode: true
schema:
type: string
- name: position.tickLower
in: query
description: "min tick of the position, required if creating a new uniswapV3 position."
required: false
style: form
explode: true
schema:
type: integer
format: int32
example: 120000
- name: position.tickUpper
in: query
description: "max tick of the position, required if creating a new uniswapV3 position."
required: false
style: form
explode: true
schema:
type: integer
format: int32
example: 480000
- name: tokensIn
in: query
description: which token(s) to use as zap source. also accepts comma separated addresses
required: false
style: form
explode: true
schema:
type: array
items:
type: string
- name: amountsIn
in: query
description: "amount(s) to zap including fee, corresponding to tokenIn. also accepts comma separated amounts."
required: false
style: form
explode: true
schema:
type: array
items:
type: string
- name: tokenIn
in: query
description: |-
which token(s) to use as zap source. also accepts comma separated addresses.
deprecated: use tokens_in. if both fields are specified, they are combined
required: false
style: form
explode: true
schema:
type: array
items:
type: string
example: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"
- name: amountIn
in: query
description: |-
amount(s) to zap including fee, corresponding to tokenIn. also accepts comma separated amounts.
deprecated: use amounts_in. if both fields are specified, they are combined
required: false
style: form
explode: true
schema:
type: array
items:
type: string
example: "1000000000000000000"
- name: aggregatorOptions.disable
in: query
description: whether to disable swapping with the aggregator
required: false
style: form
explode: true
schema:
type: boolean
- name: aggregatorOptions.includedSources
in: query
description: comma-separated list of sources to use for aggregator
required: false
style: form
explode: true
schema:
type: string
- name: aggregatorOptions.excludedSources
in: query
description: comma-separated list of sources to exclude for aggregator
required: false
style: form
explode: true
schema:
type: string
- name: feeAddress
in: query
description: the address of the fee recipient.
required: false
style: form
explode: true
schema:
type: string
- name: feePcm
in: query
description: |-
fee percentage in per cent mille (0.001% or 1 in 100,000). Ignored if feeAddress is empty.
From 0 to 100,000 inclusively. Example: 1 for 0.001%.
required: false
style: form
explode: true
schema:
type: integer
format: int64
- name: slippage
in: query
description: |-
maximum slippage tolerance in basis points (0.01%), used for aggregator (exceeding which the transaction will
revert) and pool swap during zap (for additional zapping and for refund).
From 0 to 10,000 inclusively. Example: 1 for 0.01%.
required: false
style: form
explode: true
schema:
type: integer
format: int64
example: "100"
- name: X-Client-Id
in: header
description: Client Id
required: false
style: simple
explode: false
schema:
type: string
example: "zap-docs"
- name: X-Request-Id
in: header
description: Request Id
required: false
style: simple
explode: false
schema:
type: string
responses:
"200":
description: A successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/v1GetInRouteResponse'
"400":
description: Invalid Argument
content:
application/json:
schema:
$ref: '#/components/schemas/rpcStatus'
example:
code: 3
message: "validation error:\\\\n - pool: missing tokens [Pool.tokens]\\\\n - pool.id: value does not match regex pattern `^0x[0-9A-Za-z]{40}$` [string.pattern]\\\\n - position: value is required [required]\\\\n - token_in[0]: value does not match regex pattern `^0x[0-9A-Za-z]{40}(,0x[0-9A-Za-z]{40})*$` [string.pattern]\\\\n - amount_in[0]: value does not match regex pattern `^\\\\d+(,\\\\d+)*$` [string.pattern]\\\\n - fee_address: value does not match regex pattern `^0x[0-9A-Za-z]{40}$` [string.pattern]"
"404":
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/rpcStatus'
example:
code: 5
message: "failed to get zap routes: cannot swap tokens [0xE2035f04040A135c4dA2f96AcA742143c57c79F9]"
default:
description: An unexpected error response.
content:
application/json:
schema:
$ref: '#/components/schemas/rpcStatus'
/api/v1/in/route/decode:
post:
tags:
- Service
summary: Decode zap-in route for debugging purposes.
operationId: Service_DecodeInRoute
requestBody:
description: Decode zap-in route for debugging purposes.
content:
application/json:
schema:
$ref: '#/components/schemas/v1DecodeInRouteRequest'
required: true
responses:
"200":
description: A successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/v1DecodeInRouteResponse'
"400":
description: Invalid Argument
content:
application/json:
schema:
$ref: '#/components/schemas/rpcStatus'
example:
code: 3
message: "validation error:\\\\n - pool: missing tokens [Pool.tokens]\\\\n - pool.id: value does not match regex pattern `^0x[0-9A-Za-z]{40}$` [string.pattern]\\\\n - position: value is required [required]\\\\n - token_in[0]: value does not match regex pattern `^0x[0-9A-Za-z]{40}(,0x[0-9A-Za-z]{40})*$` [string.pattern]\\\\n - amount_in[0]: value does not match regex pattern `^\\\\d+(,\\\\d+)*$` [string.pattern]\\\\n - fee_address: value does not match regex pattern `^0x[0-9A-Za-z]{40}$` [string.pattern]"
"404":
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/rpcStatus'
example:
code: 5
message: "failed to get zap routes: cannot swap tokens [0xE2035f04040A135c4dA2f96AcA742143c57c79F9]"
default:
description: An unexpected error response.
content:
application/json:
schema:
$ref: '#/components/schemas/rpcStatus'
x-codegen-request-body-name: body
parameters: []
/api/v1/in/route/build:
post:
tags:
- Service
summary: Build encoded data for the specified zap-in route.
operationId: Service_BuildInRoute
parameters:
- name: X-Client-Id
in: header
description: Client Id
required: false
style: simple
explode: false
schema:
type: string
example: "zap-docs"
- name: X-Request-Id
in: header
description: Request Id
required: false
style: simple
explode: false
schema:
type: string
requestBody:
description: Build encoded data for zap-in transaction from the specified route.
content:
application/json:
schema:
$ref: '#/components/schemas/v1BuildInRouteRequest'
required: true
responses:
"200":
description: A successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/v1BuildInRouteResponse'
"400":
description: Invalid Argument
content:
application/json:
schema:
$ref: '#/components/schemas/rpcStatus'
example:
code: 3
message: "validation error:\\\\n - pool: missing tokens [Pool.tokens]\\\\n - pool.id: value does not match regex pattern `^0x[0-9A-Za-z]{40}$` [string.pattern]\\\\n - position: value is required [required]\\\\n - token_in[0]: value does not match regex pattern `^0x[0-9A-Za-z]{40}(,0x[0-9A-Za-z]{40})*$` [string.pattern]\\\\n - amount_in[0]: value does not match regex pattern `^\\\\d+(,\\\\d+)*$` [string.pattern]\\\\n - fee_address: value does not match regex pattern `^0x[0-9A-Za-z]{40}$` [string.pattern]"
"404":
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/rpcStatus'
example:
code: 5
message: "failed to get zap routes: cannot swap tokens [0xE2035f04040A135c4dA2f96AcA742143c57c79F9]"
default:
description: An unexpected error response.
content:
application/json:
schema:
$ref: '#/components/schemas/rpcStatus'
x-codegen-request-body-name: body
/api/v1/migrate/route:
get:
tags:
- Service
summary: Get the best zap-migrate route.
operationId: Service_GetMigrateRoute
parameters:
- name: dexFrom
in: query
description: |-
which dex to zap migrate out from
- DEX_UNSPECIFIED: Unspecified value.
- DEX_UNISWAPV3: For UniSwap V3.
- DEX_PANCAKESWAPV3: For PancakeSwap V3.
- DEX_UNISWAPV2: For Uniswap V2.
- DEX_SUSHISWAPV2: For SushiSwap V2.
- DEX_CURVE: For Curve
required: false
style: form
explode: true
schema:
type: string
default: DEX_UNSPECIFIED
enum:
- DEX_UNSPECIFIED
- DEX_UNISWAPV3
- DEX_PANCAKESWAPV3
- DEX_UNISWAPV2
- DEX_SUSHISWAPV2
- DEX_CURVE
- name: dexTo
in: query
description: |-
which dex to zap migrate in to
- DEX_UNSPECIFIED: Unspecified value.
- DEX_UNISWAPV3: For UniSwap V3.
- DEX_PANCAKESWAPV3: For PancakeSwap V3.
- DEX_UNISWAPV2: For Uniswap V2.
- DEX_SUSHISWAPV2: For SushiSwap V2.
- DEX_CURVE: For Curve
required: false
style: form
explode: true
schema:
type: string
default: DEX_UNSPECIFIED
enum:
- DEX_UNSPECIFIED
- DEX_UNISWAPV3
- DEX_PANCAKESWAPV3
- DEX_UNISWAPV2
- DEX_SUSHISWAPV2
- DEX_CURVE
- name: poolFrom.id
in: query
description: id of the pool to zap into.
required: false
style: form
explode: true
schema:
type: string
- name: poolTo.id
in: query
description: id of the pool to zap into.
required: false
style: form
explode: true
schema:
type: string
- name: positionFrom.id
in: query
description: id of the position to add liquidity to; omit to create a new uniswapV3 position. for uniswapV2 this is user address
required: false
style: form
explode: true
schema:
type: string
- name: positionFrom.tickLower
in: query
description: "min tick of the position, required if creating a new uniswapV3 position."
required: false
style: form
explode: true
schema:
type: integer
format: int32
- name: positionFrom.tickUpper
in: query
description: "max tick of the position, required if creating a new uniswapV3 position."
required: false
style: form
explode: true
schema:
type: integer
format: int32
- name: positionTo.id
in: query
description: id of the position to add liquidity to; omit to create a new uniswapV3 position. for uniswapV2 this is user address
required: false
style: form
explode: true
schema:
type: string
- name: positionTo.tickLower
in: query
description: "min tick of the position, required if creating a new uniswapV3 position."
required: false
style: form
explode: true
schema:
type: integer
format: int32
- name: positionTo.tickUpper
in: query
description: "max tick of the position, required if creating a new uniswapV3 position."
required: false
style: form
explode: true
schema:
type: integer
format: int32
- name: liquidityOut
in: query
description: "liquidity amount to withdraw, or empty or 0 to withdraw all"
required: false
style: form
explode: true
schema:
type: string
- name: aggregatorOptions.disable
in: query
description: whether to disable swapping with the aggregator
required: false
style: form
explode: true
schema:
type: boolean
- name: aggregatorOptions.includedSources
in: query
description: comma-separated list of sources to use for aggregator
required: false
style: form
explode: true
schema:
type: string
- name: aggregatorOptions.excludedSources
in: query
description: comma-separated list of sources to exclude for aggregator
required: false
style: form
explode: true
schema:
type: string
- name: feeAddress
in: query
description: |-
options for getting aggregator routes
the address of the fee recipient.
required: false
style: form
explode: true
schema:
type: string
- name: feePcm
in: query
description: |-
fee percentage in per cent mille (0.001% or 1 in 100,000). Ignored if feeAddress is empty.
From 0 to 100,000 inclusively. Example: 1 for 0.001%.
required: false
style: form
explode: true
schema:
type: integer
format: int64
- name: slippage
in: query
description: |-
maximum slippage tolerance in basis points (0.01%), used for aggregator (exceeding which the transaction will
revert) and pool swap during zap (for additional zapping and for refund).
From 0 to 10,000 inclusively. Example: 1 for 0.01%.
required: false
style: form
explode: true
schema:
type: integer
format: int64
example: "100"
- name: X-Client-Id
in: header
description: Client Id
required: false
style: simple
explode: false
schema:
type: string
example: "zap-docs"
- name: X-Request-Id
in: header
description: Request Id
required: false
style: simple
explode: false
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/v1GetMigrateRouteResponse'
example:
code: 0
data: {}
"400":
description: Invalid Argument
content:
application/json:
schema:
$ref: '#/components/schemas/rpcStatus'
example:
code: 3
message: "validation error:\\\\n - pool: missing tokens [Pool.tokens]\\\\n - pool.id: value does not match regex pattern `^0x[0-9A-Za-z]{40}$` [string.pattern]\\\\n - position: value is required [required]\\\\n - token_in[0]: value does not match regex pattern `^0x[0-9A-Za-z]{40}(,0x[0-9A-Za-z]{40})*$` [string.pattern]\\\\n - amount_in[0]: value does not match regex pattern `^\\\\d+(,\\\\d+)*$` [string.pattern]\\\\n - fee_address: value does not match regex pattern `^0x[0-9A-Za-z]{40}$` [string.pattern]"
"404":
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/rpcStatus'
example:
code: 5
message: "failed to get zap routes: cannot swap tokens [0xE2035f04040A135c4dA2f96AcA742143c57c79F9]"
default:
description: An unexpected error response.
content:
application/json:
schema:
$ref: '#/components/schemas/rpcStatus'
/api/v1/migrate/route/decode:
post:
tags:
- Service
summary: Decode zap-migrate route for debugging purposes.
operationId: Service_DecodeMigrateRoute
requestBody:
description: Decode zap-migrate route for debugging purposes.
content:
application/json:
schema:
$ref: '#/components/schemas/v1DecodeMigrateRouteRequest'
required: true
responses:
"200":
description: A successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/v1DecodeMigrateRouteResponse'
"400":
description: Invalid Argument
content:
application/json:
schema:
$ref: '#/components/schemas/rpcStatus'
example:
code: 3
message: "validation error:\\\\n - pool: missing tokens [Pool.tokens]\\\\n - pool.id: value does not match regex pattern `^0x[0-9A-Za-z]{40}$` [string.pattern]\\\\n - position: value is required [required]\\\\n - token_in[0]: value does not match regex pattern `^0x[0-9A-Za-z]{40}(,0x[0-9A-Za-z]{40})*$` [string.pattern]\\\\n - amount_in[0]: value does not match regex pattern `^\\\\d+(,\\\\d+)*$` [string.pattern]\\\\n - fee_address: value does not match regex pattern `^0x[0-9A-Za-z]{40}$` [string.pattern]"
"404":
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/rpcStatus'
example:
code: 5
message: "failed to get zap routes: cannot swap tokens [0xE2035f04040A135c4dA2f96AcA742143c57c79F9]"
default:
description: An unexpected error response.
content:
application/json:
schema:
$ref: '#/components/schemas/rpcStatus'
x-codegen-request-body-name: body
parameters: []
/api/v1/migrate/route/build:
post:
tags:
- Service
summary: Build encoded data for the specified zap-migrate route.
operationId: Service_BuildMigrateRoute
requestBody:
description: Build encoded data for zap-migrate transaction from the specified route.
content:
application/json:
schema:
$ref: '#/components/schemas/v1BuildMigrateRouteRequest'
required: true
responses:
"200":
description: A successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/v1BuildMigrateRouteResponse'
"400":
description: Invalid Argument
content:
application/json:
schema:
$ref: '#/components/schemas/rpcStatus'
example:
code: 3
message: "validation error:\\\\n - pool: missing tokens [Pool.tokens]\\\\n - pool.id: value does not match regex pattern `^0x[0-9A-Za-z]{40}$` [string.pattern]\\\\n - position: value is required [required]\\\\n - token_in[0]: value does not match regex pattern `^0x[0-9A-Za-z]{40}(,0x[0-9A-Za-z]{40})*$` [string.pattern]\\\\n - amount_in[0]: value does not match regex pattern `^\\\\d+(,\\\\d+)*$` [string.pattern]\\\\n - fee_address: value does not match regex pattern `^0x[0-9A-Za-z]{40}$` [string.pattern]"
"404":
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/rpcStatus'
example:
code: 5
message: "failed to get zap routes: cannot swap tokens [0xE2035f04040A135c4dA2f96AcA742143c57c79F9]"
default:
description: An unexpected error response.
content:
application/json:
schema:
$ref: '#/components/schemas/rpcStatus'
x-codegen-request-body-name: body
parameters: []
components:
schemas:
PoolDetailsUniswapV2:
title: details of the uniswapV2 pool
type: object
properties:
reserve0:
title: reserve0 before zap
type: string
newReserve0:
title: reserve0 after zap
type: string
reserve1:
title: reserve1 before zap
type: string
newReserve1:
title: reserve1 after zap
type: string
PoolDetailsUniswapV3:
title: details of the uniswapV3 pool
type: object
properties:
tick:
title: pool tick before zap
type: integer
format: int32
newTick:
title: pool tick after zap
type: integer
format: int32
sqrtP:
title: pool sqrt price (times 2^96) before zap
type: string
newSqrtP:
title: pool sqrt price (times 2^96) after zap
type: string
SwapActionSwap:
title: a single swap
type: object
properties:
tokenIn:
$ref: '#/components/schemas/ZapDetailsTokenAmount'
tokenOut:
$ref: '#/components/schemas/ZapDetailsTokenAmount'
ZapDetailsAction:
title: "one of the zap actions, specified by the type field"
type: object
properties:
type:
$ref: '#/components/schemas/ZapDetailsActionType'
protocolFee:
$ref: '#/components/schemas/ZapDetailsFeeAction'
partnerFee:
$ref: '#/components/schemas/ZapDetailsFeeAction'
aggregatorSwap:
$ref: '#/components/schemas/ZapDetailsSwapAction'
poolSwap:
$ref: '#/components/schemas/ZapDetailsSwapAction'
addLiquidity:
$ref: '#/components/schemas/ZapDetailsLiquidityAction'
removeLiquidity:
$ref: '#/components/schemas/ZapDetailsLiquidityAction'
refund:
$ref: '#/components/schemas/ZapDetailsRefundAction'
ZapDetailsActionType:
title: type of the zap action
type: string
description: |-
- ACTION_TYPE_UNSPECIFIED: Unspecified action
- ACTION_TYPE_PROTOCOL_FEE: protocol fee
- ACTION_TYPE_PARTNER_FEE: partner fee
- ACTION_TYPE_AGGREGATOR_SWAP: aggregator swap
- ACTION_TYPE_POOL_SWAP: pool swap
- ACTION_TYPE_ADD_LIQUIDITY: add liquidity
- ACTION_TYPE_REMOVE_LIQUIDITY: remove liquidity
- ACTION_TYPE_REFUND: refund
default: ACTION_TYPE_UNSPECIFIED
enum:
- ACTION_TYPE_UNSPECIFIED
- ACTION_TYPE_PROTOCOL_FEE
- ACTION_TYPE_PARTNER_FEE
- ACTION_TYPE_AGGREGATOR_SWAP
- ACTION_TYPE_POOL_SWAP
- ACTION_TYPE_ADD_LIQUIDITY
- ACTION_TYPE_REMOVE_LIQUIDITY
- ACTION_TYPE_REFUND
ZapDetailsFeeAction:
title: fee collection
type: object
properties:
pcm:
title: fee per cent mille (0.001%) of the source zap amount
type: integer
format: int64
tokens:
title: token amounts
type: array
items:
$ref: '#/components/schemas/ZapDetailsTokenAmount'
ZapDetailsLiquidityAction:
title: added or removed liquidity
type: object
properties:
tokens:
title: added or removed token amounts
type: array
items:
$ref: '#/components/schemas/ZapDetailsTokenAmount'
fees:
title: collected fees
type: array
items:
$ref: '#/components/schemas/ZapDetailsTokenAmount'
token0:
$ref: '#/components/schemas/ZapDetailsTokenAmount'
token1:
$ref: '#/components/schemas/ZapDetailsTokenAmount'
ZapDetailsRefundAction:
title: refund left-over tokens to user
type: object
properties:
tokens:
title: refunded token amounts
type: array
items:
$ref: '#/components/schemas/ZapDetailsTokenAmount'
ZapDetailsSwapAction:
title: "token swap, either with aggregator or with pool"
type: object
properties:
swaps:
type: array
items:
$ref: '#/components/schemas/SwapActionSwap'
ZapDetailsTokenAmount:
title: token address and amount in wei and in usd
type: object
properties:
address:
title: token address
pattern: "^0x[0-9A-Za-z]{40}$"
type: string
amount:
title: wei amount of the token
type: string
amountUsd:
title: USD value of the token
type: string
protobufAny:
type: object
properties:
'@type':
type: string
additionalProperties:
type: object
rpcStatus:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
details:
type: array
items:
$ref: '#/components/schemas/protobufAny'
v1AggregatorOptions:
title: options for getting aggregator routes
type: object
properties:
disable:
title: whether to disable swapping with the aggregator
type: boolean
includedSources:
title: comma-separated list of sources to use for aggregator
type: string
excludedSources:
title: comma-separated list of sources to exclude for aggregator
type: string
v1BuildInRouteRequest:
type: object
properties:
sender:
type: string
description: "the wallet sending the transaction, and thus, the tokens."
recipient:
type: string
description: the wallet receiving the new position. default to sender if empty.
route:
pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"
type: string
description: the route as returned from get-route endpoint.
format: byte
deadline:
type: integer
description: deadline for the swap transaction to execute.
format: int64
source:
type: string
description: the source of the zap-in transaction.
permits:
type: object
additionalProperties:
type: string
description: map of each token address to its ERC20 permit using EIP-2612 to skip a separate approval step.
description: Build encoded data for zap-in transaction from the specified route.
example:
sender: "0xa2DFeb674d997b68ec5adB0A6fb9136BD45C2D2d"
recipient: "0xa2DFeb674d997b68ec5adB0A6fb9136BD45C2D2d"
route: "KLUv/WAdB00bAOY5nCNAj3JMrqhs1F7Rx8ZtyeIRkgGqIXfgSOampMyhZleOYZgzAYgAigChAM2d3Nn7iLnY66vzVWYuXVS7q9ecpZ+zuUgxlxgVb4CvKk5c764QuTno0imHOZAmq01WqNmBDoff4WhbyNyxdn8hlq4uHYQOP1BjCDWHV0uHsQX9crda1svR5WSJl+75T1b4y8HZzdt+qYcdjX0yKJX+s7wxlBi85iCX0RzlUjbnuKRa5Tb3XEbqyqp2Of//RpLLhIJJCiRtYlJRk0uHGLyGI0Dr/+ek+tNxrUdW3G9EDMDECqAxIvZvK0xEXR2gEM1dLrFL1zB4KVM9X3vb1XX/1/nXb69d/6uUL4VyQUzVXKVZTCIREw9Ecimj1lUzXeXyRNWcxaVVVsuo//zJzUVQkfdfeTvXWykzqsJeinEpk7nPJOIMUC4aIpOJRPSQtIN0WgHQJtgjYZSHhEk8709hFpZLksolagwRhAISwdd1/NluW+wXS/XMIaXQYo5lmQ/kbGQyoVwGBERzLbpMKpcyJ9Aa1BoBq0SYdulScxc+sie3wgC0sIeFPXjZI7oocGLv6/pSVr7bGV0UmiXCoOZaxGERCKsQaA+kshC1iQpDSMe+u1hx768GtLq65hwWh1ZfARm1VPGq5h6XMo1GJtPIVuqpmz/Vql6ZjPnoqlZTPS3icqW+WN2bIVLDPT0pXPxk76WsnZSHSw1MvnA961prlx+iOTS4hwRyEak0h+RySWGaQ1LQUAGJWIKloEEfEoBJRLmoPJBKBNAqKpdHU9FVcXnbs/+3ZT/sdW0/ns63cyvmUGYqZ6OyQrg6PTUymeZQXBImAmEgQAJCDDOmHZLEGJj0Yxm1rG2f2YZ071vZSmuTEYMc7ksXKTyQndCnyoI34X93YwbNI3xyLUJ6AY9LrS6IJcMwm/eSsBsVqAI2PFuTKUizGWTHhcFXrKvsl7iawsClp6xyNDBUSxoFdUsqRanhffuMrI+Aa2sqmbkA6Xgu21EIhh/cypg4W7hogNnGFhyT24o1cAeaZ5ILOW7cAQIfQCmJ49N52JNgQ7O7L1gWAkKhheQ60Elw0AKCCulGAVUHGJgaPIElWIKKTLpC06UHnCVX7TvCAMNuc2ogLKuyTnCUAPqFS2x0VeyCy+qwbowuW746oVmIAg=="
deadline: 1800000000
source: "zap-docs"
v1BuildInRouteResponse:
type: object
properties:
code:
title: grpc error code
type: integer
format: int32
message:
title: grpc error message
type: string
data:
$ref: '#/components/schemas/v1BuildInRouteResponseData'
requestId:
title: request trace id
type: string
description: Returns the zap-in transaction details.
example:
code: 0
message: "OK"
data:
routerAddress: "0x6960f99e6F9A9A5EFcd44C5BaA3245aC2b145287"
callData: "0x0779b145000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000002000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000000600000000000000000000000002f5e87c9312fa29aed5c179e456625d79015299c000000000000000000000000c36442b4a4522e871399cd717abdd847ab11fe8800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000a2dfeb674d997b68ec5adb0a6fb9136bd45c2d2d000000000000000000000000000000000000000000000000000000000001d4c000000000000000000000000000000000000000000000000000000000000753000000000000000000000000000000000000000000000000000000010912662471000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022ad1a118075557c20d42f2de3feedb8d16a8ee6000000000000000000000000bde6709804b89497f378c7123d5362f8a24cb7f6000000000000000000000000000000000000000000000000000000006b49d20000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000ca00000000000000000000000000000000000000000000000000000000000000be00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000200000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab10000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000088000000000000000000000000000000000000000000000000000000000000000800000000000000000000000008aec70a335b4cb0c3c0866065d9c04c26cd749fa0000000000000000000000000000000000000000000000000001c6bf5263400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000000200000000000000000000000006131b5fae19ea4f9d964eac0408e4408b66337b500000000000000000000000000000000000000000000000006f035d38cbf350c00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000644e21fd0e9000000000000000000000000000000000000000000000000000000000000002000000000000000000000000011ddd59c33c73c44733b4123a86ea5ce57f6e854000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000f1020100000029020000004bfc22a4da7f31f8a912a79a7e44a822398b4390000000000000000000b19efb8e131ef6010a010000002b0100000082670f35306253222f8a165869b28c64739ac62e010000000000000000063e96d7feac161600010982af49447d8a07e3bd95bd0d56f35241523fbab12f2a2543b76a4166549f7aab2e75bef0aefc5b0fbde6709804b89497f378c7123d5362f8a24cb7f60000000000000000000000006b49d2000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000285b4f00000000000000000000000000000000000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab10000000000000000000000002f2a2543b76a4166549f7aab2e75bef0aefc5b0f000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000bde6709804b89497f378c7123d5362f8a24cb7f600000000000000000000000000000000000000000000000006f035d38cbf350c000000000000000000000000000000000000000000000000000000000027f3fe00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000000100000000000000000000000011ddd59c33c73c44733b4123a86ea5ce57f6e854000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000006f035d38cbf350c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f97b22536f75726365223a227a61702d646f6373222c22416d6f756e74496e555344223a22313833352e38373838323235313139313031222c22416d6f756e744f7574555344223a22313833352e35303836363830393034393637222c22526566657272616c223a22222c22466c616773223a302c22496e74656772697479496e666f223a7b224b65794944223a2231222c225369676e6174757265223a224943644253394c714132676248584f6c557a3349626d75637a4679657755392f49796f70636d6875476a466e596b42377044773547585347592b2f5a4f4c664c4158795958346c4c797937384f525462307667714a695632677243706c36304a52796e4338443078724d73786e44446f764f646d592b6a6e71456d615670374b664b4b45526348744f30784f4f7472776f38537a73757a4c3672384a6b716f416558335a744f6b705a4a7a4e65694843612f4971384d6938345a792b597044726e7769766b714a524a535464665950787745704b62757a6c484a6165717a445276554f4f4d5556727344643276426b45377771536b6a6e69437a784665365076374c65366c49474c784c36314b4156484e4a3343667675702f54464c386f4c6a36417a547535415a3958533034377a56574266484a4a4379326d536e7236475778536e6635536157724c734f78776b7a344a665752513d3d227d7d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000c36442b4a4522e871399cd717abdd847ab11fe880000000000000000000000002f5e87c9312fa29aed5c179e456625d79015299c0000000000000000000000002f2a2543b76a4166549f7aab2e75bef0aefc5b0f00000000000000000000000000000000000000000000000000000000000001f400000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a2dfeb674d997b68ec5adb0a6fb9136bd45c2d2d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000108000000000000000000000000000000900000000000000000000000000000000100000000000000000000000000000001000000000000000000000000000000000000000000000000000000000001d4c000000000000000000000000000000000000000000000000000000000000753000000000000000000000000000000000000069118042346bcd79b11b76147d0ab000000000000000000000000000000000006b33a11557d53e337f572e1d50a4b0000000000000000000000000000000000000000000000000000010912662471000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000005d8fcbe11af100000000000000000000000000285a4600000000000000000000000000285c57000000000000000006ee8cb1ee542c44000000000000000006eee790cbf67b7c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006a213163b1c66b70364a5f1403ef0000000000000000000000000000000000000000000000000000000000003f64d000000000000000000000000000000000000000000000000075982b768bcece70000000000000000000000000000000000000000000000000000000000000000"
value: "1000000000000000000"
requestId: "b8c105304e178953e36021af9b26f3da"
v1BuildInRouteResponseData:
type: object
properties:
routerAddress:
title: zap router address to send the zap-in transaction to
type: string
callData:
title: call data for the zap-in transaction
type: string
value:
title: native token value to transfer with the zap-in transaction in case of zapping with native tokens
type: string
description: Encompasses returned data.
v1BuildMigrateRouteRequest:
type: object
properties:
sender:
type: string
description: "the wallet sending the transaction, and thus, the tokens."
recipient:
type: string
description: the wallet receiving the new position. default to sender if empty.
route:
pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"
type: string
description: the route as returned from get-route endpoint.
format: byte
deadline:
type: integer
description: deadline for the swap transaction to execute.
format: int64
source:
type: string
description: the source of the zap-migrate transaction.
burnNft:
type: boolean
description: whether to throw away the position NFT or keep it.
description: Build encoded data for zap-migrate transaction from the specified route.
v1BuildMigrateRouteResponse:
type: object
properties:
code:
title: grpc error code
type: integer
format: int32
message:
title: grpc error message
type: string
data:
$ref: '#/components/schemas/v1BuildMigrateRouteResponseData'
requestId:
title: request trace id
type: string
description: Returns the zap-migrate transaction details.
v1BuildMigrateRouteResponseData:
type: object
properties:
routerAddress:
title: zap router address to send the zap-migrate transaction to
type: string
callData:
title: call data for the zap-migrate transaction
type: string
value:
title: native token value to transfer with the zap-migrate transaction in case of zapping with native tokens
type: string
description: Encompasses returned data.
v1DecodeInRouteRequest:
type: object
properties:
route:
pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"
type: string
description: the route as returned from get-route endpoint.
format: byte
description: Decode zap-in route for debugging purposes.