Transform raw market data in real-time to provide insights into market trends, asset health, and trade opportunities.
psql
, is installed in your environment. For detailed instructions, see Download PostgreSQL.raw_market_data
tracks raw market data of each asset, such as the price, volume, and bid-ask price.
enrichment_data
contains external data that adds context to the raw market data. It includes additional metrics such as historical volatility, sector performance, and sentiment scores.
data_generator.py
file. This Python script utilizes the psycopg2
library to establish a connection with RisingWave so you can generate and insert synthetic data into the tables positions
and market_data
.
If you are not running RisingWave locally or using default credentials, update the connection parameters accordingly:
avg_price_bid_ask_spread
materialized view calculates the average price and average bid-ask spread for each asset in five-minute time windows by using TUMBLE()
and grouping by the assed_id
and the time window.
To learn more about TUMBLE()
, see Time windows.
avg_price_bid_ask_spread
to see the results.
rolling_volatility
materialized view uses the stddev_samp
function to calculate the rolling price volatility within five-minute time windows by using TUMBLE()
and grouping by the assed_id
and the time window.
rolling_volatility
to see the results.
enriched_market_data
materialized view combines the transformed market data with the enrichment data. TUMBLE()
is used to group the data from enrichment_data
into five-minute time windows for each asset. Then it is joined with the volatility and bid-ask spread data.
By combining these data sources, you can obtain a more holistic view of each asset, empowering you to make more informed market decisions.
enriched_market_data
to see the results.
Ctrl+C
to close the connection between RisingWave and psycopg2
.