forked from DefiLlama/api-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefillama-openapi-free.json
More file actions
3099 lines (3099 loc) · 104 KB
/
defillama-openapi-free.json
File metadata and controls
3099 lines (3099 loc) · 104 KB
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.0",
"info": {
"description": "\n\nNeed higher rate limits or priority support? We offer a premium plan for 300$/mo. To get it, go to https://defillama.com/subscription\n\nSDK\n\nInstall:\n```bash\nnpm install @defillama/api\npip install defillama-sdk\n```\n\nQuick start (JavaScript):\n```ts\nimport { DefiLlama } from '@defillama/api'\n\nconst client = new DefiLlama()\nconst protocols = await client.tvl.getProtocols()\n```\n\nQuick start (Python):\n```py\nfrom defillama_sdk import DefiLlama\n\nclient = DefiLlama()\nprotocols = client.tvl.getProtocols()\n```\n\nCoding with AI? Paste this link to LLM-specific docs for best results\n<a href='/llms.txt'>llms.txt</a>",
"version": "1.0.0-oas3",
"title": "DefiLlama API",
"x-scalar-sdk-installation": [
{
"lang": "node",
"description": "Install the DefiLlama JavaScript SDK:",
"source": "npm install @defillama/api"
},
{
"lang": "js",
"description": "Install the DefiLlama JavaScript SDK:",
"source": "npm install @defillama/api"
},
{
"lang": "python",
"description": "Install the DefiLlama Python SDK:",
"source": "pip install defillama-sdk"
}
]
},
"tags": [
{
"name": "TVL",
"description": "Retrieve TVL data"
},
{
"name": "coins",
"description": "General blockchain data used by defillama and open-sourced"
},
{
"name": "stablecoins",
"description": "Data from our stablecoins dashboard"
},
{
"name": "yields",
"description": "Data from our yields/APY dashboard"
},
{
"name": "volumes",
"description": "Data from our volumes dashboards"
},
{
"name": "fees and revenue",
"description": "Data from our fees and revenue dashboard"
}
],
"servers": [
{
"url": "https://api.llama.fi"
}
],
"paths": {
"/protocols": {
"get": {
"tags": ["TVL"],
"summary": "List all protocols on defillama along with their tvl",
"responses": {
"200": {
"description": "Array of all protocols with their TVL data",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "2269"
},
"name": {
"type": "string",
"example": "Aave"
},
"symbol": {
"type": "string",
"example": "AAVE"
},
"category": {
"type": "string",
"example": "Lending"
},
"chains": {
"type": "array",
"items": {
"type": "string"
},
"example": ["Ethereum", "Polygon"]
},
"tvl": {
"type": "number",
"example": 5200000000
},
"chainTvls": {
"type": "object",
"additionalProperties": {
"type": "number"
},
"example": {
"Ethereum": 3200000000,
"Polygon": 2000000000
}
},
"change_1d": {
"type": "number",
"example": 2.1
},
"change_7d": {
"type": "number",
"example": -5.3
}
}
}
}
}
}
}
},
"x-codeSamples": [
{
"lang": "javascript",
"label": "JavaScript SDK",
"source": "const result = await client.tvl.getProtocols()"
},
{
"lang": "python",
"label": "Python SDK",
"source": "result = client.tvl.getProtocols()"
}
]
}
},
"/protocol/{protocol}": {
"get": {
"tags": ["TVL"],
"summary": "Get historical TVL of a protocol and breakdowns by token and chain",
"parameters": [
{
"name": "protocol",
"in": "path",
"description": "protocol slug",
"required": true,
"schema": {
"type": "string",
"example": "aave"
}
}
],
"responses": {
"200": {
"description": "Protocol details with historical TVL data and chain breakdowns",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "parent#aave"
},
"name": {
"type": "string",
"example": "AAVE"
},
"symbol": {
"type": "string",
"example": "AAVE"
},
"category": {
"type": "string",
"example": "Lending"
},
"chains": {
"type": "array",
"items": {
"type": "string"
},
"example": ["Ethereum", "Polygon", "Avalanche"]
},
"currentChainTvls": {
"type": "object",
"additionalProperties": {
"type": "number"
},
"example": {
"Ethereum": 3200000000,
"Polygon": 1500000000
}
},
"chainTvls": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"tvl": {
"type": "array",
"items": {
"type": "object",
"properties": {
"date": {
"type": "number",
"example": 1609459200
},
"totalLiquidityUSD": {
"type": "number",
"example": 1000000
}
}
}
},
"tokens": {
"type": "array",
"items": {
"type": "object",
"properties": {
"date": {
"type": "number",
"example": 1609459200
},
"tokens": {
"type": "object",
"additionalProperties": {
"type": "number"
},
"example": {
"USDC": 1000000,
"USDT": 800000
}
}
}
}
}
}
}
}
}
}
}
}
},
"404": {
"description": "Protocol not found"
}
},
"x-codeSamples": [
{
"lang": "javascript",
"label": "JavaScript SDK",
"source": "const result = await client.tvl.getProtocol('<protocol>')"
},
{
"lang": "python",
"label": "Python SDK",
"source": "result = client.tvl.getProtocol('<protocol>')"
}
]
}
},
"/v2/historicalChainTvl": {
"get": {
"tags": ["TVL"],
"summary": "Get historical TVL (excludes liquid staking and double counted tvl) of DeFi on all chains",
"responses": {
"200": {
"description": "Historical TVL data for all chains combined",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"date": {
"type": "number",
"description": "Unix timestamp",
"example": 1609459200
},
"tvl": {
"type": "number",
"description": "Total Value Locked in USD across all chains",
"example": 15000000000
}
}
}
}
}
}
}
},
"x-codeSamples": [
{
"lang": "javascript",
"label": "JavaScript SDK",
"source": "const result = await client.tvl.getHistoricalChainTvl()"
},
{
"lang": "python",
"label": "Python SDK",
"source": "result = client.tvl.getHistoricalChainTvl()"
}
]
}
},
"/v2/historicalChainTvl/{chain}": {
"get": {
"tags": ["TVL"],
"summary": "Get historical TVL (excludes liquid staking and double counted tvl) of a chain",
"parameters": [
{
"name": "chain",
"in": "path",
"required": true,
"description": "chain slug, you can get these from /chains or the chains property on /protocols",
"schema": {
"type": "string",
"example": "Ethereum"
}
}
],
"responses": {
"200": {
"description": "Historical TVL data for the specified chain",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"date": {
"type": "number",
"description": "Unix timestamp",
"example": 1609459200
},
"tvl": {
"type": "number",
"description": "Total Value Locked in USD for this chain",
"example": 45000000000
}
}
}
}
}
}
},
"404": {
"description": "Chain not found"
}
},
"x-codeSamples": [
{
"lang": "javascript",
"label": "JavaScript SDK",
"source": "const result = await client.tvl.getHistoricalChainTvl('<chain>')"
},
{
"lang": "python",
"label": "Python SDK",
"source": "result = client.tvl.getHistoricalChainTvl()"
}
]
}
},
"/tvl/{protocol}": {
"get": {
"tags": ["TVL"],
"summary": "Simplified endpoint to get current TVL of a protocol",
"description": "Simplified endpoint that only returns a number, the current TVL of a protocol",
"parameters": [
{
"name": "protocol",
"in": "path",
"required": true,
"description": "protocol slug",
"schema": {
"type": "string",
"example": "uniswap"
}
}
],
"responses": {
"200": {
"description": "Current TVL of the protocol in USD",
"content": {
"application/json": {
"schema": {
"type": "number",
"description": "Total Value Locked in USD",
"example": 4962012809.795062
}
}
}
},
"404": {
"description": "Protocol not found"
}
},
"x-codeSamples": [
{
"lang": "javascript",
"label": "JavaScript SDK",
"source": "const result = await client.tvl.getTvl('<protocol>')"
},
{
"lang": "python",
"label": "Python SDK",
"source": "result = client.tvl.getTvl('<protocol>')"
}
]
}
},
"/v2/chains": {
"get": {
"tags": ["TVL"],
"summary": "Get current TVL of all chains",
"responses": {
"200": {
"description": "Array of all chains with their TVL data",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"gecko_id": {
"type": "string",
"nullable": true,
"description": "CoinGecko ID for the chain's native token",
"example": "ethereum"
},
"tvl": {
"type": "number",
"description": "Total Value Locked in USD",
"example": 65998652431.40251
},
"tokenSymbol": {
"type": "string",
"nullable": true,
"description": "Native token symbol",
"example": "ETH"
},
"cmcId": {
"type": "string",
"nullable": true,
"description": "CoinMarketCap ID",
"example": "1027"
},
"name": {
"type": "string",
"description": "Chain name",
"example": "Ethereum"
},
"chainId": {
"type": "number",
"nullable": true,
"description": "Chain ID number",
"example": 1
}
}
}
}
}
}
}
},
"x-codeSamples": [
{
"lang": "javascript",
"label": "JavaScript SDK",
"source": "const result = await client.tvl.getChains()"
},
{
"lang": "python",
"label": "Python SDK",
"source": "result = client.tvl.getChains()"
}
]
}
},
"/prices/current/{coins}": {
"get": {
"tags": ["coins"],
"summary": "Get current prices of tokens by contract address",
"description": "The goal of this API is to price as many tokens as possible, including exotic ones that never get traded, which makes them impossible to price by looking at markets.\n\nThe base of our data are prices pulled from coingecko, which is then extended through multiple means:\n- We price all bridged tokens by using the price of the token in it's original chain, so we fetch all bridged versions of USDC on arbitrum, fantom, avax... and price all them using the price for the token on Ethereum, which we know. Right now we support 10 different bridging protocols.\n- We have multiple adapters to price specialized sets of tokens by running custom code:\n - We price yearn's yToken LPs by checking how much underlying token can be withdrawn for each LP\n - Aave, compound and euler LP tokens are also priced based on their relationship against underlying tokens\n - Uniswap, curve, balancer and stargate LPs are priced using the underlying tokens in each pair\n - GMX's GLP token is priced based on the value of tokens given on withdrawal (which includes calculations based on trader's PnL)\n \n - Synthetix tokens are priced using forex prices of the coin they are pegged to\n- For tokens that we haven't been able to price in any other way, we find the pool with most liquidity for each on uniswap, curve and serum and then use the prices provided on those exchanges.\n \n Unlike all the other tokens, we can't confirm that these prices are correct, so we only ingest the ones that have sufficient liquidity and, even in that case, we attach a `confidence` value to them that is related to the depth of liquidity and which represents our confidence in the quality of each price. API consumers can choose to filter out prices with low confidence values.\n \n Our API server is fully open source and we are constantly adding more pricing adapters, extending the amount of tokens we support.\n \nTokens are queried using {chain}:{address}, where chain is an identifier such as ethereum, bsc, polygon, avax... You can also get tokens by coingecko id by setting `coingecko` as the chain, eg: coingecko:ethereum, coingecko:bitcoin. Examples:\n - ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1\n - bsc:0x762539b45a1dcce3d36d080f74d1aed37844b878\n - coingecko:ethereum\n - arbitrum:0x4277f8f2c384827b5273592ff7cebd9f2c1ac258\n",
"servers": [
{
"url": "https://coins.llama.fi"
}
],
"parameters": [
{
"name": "coins",
"in": "path",
"required": true,
"description": "set of comma-separated tokens defined as {chain}:{address}",
"schema": {
"type": "string",
"example": "ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1,coingecko:ethereum,bsc:0x762539b45a1dcce3d36d080f74d1aed37844b878,ethereum:0xdB25f211AB05b1c97D595516F45794528a807ad8"
}
},
{
"name": "searchWidth",
"in": "query",
"required": false,
"description": "time range on either side to find price data, defaults to 6 hours",
"schema": {
"type": "string",
"example": "4h"
}
}
],
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"coins": {
"type": "object",
"properties": {
"ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1": {
"type": "object",
"properties": {
"decimals": {
"type": "number",
"example": 8
},
"price": {
"type": "number",
"example": 0.022053735051098835
},
"symbol": {
"type": "string",
"example": "cDAI"
},
"timestamp": {
"type": "number",
"example": 0.99
}
}
}
}
}
}
}
}
}
},
"502": {
"description": "Internal error"
}
},
"x-codeSamples": [
{
"lang": "javascript",
"label": "JavaScript SDK",
"source": "const result = await client.prices.getCurrentPrices(['<coins>'])"
},
{
"lang": "python",
"label": "Python SDK",
"source": "result = client.prices.getCurrentPrices(['<coins>'])"
}
]
}
},
"/prices/historical/{timestamp}/{coins}": {
"get": {
"tags": ["coins"],
"summary": "Get historical prices of tokens by contract address",
"description": "See /prices/current for explanation on how prices are sourced.",
"servers": [
{
"url": "https://coins.llama.fi"
}
],
"parameters": [
{
"name": "coins",
"in": "path",
"required": true,
"description": "set of comma-separated tokens defined as {chain}:{address}",
"schema": {
"type": "string",
"example": "ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1,coingecko:ethereum,bsc:0x762539b45a1dcce3d36d080f74d1aed37844b878,ethereum:0xdB25f211AB05b1c97D595516F45794528a807ad8"
}
},
{
"name": "timestamp",
"in": "path",
"required": true,
"description": "UNIX timestamp of time when you want historical prices",
"schema": {
"type": "number",
"example": 1648680149
}
},
{
"name": "searchWidth",
"in": "query",
"required": false,
"description": "time range on either side to find price data, defaults to 6 hours",
"schema": {
"type": "string",
"example": "4h"
}
}
],
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"coins": {
"type": "object",
"properties": {
"ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1": {
"type": "object",
"properties": {
"decimals": {
"type": "number",
"example": 8
},
"price": {
"type": "number",
"example": 0.022053735051098835
},
"symbol": {
"type": "string",
"example": "cDAI"
},
"timestamp": {
"type": "number",
"example": 1648680149
}
}
}
}
}
}
}
}
}
},
"502": {
"description": "Internal error"
}
},
"x-codeSamples": [
{
"lang": "javascript",
"label": "JavaScript SDK",
"source": "const result = await client.prices.getHistoricalPrices(1704067200, ['<coins>'])"
},
{
"lang": "python",
"label": "Python SDK",
"source": "result = client.prices.getHistoricalPrices(1704067200, ['<coins>'])"
}
]
}
},
"/batchHistorical": {
"get": {
"tags": ["coins"],
"summary": "Get historical prices for multiple tokens at multiple different timestamps",
"description": "Strings accepted by period and searchWidth:\nCan use regular chart candle notion like ‘4h’ etc where:\nW = week, D = day, H = hour, M = minute (not case sensitive)\n",
"servers": [
{
"url": "https://coins.llama.fi"
}
],
"parameters": [
{
"name": "coins",
"in": "query",
"required": true,
"description": "object where keys are coins in the form {chain}:{address}, and values are arrays of requested timestamps",
"schema": {
"type": "string",
"example": "{\"avax:0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e\": [1666876743, 1666862343], \"coingecko:ethereum\": [1666869543, 1666862343]}\n"
}
},
{
"name": "searchWidth",
"in": "query",
"required": false,
"description": "time range on either side to find price data, defaults to 6 hours",
"schema": {
"type": "string",
"example": 600
}
}
],
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"coins": {
"type": "object",
"properties": {
"avax:0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e": {
"type": "object",
"properties": {
"symbol": {
"type": "string",
"example": "USDC"
},
"prices": {
"type": "array",
"items": {
"type": "object",
"properties": {
"timestamp": {
"type": "number",
"example": 1666876674
},
"price": {
"type": "number",
"example": 0.999436
},
"confidence": {
"type": "number",
"example": 0.99
}
}
}
}
}
}
}
}
}
}
}
}
},
"502": {
"description": "Internal error"
}
},
"x-codeSamples": [
{
"lang": "javascript",
"label": "JavaScript SDK",
"source": "const result = await client.prices.getBatchHistoricalPrices({ '<coins>': [1704067200] })"
},
{
"lang": "python",
"label": "Python SDK",
"source": "result = client.prices.getBatchHistoricalPrices(['<coins>'], '<List[int]]>')"
}
]
}
},
"/chart/{coins}": {
"get": {
"tags": ["coins"],
"summary": "Get token prices at regular time intervals",
"description": "Strings accepted by period and searchWidth:\nCan use regular chart candle notion like ‘4h’ etc where:\nW = week, D = day, H = hour, M = minute (not case sensitive)\n",
"servers": [
{
"url": "https://coins.llama.fi"
}
],
"parameters": [
{
"name": "coins",
"in": "path",
"required": true,
"description": "set of comma-separated tokens defined as {chain}:{address}",
"schema": {
"type": "string",
"example": "ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1,coingecko:ethereum,bsc:0x762539b45a1dcce3d36d080f74d1aed37844b878,ethereum:0xdB25f211AB05b1c97D595516F45794528a807ad8"
}
},
{
"name": "start",
"in": "query",
"required": false,
"description": "unix timestamp of earliest data point requested",
"schema": {
"type": "number",
"example": 1664364537
}
},
{
"name": "end",
"in": "query",
"required": false,
"description": "unix timestamp of latest data point requested",
"schema": {
"type": "number",
"example": null
}
},
{
"name": "span",
"in": "query",
"required": false,
"description": "number of data points returned, defaults to 0",
"schema": {
"type": "number",
"example": 10
}
},
{
"name": "period",
"in": "query",
"required": false,
"description": "duration between data points, defaults to 24 hours",
"schema": {
"type": "string",
"example": "2d"
}
},
{
"name": "searchWidth",
"in": "query",
"required": false,
"description": "time range on either side to find price data, defaults to 10% of period",
"schema": {
"type": "string",
"example": 600
}
}
],
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"coins": {
"type": "object",
"properties": {
"ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1": {
"type": "object",
"properties": {
"decimals": {
"type": "number",
"example": 8
},
"confidence": {
"type": "number",
"example": 0.99
},
"prices": {
"type": "array",
"items": {
"type": "object",
"properties": {
"timestamp": {
"type": "number",
"example": 1666790570
},
"price": {
"type": "number",
"example": 0.984519
}
}
}
},
"symbol": {
"type": "string",
"example": "HUSD"
}
}
}
}
}
}
}
}
}
},
"502": {
"description": "Internal error"
}
},
"x-codeSamples": [
{
"lang": "javascript",
"label": "JavaScript SDK",
"source": "const result = await client.prices.getChart(['<coins>'])"
},
{
"lang": "python",
"label": "Python SDK",
"source": "result = client.prices.getChart(['<coins>'])"
}
]
}
},
"/percentage/{coins}": {
"get": {
"tags": ["coins"],
"summary": "Get percentage change in price over time",
"description": "Strings accepted by period:\nCan use regular chart candle notion like ‘4h’ etc where:\nW = week, D = day, H = hour, M = minute (not case sensitive)\n",
"servers": [
{
"url": "https://coins.llama.fi"
}
],
"parameters": [
{
"name": "coins",
"in": "path",
"required": true,
"description": "set of comma-separated tokens defined as {chain}:{address}",
"schema": {
"type": "string",
"example": "ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1,coingecko:ethereum,bsc:0x762539b45a1dcce3d36d080f74d1aed37844b878,ethereum:0xdB25f211AB05b1c97D595516F45794528a807ad8"
}
},
{
"name": "timestamp",
"in": "query",
"required": false,
"description": "timestamp of data point requested, defaults to time now",
"schema": {
"type": "number",
"example": 1664364537
}
},
{
"name": "lookForward",
"in": "query",
"required": false,
"description": "whether you want the duration after your given timestamp or not, defaults to false (looking back)",
"schema": {
"type": "boolean",
"example": false
}
},
{
"name": "period",
"in": "query",
"required": false,
"description": "duration between data points, defaults to 24 hours",
"schema": {
"type": "string",
"example": "3w"
}
}
],
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"coins": {
"type": "object",
"properties": {
"ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1": {
"type": "number",
"example": -2.3009954568977147
}
}
}
}
}
}
}
},
"502": {
"description": "Internal error"
}
},
"x-codeSamples": [
{
"lang": "javascript",
"label": "JavaScript SDK",
"source": "const result = await client.prices.getPercentageChange(['<coins>'])"
},
{
"lang": "python",
"label": "Python SDK",
"source": "result = client.prices.getPercentageChange(['<coins>'])"
}
]