Should dex.trades backfill prices from dex.prices? (Where there's no entry in prices.usd) #3153
Replies: 3 comments 2 replies
-
There may be a dependency loop need to solve, I am not sure Or when |
Beta Was this translation helpful? Give feedback.
-
thinking off the top of the head here, without looking closely at the downside is: we'd have to edit all underlying base models. we're already in conversation to redesign |
Beta Was this translation helpful? Give feedback.
-
closing this in favor of #4637 where i've added this to the appendix section of the issue |
Beta Was this translation helpful? Give feedback.
-
Originally was going to post this as an issue, but figured it may be better as a discussion
Description
In dex.trades, amount_usd will only be > 0 if the price feed for one of the tokens traded exists in coinpaprika. This understates total DEX volume, since tokens may have known prices, but not be supported in the token price API.
Current behavior
Trades between 2 non-prices.usd/coinpaprika tokens returns NULL amount_usd
Expected behavior
dex.trades pulls from dex.prices when amount_usd is null.
Impacted model(s)
Possible solution
When amount_usd is NULL via prices.usd / coinpaprika, use the token price from dex.prices to calculate amount_usd. To avoid some data quality errors, we could add some filtering on these matches and/or select the lowest USD value of each token.
Example of impacted trades: https://dune.com/queries/2357626
I'd expect that there's some dependency issues, so raising here before making any approach.
Beta Was this translation helpful? Give feedback.
All reactions