diff --git a/models/gold/defi/defi__ez_bridge_activity.sql b/models/gold/defi/defi__ez_bridge_activity.sql index ab821c6..9c4b7a1 100644 --- a/models/gold/defi/defi__ez_bridge_activity.sql +++ b/models/gold/defi/defi__ez_bridge_activity.sql @@ -33,7 +33,13 @@ SELECT token_symbol, amount_unadj, amount, - amount_usd, + ROUND( + CASE + WHEN amount_usd < 1e+15 THEN amount_usd + ELSE NULL + END, + 2 + ) AS amount_usd, COALESCE ( complete_bridge_activity_id, {{ dbt_utils.generate_surrogate_key( diff --git a/models/gold/defi/defi__ez_dex_swaps.sql b/models/gold/defi/defi__ez_dex_swaps.sql index 17d19e3..7e9d5e2 100644 --- a/models/gold/defi/defi__ez_dex_swaps.sql +++ b/models/gold/defi/defi__ez_dex_swaps.sql @@ -24,10 +24,26 @@ SELECT event_name, amount_in_unadj, amount_in, - amount_in_usd, + ROUND( + CASE + WHEN amount_out_usd IS NULL + OR ABS((amount_in_usd - amount_out_usd) / NULLIF(amount_out_usd, 0)) > 0.75 + OR ABS((amount_in_usd - amount_out_usd) / NULLIF(amount_in_usd, 0)) > 0.75 THEN NULL + ELSE amount_in_usd + END, + 2 + ) AS amount_in_usd, amount_out_unadj, amount_out, - amount_out_usd, + ROUND( + CASE + WHEN amount_in_usd IS NULL + OR ABS((amount_out_usd - amount_in_usd) / NULLIF(amount_in_usd, 0)) > 0.75 + OR ABS((amount_out_usd - amount_in_usd) / NULLIF(amount_out_usd, 0)) > 0.75 THEN NULL + ELSE amount_out_usd + END, + 2 + ) AS amount_out_usd, sender, tx_to, event_index,