Skip to content

Commit d29435c

Browse files
waynebruce0xclaude
andcommitted
coins: mark decimals optional and document confidence
Live responses on api.llama.fi and coins.llama.fi return `confidence` on price entries today, and coingecko-native assets (e.g. coingecko:ethereum) legitimately omit `decimals`. The schema did not reflect either, so clients generating types from the spec were either missing `confidence` or erroneously treating coingecko coins as malformed. - `/prices/current/{coins}`, `/prices/historical/{timestamp}/{coins}`, `/chart/{coins}`: add explicit `required` arrays marking decimals optional - `/prices/current` and `/prices/historical`: add `confidence` property - `/chart`: already had `confidence` — add matching description - Mirror the same three changes in the pro spec under /coins/* Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 8772d46 commit d29435c

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

defillama-openapi-free.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,9 +527,11 @@
527527
"properties": {
528528
"ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1": {
529529
"type": "object",
530+
"required": ["price", "symbol", "timestamp"],
530531
"properties": {
531532
"decimals": {
532533
"type": "number",
534+
"description": "Token decimals. Omitted for coingecko-native assets (e.g. coingecko:ethereum).",
533535
"example": 8
534536
},
535537
"price": {
@@ -543,6 +545,11 @@
543545
"timestamp": {
544546
"type": "number",
545547
"example": 0.99
548+
},
549+
"confidence": {
550+
"type": "number",
551+
"description": "Confidence score between 0 and 1 indicating the reliability of the price.",
552+
"example": 0.99
546553
}
547554
}
548555
}
@@ -626,9 +633,11 @@
626633
"properties": {
627634
"ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1": {
628635
"type": "object",
636+
"required": ["price", "symbol", "timestamp"],
629637
"properties": {
630638
"decimals": {
631639
"type": "number",
640+
"description": "Token decimals. Omitted for coingecko-native assets (e.g. coingecko:ethereum).",
632641
"example": 8
633642
},
634643
"price": {
@@ -642,6 +651,11 @@
642651
"timestamp": {
643652
"type": "number",
644653
"example": 1648680149
654+
},
655+
"confidence": {
656+
"type": "number",
657+
"description": "Confidence score between 0 and 1 indicating the reliability of the price.",
658+
"example": 0.99
645659
}
646660
}
647661
}
@@ -852,13 +866,16 @@
852866
"properties": {
853867
"ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1": {
854868
"type": "object",
869+
"required": ["confidence", "prices", "symbol"],
855870
"properties": {
856871
"decimals": {
857872
"type": "number",
873+
"description": "Token decimals. Omitted for coingecko-native assets (e.g. coingecko:ethereum).",
858874
"example": 8
859875
},
860876
"confidence": {
861877
"type": "number",
878+
"description": "Confidence score between 0 and 1 indicating the reliability of the price.",
862879
"example": 0.99
863880
},
864881
"prices": {

defillama-openapi-pro.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11296,9 +11296,11 @@
1129611296
"properties": {
1129711297
"ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1": {
1129811298
"type": "object",
11299+
"required": ["price", "symbol", "timestamp"],
1129911300
"properties": {
1130011301
"decimals": {
1130111302
"type": "number",
11303+
"description": "Token decimals. Omitted for coingecko-native assets (e.g. coingecko:ethereum).",
1130211304
"example": 8
1130311305
},
1130411306
"price": {
@@ -11312,6 +11314,11 @@
1131211314
"timestamp": {
1131311315
"type": "number",
1131411316
"example": 0.99
11317+
},
11318+
"confidence": {
11319+
"type": "number",
11320+
"description": "Confidence score between 0 and 1 indicating the reliability of the price.",
11321+
"example": 0.99
1131511322
}
1131611323
}
1131711324
}
@@ -11390,9 +11397,11 @@
1139011397
"properties": {
1139111398
"ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1": {
1139211399
"type": "object",
11400+
"required": ["price", "symbol", "timestamp"],
1139311401
"properties": {
1139411402
"decimals": {
1139511403
"type": "number",
11404+
"description": "Token decimals. Omitted for coingecko-native assets (e.g. coingecko:ethereum).",
1139611405
"example": 8
1139711406
},
1139811407
"price": {
@@ -11406,6 +11415,11 @@
1140611415
"timestamp": {
1140711416
"type": "number",
1140811417
"example": 1648680149
11418+
},
11419+
"confidence": {
11420+
"type": "number",
11421+
"description": "Confidence score between 0 and 1 indicating the reliability of the price.",
11422+
"example": 0.99
1140911423
}
1141011424
}
1141111425
}
@@ -11606,13 +11620,16 @@
1160611620
"properties": {
1160711621
"ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1": {
1160811622
"type": "object",
11623+
"required": ["confidence", "prices", "symbol"],
1160911624
"properties": {
1161011625
"decimals": {
1161111626
"type": "number",
11627+
"description": "Token decimals. Omitted for coingecko-native assets (e.g. coingecko:ethereum).",
1161211628
"example": 8
1161311629
},
1161411630
"confidence": {
1161511631
"type": "number",
11632+
"description": "Confidence score between 0 and 1 indicating the reliability of the price.",
1161611633
"example": 0.99
1161711634
},
1161811635
"prices": {

0 commit comments

Comments
 (0)