add historical capability #525
Draft
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.




Hello Balancer team,
second attempt at adding historical capability to the SDK (see my other PR I made a few hours ago: balancer/balancer-sor#413 that I closed now), this time without modifying anything on the SOR part.
I figured that the "GraphQLArgs" already had the blockNumber available so I used it to fetch the pools from TheGraph at the block I wanted and used the parameter in "getOnChainBalances" to instantiate the multicaller with the override "blockTag".
This seem to be working but sadly I don't find valid results and I don't know why. You can try with the new example I wrote in examples/swaps/historicalSwaps.ts
when running it here's what is outputted:
While the current value is correct, the one at block 17M is not, should be around 1864 .
What's crazy to me is that my other PR on the SOR does almost the same thing and finds the correct results. I'm still investigating.