Skip to content

Commit 81c8e40

Browse files
committed
Update the example schema
1 parent fbc4764 commit 81c8e40

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

examples/cw-contract/schema/fetch_price_response.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@
1616
},
1717
"definitions": {
1818
"Price": {
19-
"description": "A price with a degree of uncertainty, represented as a price +- a confidence interval.\n\nThe confidence interval roughly corresponds to the standard error of a normal distribution. Both the price and confidence are stored in a fixed-point numeric representation, `x * 10^expo`, where `expo` is the exponent. For example:\n\n``` use pyth_sdk::Price; Price { price: 12345, conf: 267, expo: -2 }; // represents 123.45 +- 2.67 Price { price: 123, conf: 1, expo: 2 }; // represents 12300 +- 100 ```\n\n`Price` supports a limited set of mathematical operations. All of these operations will propagate any uncertainty in the arguments into the result. However, the uncertainty in the result may overestimate the true uncertainty (by at most a factor of `sqrt(2)`) due to computational limitations. Furthermore, all of these operations may return `None` if their result cannot be represented within the numeric representation (e.g., the exponent is so small that the price does not fit into an i64). Users of these methods should (1) select their exponents to avoid this problem, and (2) handle the `None` case gracefully.",
19+
"description": "A price with a degree of uncertainty at a certain time, represented as a price +- a confidence interval.\n\nThe confidence interval roughly corresponds to the standard error of a normal distribution. Both the price and confidence are stored in a fixed-point numeric representation, `x * 10^expo`, where `expo` is the exponent. For example:\n\n``` use pyth_sdk::Price; Price { price: 12345, conf: 267, expo: -2, publish_time: 100 }; // represents 123.45 +- 2.67 published at UnixTimestamp 100 Price { price: 123, conf: 1, expo: 2, publish_time: 100 }; // represents 12300 +- 100 published at UnixTimestamp 100 ```\n\n`Price` supports a limited set of mathematical operations. All of these operations will propagate any uncertainty in the arguments into the result. However, the uncertainty in the result may overestimate the true uncertainty (by at most a factor of `sqrt(2)`) due to computational limitations. Furthermore, all of these operations may return `None` if their result cannot be represented within the numeric representation (e.g., the exponent is so small that the price does not fit into an i64). Users of these methods should (1) select their exponents to avoid this problem, and (2) handle the `None` case gracefully.",
2020
"type": "object",
2121
"required": [
2222
"conf",
2323
"expo",
24-
"price"
24+
"price",
25+
"publish_time"
2526
],
2627
"properties": {
2728
"conf": {
@@ -36,6 +37,11 @@
3637
"price": {
3738
"description": "Price.",
3839
"type": "string"
40+
},
41+
"publish_time": {
42+
"description": "Publish Timestamp",
43+
"type": "integer",
44+
"format": "int64"
3945
}
4046
}
4147
}

0 commit comments

Comments
 (0)