Skip to content
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

Merged
merged 51 commits into from
Jul 31, 2024
Merged

Conversation

guibescos
Copy link
Contributor

@guibescos guibescos commented Jul 16, 2024

I implements the publisher cap as:

image

where M and Z are parameters, n_s is the number of publishers of symbol s

@guibescos guibescos changed the base branch from main to accumulator-v2 July 17, 2024 18:40
@guibescos guibescos marked this pull request as ready for review July 22, 2024 16:47
@guibescos guibescos changed the title Feat/publisher caps feat: publisher caps Jul 22, 2024
@guibescos guibescos changed the title feat: publisher caps feat: add publisher caps to the validator Jul 22, 2024
Base automatically changed from accumulator-v2 to main July 24, 2024 16:04
keyvankhademi
keyvankhademi previously approved these changes Jul 30, 2024
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))
Copy link
Collaborator

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.

Copy link
Contributor Author

@guibescos guibescos Jul 31, 2024

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

@guibescos guibescos dismissed Riateche’s stale review July 31, 2024 19:28

It has been addressed

@guibescos guibescos merged commit 1de3dd4 into main Jul 31, 2024
3 checks passed
@guibescos guibescos deleted the feat/publisher-caps branch July 31, 2024 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants