Volume-Synchronized Probability of Informed Trading (VPIN)
Calculate the Volume-Synchronized Probability of Informed Trading (VPIN) of Easley, López de Prado and O’Hara (2012) per asset and day, from daily bars: how one-sided, and thus toxic, the order flow is.
VPIN measures the toxicity of the order flow, the share of the volume that is one-sided: informed traders buy (or sell) persistently, while uninformed trading roughly balances. The volume is cut into buckets of the same size (a volume clock rather than a time clock), the volume of each bucket is split into buys and sells with the Bulk Volume Classification (a large rise is mostly buying, a day without a change half buying and half selling) and VPIN is the mean order imbalance over the last 50 buckets. A high VPIN means a one-sided market in which market makers lose to informed traders and may withdraw; the paper finds that VPIN was at its highest in the hours before the flash crash of 6 May 2010.
This is a coarse approximation of a measure designed for intraday data. The paper fills 50 buckets a day from one-minute bars, so its VPIN measures the toxicity within a day. On daily bars the finest classification is a whole day, which nets the buying and selling within it, and a bucket holds about a day of volume, so VPIN here is a slow-moving estimate of the one-sidedness of the volume over about 50 trading days. Use it to compare assets and periods, not as the published intraday VPIN or as a warning of an intraday liquidity crash.
The formula is as follows:
\[\Delta P_{t} = P_{t} - P_{t-1}\] \[V^{B_{t}} = V_{t} \cdot Z\left(\frac{\Delta P_{t}}{\sigma_{\Delta} P}\right)\] \[V^{B_{\tau}} = \text{the buy volume of the volume in bucket}\; \tau,\;\; V^{S_{\tau}} = V - V^{B_{\tau}}\] \[\text{VPIN} = \frac{\sum\left|V^{S_{\tau}} - V^{B_{\tau}}\right|}{n \cdot V} \;\text{over the last}\; n \;\text{buckets}\]Where P is the Adjusted Close and \(V_{t}\) the Volume of day t, Z the cumulative distribution function of the standard normal distribution (or of the Student-t distribution with degrees_of_freedom), \(\sigma_{\Delta} P\) the sample standard deviation (with n - 1 in the denominator) of the price changes of the last window days, V the volume of a bucket and n the number of buckets.
Also known as: volume-synchronized probability of informed trading, flow toxicity, order flow toxicity, bulk volume classification, BVC.
Example · SNAP, ETSY, LYFT · 2024 to 2025
Install the Finance Toolkit with pip install financetoolkit -U, then call get_vpin:
from financetoolkit import Toolkit
toolkit = Toolkit(
["SNAP", "ETSY", "LYFT"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2024-07-01",
end_date="2025-06-30",
)
toolkit.risk.get_vpin()
Or, with the Finance Toolkit MCP set up, ask an AI assistant such as Claude or ChatGPT:
How likely was informed trading in Snap, Etsy, Lyft and the S&P 500 over the last five trading days of June 2025, measured by the VPIN on a year of daily bars?
Which returns:
| Date | SNAP | ETSY | LYFT | Benchmark |
|---|---|---|---|---|
| 2024-07-01 | ||||
| 2024-07-02 | ||||
| 2024-07-03 | ||||
| 2024-07-05 | ||||
| 2024-07-08 | ||||
| 2024-07-09 | ||||
| 2024-07-10 | ||||
| 2024-07-11 | ||||
| 2024-07-12 | ||||
| 2024-07-15 | ||||
| 2024-07-16 | ||||
| 2024-07-17 | ||||
| 2024-07-18 | ||||
| 2024-07-19 | ||||
| 2024-07-22 | ||||
| 2024-07-23 | ||||
| 2024-07-24 | ||||
| 2024-07-25 | ||||
| 2024-07-26 | ||||
| 2024-07-29 | ||||
| 2024-07-30 | ||||
| 2024-07-31 | ||||
| 2024-08-01 | ||||
| 2024-08-02 | ||||
| 2024-08-05 | ||||
| 2024-08-06 | ||||
| 2024-08-07 | ||||
| 2024-08-08 | ||||
| 2024-08-09 | ||||
| 2024-08-12 | ||||
| 2024-08-13 | ||||
| 2024-08-14 | ||||
| 2024-08-15 | ||||
| 2024-08-16 | ||||
| 2024-08-19 | ||||
| 2024-08-20 | ||||
| 2024-08-21 | ||||
| 2024-08-22 | ||||
| 2024-08-23 | ||||
| 2024-08-26 | ||||
| 2024-08-27 | ||||
| 2024-08-28 | ||||
| 2024-08-29 | ||||
| 2024-08-30 | ||||
| 2024-09-03 | ||||
| 2024-09-04 | ||||
| 2024-09-05 | ||||
| 2024-09-06 | ||||
| 2024-09-09 | ||||
| 2024-09-10 | ||||
| 2024-09-11 | ||||
| 2024-09-12 | ||||
| 2024-09-13 | ||||
| 2024-09-16 | ||||
| 2024-09-17 | ||||
| 2024-09-18 | ||||
| 2024-09-19 | ||||
| 2024-09-20 | ||||
| 2024-09-23 | ||||
| 2024-09-24 | ||||
| 2024-09-25 | ||||
| 2024-09-26 | ||||
| 2024-09-27 | ||||
| 2024-09-30 | ||||
| 2024-10-01 | ||||
| 2024-10-02 | ||||
| 2024-10-03 | ||||
| 2024-10-04 | ||||
| 2024-10-07 | ||||
| 2024-10-08 | ||||
| 2024-10-09 | ||||
| 2024-10-10 | ||||
| 2024-10-11 | ||||
| 2024-10-14 | ||||
| 2024-10-15 | ||||
| 2024-10-16 | ||||
| 2024-10-17 | ||||
| 2024-10-18 | ||||
| 2024-10-21 | ||||
| 2024-10-22 | ||||
| 2024-10-23 | ||||
| 2024-10-24 | ||||
| 2024-10-25 | ||||
| 2024-10-28 | ||||
| 2024-10-29 | ||||
| 2024-10-30 | ||||
| 2024-10-31 | ||||
| 2024-11-01 | 0.3667 | |||
| 2024-11-04 | 0.3675 | |||
| 2024-11-05 | 0.3510 | |||
| 2024-11-06 | 0.3426 | |||
| 2024-11-07 | 0.4295 | 0.3326 | ||
| 2024-11-08 | 0.4456 | 0.3331 | ||
| 2024-11-11 | 0.4504 | 0.3368 | ||
| 2024-11-12 | 0.4659 | 0.3426 | ||
| 2024-11-13 | 0.4730 | 0.3470 | ||
| 2024-11-14 | 0.4788 | 0.3631 | ||
| 2024-11-15 | 0.4819 | 0.3631 | ||
| 2024-11-18 | 0.4788 | 0.3756 | ||
| 2024-11-19 | 0.4788 | 0.3832 | ||
| 2024-11-20 | 0.4782 | 0.3826 | ||
| 2024-11-21 | 0.4767 | 0.3894 | 0.4850 | |
| 2024-11-22 | 0.4922 | 0.3894 | 0.4701 | |
| 2024-11-25 | 0.5014 | 0.4313 | 0.4751 | |
| 2024-11-26 | 0.5025 | 0.4338 | 0.4748 | |
| 2024-11-27 | 0.4973 | 0.4355 | 0.4782 | 0.3399 |
| 2024-11-29 | 0.4973 | 0.4355 | 0.4694 | 0.3399 |
| 2024-12-02 | 0.5003 | 0.4331 | 0.4694 | 0.3329 |
| 2024-12-03 | 0.5284 | 0.4423 | 0.4732 | 0.3234 |
| 2024-12-04 | 0.5284 | 0.4571 | 0.4732 | 0.3234 |
| 2024-12-05 | 0.5435 | 0.4578 | 0.4874 | 0.3242 |
| 2024-12-06 | 0.5652 | 0.4578 | 0.4814 | 0.3242 |
| 2024-12-09 | 0.5607 | 0.4458 | 0.4820 | 0.3221 |
| 2024-12-10 | 0.5404 | 0.4384 | 0.4800 | 0.3319 |
| 2024-12-11 | 0.5404 | 0.4323 | 0.4851 | 0.3319 |
| 2024-12-12 | 0.5461 | 0.4329 | 0.4948 | 0.3325 |
| 2024-12-13 | 0.5450 | 0.4353 | 0.5066 | 0.3220 |
| 2024-12-16 | 0.5402 | 0.4640 | 0.5223 | 0.3216 |
| 2024-12-17 | 0.5325 | 0.4569 | 0.5223 | 0.3266 |
| 2024-12-18 | 0.5101 | 0.4802 | 0.5259 | 0.3584 |
| 2024-12-19 | 0.5009 | 0.4686 | 0.5142 | 0.3631 |
| 2024-12-20 | 0.4813 | 0.4380 | 0.4866 | 0.3892 |
| 2024-12-23 | 0.4650 | 0.4435 | 0.4866 | 0.3914 |
| 2024-12-24 | 0.4499 | 0.4435 | 0.4866 | 0.4045 |
| 2024-12-26 | 0.4499 | 0.4431 | 0.4880 | 0.4045 |
| 2024-12-27 | 0.4329 | 0.4549 | 0.4863 | 0.4095 |
| 2024-12-30 | 0.4272 | 0.4492 | 0.4824 | 0.4188 |
| 2024-12-31 | 0.4154 | 0.4396 | 0.4804 | 0.4222 |
| 2025-01-02 | 0.4079 | 0.4370 | 0.4892 | 0.4248 |
| 2025-01-03 | 0.4110 | 0.4313 | 0.4924 | 0.4220 |
| 2025-01-06 | 0.4136 | 0.4295 | 0.4924 | 0.4208 |
| 2025-01-07 | 0.4012 | 0.4183 | 0.4915 | 0.4327 |
| 2025-01-08 | 0.3977 | 0.4105 | 0.4813 | 0.4286 |
| 2025-01-10 | 0.4013 | 0.4049 | 0.4831 | 0.4425 |
| 2025-01-13 | 0.4019 | 0.4049 | 0.4726 | 0.4419 |
| 2025-01-14 | 0.4031 | 0.4080 | 0.4543 | 0.4405 |
| 2025-01-15 | 0.4058 | 0.4059 | 0.4439 | 0.4527 |
| 2025-01-16 | 0.4030 | 0.4059 | 0.4285 | 0.4550 |
| 2025-01-17 | 0.4069 | 0.4054 | 0.4285 | 0.4613 |
| 2025-01-21 | 0.4074 | 0.4015 | 0.4123 | 0.4590 |
| 2025-01-22 | 0.4108 | 0.4103 | 0.3943 | 0.4678 |
| 2025-01-23 | 0.4089 | 0.4123 | 0.3757 | 0.4771 |
| 2025-01-24 | 0.4172 | 0.4081 | 0.3757 | 0.4771 |
| 2025-01-27 | 0.4151 | 0.4176 | 0.3625 | 0.4670 |
| 2025-01-28 | 0.4165 | 0.4270 | 0.3619 | 0.4670 |
| 2025-01-29 | 0.4129 | 0.4270 | 0.3580 | 0.4632 |
| 2025-01-30 | 0.4098 | 0.4131 | 0.3577 | 0.4570 |
| 2025-01-31 | 0.4098 | 0.4004 | 0.3473 | 0.4580 |
| 2025-02-03 | 0.4118 | 0.3931 | 0.3544 | 0.4657 |
| 2025-02-04 | 0.4157 | 0.3973 | 0.3577 | 0.4697 |
| 2025-02-05 | 0.4354 | 0.3973 | 0.3653 | 0.4623 |
| 2025-02-06 | 0.4390 | 0.3985 | 0.3517 | 0.4623 |
| 2025-02-07 | 0.4443 | 0.3962 | 0.3476 | 0.4585 |
| 2025-02-10 | 0.4423 | 0.3962 | 0.3667 | 0.4620 |
| 2025-02-11 | 0.4314 | 0.3815 | 0.3960 | 0.4620 |
| 2025-02-12 | 0.4314 | 0.3694 | 0.4686 | 0.4643 |
| 2025-02-13 | 0.4487 | 0.3694 | 0.4658 | 0.4587 |
| 2025-02-14 | 0.4487 | 0.3904 | 0.4477 | 0.4610 |
| 2025-02-18 | 0.4553 | 0.3805 | 0.4602 | 0.4610 |
| 2025-02-19 | 0.4613 | 0.4033 | 0.4686 | 0.4570 |
| 2025-02-20 | 0.4679 | 0.3984 | 0.4692 | 0.4570 |
| 2025-02-21 | 0.4740 | 0.3991 | 0.4750 | 0.4699 |
| 2025-02-24 | 0.4740 | 0.4054 | 0.4803 | 0.4804 |
| 2025-02-25 | 0.4709 | 0.4007 | 0.4811 | 0.4785 |
| 2025-02-26 | 0.4708 | 0.3836 | 0.4772 | 0.4819 |
| 2025-02-27 | 0.4752 | 0.3874 | 0.4577 | 0.4823 |
| 2025-02-28 | 0.4747 | 0.3703 | 0.4633 | 0.5020 |
| 2025-03-03 | 0.4750 | 0.3751 | 0.4622 | 0.5085 |
| 2025-03-04 | 0.4801 | 0.3832 | 0.4615 | 0.5012 |
| 2025-03-05 | 0.4726 | 0.3832 | 0.4620 | 0.5060 |
| 2025-03-06 | 0.4598 | 0.3970 | 0.4697 | 0.5083 |
| 2025-03-07 | 0.4470 | 0.4002 | 0.4668 | 0.4980 |
| 2025-03-10 | 0.4631 | 0.4003 | 0.4706 | 0.4919 |
| 2025-03-11 | 0.4619 | 0.4156 | 0.4839 | 0.5023 |
| 2025-03-12 | 0.4629 | 0.4375 | 0.4873 | 0.4881 |
| 2025-03-13 | 0.4617 | 0.4260 | 0.4882 | 0.4901 |
| 2025-03-14 | 0.4514 | 0.4260 | 0.4991 | 0.4979 |
| 2025-03-17 | 0.4442 | 0.4262 | 0.4991 | 0.4999 |
| 2025-03-18 | 0.4317 | 0.4210 | 0.5008 | 0.4927 |
| 2025-03-19 | 0.4262 | 0.4203 | 0.4958 | 0.4917 |
| 2025-03-20 | 0.4158 | 0.4213 | 0.4969 | 0.4818 |
| 2025-03-21 | 0.4068 | 0.4139 | 0.5011 | 0.4796 |
| 2025-03-24 | 0.4068 | 0.4125 | 0.5011 | 0.4740 |
| 2025-03-25 | 0.4153 | 0.4261 | 0.4996 | 0.4810 |
| 2025-03-26 | 0.4069 | 0.4261 | 0.4997 | 0.4776 |
| 2025-03-27 | 0.4162 | 0.4146 | 0.4885 | 0.4728 |
| 2025-03-28 | 0.4168 | 0.4116 | 0.4790 | 0.4751 |
| 2025-03-31 | 0.4118 | 0.4114 | 0.4706 | 0.4760 |
| 2025-04-01 | 0.4081 | 0.4192 | 0.4640 | 0.4647 |
| 2025-04-02 | 0.4084 | 0.4347 | 0.4600 | 0.4676 |
| 2025-04-03 | 0.4227 | 0.4449 | 0.4501 | 0.4920 |
| 2025-04-04 | 0.4192 | 0.4713 | 0.4464 | 0.5347 |
| 2025-04-07 | 0.3947 | 0.4662 | 0.4383 | 0.5308 |
| 2025-04-08 | 0.3929 | 0.4891 | 0.4308 | 0.5217 |
| 2025-04-09 | 0.4276 | 0.4827 | 0.4450 | 0.5648 |
| 2025-04-10 | 0.4334 | 0.4674 | 0.4541 | 0.5598 |
| 2025-04-11 | 0.4477 | 0.4510 | 0.4541 | 0.5720 |
| 2025-04-14 | 0.4320 | 0.4442 | 0.4468 | 0.5631 |
| 2025-04-15 | 0.4255 | 0.4433 | 0.4334 | 0.5639 |
| 2025-04-16 | 0.4220 | 0.4483 | 0.4334 | 0.5566 |
| 2025-04-17 | 0.4109 | 0.4464 | 0.4254 | 0.5392 |
| 2025-04-21 | 0.4200 | 0.4368 | 0.4254 | 0.5468 |
| 2025-04-22 | 0.4223 | 0.4428 | 0.4291 | 0.5473 |
| 2025-04-23 | 0.4195 | 0.4378 | 0.4263 | 0.5409 |
| 2025-04-24 | 0.4300 | 0.4373 | 0.4287 | 0.5429 |
| 2025-04-25 | 0.4288 | 0.4202 | 0.4287 | 0.5485 |
| 2025-04-28 | 0.4422 | 0.4162 | 0.4274 | 0.5400 |
| 2025-04-29 | 0.4564 | 0.3991 | 0.4313 | 0.5393 |
| 2025-04-30 | 0.5250 | 0.4190 | 0.4313 | 0.5396 |
| 2025-05-01 | 0.5221 | 0.4245 | 0.4280 | 0.5236 |
| 2025-05-02 | 0.5482 | 0.4123 | 0.4280 | 0.5276 |
| 2025-05-05 | 0.5445 | 0.4142 | 0.4282 | 0.5183 |
| 2025-05-06 | 0.5344 | 0.4075 | 0.4364 | 0.5103 |
| 2025-05-07 | 0.5439 | 0.4090 | 0.4445 | 0.5021 |
| 2025-05-08 | 0.5232 | 0.4097 | 0.4381 | 0.4977 |
| 2025-05-09 | 0.5058 | 0.4108 | 0.5352 | 0.4917 |
| 2025-05-12 | 0.5336 | 0.4176 | 0.5455 | 0.5017 |
| 2025-05-13 | 0.5219 | 0.4224 | 0.5394 | 0.5052 |
| 2025-05-14 | 0.5080 | 0.4189 | 0.5380 | 0.4738 |
| 2025-05-15 | 0.5009 | 0.4103 | 0.5388 | 0.4569 |
| 2025-05-16 | 0.4971 | 0.3942 | 0.5323 | 0.4259 |
| 2025-05-19 | 0.4819 | 0.3896 | 0.5323 | 0.4070 |
| 2025-05-20 | 0.4556 | 0.3895 | 0.5239 | 0.3925 |
| 2025-05-21 | 0.4453 | 0.3895 | 0.5297 | 0.4076 |
| 2025-05-22 | 0.4424 | 0.3871 | 0.5297 | 0.4104 |
| 2025-05-23 | 0.4449 | 0.3748 | 0.5222 | 0.4100 |
| 2025-05-27 | 0.4495 | 0.3744 | 0.5103 | 0.4057 |
| 2025-05-28 | 0.4495 | 0.3637 | 0.5103 | 0.3998 |
| 2025-05-29 | 0.4481 | 0.3710 | 0.4995 | 0.3753 |
| 2025-05-30 | 0.4483 | 0.3787 | 0.4947 | 0.3366 |
| 2025-06-02 | 0.4438 | 0.4290 | 0.4947 | 0.3205 |
| 2025-06-03 | 0.4340 | 0.4522 | 0.4758 | 0.3189 |
| 2025-06-04 | 0.4340 | 0.4655 | 0.4599 | 0.3019 |
| 2025-06-05 | 0.4310 | 0.4686 | 0.4518 | 0.2753 |
| 2025-06-06 | 0.4201 | 0.4882 | 0.4439 | 0.2668 |
| 2025-06-09 | 0.4173 | 0.4874 | 0.4390 | 0.2625 |
| 2025-06-10 | 0.4042 | 0.5079 | 0.4210 | 0.2599 |
| 2025-06-11 | 0.3948 | 0.5209 | 0.4025 | 0.2496 |
| 2025-06-12 | 0.3853 | 0.5072 | 0.4025 | 0.2407 |
| 2025-06-13 | 0.3872 | 0.5311 | 0.3978 | 0.2388 |
| 2025-06-16 | 0.3749 | 0.5561 | 0.4038 | 0.2367 |
| 2025-06-17 | 0.3559 | 0.5441 | 0.4032 | 0.2268 |
| 2025-06-18 | 0.3371 | 0.5535 | 0.4077 | 0.2081 |
| 2025-06-20 | 0.3226 | 0.5646 | 0.4048 | 0.2045 |
| 2025-06-23 | 0.3091 | 0.5662 | 0.4046 | 0.2117 |
| 2025-06-24 | 0.2988 | 0.5868 | 0.4158 | 0.2241 |
| 2025-06-25 | 0.3125 | 0.5908 | 0.4132 | 0.2323 |
| 2025-06-26 | 0.3138 | 0.6208 | 0.4149 | 0.2339 |
| 2025-06-27 | 0.3097 | 0.6293 | 0.4178 | 0.2457 |
| 2025-06-30 | 0.3153 | 0.6162 | 0.4109 | 0.2541 |
250 rows
Parameters
get_vpin accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
buckets | int | The number of buckets n VPIN is the mean over. Defaults to 50, as in the paper. | 50, as in the paper |
window | int | The number of days the standard deviation of the price changes of the classification is taken over. Defaults to 50. | 20 |
degrees_of_freedom | float | None | The degrees of freedom of a Student-t distribution for the classification, as in Easley, López de Prado and O’Hara (2016), instead of the standard normal distribution. Defaults to None. | None |
rounding | int | None | The number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise). | 2 |
show_columns | str | list[str] | None | The columns to keep, a name or a list of names, matched on every column level, or the rows when no column has those names (such as the line items of a financial statement). Names that do not exist are logged, and when none exist the result is returned in full. Defaults to None, which keeps every column. | None, which keeps every column |
References
- Paper Easley, D., López de Prado, M., & O’Hara, M. (2012). “Flow Toxicity and Liquidity in a High-Frequency World.” The Review of Financial Studies, 25(5), 1457-1493.
- Paper Easley, D., López de Prado, M., & O’Hara, M. (2016). “Discerning Information from Trade Data.” Journal of Financial Economics, 120(2), 269-285.
- Paper López de Prado, M. (2018). “Advances in Financial Machine Learning.” Wiley, section 19.5.2.
- Library Shares similar logic as RiskLabAI’s volume_synchronized_pin