ExocoreNetwork / exocore

5 stars 9 forks source link

feat(dogfood): asset ids, oracle usage #11

Closed MaxMustermann2 closed 4 months ago

MaxMustermann2 commented 4 months ago

As #4 stands today, the dogfood module relies on operator and delegation hooks to decide the validator updates which need to be passed to Tendermint. However, in a multi-asset staking situation, this is not feasible because the price of the asset (which is being delegated / undelegated) may change during the epoch. Hence, a function called GetAvgDelegatedValue is envisaged in the restaking_assets_manage keeper. This function should return the sum of the currently delegated values (not pending undelegation) multiplied by the average price of the assets within the epoch (derived from the oracle module). With this new design, a lot of the complexities of the previous design have been eliminated or offloaded to other modules; however, it is a heavier operation because of the iteration of validators that is required at each epoch.