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

owner limit #240

Merged
merged 41 commits into from
Nov 28, 2024
Merged

owner limit #240

merged 41 commits into from
Nov 28, 2024

Conversation

rouzwelt
Copy link
Collaborator

@rouzwelt rouzwelt commented Oct 25, 2024

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 and RemoveOrder entities, and keep track of changes returned by the query.

Checks

By submitting this for review, I'm confirming I've done the following:

  • made this PR as small as possible
  • unit-tested any new functionality
  • linked any relevant issues or PRs
  • included screenshots (if this involves a front-end change)

@rouzwelt rouzwelt self-assigned this Oct 25, 2024
@rouzwelt rouzwelt added enhancement New feature or request new feature New Feature update Update Inner Logic labels Oct 25, 2024
@rouzwelt rouzwelt merged commit 43bc191 into master Nov 28, 2024
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request new feature New Feature update Update Inner Logic
Projects
None yet
Development

Successfully merging this pull request may close these issues.

limit simulations per loop per owner
1 participant