Metrics and Statistics (24h Volumes, TWAP, Price Impact)
Functions like record_trade(...)
, get_trades_24h(...)
, and calculate_average_price_24h(...)
help track:
24h Volumes: Total trading volumes over the last day, aiding analytics and decision-making.
TWAP: Providing stable pricing references.
Price Impact: Calculating how much a trade shifts the price and ensuring trades occur within acceptable bounds.
Use Cases:
Analytics dashboards displaying recent pool activity and health.
Traders adjusting strategy based on recent volume and volatility.
Best Practices:
Regularly read and interpret these metrics to maintain a healthy, attractive pool.
Set safeguards (e.g., max slippage) based on observed volatility.
Last updated