This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
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.
Description of change
Since the previous refactoring, the subgraph's epochs key id was badly generated.
The implications are the followings:
The following steps are:
Another issue was raised for this distribution:
If there is no tx during an epoch for a given market, the subgraph used the last epoch market rate to distribute rewards (which is not the case for the off-chain script. Until now, all market side was active during epochs, but the Compound COMP borrow side was not active during the age 3. So the off-chain script was distributing the correct rewards for the users of age 4, but the user has repaid COMP during age6, and the age five was skipped. So basically, the subgraph has badly distributed rewards to the user, considering a 0 rate for the age4. There is no incidence for the previous Merkle trees, but we have to loop over all epochs between the previous update and the current epoch in the subgraph.
This transaction is the one that is making issues (repay of COMP where Borrow side of cCOMP market has no activity for 3 epochs)
Pull-Request Checklist
main
branchyarn lint
passes with this changeyarn test
passes with this changeFixes #0000