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:
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:
/duality/dex/pool/{poolID}
/duality/dex/pool_metadata/{ID}
/duality/dex/pool_metadata
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:
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:
/duality/dex/user/deposits/{address}
which returns a list of DepositRecord:
however this is not an option for the staked deposits on the incentives module:
/duality/incentives/stakes?owner={address}
which returns the following response
message Stake {
// ID is the "autoincrementing" id of the stake, assigned at creation.
uint64 ID = 1;
// owner is the account originating the stake. Only the owner can withdraw
// coins from the stake.
string owner = 2 [ (gogoproto.moretags) = "yaml:\"owner\"" ];
// start_time is the time at which the coins in the lock were staked.
google.protobuf.Timestamp start_time = 3 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false,
(gogoproto.jsontag) = "start_time,omitempty",
(gogoproto.moretags) = "yaml:\"start_time\""
];
// coins are the tokens staked, and managed by the module account.
repeated cosmos.base.v1beta1.Coin coins = 4 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
// start_dist_epoch is the dist epoch (defaulting to the day) at which the
// coins in the lock were staked. This is used by distribution logic to filter
// on stakes that have existed for longer than the distribution period (you
// can only qualify for today's rewards if you staked your LP tokens
// yesterday). We use int64 instead of uint64 to make testing easier.
int64 start_dist_epoch = 5;
}
Where the cosmos.base.v1beta1.Coin type is the base Cosmos coin type
and that denom is the previously mentioned unparseable dex coin denom (eg. Pool/id/1234) which requires the additional dex pool metadata lookups by querying for each stake the user has its ID at:
/duality/dex/pool_metadata/{ID}
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.
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:
/duality/dex/pool/{poolID}
/duality/dex/pool_metadata/{ID}
/duality/dex/pool_metadata
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: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:
/duality/dex/user/deposits/{address}
which returns a list ofDepositRecord
:however this is not an option for the staked deposits on the incentives module:
/duality/incentives/stakes?owner={address}
which returns the following responseWhere the
cosmos.base.v1beta1.Coin
type is the base Cosmos coin typeand that denom is the previously mentioned unparseable dex coin denom (eg.
Pool/id/1234
) which requires the additional dex pool metadata lookups by querying for each stake the user has its ID at:/duality/dex/pool_metadata/{ID}
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.