galacticcouncil / galacticcouncil/hydration-node

stableswap asset order dependency issue

Open
#1,164 0 comments 0 reactions 0 assignees View on GitHub
type/bug
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.