Cardinality issue in slippage query
Opened this issue · 1 comments
fleupold commented
valued_potential_buffered_trades
joins potential_buffer_trades
with clearing_prices
and should not increase the number of rows, but seems to do so (period 01-24 to 01-31, 17223 potential buffer trades, 17331 valued buffer trades).
This is likely due to prices.usd
no longer being unique for token/minute pair in Dune v2
solver-rewards/queries/dune_v2/period_slippage.sql
Lines 242 to 246 in 0c24b84
Fix may be to create an intermediate table that averages prices of tokens for which we have multiple records per week.