Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support CW pools in split routes #129

Open
p0mvn opened this issue Mar 18, 2024 · 0 comments
Open

Support CW pools in split routes #129

p0mvn opened this issue Mar 18, 2024 · 0 comments

Comments

@p0mvn
Copy link
Member

p0mvn commented Mar 18, 2024

This is an effort that is not as simple from the performance standpoint.

With split routes, to compute the optimal split we, essentially, do swap estimates in various proportions.

With most pool types, we have the algorithms reimplemented in the router so we compute estimates directly. However, for cw pools, we query the node so that smart contract provides this estimate.

This excessive node querying might lead to the node falling behind or just make the router extremely slow.

We will need to rethink how splits are done if we want to support cw pools.

The problem here is that it is impossible to know a stable perfect split. It keeps changing as liquidity changes and pools are added.

As a result, we keep recomputing it.

We do have various layers of caching to avoid excessive recomputation.

One possible solution is to add another one to compute optimal split proportion in the background and have a custom ttl for token pairs. For example, splits for tokens with higher liquidity need to be recomputed less frequently.

The refactor tracked in #111 should make this simpler

Acceptance Critera

  • Define a way to support CW pools in split routes
  • Implement
  • Test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant