What Are the Trade-Offs between Using a Median Price versus an Average Price?
A median price is the middle value in a set of data, which is highly resistant to extreme outliers or single malicious data points. It is simpler to calculate and robust against a small number of bad actors.
An average price (like VWAP) incorporates volume and reflects liquidity better but can be slightly more susceptible to a large, coordinated attack. The median prioritizes security against outliers, while the average prioritizes market representation.