@@ -8,6 +8,7 @@ use schemars::JsonSchema;
8
8
mod price_conf;
9
9
pub use price_conf:: PriceConf ;
10
10
11
+ /// This consists of 32 bytes and it is currently based on largest Public Key size on various blockchains.
11
12
pub type ProductIdentifier = [ u8 ; 32 ] ;
12
13
13
14
/// Represents availability status of a price feed.
@@ -80,6 +81,7 @@ pub struct Price {
80
81
impl Price {
81
82
/**
82
83
* Get the current price and confidence interval as fixed-point numbers of the form a * 10^e.
84
+ *
83
85
* Returns a struct containing the current price, confidence interval, and the exponent for both
84
86
* numbers. Returns `None` if price information is currently unavailable for any reason.
85
87
*/
@@ -97,8 +99,8 @@ impl Price {
97
99
98
100
/**
99
101
* Get the exponential moving average price (ema_price) and a confidence interval on the result.
100
- * Returns `None` if the ema price is currently unavailable.
101
102
*
103
+ * Returns `None` if the ema price is currently unavailable.
102
104
* At the moment, the confidence interval returned by this method is computed in
103
105
* a somewhat questionable way, so we do not recommend using it for high-value applications.
104
106
*/
@@ -112,8 +114,9 @@ impl Price {
112
114
}
113
115
114
116
/**
115
- * Get the current price of this account in a different quote currency. If this account
116
- * represents the price of the product X/Z, and `quote` represents the price of the product Y/Z,
117
+ * Get the current price of this account in a different quote currency.
118
+ *
119
+ * If this account represents the price of the product X/Z, and `quote` represents the price of the product Y/Z,
117
120
* this method returns the price of X/Y. Use this method to get the price of e.g., mSOL/SOL from
118
121
* the mSOL/USD and SOL/USD accounts.
119
122
*
@@ -140,7 +143,9 @@ impl Price {
140
143
}
141
144
142
145
/**
143
- * Get the price of a basket of currencies. Each entry in `amounts` is of the form
146
+ * Get the price of a basket of currencies.
147
+ *
148
+ * Each entry in `amounts` is of the form
144
149
* `(price, qty, qty_expo)`, and the result is the sum of `price * qty * 10^qty_expo`.
145
150
* The result is returned with exponent `result_expo`.
146
151
*
0 commit comments