Skip to content

Commit

Permalink
Update wording
Browse files Browse the repository at this point in the history
  • Loading branch information
emile-00 committed Nov 26, 2024
1 parent 884cca9 commit 1f5fe64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions demos/market-trade-surveillance.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ Materialized views contain the results of a view expression and are stored in th

### Identify unusual volume trades

The `unusual_volume` materialized view indicates if a trade has a higher than average trading volume within a 10-minute window. `TUMBLE()` and `GROUP BY` is used to to aggregate everything into 10-minute windows. Then `PARTITION BY` is used to ensure that the average volume is calculated separately for each asset.
The `unusual_volume` materialized view indicates if a trade has a higher than average trading volume within a 10-minute window. `TUMBLE()` is used to to split everything into non-overlapping 10-minute windows. `GROUP BY` is used to group the data by the unique trade ID, asset ID, volume, and window start time. Then `PARTITION BY` is used to ensure that the average volume is calculated separately for each asset.

If the trade's volume is 1.5 times greater than the average volume over the past ten-minutes, it is marked as an unusual trade.
If the trade's volume is 1.5 times greater than the average volume of each asset over the past ten-minutes, it is marked as an unusual trade.

```sql
CREATE MATERIALIZED VIEW unusual_volume AS
Expand Down

0 comments on commit 1f5fe64

Please sign in to comment.