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

update dextools api endpoint and supported chain names #8

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

papismurf
Copy link

@papismurf papismurf commented Dec 18, 2024

  • Integrated Dextools API endpoints in contstants
  • added params in get_request helper method add added params in pool_processor
  • Updated method to build AssetInfo in correct format based on dextools data structure

WIP:

* add request params to sort tokens
* update get_request helper method and pool_parser
Wanted to introduce another async get request to another endpoint in pool_processor method to retrieve liquidity something like:

async with aiohttp.ClientSession() as session:
        # get the basic liquidity information
        pool_url = f"{base_url}/{chain_id}/{pool_address}"
        async with session.get(pool_url, headers=headers) as response:
            if response.status == 200:
                pool_data = await response.json()
            else:
                raise Exception(f"Failed to fetch pool data: {response.status}")

        # Now, let's get the price/volume data
        price_url = f"{pool_url}/price"
        async with session.get(price_url, headers=headers) as response:
            if response.status == 200:
                price_data = await response.json()
            else:
                raise Exception(f"Failed to fetch price data: {response.status}")

Let me know if something like this is acceptable or if you don't want that?

And will finish today
@papismurf papismurf marked this pull request as ready for review January 1, 2025 14:17
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

Successfully merging this pull request may close these issues.

1 participant