sushiswap / sushiswap-subgraph

Sushiswap Subgraph
https://thegraph.com/explorer/subgraph/sushiswap/sushiswap
MIT License
150 stars 257 forks source link

Move remaining lockup logic from MasterChef into Lockup subgraph. #30

Closed matthewlilley closed 3 years ago

matthewlilley commented 3 years ago

The Lockup subgraph is essentially a slimmed-down clone of MasterChef, which tracks SUSHI up until the point of Lockup and then freezes the state. This works well for calculating the unclaimed SUSHI at point of lockup, which is needed for some UI computation, but we have some logic inside MasterChef remaining which is tracking harvested SUSHI since lockup.

Ideally, this should all be removed from MasterChef and added to the Lockup subgraph, as right now we're forced to query both which is causing problems because when you withdraw all liquidity tokens from MasterChef, the relationship is removed.