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

Rework DB returns to be more functional #126

Open
larsyngvelundin opened this issue Nov 15, 2023 · 0 comments
Open

Rework DB returns to be more functional #126

larsyngvelundin opened this issue Nov 15, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@larsyngvelundin
Copy link
Collaborator

Rather than returning an array like:

[(70, 'eth', 'eth', 'ether', '0x1F98431c8aD98523631AE4a59f267346ea31F984', '0xA30EBe412e17aE91E80F36DED94B0AB09f99ca89', 1698514091, '0x53c6A49e8B07D7b05B81d65CaB43e360B8fbeA43', 'dev', '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', 'WETH', 'uniswap3', 18450185)]

It would be better to process that list within DB and return a Dict or something similar to this:

{
    id: 70,
    net: 'eth',
    pool_main_contract: '0x1F98431c8aD98523631AE4a59f267346ea31F984',
    pool_address: '0xA30EBe412e17aE91E80F36DED94B0AB09f99ca89',
    time_created: 1698514091,
    token1_address: '0x53c6A49e8B07D7b05B81d65CaB43e360B8fbeA43',
    token1_symbol: 'dev',
    token2_address: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
    token2_symbol: 'WETH',
    dex: 'uniswap3',
    creation_block: 18450185
}

Then the information can be easily accessed by doing pool.creation_block instead of the harder to read and debug pool[12]

@larsyngvelundin larsyngvelundin added the enhancement New feature or request label Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant