Skip to content

Add bogus_native_prices alert query (sell orders)#355

Open
data-cowwboy wants to merge 2 commits into
mainfrom
nitish/bogus-native-prices-alert
Open

Add bogus_native_prices alert query (sell orders)#355
data-cowwboy wants to merge 2 commits into
mainfrom
nitish/bogus-native-prices-alert

Conversation

@data-cowwboy
Copy link
Copy Markdown
Contributor

Summary

  • Adds the SQL for Dune query 7574432 under cowprotocol/alerts/, matching the existing solver_inactivity_alert_6568090.sql naming convention.
  • The query flags settled SELL orders where the sell-side and buy-side native values diverge by >1000x (likely bogus native price), with a min_native_volume floor so dust orders don't trip it.
  • Consumed daily by the bogus_native_prices monitor in cow-dagster (companion PR: cowprotocol/cow-dagster#nitish/bogus-native-prices-alert).

Flags settled SELL orders where the sell-side and buy-side native
values diverge by >1000x, indicating a bogus native price was used
for at least one of the two tokens. Volume floor (min_native_volume)
avoids firing on dust orders.

Dune query: 7574432. Consumed daily by cow-dagster's
bogus_native_prices monitor.
Apply SQLFluff auto-fix to the where-clause indentation and register
min_native_volume in the templater context so the parser can resolve
the parameter.
sell_value_native > 1000 * buy_value_native
or buy_value_native > 1000 * sell_value_native
)
and greatest(sell_value_native, buy_value_native) > {{min_native_volume}}
Copy link
Copy Markdown
Contributor

@harisang harisang May 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the left-hand side should be minimum/least or whatever dune uses, in my opinion, as you could have cases where i am selling 20 dollars on mainnet and most of which is consumed by gas fees.

and rod.protocol_fee_native_price > 0
)

select
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add auction_id here as well, and environment and blockchain.

Copy link
Copy Markdown
Contributor

@harisang harisang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added some comments

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.

2 participants