duality-labs / duality-web-app

2 stars 2 forks source link

Remove incentives and staking UI #487

Closed dib542 closed 9 months ago

dib542 commented 9 months ago

The incentives are not going to be merged into Neutron for a while.

Initially it was planned to remove this UI after the upgrade to duality v0.5.0, but there are some issues in the upgrade between v0.4.0 and v0.4.1 which requires a significant update in how the incentive staked deposits of a user are identified and used in the web app:

https://github.com/duality-labs/duality/commit/9ede0f2bedb85bd1d479824174b00c94e8053b94#diff-f99638c93f14bbb45d29b4058affb4444faab353aeb9ba21fde6a086897a8c45

In this commit and shown in this diff is the changes from a parseable dex coin denom (eg. DualityPoolShares-stake-token-t-10109-f30) which contains enough information to know what pool the deposit is for, to an unparseable dex coin denom (eg. Pool/id/1234) which requires another lookup to determine the information of the pool this deposit is for.

This additional context can be found by fetching the pool data or meta data from the endpoints:

The pool and pool metadata structures look are defined in the dex .proto files, and here the pool metadata contains the information that we need to identify the pool this deposit is for:

message Pool {
    uint64 ID = 1;
    PoolReserves lower_tick0 = 2;
    PoolReserves upper_tick1 = 3;
}

message PoolMetadata {
  uint64 ID = 1;
  int64 tick = 2;
  uint64 fee = 3;
  PairID pairID = 4;
}

Why this an issue with the Incentives and Staking UI

For the user deposits on the dex it is not necessary to query each pool metadata by ID to find this information as it is returned on the endpoint listing all the details for all a user's deposits:

however this is not an option for the staked deposits on the incentives module:

Conclusion

So in order to avoid creating new logic that will attempt to query the staked deposits for pool metadata information. Logic that will remain mostly untested and possibly broken as it may not even be manually tested. We should remove the incentives and staking UI before moving past this point of the Duality chain.