Price Index Module
In addition to the core NFT sale and trade functionalities, the SALE contract also includes the PRICE_INDEX
and LIQUIDITY
modules to provide comprehensive price tracking and liquidity analysis capabilities. These modules enhance the overall marketplace experience by offering valuable insights into market dynamics and trends.
Price Index Module (PRICE_INDEX
)
PRICE_INDEX
)This module tracks and stores price history and trading volume data for NFT collections. It allows users to analyze price trends over different time intervals, understand market volatility, and make informed trading decisions.
Key Features:
Price Data Tracking: The module records price and volume data for each trade, storing it in
PricePoint
structs.Time Intervals: Price data is aggregated and stored for various time intervals, including 1 minute, 5 minutes, 15 minutes, 1 hour, 4 hours, and 1 day.
Historical Data: Users can access historical price data for any supported time interval using the
get_price_history
function.Current Price and Volume: The module provides functions to retrieve the current price (
get_current_price
) and 24-hour volume (get_24h_volume
) for a collection.
Functions:
create_price_index
: Creates a new price index for a given collection.update_price
: Updates the price index with new trade data.get_price_history
: Retrieves historical price data for a specified time interval.get_current_price
: Returns the current price for a collection.get_24h_volume
: Returns the 24-hour trading volume for a collection.
Last updated