Open interest vs option volume
Open interest and volume both describe activity in an option contract, but they answer different questions and should never be added together.
Volume answers "how much traded today"
Volume is the count of contracts bought and sold during a single trading session. It resets each day and says nothing about how many contracts remain open afterward.
Open interest answers "how many are still open"
Open interest is the count of contracts that have been opened and not yet closed, exercised, or expired, as of the last settlement. It changes only when a trade opens a new position or closes an existing one, and it carries over from one day to the next.
A worked contrast
A strike can trade 5,000 contracts of volume in a single session while open interest at that strike rises by only 200, because most of that volume closed existing positions rather than opening new ones. High volume with flat open interest suggests position turnover; rising open interest suggests new exposure is being added.
Why the max-pain calculation only uses open interest
The max-pain arithmetic sums intrinsic payout across still-open contracts at each candidate settlement strike. Volume plays no part in that sum, which is why OptionHistoryDesk keeps a separate call_volume and put_volume column that the calculation itself never reads.