Only send Caching requests every X blocks #416
Merged
+10
−2
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.
This change will change the behavior of how often we sample buckets in RoutesDB.
We currently have a RoutesDB that stores routes seen for the past 24 hours for every specific pair. This database is not really growing much, since most routes will tend to stay liquid within the same liquidity pools that are currently being traded.
We care about updating the database whenever theres a major change in liquidity, but that doesn't happen often, so we are setting some threshold for how often we sample each bucket of a given pair. (A bucket is a range of from amount to amount * phi), we are changing from sampling on every block to sampling less often to reduce the amount of sync request we send to the routing api.
We will likely have to play with the numbers based on the chain velocity (how often a block is generated).