-
Notifications
You must be signed in to change notification settings - Fork 4
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
owner limit #240
Merged
Merged
owner limit #240
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rouzwelt
added
enhancement
New feature or request
new feature
New Feature
update
Update Inner Logic
labels
Oct 25, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
resolves #237
Solution
makes rounds stateful by keeping a map of
orderbooks -> owner -> owner profile -> orders -> pairs
and sequentionaly select orders based on each owner's limit for the upcoming round.this means that we cant have distinct sg query for orders on each round, since that completely collides with statefulness of owner's orders between rounds, so at startup, the orders are fetched once and after that we set watchers for orderbooks add/remove order events and apply the new changes to the map at end of every round.
this as a result minimizes the use subgraph to great extent, since there will only ne one query only at startup.
Edit1:
Reading new order changes from rpc by listening to orderbook onchain events requires a reliable rpc, so no orders changes are missed and we dont get rpc errors, since we dont have reliable rpc solution at this point, reverted back to using sg instead, which is a more reliable source at this point, we query sg for order changes on every round for the specific timeframe, basically similar to listening on onchain events, but rather querying the sg for
AddOrder
andRemoveOrder
entities, and keep track of changes returned by the query.Checks
By submitting this for review, I'm confirming I've done the following: