-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add publisher caps to the validator #412
Conversation
…ggregation errors
…ges until v1 buffer is cleared
Co-authored-by: Pavel Strakhov <[email protected]>
Co-authored-by: Pavel Strakhov <[email protected]>
for account in account_datas { | ||
if let Some(price_account) = checked_load_price_account(account) { | ||
let cap: u64 = m | ||
.checked_div(max(u64::from(price_account.num_), z)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
side-note: it's good to update our formula in the doc to mention we take the floor of the division when we sum it up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In practice it will be a very small difference since $PYTH has 6 decimals, so n_symbols
* 10^-6
I implements the publisher cap as:
where M and Z are parameters, n_s is the number of publishers of symbol s