← Back to Guides

How to Compute VWAP from Multiple Fills

December 28, 2025 Execution

What VWAP is

VWAP stands for Volume Weighted Average Price. It is the correct way to combine multiple fills into one execution price.

If you calculate execution price incorrectly, your effective spread and all cost metrics derived from it become wrong.

When you must use VWAP

Use VWAP when:

• You get multiple fills at different prices.

• Your trade executes across multiple order book levels.

• You enter or exit size in a thin market and get partial fills.

The VWAP formula

VWAP = sum(pricei × qtyi) / sum(qtyi)

• pricei is the price of fill i

• qtyi is the quantity of fill i

Worked examples

Example A: two fills

• Fill 1: 30 contracts at 52c

• Fill 2: 20 contracts at 53c

VWAP = (30×52 + 20×53) / (30+20)

VWAP = (1560 + 1060) / 50 = 52.4c

Example B: three fills, uneven sizes

• Fill 1: 10 contracts at 49c

• Fill 2: 70 contracts at 50c

• Fill 3: 20 contracts at 52c

VWAP = (10×49 + 70×50 + 20×52) / (10+70+20)

VWAP = (490 + 3500 + 1040) / 100 = 50.3c

Why simple averages are wrong

A simple average ignores size. If you average prices without weighting by quantity, you treat a 1 contract fill the same as a 100 contract fill.

• Wrong: (52 + 53) / 2 = 52.5c

• Correct VWAP in Example A: 52.4c

Units and scaling

Prediction markets commonly use cents (0 to 100) or decimals (0 to 1). VWAP works in both formats, but all fills must use the same scale.

• If you log in cents, VWAP is in cents.

• If you log as decimals, VWAP is in decimals.

VWAP and effective spread

To compute effective spread correctly:

• Compute VWAP from fills.

• Compute midquote from the same bid and ask snapshot.

• Use VWAP as Pexec in the effective spread formula.

What to log

For every trade, log:

• A list of fills (price, quantity)

• Total quantity

• Timestamp of submission and timestamp(s) of fills

• Bid and ask snapshot used for midquote

Common mistakes

Using a simple average: always weight by quantity.

Dropping partial fills: VWAP must include every fill or it becomes biased.

Mixing units: cents and decimals cannot be mixed.

Using midquote from a different time: misaligning snapshots breaks effective spread.

Related

Midquote Done Right: Snapshot Timing and Data Quality

Effective Spread

Midquote