VPIN: Toxic Flow Detection - Quant Researcher Interview Question
Difficulty: Hard
Category: machine_learning
Asked at: Jump Trading, Virtu, Two Sigma, Tower Research, Citadel Securities, Tudor Investment, HRT
Topics: market_microstructure, vpin, order_flow, high_frequency
Problem Description
The Volume-Synchronized Probability of Informed Trading (VPIN) is a high-frequency market microstructure metric used to estimate order flow toxicity by measuring order imbalances within volume-based buckets. By utilizing a volume clock instead of time bars, VPIN aligns with the speed of information arrival, making it a robust tool for predicting market volatility and liquidity crashes.
Task
Implement a function solution(trades, bucket_volume, window_size) that calculates the rolling VPIN metric
Practice this hard researcher interview question on MyntBit - the LeetCode for quants with 200+ quant interview questions for Jane Street, Citadel, Two Sigma, and other top quantitative finance firms.