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

feat: Index Swapr V3 Algebra Pools #3123

Open
greenlucid opened this issue Nov 13, 2024 · 1 comment
Open

feat: Index Swapr V3 Algebra Pools #3123

greenlucid opened this issue Nov 13, 2024 · 1 comment

Comments

@greenlucid
Copy link

Problem

Seer is a prediction market that would like access to limit orders. AMMs are hard to operate with for both liquidity providers and users. However, users in Seer are prompted to deploy liquidity in Swapr V3 pools, and currently, Cowswap will refuse to operate with those tokens and throw an UnsupportedToken error, claiming balance is below 100000. So, limit orders are not possible.

However, the issue is not that those tokens are not held in enough balance, but probably that Swapr V3 pools were not being indexed properly.

Suggested solution

Index Swapr V3 Pools.


Balance was not the issue

const MIN_AMOUNT: u64 = 100_000;

The MIN_AMOUNT variable is 100_000, but this is wei, not accounting for decimals.
It's compared to the result of balance_of;
let call = instance.balance_of(owner).call();

So this clue was likely wrong:

image

To show this in a different way, this token can take part in limit orders, will show price on network logs, and is not Unsupported:

image

This token has less token supply
https://gnosisscan.io/token/0x1ee18c3d2847ff22238130ffdd5223de2a7356e3?a=0x89c4acb8b5b5b8e5b2121934b9e143569a914c80#readContract
100000000000000000000 <== totalSupply (100 * 1e18)
100000000000000000000000 <== implied min amount, 100000 * 1e18

It started showing as supported when a Pool was created for it in Sushiswap V2, which I have been found referenced in various parts of the code.


Are SwaprV3 pools being indexed?

With that out of the way, I'm not experienced enough with Rust to help with this, and I couldn't figure out how to test or install. But I would guess that to start indexing this information you would have to:

  1. Add Swapr V3 in sources.rs
  2. (Add something under Uniswap v3 sources?)
  3. Add V3Router and Algebra Pools

I've been told that SwaprV3 are indeed indexed, but then, why can I not find any of the V3 deployment addresses anywhere in this codebase?

Likewise, I believe SushiSwap V3 is not indexed either, but I admit I'm a bit out of my element here

@squadgazzz
Copy link
Contributor

Thank you for raising this issue and providing such detailed insights.

  • You are correct that the issue is likely not related to token balances falling below the threshold, but rather with the lack of indexing support for Swapr V3 Algebra pools in our current implementation.
  • At this time, we are not actively working on adding indexing support for Swapr V3 Algebra pools, as our focus is on existing sources. However, some external solvers may already support these pools. We are checking internally why limit orders don't work as expected.

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

2 participants