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

Multiple Entries per Symbol in prices.usd_latest #6818

Closed
zakraicik opened this issue Sep 24, 2024 · 2 comments
Closed

Multiple Entries per Symbol in prices.usd_latest #6818

zakraicik opened this issue Sep 24, 2024 · 2 comments

Comments

@zakraicik
Copy link

Summary
prices.usd_latest is expected to have only one entry per symbol (the latest price). However, some symbols have multiple entries, often due to discrepancies in the symbol's decimals. This can cause issues when performing joins or calculations.

Example

select * 
from prices.usd_latest 
where blockchain = 'ethereum' AND symbol = 'PEIPEI'

Implications

  • Increased row count in joins: Unintentionally, the number of rows can increase if these discrepancies are not accounted for in queries.
  • Incorrect conversions: The inconsistency in decimals can result in incorrect value conversions, especially in interactions with protocols like Uniswap V3 during liquidity calculations.
@jeff-dude
Copy link
Member

hi @zakraicik -- we should not filter / join on symbol column. the uniqueness of prices is always going to be blockchain, contract_address.

any token can use any symbol they want. there isn't much we can do to get around that. i would suggest changing your approach and use symbol solely for metadata

@zakraicik
Copy link
Author

Thanks @jeff-dude !!

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