galacticcouncil / galacticcouncil/hydration-node
stableswap asset order dependency issue
- Dominant language
- Rust
- Stars
- 208
- Forks
- 109
- Avg merge
- 6d 3h
- Merged PRs (30d)
- 3
Description
Stableswap is implemented in a way that it is order-dependent on assets.
Currently - when a new pool is created, it sorts the order of assets in pool by their asset id.
When a pool with pegs is created - it sorts the order of asset but the list of peg sources might not be in the same order as pool assets after the sort ( it really depends on the ids ).
That's is not an issue with existing pools but if not careful, might present a problem.
Suggestions to fix:
1. Remove the reordering of assets
2. Order the list of peg sources if needed - preferable so we keep the existing behavior, but it might be tricky to do.
The order of assets is likely only due to historic reasons, and it is no longer needed. Needs to be verified.
Contributor guide
Assessment
This issue has not been assessed yet.