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

implemented kyberPMM is the same #380

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

cyberliem
Copy link
Member

Why did we need it?

We need a way to tell if the kyberPMM is updated or not (by comparing new state to the old received one)

Related Issue

Release Note

How Has This Been Tested?

Screenshots (if appropriate):

if len(p1) != len(p2) {
return false
}
priceMap := make(map[float64]float64, len(p1))
Copy link
Member

@hieuvo hieuvo Mar 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

be careful as handling float numbers
https://goplay.space/#E4wWkMLU1n_w

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cyberliem levels not need to be ordered, actually we usually give bad price at the first level(due gas fee).
I think compare two price levels by asks vs asks, bids vs bids, and they are slices, so you can do slice compare.
in theory, [{qty: 1, price 0.5}, {qty: 1, price: 0.49}] is different with [{qty: 1, price: 0.49}, {qty: 1, price 0.5}]
because we apply it from top -> end

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.

3 participants