You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -51,17 +53,17 @@ This module is used in the BandChain.
51
53
52
54
### Delegator Signal
53
55
54
-
A Delegator Signal is a sign or vote from a delegator, instructing the chain to provide feed service for the designated ID.
56
+
A Delegator Signal is a vote from a delegator, instructing the chain to provide feed service for the designated ID.
55
57
56
-
A Delegator Signal consists of an ID and the power associated with that ID. The feeding interval and deviation are reduced by the sum of the power of the ID. The total power of a delegator cannot exceed their bonded delegation.
58
+
A Delegator Signal consists of an ID and the power associated with that ID. The feeding interval and deviation are reduced by the sum of the power of the ID. The total power of a delegator cannot exceed their total bonded delegation.
57
59
58
60
### Feed
59
61
60
-
A Feed is a data structure containing a signal ID, its total power, and calculated interval and deviation values. Essentially, it instructs the validator regarding which signal IDs' prices need to be submitted at each specified interval or deviation.
62
+
A Feed is a data structure containing a signal IDand calculated interval and deviation values from the total power. Essentially, it instructs the validator regarding which signal IDs' prices need to be submitted at each specified interval or deviation.
61
63
62
64
#### Feed Interval
63
65
64
-
The interval is calculated based on the power of its feed; the greater the power, the shorter the interval. The total power of a feed is the sum of the power of its signal IDs received from the delegators. The minimum and maximum intervals are determined by parameters called `MinInterval` and `MaxInterval`, respectively.
66
+
The interval is calculated based on the total power of the signal ID; the greater the power, the shorter the interval. The total power of a signal is the sum of the power of its signal IDs received from the delegators. The minimum and maximum intervals are determined by parameters called `MinInterval` and `MaxInterval`, respectively.
65
67
66
68
#### Feed Deviation
67
69
@@ -74,29 +76,29 @@ Deviation follows a similar logic to interval. On-chain deviation is measured in
74
76
- Subsequently, the interval is calculated as the maximum of MinInterval or the floor(MaxInterval / power factor).
75
77
- The deviation is then calculated as the max(`MinDeviationInThousandth`, (`MaxDeviationInThousandth` / power factor).
76
78
77
-
You can visualize the interval/deviation as resembling the harmonic series times MaxInterval/MaxDeviationInThousandth, with step of PowerThreshold.
79
+
You can visualize the interval/deviation as resembling the harmonic series times MaxInterval/MaxDeviationInThousandth, with the step of PowerThreshold.
78
80
79
81
#### Supported Feeds
80
82
81
-
The list of currently supported feeds includes those with power exceeding the PowerThreshold parameter and ranking within the top MaxSupportedFeeds. Feeds outside of this list are considered unsupported, and validators do not need to submit their prices.
83
+
The list of currently supported feeds includes those with power exceeding the PowerThreshold parameter and ranking within the top `MaxSupportedFeeds`. The supported feeds will be re-calculated on every `BlocksPerFeedsUpdate` block(s). Validators are only required to submit their prices for the supported feeds.
82
84
83
85
### Validator Price
84
86
85
87
The Validator Price refers to the price submitted by each validator before being aggregated into the final Price.
86
88
87
-
The module only contains the latest price of each validator and signal id.
89
+
The module only contains the latest price of each validator and signal ID.
88
90
89
91
### Price
90
92
91
-
A Price is a structure that maintains the current price state for a signal id, including its current price, price status, and the most recent timestamp.
93
+
A Price is a structure that maintains the current price state for a signal ID, including its current price, price status, and the most recent timestamp.
92
94
93
-
Once the Validator Price is submitted, it will be weighted median which weight by how latest the price and how much validator power of the owner of the price to get the most accurate and trustworthy price.
95
+
Once the Validator Price is submitted, it will be weighted median which is weighted by how latest the price is and how much power the owner of the price has to get the most accurate and trustworthy price.
94
96
95
-
The module only contains the latest price of each signal id.
97
+
The module only contains the latest price of each signal ID.
96
98
97
99
### Price Service
98
100
99
-
The On-chain Price Service is the agreed-upon version of the price service suggested for validators to use when querying prices for the feeds.
101
+
The On-chain Price Service is the agreed-upon version of the price service suggested for validators to use when querying prices for the feeds. Only the admin address can update this configuration.
100
102
101
103
## State
102
104
@@ -106,39 +108,45 @@ PriceService is stored in the global store `0x00` to hold Price Service informat
// BlocksPerFeedsUpdate is the number of blocks after which the feed interval and deviation will be recalculated
196
+
uint64 blocks_per_feeds_update = 12;
183
197
}
184
198
```
185
199
186
200
## Messages
187
201
188
-
In this section we describe the processing of the feeds messages and the corresponding updates to the state. All created/modified state objects specified by each message are defined within the [state](#state) section.
202
+
In this section, we describe the processing of the `feeds` messages and the corresponding updates to the state. All created/modified state objects specified by each message are defined within the [state](#state) section.
189
203
190
204
### MsgSubmitPrices
191
205
192
206
Validator Prices are submitted using the `MsgSubmitPrices` message.
193
-
The Prices will be updated at endblock using this new Validator Prices.
207
+
The price of signals will be updated at the end block using these new prices from validators.
194
208
195
209
```protobuf
196
210
// MsgSubmitPrices is the transaction message to submit multiple prices.
@@ -211,21 +225,23 @@ message MsgSubmitPrices {
211
225
212
226
This message is expected to fail if:
213
227
214
-
* validator address is not correct
215
-
* validator status is not bonded
216
-
* price is submitted in `CooldownTime` param
217
-
* no Feed with the same signalID
228
+
* validator address is not correct.
229
+
* validator status is not bonded.
230
+
* validator's oracle status is not active.
231
+
* timestamp is too different from block time.
232
+
* the price is submitted in the `CooldownTime` param.
233
+
* the signals of the prices are not in the supported feeds.
218
234
219
235
### MsgUpdatePriceService
220
236
221
237
Price Service can be updated with the `MsgUpdatePriceService` message.
222
-
Only assigned admin can update the Price Service.
238
+
Only the assigned admin can update the Price Service.
223
239
224
240
```protobuf
225
241
// MsgUpdatePriceService is the transaction message to update price service's information.
* Price Service url is not in the correct format of an url
256
+
* sender address does not match the `Admin` param.
257
+
* Price Service's URL is not in the correct format of a URL.
242
258
243
259
### MsgUpdateParams
244
260
@@ -268,10 +284,7 @@ The message handling can fail if:
268
284
Delegator Signals are submitted as a batch using the MsgSubmitSignals message.
269
285
270
286
Batched Signals replace the previous Signals of the same delegator as a batch.
271
-
Signals are registered, and their power is added to the feeds of the same SignalID.
272
-
If the Feed's Interval is changed, its LastIntervalUpdateTimestamp will be marked as the block time.
273
-
If the updated Feed's Power is zero, it will be deleted from the state.
274
-
Every time there is an update to a Feed, `FeedByPowerIndex` will be re-indexed.
287
+
Signals are registered, and their power is added to the SignalTotalPower of the same SignalID.
275
288
276
289
```protobuf
277
290
// MsgSubmitSignals is the transaction message to submit signals
@@ -288,34 +301,40 @@ message MsgSubmitSignals {
288
301
289
302
The message handling can fail if:
290
303
291
-
* delegator address is not correct
292
-
* delegator do not have less delegation than sum of the Powers
293
-
*no Feed with the same signalID
304
+
*The delegator's address is not correct.
305
+
*The delegator has less delegation than the sum of the Powers.
306
+
*The signal is not valid. (e.g. too long signal ID, power is a negative value).
294
307
295
308
## End-Block
296
309
297
310
Each abci end block call, the operations to update prices.
298
311
299
312
### Update Prices
300
313
301
-
At every end block, the Validator Price of every Supported Feed will be obtained and checked if it is within the acceptance period (1 interval).
302
-
Any validator that does not submit a price within this period is considered to have miss-reported and will be deactivated, unless the Feed is in a transition period (where the interval has just been updated within TransitionTime).
303
-
Accepted Validator Prices of the same SignalID will be weighted and medianed based on the recency of the price and the power of the validator who submitted the price.
304
-
The medianed price is then set as the Price.
314
+
At every end block, the Validator Price of all supported feeds will be obtained and checked if it is within the acceptance period (1 interval).
315
+
Any validator that does not submit a price within this period is considered to have miss-reported and will be deactivated unless the Supported feeds are in a transition period.
316
+
Accepted Validator Prices of the same SignalID will be weighted and median based on the recency of the price and the power of the validator who submitted the price.
317
+
The median price is then set as the Price.
318
+
319
+
### Update supported feeds
320
+
321
+
At every `BlocksPerFeedsUpdate` block(s), the supported feeds will be re-calculated based on the parameters of the module (e.g. `MinInterval`, `MaxSupportedFeeds`).
0 commit comments